kamon-io / Kamon

Distributed Tracing, Metrics and Context Propagation for applications running on the JVM
https://kamon.io
Other
1.41k stars 329 forks source link

kamon-play: custom configuration of operation names does not work #850

Open ufricke opened 4 years ago

ufricke commented 4 years ago

Hi,

I've configured a custom operation name generator and tried various fields to pass a FQCN to: kamon.instrumentation.play.http.server.tracing.operations.name-generator = "my.package.NameGenerator", kamon.instrumentation.play.http.client.tracing.operations.name-generator = "my.package.NameGenerator", kamon.instrumentation.http-server.default.tracing.operations.name-generator = "my.package.NameGenerator"

Via logging, I can confirm that the custom name generator is being called correctly, and returns the expected name. However, the final span name is still the default one, and not my custom name.

I believe it's because of this functionality in PlayServerInstrumementation, which is overwriting all span names by default:

  /**
    * This final bit ensures that we will apply an operation name right before filters get to execute.
    */
  onType("play.api.http.DefaultHttpRequestHandler")
    .advise(method("filterHandler").and(takesArguments(2)), GenerateOperationNameOnFilterHandler)

If I'm not missing anything, it's not possible to configure custom operation names with kamon-play. Would be great to get an opinion on this.

Thanks!

Kamon version: 2.1.4 Play version: 2.6

yarosman commented 3 years ago

@ufricke maybe it can help you https://github.com/kamon-io/Kamon/pull/926