micrometer-metrics / tracing

Provides tracing abstractions over tracers and tracing system reporters.
https://micrometer.io
Apache License 2.0
242 stars 42 forks source link

Improve filtering out middle span by SpanExportingPredicate #266

Open quaff opened 1 year ago

quaff commented 1 year ago

If we have spans like

A > 
   B > 
       C
  1. with leaf span C dropped, It's expected that spans will be

    A > 
    B
  2. with root span A dropped, It's expected that spans will be

    B > 
    C

    but a warning show up that span B has invalid parent span

  3. with middle span B dropped, we expect

A > 
   C

but got

A
C

and warning show up that span C has invalid parent span warning by jaeger: invalid parent span IDs=c6ababd1d88b00b1; skipping clock skew adjustment.

Could we reset children's parent span id to fix such skew?

jonatan-ivanov commented 1 year ago

For the sake of documentation, I think these are related:

Could you please tell us how you "drop" spans? Are you using an ObservationPredicate or a SpanExportingPredicate or a SpanHandler or something else?

quaff commented 1 year ago

For the sake of documentation, I think these are related:

Could you please tell us how you "drop" spans? Are you using an ObservationPredicate or a SpanExportingPredicate or a SpanHandler or something else?

For example I want to drop connection but want to keep it's descendants.

    @Bean
    SpanExportingPredicate noConnectionSpanExportingPredicate() {
        return span -> !span.getName().equals("connection");
    }

Sometime I want to drop connection and it's descendants, hopeful both cases are supported.