Open s-af opened 1 month ago
Our netty instrumentation does not support tracing http/2 requests yet.
@s-af have you tried the Micronaut instrumentation? https://micronaut-projects.github.io/micronaut-tracing/latest/guide/#opentelemetry
@trask checked server spans with Micronaut Tracing. It works with http/2.
However in our app we intentionally do not use Micronaut Tracing. Would be great if tracing work with Agent.
@trask is there any work around to surface http metrics? like throughput & latency for each rest api? I have the following dependencies added in the pom. However, we don't see API level http metrics. Is there any sample/reference micronaut project which we can refer to set up metrics collection with prometheus?
<dependency>
<groupId>io.micronaut.micrometer</groupId>
<artifactId>micronaut-micrometer-core</artifactId>
</dependency>
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-management</artifactId>
</dependency>
<dependency>
<groupId>io.micronaut.micrometer</groupId>
<artifactId>micronaut-micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/io.micronaut.tracing/micronaut-tracing-opentelemetry-http -->
<dependency>
<groupId>io.micronaut.tracing</groupId>
<artifactId>micronaut-tracing-opentelemetry-http</artifactId>
<version>6.6.0</version>
</dependency>
@trask is there any work around to surface http metrics?
do you mean specifically Micronaut support in the Java agent? currently no one is working on this, but it is a contribution we would accept
Yes @trask , I meant the micronaut support in the java agent. Since netty instrumentation is not supported, I switched to jetty after following this page. After this migration, i could see the http_route in the metric, but that's not showing the actual path of the API. It just says "/*". Has anyone tried building APIs with Jetty on micronaut and succeed surfacing the http metrics?
http_server_request_duration_seconds_bucket{error_type="500",http_request_method="GET",http_response_status_code="500",*http_route="/"**,network_protocol_version="1.1",otel_scope_name="io.opentelemetry.jetty-8.0",otel_scope_version="2.4.0-alpha",url_scheme="http",le="0.005"} 1
@vishaltk miconaut specific instrumentation is needed for better route support
@laurit could you please share some more details or a documentation link to achieve micronaut specific instrumentation of jetty?
@vishaltk I'd imagine that it would involve instrumenting micronaut code and inserting a call to update
in https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/semconv/http/HttpServerRoute.java
Describe the bug
Tracing for server and client http requests doesn't work in combination with Netty/Micronaut + HTTP/2.
Steps to reproduce
Set up simple Micronaut application with netty server. Create controller:
Configure server protocol in application.properties:
Configure otel to print traces into log:
Run application and send curl request:
Expected behavior
Traces appears in console.
When I use http1.1
curl.exe https://localhost:8443 -kv --http1.1
this message appears in logs:Actual behavior
Empty traces
Javaagent or library instrumentation version
1.35.0
Environment
JDK: 17 OS: Win10
Additional context
Can share a reproducible application if it helps.