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

Support instrumenting Spring Sleuth #351

Open
Diagoras opened this issue Jun 10, 2018 · 22 comments
Open

Support instrumenting Spring Sleuth #351

Diagoras opened this issue Jun 10, 2018 · 22 comments

Comments

@Diagoras
Copy link

While Datadog supports instrumenting Spring Boot applications, it doesn't take into account the detailed trace data generated by the Spring Cloud Sleuth module. One way to deal with this would be for Sleuth to report traces to Datadog's built-in trace API - something I've created an issue for already. However, it might be nicer for instrumented applications to have the agent automatically recognize Sleuth traces, and might result in duplicate trace data (one set from Sleuth over the API, the other set coming directly from the tracing agent).

What do you think? A worthwhile goal, or one better solved by the issue I linked above?

@tylerbenson
Copy link
Contributor

I created https://github.com/tylerbenson/zipkin-datadog-reporter as an experimental side project, but haven't gotten around to writing docs or publishing to maven. We are also experimenting with collecting zipkin spans "natively". This second option is interesting because it wouldn't require code changes by users and could work with any language implementation.

@gdubya
Copy link

gdubya commented Feb 14, 2019

We are currently investigating using Sleuth to monitor our apps and would be interested in reporting these to datadog instead of implementing our own solution. What's the best way to send the traces to DD right now?

@tylerbenson
Copy link
Contributor

@gdubya Any particular reason you don't want to use dd-java-agent? Otherwise there's a fork of my repo mentioned above that's actually been published: https://github.com/smartupio/zipkin-datadog-reporter

@gdubya
Copy link

gdubya commented Feb 15, 2019

No, I suppose that is the best way once we take our other monitoring requirements into consideration (jmx reporting, etc). Thanks for the feedback!

@renannprado
Copy link

@tylerbenson @gdubya I'm going through the quest of configuring sleuth+datadog right now.
The reason I want do it with sleuth is that if we change from datadog to something else, sleuth is abstracting a lot of things such as the annotations you can use to create spans.
I believe I'm about to succeed, but if someone already has a how-to, it would be nice.

@renannprado
Copy link

@tylerbenson does datadog agent propagate tracing with B3 format when using, for example, gRPC? That's my main restriction actually.

@tylerbenson
Copy link
Contributor

@renannprado currently we don't support B3, but we do support propagation over gRPC with dd-java-agent. Is that not working for you?

@renannprado
Copy link

I does work, but I need to propagate with B3 so make the distributed tracing integration vendor neutral.

@aantono
Copy link
Contributor

aantono commented Feb 24, 2019

I think #717 would be helpful to enable configuring such integrations.

@tylerbenson
Copy link
Contributor

FYI: We are adding support for B3 in #756.

@masoncj
Copy link

masoncj commented Feb 5, 2020

Just came here to say that we spent a little while trying to get Spring Sleuth/Brave to integrate well with Datadog's java agent, and eventually gave up and fell back to using open tracing direct to Datadog. It seems like Spring Sleuth is pretty tightly coupled to Brave so substituting other Tracers seems challenging. The datadog reporter approach would seem to work but would require forgoing other features in the datadog java agent (submitting trace data directly to datadog's monitoring agent).

It would be really nice if there were some instructions around about how to configure spring sleuth to work well with datadog.

@tvcsantos
Copy link

tvcsantos commented May 13, 2021

We started using datadog and currently in our spring-boot applications we were using spring-boot-sleuth with the brave tracer, to automatically add in our logs traceId and spanId propagatting them to other services/applications.

What I can see is that by adding the following depencies:

<dependency>
    <groupId>com.datadoghq</groupId>
    <artifactId>dd-java-agent</artifactId>
    <version>${datadog.version}</version>
</dependency>
<dependency>
    <groupId>com.datadoghq</groupId>
    <artifactId>dd-trace-api</artifactId>
    <version>${datadog.version}</version>
</dependency>

and by setting DD_LOGS_INJECTION: true we can now have APM logs/trace correlations but traceId/spanId from sleuth do not match the ones sent to datadog.

So what should be the step to have correctly configured spring-boot-sleuth brave with datadog. Can someone help on this?

@marcingrzejszczak
Copy link

@masoncj with Sleuth 3.x we're abstracting tracers as such. E.g. we have a separate project https://github.com/spring-cloud-incubator/spring-cloud-sleuth-otel/ where OpenTelemetry is the tracer we're using. Maybe you can give it another shot?

@AndersClausen
Copy link

FWIW @masoncj , we're currently using what @marcingrzejszczak is referring to and it's working really well.

@avnerstr
Copy link

Hi @AndersClausen

I followed the instructions that appears here: https://spring-cloud-incubator.github.io/spring-cloud-sleuth-otel/docs/current/reference/html/howto.html#howto
and it still didn't work with Datadog.

What else do I need to add?

@AndersClausen
Copy link

Hi @avnerstr Have you got a repo you can share? There really isn't much you need to do anymore. You do have an instance of the Otel Collector running right? What does you POM and application.yml files look like?

jpbempel added a commit that referenced this issue May 18, 2022
Merge tag 'v0.93.0' into debugger/master
@elue
Copy link

elue commented Feb 28, 2023

any update on this issue?

@bm1549
Copy link
Contributor

bm1549 commented Nov 17, 2023

@elue we've made some improvements to our Spring handling in #4770

Can you try the latest version of Spring (6.1.0) and Datadog (1.24.1) and let me know if the issue still exists?

@marcingrzejszczak
Copy link

Just FYI Spring Cloud Sleuth 3.1.x is feature complete and you should migrate to Micrometer Tracing https://github.com/spring-cloud/spring-cloud-sleuth/#-important-

@KafkaProServerless
Copy link

Upvoting this.

@elue
Copy link

elue commented Apr 29, 2024

@bm1549 we moved to B3 headers, so no longer uses this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests