Here is my Aspire app code
using Projects;
IDistributedApplicationBuilder builder = DistributedApplication.CreateBuilder(args);
var telegramBroadcastService =
builder.
AddProject<Netizen_TelegramBroadcastService>("TelegramBroadcastService");
var campaignSystemApi =
builder
.AddProject<CampaignSystem_Api>("CampaignSystem.Api");
builder
.Build()
.Run();
And here is the telemetry registration code
.WithTracing(tracing =>
{
if (isDevelopment)
{
// We want to view all traces in development
tracing.SetSampler(new AlwaysOnSampler());
}
tracing
.AddSource("MyProduct.*")
.AddAspNetCoreInstrumentation()
.AddGrpcClientInstrumentation()
.AddHttpClientInstrumentation()
.AddOtlpExporter(otlpOptions =>
{
otlpOptions.Endpoint = new Uri($"https://api.honeycomb.io:443");
otlpOptions.Headers = string.Join(
",",
new List<string>
{
"x-otlp-version=0.16.0",
$"x-honeycomb-team=-----omitted-----"
});
});
});
When I run this code, Aspire sends telemetry to Honecomb but it creates multiple datasets (one for each name in builder.AddProject).
Is there a way to have them all go to a single dataset? Otherwise, I get the same telemetry in multiple datasets with (missing) nodes at the top.
As per my understanding of Aspire and How it register project.
When project register with Aspire App Host and when it run from there, It send s it to Aspire otel receiver.
The way you registered, It will send it to honeycomb and Aspire will not comes in between. (I used to send it to Grafana cloud)
In Api Project and Web Project you have to add following things.
Add Environment variable with OTEL_SERVICE_NAME.
Update
As per discussion over X, there is alternative solution. This will make in easy when you have to set one name ( Just like case mention over here in question).