Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with the migration from Sleuth to Micrometer #33977

Closed
benediktwetzel opened this issue Jan 25, 2023 · 6 comments
Closed

Problems with the migration from Sleuth to Micrometer #33977

benediktwetzel opened this issue Jan 25, 2023 · 6 comments
Labels
status: invalid An issue that we don't feel is valid theme: observability Issues related to observability

Comments

@benediktwetzel
Copy link

benediktwetzel commented Jan 25, 2023

Hello,

we are upgrading from SB2.7 to SB3 and the migration from Sleuth to Micrometer is causing problems.

We register an ObservationPredicate Bean to ignore some observerations. For testing, we return false in all cases:

   @Bean
    public ObservationPredicate ignoreAllObservations() {
        return (name, context) -> false;
    }

However, to our surprise, some traces are still displayed in Zipkin. These are metrics from methods with are annotated with @Scheduled(fixedRateString = X). Why are these Observations still being considered?

Also, we have some Sleuth configurations in our SB2.7 application, and we can't find any documentation to migrate the old configuration to Micrometer.

In particular, the following configuration parameters are the problem:

  sleuth:
    tx:
      enabled: false
    span-filter:
      additional-span-name-patterns-to-ignore:
        - '(?i)^messagebrokertaskscheduler$'
        - '(?i)^clientinboundchannelexecutor$'
    web:
      additional-skip-pattern: '/websocket.*|/connect.*'
    integration:
      websockets:
        enabled: false

Is there any guidance on how we can migrate this configuration to Micrometer?

Thanks in advance! :)

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 25, 2023
@bclozel
Copy link
Member

bclozel commented Jan 25, 2023

@benediktwetzel Could you share which metrics are published for @Scheduled methods and how they're instrumented? I don't think Spring Framework currently instruments those so knowing how this is supported currently would help.

@bclozel bclozel added status: waiting-for-feedback We need additional information before we can continue theme: observability Issues related to observability labels Jan 25, 2023
@benediktwetzel
Copy link
Author

Thanks for your answer!

I took another look at our code and found that we are creating a new span for some method calls (via AOP and annotations, so didn't see it before).

   Span newSpan = this.tracer.nextSpan().name(methodName);       
   this.tracer.withSpanInScope(newSpan.start());

Hower, shouldn't this also be affected by the ObservationPredicate?

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 25, 2023
@bclozel
Copy link
Member

bclozel commented Jan 25, 2023

This code snippet is directly calling the tracing API and is not affected by the Observation support. If you want to leverage this support, you can rewrite this using the Observation API instead. For minimal disruption, you can use a different filter mechanism that's specific to the tracing API.

@Scheduled instrumentation should come in a future Spring Framework version, see spring-projects/spring-framework#29883.

I'm closing this issue since the current behavior is expected from a Spring Boot point of view. Thanks for reporting this!

@bclozel bclozel closed this as not planned Won't fix, can't repro, duplicate, stale Jan 25, 2023
@bclozel bclozel added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels Jan 25, 2023
@benediktwetzel
Copy link
Author

@bclozel Thank you a lot! Can you also help me by the migration from the Sleuth configuration to Micrometer?

@bclozel
Copy link
Member

bclozel commented Jan 25, 2023

@benediktwetzel You'll get better support with the Micrometer docs and Community (there's a dedicated Slack instance, see the https://micrometer.io/ homepage).

@wilkinsona
Copy link
Member

@benediktwetzel If you haven't seen it already, you may also be interested in the migration guide that the Micrometer team have produced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid theme: observability Issues related to observability
Projects
None yet
Development

No branches or pull requests

4 participants