Enable OpenTelemetry for .NET Agent

The .NET Agent supports three modes to send the OpenTelemetry signals:

Prerequisites

  • Ensure that your .NET application uses a runtime and platform supported as stated in .NET Supported Environments except the following cases:

    • Hybrid mode is not supported on .NET Framework.

    • Both Dual Signal Mode and OpenTelemetry Only Mode are not supported on .NET Framework 3.5 or in NuGet-based distributions, including Azure Site Extensions.

  • By default, you must install the OpenTelemetry Collector separately to send data to Splunk Observability Cloud.

Enable Dual-signal mode

To enable this mode, set one of the following environment variables:AGENT_DEPLOYMENT_MODE=dual or APPDYNAMICS_OPENTELEMETRY_ENABLED=true before starting your application.

When the .NET Agent runs in Dual Signal mode, the agent automatically adds the following attributes to spans that correspond to Business Transaction starts. In most cases, these spans are the root spans of traces:

  • appd.app.name
  • appd.bt.name
  • appd.request.guid
  • appd.tier.name (This attribute can also appear in the middle of a trace whenever the tier changes.)

When possible, Splunk AppDynamics snapshots captured in Dual Signal mode provide the corresponding trace ID under the Data Collectors tab. For more information about sending traces and metrics to a local OpenTelemetry Collector or directly to Splunk Observability Cloud, see Configure OpenTelemetry

Enable OpenTelemetry only mode

To enable this mode, set the AGENT_DEPLOYMENT_MODE=otel environment variables before starting your application.

Enable Hybrid Mode

In this mode, if you do not explicitly set `service.name`, its value defaults to the tier name used by the .NET Agent.

To enable this mode:

  • AGENT_DEPLOYMENT_MODE=hybrid
  • Set the trace exporter to OTLP. The OpenTelemetry-enabled .NET Agent sends OpenTelemetry spans in OTLP format: OTEL_TRACES_EXPORTER=otlp
  • Set the tier name in `service.name` and the application name in `service.namespace` for the application: OTEL_RESOURCE_ATTRIBUTES=service.name=myServiceName,service.namespace=myServiceNameSpace