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

Make LongTaskTimer creation conditional in DefaultMeterObservationHandler #4755

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

jonatan-ivanov
Copy link
Member

This change makes it possible to enable/disable LongTaskTimer creation in DefaultMeterObservationHandler. If users do not need the LongTaskTimer, they can turn it off and spare CPU cycles and the extra time series that will not be created this way.

Usage example:

ObservationRegistry observationRegistry = ObservationRegistry.create();
observationRegistry.observationConfig()
    .observationHandler(new DefaultMeterObservationHandler(meterRegistry, LONG_TASK_TIMER));

@jonatan-ivanov jonatan-ivanov added the enhancement A general enhancement label Feb 17, 2024
@jonatan-ivanov jonatan-ivanov added this to the 1.13.0-M2 milestone Feb 17, 2024
Copy link
Member

@shakuzen shakuzen left a comment

Choose a reason for hiding this comment

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

Overall looks good. I left some naming polish suggestions. I worry a bit it will be surprising for users they can only pass LTTs to be ignored given the API, but at least not being able to pass other things makes it clear what is supported. I suppose we can tackle expanding the support given user requests.

@jonatan-ivanov jonatan-ivanov merged commit ac2dae0 into micrometer-metrics:main Feb 28, 2024
6 checks passed
@jonatan-ivanov jonatan-ivanov deleted the optional-ltt branch February 28, 2024 00:19
@jonatan-ivanov jonatan-ivanov added the spring-boot change Change is needed in Spring Boot for this issue label Feb 28, 2024
@jonatan-ivanov jonatan-ivanov removed this from the 1.13.0-M2 milestone Feb 29, 2024
@jonatan-ivanov jonatan-ivanov removed enhancement A general enhancement spring-boot change Change is needed in Spring Boot for this issue labels Feb 29, 2024
izeye added a commit to izeye/micrometer that referenced this pull request May 8, 2024
@izeye izeye mentioned this pull request May 8, 2024
jonatan-ivanov pushed a commit that referenced this pull request May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make it possible to disable LongtaskTimer creation in DefaultMeterObservationHandler
2 participants