Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 21 21:20
    jonatan-ivanov closed #2101
  • Jan 21 21:20

    jonatan-ivanov on 3.1.x

    auto-formatting Upgrade Brave to 5.13.7 fixes g… (compare)

  • Jan 21 21:18
    jonatan-ivanov edited #2101
  • Jan 21 21:14
    jonatan-ivanov opened #2101
  • Jan 21 21:14
    jonatan-ivanov milestoned #2101
  • Jan 21 21:14
    jonatan-ivanov labeled #2101
  • Jan 21 18:53
    CircleCI failed: spring-cloud build (#148) in https://github.com/spring-cloud/spring-cloud-core-tests
    • Updates to spring cloud 2022.0.0
      (474cb1365da5b58a2ec4511eafb0dcc9258b87f0 by spencergibb)
  • Jan 21 18:39
    CircleCI failed: spring-cloud build (#147) in https://github.com/spring-cloud/spring-cloud-core-tests
    • Adds .sdkmanrc
      (9b9e360dc66c92beaea94d1991e875b7537a5c45 by spencergibb)
  • Jan 21 18:37
    CircleCI success: spring-cloud build (#146) in https://github.com/spring-cloud/spring-cloud-core-tests
    • null
      (7fa30fa6b10a3f9a4019f732b91c62dcbe384e1b by null)
  • Jan 21 13:49
    shadabbahadara commented #1324
  • Jan 21 13:49
    shadabbahadara commented #1324
  • Jan 20 08:36
    marcingrzejszczak commented #2075
  • Jan 20 08:35
    marcingrzejszczak commented #1325
  • Jan 19 13:52
    marcingrzejszczak milestoned #2100
  • Jan 19 13:52
    marcingrzejszczak labeled #2100
  • Jan 19 12:14
    wilkinsona opened #2100
  • Jan 17 10:19
    marcingrzejszczak labeled #2004
  • Jan 17 10:19
    marcingrzejszczak unlabeled #2004
  • Jan 17 10:18
    marcingrzejszczak commented #2004
  • Jan 17 10:17

    marcingrzejszczak on 3.1.x

    Polish (compare)

Marcin Grzejszczak
@marcingrzejszczak
great, thank you I'll try to check it out today
Deserttown
@desertTown
thank you
Deserttown
@desertTown
Hi @marcingrzejszczak
can i know if there any update on this case
Marcin Grzejszczak
@marcingrzejszczak
sure, there are no updates until now - we are updating issues on the fly when we're wokring on them
larsf96
@larsf96
Hi all,
I'm currently trying to use spring-cloud-sleuth with Zipkin to setup tracing for a couple of microservices. Each of them uses kafka-streams to process messages and forwards them to the next service. The first service gets data via REST and puts it onto a kafka topic. I can see a "b3" header with a traceId there, but the next service does not seem to use and propagate this trace ID. I'm using a Streams processor (org.apache.kafka.streams.processor.api.Processor) with a custom topology (org.springframework.kafka.config.KafkaStreamsInfrastructureCustomizer). Any ideas why this isn't working?
7 replies
poornimayadav123
@poornimayadav123
how to change this request path,i am getting I/O error on POST request for "http://localhost:9411/api/v2/spans": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)
1 reply
Deserttown
@desertTown
image.png
Marcin Grzejszczak
@marcingrzejszczak
please do not cross post
ronakpatelinfodesk
@ronakpatelinfodesk
I want to integrate sleuth with web application with servlet 3.0(not spring) + log4j2 (2.14.1). can anyone suggest good blog or example?
Marcin Grzejszczak
@marcingrzejszczak
You should use Brave directly https://github.com/openzipkin/brave
ronakpatelinfodesk
@ronakpatelinfodesk
does it add spanid & traceid to each log such as sleuth did?
ronakpatelinfodesk
@ronakpatelinfodesk
thanks. I tried but SLF4JContext class used on that blog not found in any dependency. Also, I tried with https://github.com/openzipkin/brave/tree/master/context/log4j2 with [%X] log pattern but it do not generate spanid & traceid in logs. It prints [{}] in logs.
1 reply
Jason Mah
@elmsleypass
Hi, new to this.. I got sleuth showing up in my logs:
2021-10-08 12:25:08.731 INFO [k8s-api-gateway,9dcedfd1a672db7a,9dcedfd1a672db7a] 1 --- [or-http-epoll-2] c.i.i.f....
But not in my downstream microservice:
12:25:11.060 [http-nio-8080-exec-4] INFO c.i.i.controllers
which has a logback appender with pattern. Does this pattern affect the traceid/spanid from showing up? And if so how do I dump it?
Also in my microservice, when I dump the headers, it shows x-b3-traceid, so I know it's there.
2 replies
Second question, I have another microservice, it's crashing because
10-08T12:32:59.590 [http-nio-8080-exec-1] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoSuchFieldError: LIFTER] with root cause
java.lang.NoSuchFieldError: LIFTER
at org.springframework.cloud.sleuth.instrument.reactor.ReactorHooksHelper.getLifterName(ReactorHooksHelper.java:170)
at org.springframework.cloud.sleuth.instrument.reactor.ReactorHooksHelper.isTraceContextPropagator(ReactorHooksHelper.java:174)
But I updated everything to springboot 2.5.5, not sure what else I need. Hints?
5 replies
Jason Mah
@elmsleypass
I have both web and rabbitmq flows, how do I get traces through BOTH of them? Does spring.zipkin.sender.type take an array?
2 replies
Kevin van den Broek
@Kevintjeb

Hey all! I'm trying to use spring sleuth to propagate headers between services in my system.

The propagation works, however, we're sending it to Google Cloud Trace which does not work.. All services that are go-based (which use go-opentelemetry) have the traces visible in the Google Cloud Trace backend, but all calls leaving the Java service with Spring Cloud Sleuth don't seem to show up. We haven't been able to figure out what 'headers' / 'protocol' google uses, but their support said:

According to our internal notes the X-Cloud-Trace and w3c traceparent [1] headers are generally the means by which sufficient context is propagated across HTTP calls / RPCs to instrument for tracing.

I've got two questions:

  • Has someone done this before, and could they share an example of some sorts?
  • What debugging options do I have with Spring Sleuth?
1 reply
I've searched around in this room, but couldn't find much that helped me out
Luis Copetti
@lhcopetti

Hello all, happy Friday! I am trying to make sleuth work with a reactive and functional style declaration of the stream listener but I am facing some difficulties when trying to wrap some logic around a span using either MessagingSleuthOperators or WebFluxSleuthOperators. This is the relevant part of the code:

@Bean
public Consumer<Flux<Message<byte[]>> input() { 
    return flux -> flux
        .flatMap(this::processMessage)
        .subscribe();
}

public Mono<Void> processMessage(Message<byte[]> msg) {
    return Mono.just(msg)
        .doOnNext(c -> logProcessingStart(msg))
        .flatMap(this::otherOperations)
        .doOnSuccess(c -> logProcessingEnds(msg))
}

What I don't get is how I can wrap some operations inside processMessage to make use of the instrumented reactor context since all of them accept a consumer and most of the time I need to continue the stream by returning a Mono instead of void (consumer's signature):

    public static <T> void withSpanInScope(BeanFactory beanFactory, Message<T> message,
            Consumer<Message<T>> withSpanInScope) {
1 reply
Roeniss Moon
@roeniss

Hello friends! I have a just quick question: If two Spring server use same "spring-cloud-starter-sleuth", is parent_id data created automatically in B when A send a request to B?

I'm looking for how to connect span_id to parent_id among related servers, but seems that official docs don't answer it detailed I guess :)

27 replies
Marcin Grzejszczak
@marcingrzejszczak
I completely don't understand the question
what does use the same spring-cloud-starter-sleuth mean?
4 replies
Bhavesh Mistry
@bmistry13
@marcingrzejszczak , We got the latest version and it broke our patch for compilation. We have illegal char that we allow in URL and we had a patch for @Override
protected URI toUri(HttpServerRequest request) {
try {
return URI.create(request.url());
}catch (IllegalArgumentException e){
// not able to parse it URL.
}
String url = request.url();
for(String c:ILLEGAL_CHARS){
url = url.replace(c,"");
}
return URI.create(url);
}
21 replies
is there no more protected URI toUri(HttpServerRequest request) () . is there any way to inject SpringHttpServerAttributesExtractor httpAttributesExtractor = new SpringHttpServerAttributesExtractor();
I am not seeing any way
it has been replaced by SpringHttpServerAttributesExtractor class
I am not able to inject the bean
public OtelHttpServerHandler(OpenTelemetry openTelemetry, HttpRequestParser httpServerRequestParser,
        HttpResponseParser httpServerResponseParser, SkipPatternProvider skipPatternProvider,HttpServerAttributesExtractor<HttpServerRequest, HttpServerResponse> httpAttributesExtractor ) {
}
So I can inject custom implementation for URL parsing
Bhavesh Mistry
@bmistry13
URI.create(url) will throw Exception if there are illegal chars
Martin Tacit
@MartinTacit_twitter
This message was deleted
21 replies
Jorge F. Sánchez
@jfsanchez_gitlab

Hi @all,
How can I wrap a set of operations with a new SpanId, using Reactor + Sleuth.
Imagine I have some code like this:

fun fetchSomethingList(): Flux<Something> {
    // START NEW SPAN HERE
    return somethingHttpClient.fetchSomethingList().flatMap { something ->
        sanitize(something)
    }.flatMap { something ->
        doMoreWork(something)
    }.doOnNext { something ->
        logger.debug("$something fetched and processed successfully.")
    }
    // END OF SPAN
}

I would like to have a new Span at the beginning of the function and be able to finish it at the very end.
This Span should be propagated to all the Reactor operators (map, flatMap...) and other internal sub-calls (e.g: somethingHttpClient.fetchSomethingList(), sanitize(something) or doMoreWork(something)).
How can I accomplish something similar?
Thanks in advance.

2 replies
Bhavesh Mistry
@bmistry13
Hello, When is the next milestone release date for 1.1.0-snapshot?
3 replies
Anders Clausen
@AndersClausen

Hi all. I have started getting this error when running my app

Caused by: org.springframework.cloud.sleuth.autoconfig.otel.MultipleTracerAutoConfigurationsDetector$MultipleTracersFoundException: You have both Spring Cloud Sleuth OpenTelemetry (OTel) and Spring Cloud Sleuth Brave tracers on the classpath. Please exclude <org.springframework.cloud:spring-cloud-sleuth-brave> dependency from <org.springframework.cloud:spring-cloud-starter-sleuth>.
    at org.springframework.cloud.sleuth.autoconfig.otel.MultipleTracerAutoConfigurationsDetector.signalMultipleTracerAutoConfigurationsPresent(MultipleTracerAutoConfigurationsDetector.java:41) ~[spring-cloud-sleuth-otel-autoconfigure-1.1.0-M3.jar:1.1.0-M3]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389) ~[spring-beans-5.3.13.jar:5.3.13]
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333) ~[spring-beans-5.3.13.jar:5.3.13]
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157) ~[spring-beans-5.3.13.jar:5.3.13]

It happens even after upgrading to spring boot 2.6.0 and spring boot cloud 2021.0.0-RC1. I'm also using spring-cloud-sleuth-otel-autoconfigure version 1.1.0-M3.

I'm already excluding Brave dependency as the error is suggesting and can't see anything else bringing it in.

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-sleuth</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.cloud</groupId>
                    <artifactId>spring-cloud-sleuth-brave</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

Any ideas to why this is suddenly happening?

Marcin Grzejszczak
@marcingrzejszczak
eee not really. Can you run ./mvnw dependency:tree ?
2 replies
shravani154
@shravani154
Hello, I would like to know whether spring cloud sleuth opentelemetry dependency for kafka consumer apps is in production or not?
1 reply
Sharipov Shohruh
@sharipovshoxrux_gitlab
Hello everyone, I am getting this error ResourceAccessException: I/O error on POST request for "http://localhost:9411/api/v2/spans", can anyone help me
5 replies
Domenico Sibilio
@dsibilio
Hi all, I was testing out the spring.sleuth.baggage.remote-fields and spring.sleuth.baggage.correlation-fields properties in order to insert custom fields into the MDC automatically. It works well with HTTP requests as it extracts the header automatically from the request and copies that into the MDC, but when I tested it by sending a Spring Integration message to a channel it didn't do anything. Is there a chance that I may be doing something wrong or is the automatic header extraction only supposed to work for HTTP scenarios? I can share more information such as the configuration or even a reproducible sample if necessary!
11 replies
bkhashfeh
@bkhashfeh
I'm unable to search tracing data from based on tags names from ElasticSearch, I found the issue here : openzipkin/zipkin-support#46 how I can resolve the issue?
2 replies
Ivan Topolnjak
@ivantopo

Hello folks :wave:

I'm trying to get JDBC spans for the sample PetClinic application using spring-cloud-starter-sleuth version 3.0.4. I thought that adding the p6spy dependency as mentioned here would be enough for Spans to start showing up, but nothing happened so far. Is there any additional configuration required to get JDBC spans? or maybe just the PetClinic with H2 is not a good place to try this out?

2 replies
Zane XiaoYe
@Zane-XY
Is there any way to enable debug or trace info so I can observe to make sure the sleuth integration is working allright? I have integrated sleuth-otel, the application starts up normally.
I didn’t see any traces either from my Otel data collectors nor any traces print out in the std console.
It does throw any errors. but I didn’t see any trace data produced.
8 replies
Zane XiaoYe
@Zane-XY
org.springframework.cloud.sleuth.instrument.web.WebFluxSleuthOperators seems like a ReactorSleuthOperators. withSpanInScope is a generic operation, not only useful in web flux context.
8 replies
Zane XiaoYe
@Zane-XY
I also find the method with @NewSpan invoked inside a flatMap, does not get created with correct hierarchy. I expect to have processSingle span created nested inside process span. but I didn’t see the processSingle span get created. Did I miss something?
@NewSpan
public Mono<...> process(Batch batch) {
    return Flux.fromIterable(batch.getMessages())
               .flatMap(m -> processSingle(m).subscribeOn(scheduler))
               ...

}

@NewSpan
Mono<...> processSingle() {}
3 replies
Zane XiaoYe
@Zane-XY
Hi @marcingrzejszczak
In the 1.0.x Otel branch, it still points to spring-cloud-sleuth.version:3.0.4, in this version it does not have the Kafka instrumentation. Are you going to update the version in the next milestone? for now I can try to override the version in my own pom.xml.
https://github.com/spring-projects-experimental/spring-cloud-sleuth-otel/blob/1.0.x/pom.xml
11 replies
Martin Tacit
@MartinTacit_twitter
Can someone give me a hint how to use sleuth (with Zipkin) with Reactor Kafka if we don't use bare KafkaReceive but ReactiveKafkaConsumerTemplate instead? any suggestion appreciated!
4 replies
prabhushan
@prabhushan
Hi.. I would like to send Zipkin traces to New Relic Tracing using spring boot application.. Right now the property takes only base URL.. but i want to pass the complete URL.. is there any configuration to do it
1 reply
King4Code
@King4Code
Hi
Is there a way to get span name programmatically in sleuth 3.1.0?
17 replies
Nuno Marujo
@nhmarujo
Hi. I’m using Spring Boot 2.6.2 with Spring Cloud Dependencies 2021.0.0 on JDK 17.0.1. Under the same conditions other apps have tracing working just fine, but in one in particular I am facing issues having traceIds reused in several requests within a certain period.
I have checked and those requests with repeated traceId are being processed by several threads, so it doesn’t quite suggest the typical context leaking between requests.
Another weird detail I’ve noticed, in all cases I analysed so far, is that the first request done with a traceId, that then starts to be repeated for a while, is a call to PATCH endpoint we have on that service. And that endpoint doesn’t even have an high rate of calls, when compared to others. So doesn’t sound like a coincidence.
I do understand this probably doesn’t have anything to do with Sleuth itself, but I would appreciate if someone could share thoughts on how to figure this out.
15 replies
Hugo Barrigas
@hfgbarrigas
hey, what's the best way to parse tracing data from the http request body? For reactor and servlet based servers. Use case, we're leveraging pubsub push subscriptions which we don't control, pubsub template already puts tracing data as message attributes.
1 reply