Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quic, tcp: only register Prometheus counters when metrics are enabled #1971

Merged
merged 2 commits into from
Feb 3, 2023

Conversation

marten-seemann
Copy link
Contributor

Due to the performance impact, we're only collecting metrics when explicitly enabled anyway. We shouldn't even register the Prometheus metrics if not.

@marten-seemann marten-seemann mentioned this pull request Jan 22, 2023
35 tasks
func init() {
var initMetricsOnce sync.Once

func initMetrics() {
const (
direction = "direction"
encLevel = "encryption_level"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On L103 we're using the default prometheus Registerer. I think in general we should accept this as a parameter rather than hardcoded since we are a library.

No change needed now. If you agree, let's open an issue.

@marten-seemann marten-seemann merged commit 8c198c6 into master Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants