Skip to content

Span Metrics Connector should initialise stale counter series at 0 #38537

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

Closed
dmurphyccs opened this issue Mar 11, 2025 · 2 comments · Fixed by #39052
Closed

Span Metrics Connector should initialise stale counter series at 0 #38537

dmurphyccs opened this issue Mar 11, 2025 · 2 comments · Fixed by #39052
Assignees
Labels

Comments

@dmurphyccs
Copy link

Component(s)

connector/spanmetrics

Is your feature request related to a problem? Please describe.

The Span Metrics connector has a metrics_expiration argument which defines the time period after which metrics are considered stale and are removed from the cache.

This is a problem when using Prometheus for series that are removed frequently, because calls_total gets initialised at the value of the first scrape once the series gets registered, and Prometheus skips the jump from NaN to a given value. In order not to lose that first value, a first value of 0 should be pushed when a new series is added to the counter. Therefore, span metrics generated by the Span Metrics connector can be correctly queried in Prometheus, using PromQL functions such as increase() etc.

Describe the solution you'd like

calls_total to be initialised with a value of 0.

Describe alternatives you've considered

No response

Additional context

The same problem existed in Grafana Tempo metrics-generator but was resolved in the linked issue using the above suggested solution: grafana/tempo#2006

@dmurphyccs dmurphyccs added enhancement New feature or request needs triage New item requiring triage labels Mar 11, 2025
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@Frapschen Frapschen self-assigned this Mar 14, 2025
@Frapschen
Copy link
Contributor

make sence to me, I will try to fix it

@Frapschen Frapschen removed the needs triage New item requiring triage label Mar 18, 2025
atoulme pushed a commit that referenced this issue Apr 8, 2025
…t 0 (#39052)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
fix:
#38537

Signed-off-by: Murphy Chen <[email protected]>
dmathieu pushed a commit to dmathieu/opentelemetry-collector-contrib that referenced this issue Apr 8, 2025
…t 0 (open-telemetry#39052)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
fix:
open-telemetry#38537

Signed-off-by: Murphy Chen <[email protected]>
LucianoGiannotti pushed a commit to LucianoGiannotti/opentelemetry-collector-contrib that referenced this issue Apr 9, 2025
…t 0 (open-telemetry#39052)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
fix:
open-telemetry#38537

Signed-off-by: Murphy Chen <[email protected]>
Fiery-Fenix pushed a commit to Fiery-Fenix/opentelemetry-collector-contrib that referenced this issue Apr 24, 2025
…t 0 (open-telemetry#39052)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
fix:
open-telemetry#38537

Signed-off-by: Murphy Chen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants