opentelemetry-java-instrume.../smoke-tests/src/test/groovy/io/opentelemetry/smoketest
moznion 7e8d76a83b
Put `http.route` attribute onto `http.server.duration` on Play framework request processing (#7801)
Basically, `akka-http` instrumenter has the responsibility to instrument
the `http.server.duration` for the Play framework application, but the
current implementation has not marked the `http.route` attribute.
ref:
8e8161cb2e/instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/server/AkkaHttpServerAttributesGetter.java (L59)

Actually, it's hard to record that attribute by only the akka-http layer
because that library's request object doesn't hold the route
information, e.g. placeholder.

So this patch delegates that job to the `play-mvc` instrumenter and when
that has been able to get the route info, the instrumenter puts
`http.route` attribute onto `http.server.duration`.

For example, when the routes configuration of the Play is like the
following:

```
GET  /foo/:bar  controllers.HomeController.doSomething(bar: String)
```

and when it tries to access that API, then OTEL instruments like so:

```prometheus
http_server_duration_count{otel_scope_name="io.opentelemetry.akka-http-10.0",otel_scope_version="1.23.0-alpha-SNAPSHOT",http_flavor="1.1",http_method="GET",http_route="/foo/$bar<[^/]+>",http_scheme="http",http_status_code="200",net_host_name="localhost",net_host_port="9000"} 1.0 1676078079798
http_server_duration_sum{otel_scope_name="io.opentelemetry.akka-http-10.0",otel_scope_version="1.23.0-alpha-SNAPSHOT",http_flavor="1.1",http_method="GET",http_route="/foo/$bar<[^/]+>",http_scheme="http",http_status_code="200",net_host_name="localhost",net_host_port="9000"} 12183.558843 1676078079798
http_server_duration_bucket{otel_scope_name="io.opentelemetry.akka-http-10.0",otel_scope_version="1.23.0-alpha-SNAPSHOT",http_flavor="1.1",http_method="GET",http_route="/foo/$bar<[^/]+>",http_scheme="http",http_status_code="200",net_host_name="localhost",net_host_port="9000",le="0.0"} 0.0 1676078079798
...
http_server_duration_bucket{otel_scope_name="io.opentelemetry.akka-http-10.0",otel_scope_version="1.23.0-alpha-SNAPSHOT",http_flavor="1.1",http_method="GET",http_route="/foo/$bar<[^/]+>",http_scheme="http",http_status_code="200",net_host_name="localhost",net_host_port="9000",le="+Inf"} 1.0 1676078079798
```

Rel: #1415

---------

Signed-off-by: moznion <moznion@mail.moznion.net>
2023-02-14 14:05:59 +02:00
..
AgentDebugLoggingTest.groovy Fix debug logging (#6085) 2022-05-24 11:06:38 +03:00
AppServerTest.groovy Run smoke tests on OpenJ9 Java 17 and 18 (#7340) 2022-11-30 08:58:57 +01:00
CrashEarlyJdk8Test.groovy Allow running smoke tests locally on windows (#5046) 2022-01-08 11:28:59 -08:00
GrpcSmokeTest.groovy Update to OTel 1.13 (#5799) 2022-04-13 13:16:32 +03:00
JettyJpmsSmokeTest.groovy Use windows-latest (#7299) 2022-11-29 07:54:03 -08:00
JettySmokeTest.groovy Run smoke tests on OpenJ9 Java 17 and 18 (#7340) 2022-11-30 08:58:57 +01:00
LibertyServletOnlySmokeTest.groovy Auto-format groovy files in Intellij (#5260) 2022-01-28 09:29:46 -08:00
LibertySmokeTest.groovy Run smoke tests on OpenJ9 Java 17 and 18 (#7340) 2022-11-30 08:58:57 +01:00
LogsSmokeTest.groovy End groovy files with newline (#7127) 2022-11-10 12:21:55 +01:00
MetricsInspector.groovy Update to OTel 1.13 (#5799) 2022-04-13 13:16:32 +03:00
PayaraSmokeTest.groovy Run smoke tests on OpenJ9 Java 17 and 18 (#7340) 2022-11-30 08:58:57 +01:00
PlaySmokeTest.groovy Put `http.route` attribute onto `http.server.duration` on Play framework request processing (#7801) 2023-02-14 14:05:59 +02:00
PrometheusSmokeTest.groovy End groovy files with newline (#7127) 2022-11-10 12:21:55 +01:00
PropagationTest.groovy Update to OTel 1.13 (#5799) 2022-04-13 13:16:32 +03:00
QuarkusSmokeTest.groovy Update to OTel 1.13 (#5799) 2022-04-13 13:16:32 +03:00
SdkDisabledSmokeTest.groovy Update core to 1.21.0 and run license report (#7384) 2022-12-10 07:52:04 -08:00
SmokeTest.groovy Update to OTel 1.13 (#5799) 2022-04-13 13:16:32 +03:00
SpringBootSmokeTest.groovy Rename p.r.j.memory.max to p.r.j.memory.limit (#6161) 2022-06-13 13:17:04 -07:00
SpringBootWithSamplingSmokeTest.groovy Update to OTel 1.13 (#5799) 2022-04-13 13:16:32 +03:00
TelemetryRetriever.groovy Fix typos (#6961) 2022-10-24 09:06:01 -07:00
TomcatSmokeTest.groovy Run smoke tests on OpenJ9 Java 17 and 18 (#7340) 2022-11-30 08:58:57 +01:00
TomeeSmokeTest.groovy Run smoke tests on OpenJ9 Java 17 and 18 (#7340) 2022-11-30 08:58:57 +01:00
TraceInspector.java Update to OTel 1.13 (#5799) 2022-04-13 13:16:32 +03:00
WebsphereSmokeTest.groovy End groovy files with newline (#7127) 2022-11-10 12:21:55 +01:00
WildflySmokeTest.groovy Run smoke tests on OpenJ9 Java 17 and 18 (#7340) 2022-11-30 08:58:57 +01:00