Skip to content

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

@enalcopolo

Description

@enalcopolo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions