Configure Opentelemetry (Dotnet Agent)

Resource attributes

Proper identification of the source of telemetry data requires the following resource attributes:

  • service.namespace

  • service.name

  • deployment.environment.name (optional, but highly recommended)

You can set the resource attributes using environment variables:

CODE
OTEL_SERVICE_NAME=<service_name>
OTEL_RESOURCE_ATTRIBUTES=service.namespace=<service_namespace>,deployment.environment.name=<environment>

Automatic Configuration

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

In Dual Signal or OpenTelemetry-only mode, if you do not set some resource attributes, they are automatically set based on the following AppDynamics configuration for most applications:

AppDynamics Configuration Element OpenTelemetry Configuration Element
Tier name Service name
Application name Service namespace
Account name Deployment environment name

For example, if you set up and run the local Collector, all you need to do to configure Dual Signal mode is set AGENT_DEPLOYMENT_MODE to dual. The default values for other configuration settings automatically export logs, metrics, and traces to the Collector. The required resource attributes are automatically populated by the combined .NET Agent.

Note:

Automatic detection of the service name and service namespace does not work for the following .NET Framework applications:

  • IIS-hosted applications.

  • Applications where instrumentation is configured for the app-domain name.

Configure the Collector Endpoint

By default, the Collector endpoint is http://localhost:4318, and the agent sends metrics over HTTP using the OTLP format. The .NET Agent for OpenTelemetry does not support sending metrics over gRPC.

You can configure the endpoint with the OTEL_EXPORTER_OTLP_ENDPOINT environment variable:

CODE
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:8080

Configure the Batching Timing

The default exporter span-batching schedule is 5,000 milliseconds. You can configure the batching schedule with the OTEL_BSP_SCHEDULE_DELAY environment variable:

CODE
OTEL_BSP_SCHEDULE_DELAY=90000