Comments (2)
There's not a huge amount of information to go on there, but I suspect that the ParentIds are from the HTTP outbound span (HTTP Client), not the inbound AspNet core span, which is what you're showing there.
I'm not sure why ServiceC would be in a new Trace, but perhaps you've not enabled the HTTPClient instrumentation in Service B?
from opentelemetry-dotnet.
There's not a huge amount of information to go on there, but I suspect that the ParentIds are from the HTTP outbound span (HTTP Client), not the inbound AspNet core span, which is what you're showing there.
I'm not sure why ServiceC would be in a new Trace, but perhaps you've not enabled the HTTPClient instrumentation in Service B?
@martinjt hi, this is the sample code. I have checked the source code but cannot find the reason
serviceA
var builder = WebApplication.CreateBuilder(args);
builder.WebHost.ConfigureKestrel(b =>
{
b.ListenAnyIP(5000);
});
builder.Services.AddHttpClient();
builder.Services.AddOpenTelemetry()
.ConfigureResource(resource => resource
.AddService("ServiceA"))
.WithTracing(tracing => tracing
.AddAspNetCoreInstrumentation()
.AddConsoleExporter()
.AddZipkinExporter()
);
var app = builder.Build();
app.MapGet("/serviceA", async Task<string> (HttpContext context, IHttpClientFactory factory) =>
{
using var httpClient = factory.CreateClient("client");
httpClient.BaseAddress = new Uri("Http://localhost:5001");
var response = await httpClient.GetAsync("/serviceB");
response.EnsureSuccessStatusCode();
return await response.Content.ReadAsStringAsync();
});
await app.RunAsync();
serviceB
var builder = WebApplication.CreateBuilder(args);
builder.WebHost.ConfigureKestrel(b =>
{
b.ListenAnyIP(5001);
});
builder.Services.AddHttpClient();
builder.Services.AddOpenTelemetry()
.ConfigureResource(resource => resource
.AddService("ServiceB"))
.WithTracing(tracing => tracing
.AddAspNetCoreInstrumentation()
.AddConsoleExporter().AddZipkinExporter()
);
var app = builder.Build();
app.MapGet("/serviceB", async Task<string> (HttpContext context, IHttpClientFactory factory) =>
{
using var httpClient = factory.CreateClient("serviceC");
httpClient.BaseAddress = new Uri("Http://localhost:5002");
var response = await httpClient.GetAsync("/serviceC");
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
response = await httpClient.GetAsync("/serviceC");
response.EnsureSuccessStatusCode();
return await response.Content.ReadAsStringAsync();
});
await app.RunAsync();
ServiceC
var builder = WebApplication.CreateBuilder(args);
builder.WebHost.ConfigureKestrel(b =>
{
b.ListenAnyIP(5002);
});
builder.Services.AddHttpClient();
builder.Services.AddOpenTelemetry()
.ConfigureResource(resource => resource
.AddService("ServiceC"))
.WithTracing(tracing => tracing
.AddAspNetCoreInstrumentation()
.AddConsoleExporter().AddZipkinExporter()
);
var app = builder.Build();
app.MapGet("/serviceC", ValueTask<string> (HttpContext context) =>
{
return new ValueTask<string>($"DateTime Now:{DateTime.Now},GUid:{Guid.NewGuid().ToString("N")}");
});
await app.RunAsync();
from opentelemetry-dotnet.
Related Issues (20)
- Support .NET 9 Advice API
- [Instrumentation.AspNetCore, Instrumentation.Http] Cache activity names
- [Instrumentations] ActivitySource and Meter versioning
- Expand test coverage for baggage encoding
- unit "bytes" not a suffix of metric "process_runtime_dotnet_gc_allocations_size_bytes_total" HOT 4
- Dotnet Otel Grpc hits client limit and drops messages. Event with default batch settings. HOT 12
- After update to 1.8 version and when using the ASP .Net Core Prometheus exporter and /metrics end point I get error on Prometheus some times. HOT 2
- [logs] Reloading application configuration may lead to unnecessary thread creation
- Prometheus exporter sometimes produces malformed data HOT 1
- DelegatingOptionsFactoryServiceCollectionExtensions breaks native AoT compatibility HOT 1
- Test stability - OpenTelemetry.Trace.Tests.BatchExportActivityProcessorTest.CheckShutdownExport HOT 2
- Move remaining instrumentation libraries to the opentelemetry-dotnet-contrib repo HOT 5
- Release changes for unstable core components HOT 2
- Tests Stability - OpenTelemetry.Instrumentation.AspNetCore.Tests.BasicTests
- Exception is thrown on non-standard IOC container due to use of Concrete classes. HOT 6
- [otlp] UseOtlpExporter and AddOtlpExporter extensions don't play nice together HOT 1
- Instrumentation.AspNetCore and Instrumentation.Http 1.8.1 have illegal breaking changes in the produced telemetry HOT 8
- service.name is defined as unknown_service HOT 2
- service.name is defined as unknown_service HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opentelemetry-dotnet.