-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
receiver/prometheusreceiver: add option to fallback to collector starttime #36365
base: main
Are you sure you want to change the base?
receiver/prometheusreceiver: add option to fallback to collector starttime #36365
Conversation
05b85e8
to
d67a526
Compare
The code itself looks correct! To be completely honest, I'm pretty new to this component and haven't used it myself. I noticed we have waaaay too many fallbacks for Created Timestamps; that looks weird 🤔. Do I understand correctly that the flow is like this:
Did I get the flow correctly? It makes me wonder, when would an OpenTelemetry metric not have |
receiver/prometheusreceiver/internal/starttimemetricadjuster.go
Outdated
Show resolved
Hide resolved
receiver/prometheusreceiver/internal/starttimemetricadjuster.go
Outdated
Show resolved
Hide resolved
receiver/prometheusreceiver/internal/starttimemetricadjuster.go
Outdated
Show resolved
Hide resolved
This is the prometheus receiver, so the concern here is prometheus metrics not having a start time and we want to ensure that the |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Sorry I let this get stale, I was ooo for the past couple months but am getting back to this today. I'll make the change to set the start time in an init function, that feels most appropriate here |
5e0b231
to
2f6bba4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a feature gate around this (alpha) so this is easier for us to remove later if we move it to the metric start time processor?
(accidental approval) |
2f6bba4
to
4fc4202
Compare
86ee36f
to
80e5d9d
Compare
Done. Makes sense to me |
receiver/prometheusreceiver/internal/starttimemetricadjuster.go
Outdated
Show resolved
Hide resolved
receiver/prometheusreceiver/internal/starttimemetricadjuster.go
Outdated
Show resolved
Hide resolved
receiver/prometheusreceiver/internal/starttimemetricadjuster.go
Outdated
Show resolved
Hide resolved
…ttime This change adds an option to the metric adjuster to use an approximation of the collector starttime as a fallback for the start time of scraped cumulative metrics. This is useful when no start time is found and when the collector starts up alongside its targets (like in serverless environments or sidecar approaches). Signed-off-by: Ridwan Sharif <[email protected]>
…mponent initialization
…a featuregate This change creates an Alpha feature gate for this functionality since this can be replaced when open-telemetry#37186 is implemented.
69d33dc
to
6cc71ee
Compare
6cc71ee
to
d28d7d2
Compare
Description
This change adds an option to the metric adjuster to use an approximation of the collector starttime as a fallback for the start time of scraped cumulative metrics. This is useful when no start time is found and when the collector starts up alongside its targets (like in serverless environments or sidecar approaches).
Link to tracking issue
Fixes #36364
Testing
Added unit test for this config option
Documentation
Config option added to the README.