Enable OpenTelemetry in the Python Agent
Run Splunk AppDynamics APM and the Splunk Distribution of OpenTelemetry in the same Python application process to report data to both platforms.
You can run Python Agent on Splunk AppDynamics and Splunk Distribution of OpenTelemetry in the same application process. This combined mode reports application telemetry to Splunk AppDynamics and Splunk Observability. It also enriches matching OpenTelemetry server spans with AppDynamics Business Transaction context for cross-product correlation.
Install and Enable Combined Agent Mode
Install the OpenTelemetry package extra, select combined deployment mode, and start the Python application with the Python agent.
Combined and OpenTelemetry-only modes require Python 3.10 or higher
The application reports through Splunk AppDynamics and the Splunk Distribution of OpenTelemetry.
Configure the Combined Agent
Review configuration precedence, supplied OpenTelemetry resource values, and included instrumentation.
Use the existing Splunk AppDynamics settings for the Controller connection. Use standard Splunk OpenTelemetry and OpenTelemetry environment variables for authentication, exporters, endpoints, protocols, signals, and resource attributes.
The agent supplies missing OpenTelemetry resource values from Splunk AppDynamics configuration:
| Splunk AppDynamics Setting | OpenTelemetry Value |
|---|---|
| Application name | service.namespace in OTEL_RESOURCE_ATTRIBUTES |
| Tier name | OTEL_SERVICE_NAME or service.name |
| Account name | deployment.environment.name in OTEL_RESOURCE_ATTRIBUTES |
Customer-provided OTEL_SERVICE_NAME, service.namespace, and deployment.environment.name values take precedence and are never overwritten.
Instrumentation
The otel extra includes splunk-opentelemetry==2.11.0 and the following zero-code instrumentation:
- Web frameworks
- Flask:
opentelemetry-instrumentation-flask - Django:
opentelemetry-instrumentation-django - FastAPI:
opentelemetry-instrumentation-fastapi - Pyramid:
opentelemetry-instrumentation-pyramid - Tornado:
opentelemetry-instrumentation-tornado
- Flask:
- HTTP
- Instrumentation for aiohttp:
opentelemetry-instrumentation-aiohttp-clientandopentelemetry-instrumentation-aiohttp-server - Requests:
opentelemetry-instrumentation-requests - Instrumentation for urllib3:
opentelemetry-instrumentation-urllib3
- Instrumentation for aiohttp:
- Databases and data stores
- Instrumentation for psycopg2:
opentelemetry-instrumentation-psycopg2 - PyMySQL:
opentelemetry-instrumentation-pymysql - MySQL Connector/Python:
opentelemetry-instrumentation-mysql - Instrumentation for mysqlclient:
opentelemetry-instrumentation-mysqlclient - Redis:
opentelemetry-instrumentation-redis - PyMongo:
opentelemetry-instrumentation-pymongo
- Instrumentation for psycopg2:
Logging and system-metrics support are supplied by the Splunk distribution. Instrumentation activates automatically, so you do not need to run the opentelemetry-bootstrap command.
Correlation and Resiliency
In the combined (dual) mode, matching OpenTelemetry server spans receive the appd.bt.name, appd.tier.name, appd.app.name, and appd.request.guid attributes. OpenTelemetry trace IDs are also recorded with AppDynamics snapshots, including asynchronous transactions.
The agents start independently. If OpenTelemetry cannot initialize, Splunk AppDynamics continues to run. If AppDynamics cannot initialize, OpenTelemetry continues to run. Initialization problems are recorded in the Python Agent log.
(Optional) Install the Combined Agent Offline
Install the Splunk AppDynamics Python Agent and its Splunk OpenTelemetry dependencies from a download-portal archive.
Download and extract the appropriate download-portal archive. For an Alpine bundle, use musl 1.2 or higher, available with Alpine 3.16 or higher.
Download-portal archives include the complete Splunk OpenTelemetry dependency set.
The installer installs the Python Agent and the complete Splunk OpenTelemetry dependency set from local files.