question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why is @Bean SamplerFunction<MessagingRequest> trySample never executed?

See original GitHub issue

In project with spring-cloud-stream, rabbitmq and spring-cloud-sleuth my SamplerFunction<MessagingRequest>.trySample is never executed. Where can be a problem? Bean is in a correct @Configuration class (other beans are created and work).

`spring.sleuth.sampler.probability: 0.001

@Bean
SamplerFunction<MessagingRequest> zipkinSampler() {
    return new Zipkin.ZipkinSampler();
}

public static class ZipkinSampler implements SamplerFunction<MessagingRequest> {

    private SamplerFunction<MessagingRequest> sampler = MessagingRuleSampler.newBuilder()
            .putRule(channelNameEquals("alertsNever"), Sampler.NEVER_SAMPLE)
            .putRule(channelNameEquals("rabbitChannel"), RateLimitingSampler.create(1))
            .putRule(Matchers.alwaysMatch(), RateLimitingSampler.create(100))
            .build();;

    @Override
    public Boolean trySample(final MessagingRequest request) {
        log.info("trySample {}, channelKind: {}, channelName: {}, operation: {}", request, request.channelKind(), request.channelName(), request.operation());

        return sampler.trySample(request);
    }
}`

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gindexcommented, Aug 27, 2020

Here is a sample repository to reproduce the issue https://github.com/gindex/sleuth-rabbit-issue

0reactions
spring-cloud-issuescommented, Mar 31, 2021

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Component Reference - Apache JMeter - User's Manual
The JavaTest example sampler can be useful for checking test plans, because it allows one to set values in almost all the fields....
Read more >
Spring ResponseStatusException does not return reason
I'm passing a JSON, but I'm not validating anything, I'm just trying to set the custom message. If I change the status code,...
Read more >
Spring Bean Life Cycle | DigitalOcean
Today we will look into Spring Bean Life Cycle. Spring Beans are the most important part of any Spring application.
Read more >
5. The IoC container - Spring
In Spring, the objects that form the backbone of your application and that are managed by the Spring IoC container are called beans....
Read more >
How to Write Groovy JMeter Functions - BlazeMeter
This means that JMeter will execute the Groovy script faster, resulting in a ... Because each Beanshell sampler has its own copy of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found