While using the OpenTelemetry Java agent on an application that uses Servlet 2.0/3.0, the http_route attribute is not recorded by the server metrics. It appears as follows:
The metric http_server_request_duration_seconds_count does not contain the http_route attribute.
http_server_request_duration_seconds_count{http_request_method="POST",http_response_status_code="200",network_protocol_version="1.1",otel_scope_name="io.opentelemetry.jetty-8.0",otel_scope_version="2.8.0-alpha",url_scheme="http"} 1`
We believe that we can not provide a reasonable route based on just the servlets. If you are using a higher level framework it may be possible to instrument that framework to get a route.
Describe the bug
While using the OpenTelemetry Java agent on an application that uses Servlet 2.0/3.0, the http_route attribute is not recorded by the server metrics. It appears as follows:
Steps to reproduce
Here's a clearer and more structured version of your steps:
Build HTTP Server Using Jetty Embedded 9.3 (Servlet 3.0)
Run Java Agent with Prometheus Exporter Enabled on Port 9464
9464
:Send a Request to the Application
Load Metrics via Prometheus
Find the
http_server_request_duration_seconds_count
Metrichttp_server_request_duration_seconds_count
metric in the Prometheus output to check the recorded server request duration.Expected behavior
The metric
http_server_request_duration_seconds_count
should contain the http_route attributeActual behavior
The metric
http_server_request_duration_seconds
_count does not contain the http_route attribute. http_server_request_duration_seconds_count{http_request_method="POST",http_response_status_code="200",network_protocol_version="1.1",otel_scope_name="io.opentelemetry.jetty-8.0",otel_scope_version="2.8.0-alpha",url_scheme="http"} 1`Javaagent or library instrumentation version
2.8.0
Environment
JDK: OpenJDK 11.0.23 OS: Ubuntu 20.04 Jetty Embedded 9.3, Servlet 3
Additional context
No response