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

LongTaskTimer created from a Timed annotation doesn't enable histogram #2704

Closed
shakuzen opened this issue Jul 19, 2021 · 0 comments
Closed
Labels
bug A general bug module: micrometer-core An issue that is related to our core module
Milestone

Comments

@shakuzen
Copy link
Member

Describe the bug
With frameworks, e.g. Spring Boot, that support the Micrometer @Timed annotation, you can make LongTaskTimers by setting the attribute longTask = true. There is also a histogram attribute which currently has no effect with longTask = true.

Environment

  • Micrometer version: 1.5.0 - 1.7.2
  • Micrometer registry: e.g. prometheus
  • OS: macOS
  • Java version: openjdk version "16.0.1" 2021-04-20

To Reproduce
How to reproduce the bug:
In a Spring Boot web app, make a controller like the following:

@Timed(longTask = true, value = "some.job", histogram = true)
@GetMapping("long")
void longTask() throws InterruptedException {
    Thread.sleep(new Random().nextInt(180_000));
}

Expected behavior
The created LongTaskTimer some.job should have histograms enabled, but it does not.

Additional context
LongTaskTimers were enhanced in the 1.5 release to add histogram support. It seems we missed updating the code where a LongTaskTimer was built from an instance of the @Timed annotation.

@shakuzen shakuzen added bug A general bug module: micrometer-core An issue that is related to our core module labels Jul 19, 2021
@shakuzen shakuzen added this to the 1.5.x milestone Jul 19, 2021
@shakuzen shakuzen changed the title LongTaskTimer created from a Timed annotation missing histogram LongTaskTimer created from a Timed annotation cannot enable histogram Jul 19, 2021
@shakuzen shakuzen changed the title LongTaskTimer created from a Timed annotation cannot enable histogram LongTaskTimer created from a Timed annotation doesn't enable histogram Jul 19, 2021
@shakuzen shakuzen modified the milestones: 1.5.x, 1.5.17 Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A general bug module: micrometer-core An issue that is related to our core module
Projects
None yet
Development

No branches or pull requests

1 participant