Datadog
Application Kit provides Datadog APM (Application Performance Monitoring) integration for tracing and observability. The integration automatically configures service names, environment tags, and version information based on your Bender manifest.
Configuration
The configure_datadog() function should be called during application startup. It configures:
- Service Name: Derived from the manifest
name, optionally suffixed with a worker name - Environment: From
ENVIRONMENTorDATADOG_ENVenvironment variables - Version: From
VERSIONorDD_VERSIONenvironment variables
For FastAPI applications, get_fastapi_app() calls configure_datadog() automatically. For Django applications, call it in your settings or WSGI/ASGI entry point.
Version Compatibility
The integration supports ddtrace versions 2.x through 4.1.x:
- v3.x+: Uses simplified
patch_all()approach - v2.x: Explicit tracer configuration with RuntimeMetrics
Tracing is only enabled when get_environment() returns a non-None value (i.e., when ENVIRONMENT or DATADOG_ENV is set).
application_kit.datadog.configure_datadog
configure_datadog(worker_name=None)
Setups datadog integration.
- service name will be computed from current application name optionally appending worker_name to it.
- checks that worker_name is declared in the workers section of the manifest if not None
| PARAMETER | DESCRIPTION |
|---|---|
worker_name
|
The worker_name to use.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
The datadog service name that was computed |
Source code in application_kit/datadog/__init__.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |