Description
Component(s)
receiver/prometheus
What happened?
Description
When being called Append.*CTZeroSample is called with ctMs
in milliseconds.
This inturn calls addCreationTimestamp
in milliseconds. But that assumes and sets mg.created as though it is called with seconds.
This causes the resulting metrics to have wildly incorrect start times when it is set here:
since no conversion is done.
This was introduced in this PR: #36660
And this bug was present ever since.
Steps to Reproduce
scrape metrics that have the _created metrics and see if the start time is set appropriately when converted to OTLP
Steps to fix
I'll be sending a PR that makes sure that when mg.created
is set, it is set in seconds as expected here: https://github.com/prometheus/OpenMetrics/blob/main/specification/OpenMetrics.md#counter
Collector version
0.120.0 to latest
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
Log output
Additional context
No response