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

feat: add operational prometheus metrics #342

Merged
merged 1 commit into from
Nov 9, 2024

Conversation

slawo
Copy link
Contributor

@slawo slawo commented Nov 9, 2024

refs: #34

I had to split c.metrics.Connections to 2 different metrics because prometheus requires a fixed number of labels, it wasn't possible to do the following:
c.metrics.Connections.With("side", "frontend").Add(1)
c.metrics.Connections.With("side", "backend", "host", resolvedHost).Add(1)

refs: itzg#34

I had to split c.metrics.Connections to 2 different metrics because prometheus requires a fixed number of labels, it wasn't possible to do the following:
	c.metrics.Connections.With("side", "frontend").Add(1)
	c.metrics.Connections.With("side", "backend", "host", resolvedHost).Add(1)
@slawo
Copy link
Contributor Author

slawo commented Nov 9, 2024

Please note for existing metrics backends this will not affect the labels as the 2 new metrics are split from the initial counter like this ConnectionsFrontend = Connections.With("side", "frontend") ConnectionsBackend = Connections.With("side", "backend")

Copy link
Owner

@itzg itzg left a comment

Choose a reason for hiding this comment

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

Very nice! Thanks.

@itzg itzg changed the title feat: add prometheus metrics feat: add operational prometheus metrics Nov 9, 2024
@itzg itzg linked an issue Nov 9, 2024 that may be closed by this pull request
@itzg itzg added the enhancement New feature or request label Nov 9, 2024
@itzg itzg merged commit 2624e25 into itzg:master Nov 9, 2024
2 checks passed
@itzg
Copy link
Owner

itzg commented Nov 9, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prometheus Metrics
2 participants