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.

Multiple services

See original GitHub issue

Question

I have multiple services in a various assemblies and I’d like to be able to track each one by name

In the code below, there is the option to call AddService multiple times but I cannot see how to get a mapping from that to a service specific ActivitySource
Startup .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(info.name)

E.g. Lets say I have a UserService and a Repository<User> service
I’d like to add add a services UserService and Repository_User and then in my UserService I’d have an ActivitySource named UserService and in Repository<User> I’d have an ActivitySource named Repository_User

Is this configuration possible?

I’m using Jaeger exporter if it makes a difference

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
thrixtoncommented, May 12, 2021

Would it be something like this:

var openTelemetry = Sdk.CreateTracerProviderBuilder()
                    .AddSource("Samples.SampleClient", "Samples.SampleServer")
                    .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("otlp-test"))
                    .AddOtlpExporter(opt => opt.Endpoint = new Uri(endpoint))
                    .Build();

I use this pattern currently, and it has the downside of every operation being grouped / tagged under the service otlp-test, instead of (e.g. Samples.SampleClient, Samples.SampleServer).

If I add multiple services(…AddService(“Service1”).AddService(“Service2”), it appears that the last one wins, e.g. everything is grouped under that name.

I cannot find a way to map a service name back to a source, in my desired state it is a 1=1 mapping.

I think the .NET implementation (at least) is assuming that a process is a service, whereas what I want is the ability to separate my process into multiple logical services.

Using Jaeger at least, logically separating services has the benefit of colour coding each service which makes it easy to visually distinguish logical components of a larger application. Maybe a picture helps 😃 image

0reactions
buvinghausencommented, Jun 24, 2021

@AlexGS74 you can disregard the prior questions it looks like I just configure the AspNetCoreInstrumentation to filter out requests from other services and that solves that riddle. Now I just need to ping my main man Jimmy Bogard and see if we can get a similar filter setup for the NServiceBus side for my worker process and this problem will be solved for good. Many thanks for pointing me in the right direction!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple Services
Multiple Services, LLC is a full-service residential construction firm providing clients with the highest level of quality and service at a fair and...
Read more >
Multiple Services Inc. Heating & Cooling
We combine our use of the highest quality parts and equipment, and our dedication to delivering exceptional service to provide you with top...
Read more >
Multiple services Definition
Multiple services means the counseling and guidance provided as a routine part of case management plus two or more VR services.
Read more >
Multiple Services, Llc. Company Profile | Urbana, OH
Multiple Services, Llc. Company Profile | Urbana, OH | Competitors, Financials & Contacts - Dun & Bradstreet.
Read more >
Multiple Services LLC
Multiple Services LLC A preferred Pinnacol agent partner. An expert in workers' comp and will help you get just the right policy for...
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