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

metricstarttimeprocessor: Copy true reset strategy from prometheus receiver #37855

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

dashpole
Copy link
Contributor

Description

Copy the "metric adjuster" from the prometheus receiver to a new "true_reset_point" strategy in the metricstarttimeprocessor

Link to tracking issue

Part of #37186

Testing

Copied unit tests

Documentation

Updated the README.

Notes for reviewers

  • I would recommend reviewing commit-by-commit. The first commit is copied verbatim, with minimal changes other than splitting into multiple files.
  • I changed the function signature of AdjustMetrics to match the processMetrics function so that it doesn't need an additional wrapper layer.
  • I removed the MetricsAdjuster interface, since it isn't needed (we implement the processor function for metrics now).
  • I had to remove the validation of job + instance being present because it didn't pass generated tests. Regardless, we should not rely on those in a generic processor.

@dashpole dashpole added the enhancement New feature or request label Feb 12, 2025
@dashpole dashpole marked this pull request as ready for review February 12, 2025 18:42
@dashpole dashpole requested a review from a team as a code owner February 12, 2025 18:42
@dashpole
Copy link
Contributor Author

cc @ridwanmsharif @jmacd @ArthurSens

metricstarttime:

# specify the strategy to use for setting the start time
strategy: true_reset_point
Copy link
Contributor

Choose a reason for hiding this comment

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

What are other strategies that you envision this processor supporting? using another metric's value for the start time (process_start_time_seconds)? Wouldn't those also need to use the true_reset_point strategy to deal with resets?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If a metric's value resets, it seems like we should always reset the start time, but I don't think that should involve inserting a "true reset" point. I think it should be implicit for all adjustment strategies (maybe with an on/off config option, similar to fallback to collector start time?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants