Digma Quick Start
Guide for .NET
connect your code to Digma!
A
Connecting your code to Digma
.NET / ASP.NET MVC
Add the Digma NuGet package to your project:
dotnet add package OpenTel.Instrumentation.Digma
Use the ‘AddDigmaAttributes()’ extension method to add Digma’s instrumentation to your project.
Here is an example (your instrumentation code may look a little different):
builder.Services.AddOpenTelemetryTracing(
builder => builder
.AddAspNetCoreInstrumentation(options =>{options.RecordException = true;})
.AddHttpClientInstrumentation()
.SetResourceBuilder(ResourceBuilder.CreateDefault()
.AddTelemetrySdk()
.AddService(serviceName: serviceName, serviceVersion: serviceVersion ?? "0.0.0")
.AddDigmaAttributes())
.AddOtlpExporter(c => { c.Endpoint = new Uri("http://localhost:5050");})
.AddSource("*")
);
You’re good to go! Check out our sample .NET project for reference.
Get More Out of Digma
To find out about adding environments, commit info, and other configuration options, check out the Digma instrumentation page.
New to observability? OpenTelemetry has extensive documentation explaining how to get started. [ Get started with OpenTelemetry ]
FOUND ANY ISSUES?
Let us know on our community page and we’ll be happy to assist.