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

Add ability to distinguish traces from different services located in the same JVM #472

Closed
Jokser opened this issue Jul 25, 2019 · 5 comments

Comments

@Jokser
Copy link

Jokser commented Jul 25, 2019

The issue is coming from a discussion census-instrumentation/opencensus-java#1952

There is a problem about how to distinguish traces from different services located in the same JVM. I mean service in terms of Zipkin exporter configuration. As I see the exporter has "service" field which represents a logical separation between some business and internal processes.
Let's suppose the situation if you have some web-service that does some business logic and embedded database for storing/querying a data to it. Physically they share the same JVM but logically it's two different service - business and db.
At the moment we can use tags to separate spans come from business service and db but both of them will relate to the same service.
This problem can be resolved by using separated tracing components stacks in the same JVM but the ability to create several tracing components is a difficult task at the moment because of the singleton nature of some internals.
Another approach is that we can use different span exporters with different "service" parameters. At the moment all spans in JVM go through all registered exporters. We can add span filtering for exporters that some spans go to one exporter while some to another using "resource" field in Span.
WDYT?

@codefromthecrypt
Copy link
Contributor

codefromthecrypt commented Jul 26, 2019 via email

@pavolloffay
Copy link
Member

hi @Jokser, It seems what you are describing is related to #308 and PR #350.

The PR #350 adds the ability to have multiple tracers.

@Jokser
Copy link
Author

Jokser commented Jul 26, 2019

@pavolloffay @adriancole Thank you for the responses. Does it mean that the approach described in the issue you mentioned will only way to resolve the problem described here?
If you have the ability to create multiple tracers do we really need the ability to filter spans in exporters? Or it may be a useful feature anyway?

@codefromthecrypt
Copy link
Contributor

codefromthecrypt commented Jul 27, 2019

multiple tracers will work if similarly scoped down the tree of requests and don't make local calls to things handled by other tracers. if all tracers share the same exporter, you can increase the effectiveness of the batching handled there. If they share the same sampling impl, this can help avoid overrunning the policy you want because otherwise a rate is increased by tracer count (unless the sampler itself has some global coordination)

@jkwatson
Copy link
Contributor

jkwatson commented Mar 3, 2021

Now that the exporters all use the Resource service.name attribute, and we can very easily have multiple instances of the SDK, I think we can close this issue.

@jkwatson jkwatson closed this as completed Mar 3, 2021
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

4 participants