open-telemetry / opentelemetry.io

The OpenTelemetry website and documentation
https://opentelemetry.io
Creative Commons Attribution 4.0 International
565 stars 1.23k forks source link

how to get a meter/tracer in Java agent or spring stater #5713

Open zeitlinger opened 2 days ago

zeitlinger commented 2 days ago

What needs to be changed?

We need a landing page that explains to do manual instrumentation in Java agent or spring stater.

Use cases:

Possible solutions:

zeitlinger commented 2 days ago

@svrnm any overarching guidance?

svrnm commented 1 day ago

Embed docs like it was done a while ago: 2024.08/content/en/docs/languages/java/instrumentation.md#acquiring-a-meter-in-java-agent

I think it would be good to re-introduce something like that. I would also suggest that some other pages point to it, the zero code pages for sure, but also https://opentelemetry.io/docs/languages/java/instrumentation/, I would not name it "Record Telemetry with the API" like the existing page, but more something like "Add custom telemetry" or "Combine automatic and manual telemetry" or something like that to make it clear that this is about doing both at the same time

zeitlinger commented 1 day ago

@jack-berg wdyt?

jeanbisutti commented 1 day ago

Perhaps it may be worth highlighting how to retrieve an OpenTelemetry instance when using the Java agent or Spring starter in addition to point to additional resources.

zeitlinger commented 1 day ago

Perhaps it may be worth highlighting how to retrieve an OpenTelemetry instance when using the Java agent or Spring starter in addition to point to additional resources.

yes, that is the content of the proposed page

jeanbisutti commented 1 day ago

I agree it's already explained in the meter part:

An OpenTelemetry instance is useful in several programmatic instrumentation cases.

Perhaps how to retrieve an OpenTelemetry instance with the agent and Spring starter cases is a general and important concept that should be highlighted in the agent and Spring starter documentations.

jack-berg commented 1 day ago

Perhaps it may be worth highlighting how to retrieve an OpenTelemetry instance when using the Java agent or Spring starter in addition to point to additional resources.

That's the key bit. After a user knows how to get the autoconfigured OpenTelemetry instance, then we can refer to the existing API docs.

My inclination is to have a section in each of the Agent / Spring Boot starter with a heading something like "Extending with custom manual instrumenation". This seems like the most discoverable place for users, since it would be co-located with all the other Agent / Srping Boot starter specific content.

zeitlinger commented 1 day ago

I agree it's already explained in the meter part:

these are links to removed content