kamon-io / kamon-http4s

Kamon Integration for http4s
Apache License 2.0
53 stars 29 forks source link

Dynamic values in paths are not replaced with placeholders #51

Open lolgab opened 1 year ago

lolgab commented 1 year ago

Hi and thank you for this library! I'm in the progress of migrating an application from akka-http to http4s and I noticed a behavioral difference. While in akka-http paths are reported to Prometheus with a {} placeholder when the segment contains dynamic values (like integers), in http4s paths are reported literally: For example:

with http4s:

/v1/organization/30755/authors/suggested

with akka-http:

/v1/organization/{}/authors/suggested

Is this intended? Can I configure Kamon to have the same behavior? In case it's a missing feature, are you willing to merge a PR implementing the change (maybe guiding me to show what needs to be changed)

Thank you! Lorenzo

lolgab commented 1 year ago

I searched {} in the Kamon codebase and it seems to me that here is where the paths are modified.