-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Add support for Micrometer Observation #93591
Comments
Pinging @elastic/es-analytics-geo (Team:Analytics) |
Hi, I'm a Spring team member and I'm working with @marcingrzejszczak in the Micrometer team. First, this issue is not about global instrumentation of the Elasticsearch server - this has been declined already in #83780. Rationale for this changeAs far as I understand, the official Java client is currently not instrumented for metrics nor traces. Elasticsearch itself supports tracing headers and can surface very useful information with it. Other official clients, like the JavaScript variant ship observability support. The OpenTelemetry agent currently instruments the deprecated
I think we can provide more information for metrics and traces for the official client, with very little maintenance effort with direct Micrometer Observation instrumentation. ProposalInstrumenting the official Java client would probably be challenging, as its codebase is partially generated and very much user facing. This would allow higher level metrics/traces metadata, but at this point I'm not convinced that it's the best ROI. Instrumenting the low level client here would bring significant results already. This change would require:
With this instrumentation, developers would get, depending on their setup:
This can be achieved with very few classes and would allow developers to use their own conventions for extracting or adding more metadata to metrics and traces. The additional setup would be minimal and most likely configured automatically by Frameworks like Spring Boot. You can find an example of documented instrumentation in Spring Framework for the web layer. cc @tlrx and @swallez to get your opinion on the matter. I'd be happy to discuss this more, or start drafting a proof of concept if this can help. Even if this feature can be contributed by the Micrometer team, I think it's important for library developers to define the semantics of the observations as they're the ones who know better what should be measured, and what users should see in their dashboards. Thanks! |
@bclozel thank you for your interest. First of all, I'd like to point out that Next, we want to keep dependencies of the Java client minimal and avoid introducing a dependency to a specific instrumentation library, when both our own APM agent and the OpenTelemetry agent already provide transparent support for it. So considering that this proposal doesn't align with a number of our objectives, I'm closing this issue. Thanks anyway for these suggestions. |
Indeed, I mixed the artifacts names. Thanks for considering this proposal! |
Hello @swallez , Thank you for the explanation here. Thank you for sharing your opinion on the high vs low level client, as well as the design to keep the dependencies light. With that said, we are using the full elastic stack with APM server, and using elastic-java to send requests for our document (create delete update etc) We are not seeing any metrics, not seeing any traces coming out of elasticsearch-java. For instance, this is what we would have expected to see: But actually, neither of the two is available in APM server. Having metrics and tracing is a requirement in many companies for production readiness, and having elasticsearch-java support those would be great. |
Thanks for the feedback @patpatpat123, I will check with the APM team. And – forgive me if this is a stupid question – have you installed the Java APM agent? |
This is not a stupid question, and actually one we asked ourselves first. We are actually using OTLP for traces, and a custom solution for metrics. We verified they are working since we can see the traces in APM as well as the metrics, but just not those from elasticsearch-java. Let me come up with a minimal reproducible example and track this issue there. Thank you all for this thread. |
Description
I'm a co-maintainer of Spring Cloud Sleuth and Micrometer projects (together with @shakuzen and @jonatan-ivanov).
Micrometer Observation is coming as part of the Micrometer 1.10 release and Micrometer Tracing is a new project. The idea of Micrometer Observation is that you instrument code once but you get multiple benefits out of it - e.g. you can get tracing, metrics, logging or whatever you see fit).
Since this project already supports Micrometer I was curious if there's interest in adding Micrometer Observation support so that except for metrics, spans could be created and tracing context propagation could happen too.
If there's such interest we could provide a PR to add support for that.
The text was updated successfully, but these errors were encountered: