-
Notifications
You must be signed in to change notification settings - Fork 324
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
Netty instrumentation #860
Comments
Just curious, what is this currently being blocked by? @eyalkoren |
@brentonr94 this is not blocked, it just didn't get to the top of our priorities yet, but it's definitely an item on our long-term roadmap. |
@eyalkoren have we had any news regarding this implementacion? |
@gmoskovicz unfortunately not a lot to update on that yet. We may eventually decide to write dedicated support for each higher-level framework that uses Netty instead. |
+1 - I had a question asking for Netty support with Spring reactive framework. |
Would be nice to see this supported in Micronaut |
Yes, we have been using Micronaut for over two years now and would love to see support Micronaut/Netty support in ElasticCloud APM |
While the Elastic Java APM agent does not have native support for Netty and thus Micronaut, Micronaut does come with its own native OpenTracing integration:
The integration starting with Micronaut 3.3.0 has full support for OTLP, so if you have a modern enough Elastic APM setup, you can probably get by without using any agent and configure Micronaut to send the data to the OTLP-compatible Elastic APM endpoint. If your Elastic APM setup is older and doesn't have OTLP support, or you are still on a Micronaut version <3.3.0, or you want to use the Elastic APM agent for the other niceties it has (like JVM metrics), you can use Elastic's first-party OpenTracing bridge, instruct Micronaut to trace into that, and have the Elastic APM agent take care of everything. How to set it up:
You should get the full integration you can expect from JVM-based services: We have only tested the setup provided above with the "old" tracing module, although we have used it with Micronaut versions up until 3.5.3 without issues (we have not tested 3.6.0 yet, although I expect it to work, too). I assume that a similar solution can be achieved with the new tracing module as well (most likely by just depending on I hope this helps 👍 |
@pitkley thanks for this wonderful writeup!! ❤️ Just wanted to add that if "you want to use the Elastic APM agent for the other niceties it has", you can do that with OpenTelemetry as well through our OpenTelemetry bridge. Furthermore, I assume that if you use the If you get a chance to try it out, we'll be happy to get your feedback on that. |
As Micronaut does not have any guides on how to provide the needed configuration to configure the integrated OTLP feature and Elastic APM it would be very helpful if anyone with knowledge about how to add the correct Micronaut config for OTLP could provide an example for Elastic APM so that its possible to use directly to Elastic APM instead of the agent. |
@eyalkoren I tried to use Micronaut 3.6.0 and adding the micronut-tracing-opentelemetry-http without adding rest of the opentelemetry dependencies make micronaut just throw exceptions. |
@dniel there are two options to trace with OTel and monitor with Elastic:
I was referring to the second option that relies on the Elastic APM Java agent's OTel bridge. I hope this helps. If you do try it out and it doesn't work, please provide more details and we'll try to make it work. |
@eyalkoren I'm going to attempt to find a way to integrate micronaut 3.6.0 with ElasticAPM and created an discussion in micronaut-projects/micronaut-tracing#154 to follow up with the Micronaut developers. My first attempt with using otel api and annotations dependencies and elastic java agent in micronaut did not pick up any transactions at all in first attempt, will try again in the weekend. This is my repo that im experimenting in https://github.com/nsbno/trafficinfo-baseline-micronaut |
@dniel I hope you find a way to make it work. Unfortunately I cannot allocate the time I'd need to learn everything I need for this and actively assist, but if you have concrete issues, please raise a topic in our forum, preferably with some context like your full setup, code sample and logs related to the issue. First thing to make sure is that the agent gets attached. You should get a lot of info if you set Are you trying with OTel annotations, or are you referring to some Micronaut annotations? |
@eyalkoren my elasticapm agent is reporting jvm metrics to elastic apm, so it seems the agent is configured correctly and sending data. When looking the the logs of the agent I found
Even though I have added alle the opentelemetry depenendencies think is needed to micronaut
Even if I enable opentelemetry with https://www.elastic.co/guide/en/apm/agent/java/master/config-core.html#config-enable-instrumentations configuration it always say "not applying excluded instrumentation" Found this config https://www.elastic.co/guide/en/apm/agent/java/master/config-core.html#config-enable-experimental-instrumentations and tried it just to see if anything happens, and found some new loglines in the agent log.
Now got lots of this stuff in the agent log, but cant find anything in the Elastic APM where I hoped they should show up as transactions. This is a call to a micronaut controller endpoint without any special annotations, but also when adding Changed Java agent from Elastic APM java agent to the standard OpentTelemetry Java Agent and configured it like described on https://www.elastic.co/guide/en/apm/guide/current/open-telemetry.html worked on first try, but the drawback is that no more JVM metrics is reported from the agent. Unfortunately the agent started throwing the following warning, most probably you could try to get the instance from the agent and return instead in Micronaut.
|
You are probably not using one of our recent agent versions, where OTel bridge is on by default and there's no need to set the
Our OTel bridge does not support the OTel annotation API yet, including |
Just for info, I configured Micronaut 3.6.0 integrated open telemetry feature which run the opentelemetry-exporter in Micronaut.
This sends OTEL transactions directly to Elastic APM without any agent and using both Otel Annotations and manual transactions to send traces to Elasti APM. I didnt get any stacktraces reported under errors and no JVM metrics is reported but otherwise requests to the controllers and methods annotated with WithSpan is reported without any workaround or extra code in Micronaut and without any running agents. |
Also hoping to have this working :). I am using https://github.com/mock-server/mockserver which uses netty and nothing comes out of it when plugin the APM agent on it. |
Netty is used as the foundation of a lot of client and server implementations. If we have generic support for monitoring HTTP requests, we'd already provide basic insight for lots of web frameworks.
One complication could be when Netty is used as the foundation of a Servlet container where we already instrument at the Servlet/Filter level.
That also doesn't solve context propagation for frameworks like Play which use Netty as the foundation but also have their own threading model.
relates to #722
The text was updated successfully, but these errors were encountered: