Kamon icon indicating copy to clipboard operation
Kamon copied to clipboard

Missing path (endpoint) tag in http_server_requests metric with Play 3 and Pekko HTTP

Open enalcopolo opened this issue 5 months ago • 1 comments

Hi!

After updating to kamon-bundle version 2.8.0-beta.1 (and later) in a Play 3 application running with Pekko HTTP, the http_server_requests metric does not include a tag for the HTTP path/endpoint (path, route or url). This makes it impossible to segment or filter metrics by API endpoint in Prometheus/Grafana.

The metrics only show tags for method and status_code. The path tag is either missing entirely or is set to a generic value for all requests.

Steps to reproduce:

  1. Use Play 3 with Pekko HTTP as the server backend and kamon-bundle 2.8.0-beta.1.
    
2.     Enable standard HTTP instrumentation in application.conf, e.g.:

kamon.instrumentation.[play|pekko].http {
  server.metrics.enabled = yes
  server.tracing.enabled = yes
  server.tracing.span-metrics = on
  server.tracing.tags {
    url = span
    method = metric
    status-code = metric
  }
}
  1. Expose /metrics via Prometheus and inspect the http_server_requests samples.

Expected behavior:

Each http_server_requests metric should be segmented by the HTTP path or endpoint (e.g. /api/users, /api/orders)

Actual behavior: No path, url or route tag is present. Only method and status_code tags.

Environment:

  • Play Framework: 3.0.8
  • Pekko HTTP: 1.2.0
  • kamon-bundle: 2.8.0-beta.1
  • kamon-prometheus: 2.8.0-beta.1
  • kanela-agent: 2.0.0-beta.3
  • Java: 21+
  • Scala 3.5.2

enalcopolo avatar Sep 23 '25 17:09 enalcopolo

Maybe this is caused by

  • #1402 ?

Maybe you need to use different config keys now (like pekko-http)?

mkurz avatar Sep 24 '25 07:09 mkurz