We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e53398 commit 2fb94e2Copy full SHA for 2fb94e2
1 file changed
readme.md
@@ -377,6 +377,21 @@ using var tracer = Sdk
377
.Build();
378
```
379
380
+For integration from a plain CLI app with Aspire (or whenever an OLTP endpoint is provided as an
381
+environment variable), you can simplify it as:
382
+
383
+```csharp
384
+var builder = Host.CreateApplicationBuilder(args);
385
386
+if (!string.IsNullOrWhiteSpace(builder.Configuration["OTEL_EXPORTER_OTLP_ENDPOINT"]))
387
+{
388
+ builder.Services.AddOpenTelemetry()
389
+ .ConfigureResource(x => x.AddService("MyApp"))
390
+ .WithTracing(x => x.AddSource("Merq").AddOtlpExporter())
391
+ .WithMetrics(x => x.AddMeter("Merq").AddOtlpExporter());
392
+}
393
+```
394
395
Collecting traces via [dotnet-trace](https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-trace):
396
397
```shell
0 commit comments