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

prometheusremotewrite: Don't generate target_info unless there are metrics #32318

Merged

Conversation

aknuds1
Copy link
Contributor

@aknuds1 aknuds1 commented Apr 11, 2024

Description:
Modify prometheusremotewrite.FromMetrics to not generate target_info unless there are metrics, as you can't detect a timestamp otherwise. Currently, if there are no metrics, a target_info metric is generated with the Unix epoch for timestamp.

Link to tracking Issue:
See Mimir issue where this was reported.

Testing:
I've added a test case for the bug.

Documentation:

Modify prometheusremotewrite.FromMetrics to not generate target_info
if there are no metrics, as you can't detect the most recent timestamp.
Currently, if there are no metrics, a target_info metric is generated
with the Unix epoch for timestamp.

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
@aknuds1 aknuds1 force-pushed the bugfix/missing-resource-timestamp branch from b38fed9 to 64bee69 Compare April 11, 2024 11:14
Copy link
Contributor

@jesusvazquez jesusvazquez left a comment

Choose a reason for hiding this comment

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

LGTM

@aknuds1
Copy link
Contributor Author

aknuds1 commented Apr 12, 2024

CI failure looks like a flake.

Copy link

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

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

Looks like the right approach since there's no way to infer the timestamp anyway.

…g-resource-timestamp

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
@aknuds1
Copy link
Contributor Author

aknuds1 commented Apr 12, 2024

CI flaked again.

@github-actions github-actions bot requested a review from rapphil April 25, 2024 09:22
@jpkrohling jpkrohling merged commit b536522 into open-telemetry:main Apr 25, 2024
171 checks passed
@github-actions github-actions bot added this to the next release milestone Apr 25, 2024
@aknuds1 aknuds1 deleted the bugfix/missing-resource-timestamp branch April 25, 2024 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants