The Prometheus receiver outputs unstable attributes when using k8s sd config, causing the cumulative to delta processor to fail to calculate delta values properly. #37413
Labels
bug
Something isn't working
needs triage
New item requiring triage
processor/cumulativetodelta
Cumulative To Delta processor
Component(s)
receiver/prometheus, processor/cumulativetodelta
What happened?
Description
Sometimes, attributes output are unstable:
k8s.replicaset.name
, will change.As long as some attributes are changed, the cumulative to delta processor will not calculate the delta value correctly.
Steps to Reproduce
3 (Alternative). Edit some k8s labels, which are added to the attributes by Prometheus relabel configuration.
Expected Result
It should calculate the delta values correctly.
Actual Result
It cannot calculate the delta values. Because of the default behavior for start_timestamp, original values are preserved as delta.
Collector version
v0.118.0
Environment information
Environment
OS: Alpine Linux
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
Log output
Additional context
I think the best way is to calculate the delta values before adding any extra information. This means to make cumulative to delta processor embedded into prometheus receiver, which is not too easy.
Alternatively, I think we can add an option in cumulative to delta processor, to exclude some attributes. Then users should exclude those attributes that may change when running, to avoid this issue.
The text was updated successfully, but these errors were encountered: