.NET
StackState v6.0
Last updated
StackState v6.0
Last updated
Automatic instrumentation for .NET can automatically capture traces and metrics for a variety of .
Automatic instrumentation does not require any modifications of the application. To set it up follow these steps:
Download the or version of the instrumentation libraries (musl for Alpine, glibc for most other docker images) from the of the opentelemetry-dotnet-instrumentation repository. Unzip the files and include them in your application docker image in a directory, here we use /autoinstrumentation
.
Set the following env vars, here we do it via the env
of the container in the Kubernetes pod spec:
Deploy your application with the changes
Manual instrumentation can be used when you need metrics, traces or logs from parts of the code that are not supported by the auto instrumentation. For example unsupported libraries, in-house code or business-level metrics.
To capture that data you need to modify your application.
Include the Open Telemetry SDK as a dependency
Add code to your application to capture metrics, spans or logs where needed
Also add the extra environment variables on the pod.
StackState is receiving traces and/or metrics
For more details please refer to the .
There is detailed documentation for this on the .
Make sure you use the OTLP exporter (this is the default) and . When deploying the application the service name and exporter are .
For some .NET metrics, for example, garbage collector metrics, StackState has defined charts on the related components. For Kubernetes,the charts are available on the pods. It is possible to , this works for metrics from automatic instrumentation but also for application-specific metrics from manual instrumentation.