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

Apply micrometer instrumentation to spring-boot-actuator apps #5666

Merged
merged 3 commits into from
Mar 23, 2022

Conversation

mateuszrzeszutek
Copy link
Member

@mateuszrzeszutek mateuszrzeszutek commented Mar 22, 2022

This is heavily based on the ApplicationInsights micrometer instrumentation. @trask should I include some additional attribution in the code?

Resolves #5536

@mateuszrzeszutek mateuszrzeszutek requested a review from a team as a code owner March 22, 2022 15:00
Comment on lines +28 to +30
helperResourceBuilder.registerForAllClassLoaders(
"io/opentelemetry/javaagent/instrumentation/spring/actuator/OpenTelemetryMeterRegistryAutoConfiguration.class");
Copy link
Member Author

Choose a reason for hiding this comment

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

I used a bit different way of making that class visible to spring class loaders; maybe it'll be useful in other spring instrumentations too.

(Also, an interesting bit: no need to explicitly pass .classdata here, the AgentClassLoader will add the suffix automatically when it's asked to get a .class resource)

Copy link
Member

Choose a reason for hiding this comment

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

💯

@trask
Copy link
Member

trask commented Mar 22, 2022

This is heavily based on the ApplicationInsights micrometer instrumentation. @trask should I include some additional attribution in the code?

No attribution needed. I hereby contribute it to OpenTelemetry under the CLA.

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

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

that was a hard read and I wrote some of it 😅

Comment on lines +28 to +30
helperResourceBuilder.registerForAllClassLoaders(
"io/opentelemetry/javaagent/instrumentation/spring/actuator/OpenTelemetryMeterRegistryAutoConfiguration.class");
Copy link
Member

Choose a reason for hiding this comment

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

💯

@trask trask merged commit f2587ba into open-telemetry:main Mar 23, 2022
@trask
Copy link
Member

trask commented Mar 23, 2022

💯

@mateuszrzeszutek mateuszrzeszutek deleted the spring-boot-micrometer branch March 23, 2022 17:27
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
…elemetry#5666)

* Apply micrometer instrumentation to spring-boot-actuator apps

* fix a bug

* code review comments
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.

Prometheus metrics exporter does not export the same metrics as the spring-boot actuator prometheus exporter
2 participants