Service Mapping File
DD_SERVICE_MAPPING supports remapping span service names before traces are reported. For large mapping sets, use DD_SERVICE_MAPPING_FILE to load mappings from a file.
Environment Variables
DD_SERVICE_MAPPING: inline service mapping list.
DD_SERVICE_MAPPING_FILE: path to a file containing service mappings.
File Format
The mapping file uses the same source:target format as DD_SERVICE_MAPPING.
Each non-empty line can contain one mapping:
mysql:checkout-db
postgres:orders-db
redis:checkout-cache
kafka:order-events
Single-line comma-separated mappings are also valid:
mysql:checkout-db,postgres:orders-db,redis:checkout-cache
Example
Create a mapping file:
/etc/datadog/service-mapping.txt
mysql:checkout-db
postgres:orders-db
redis:checkout-cache
legacy-payment:payments
Configure the tracer:
export DD_SERVICE_MAPPING_FILE=/etc/datadog/service-mapping.txt
With this configuration:
- spans with service mysql are reported as checkout-db
- spans with service postgres are reported as orders-db
- spans with service redis are reported as checkout-cache
- spans with service legacy-payment are reported as payments
Inline Overrides
DD_SERVICE_MAPPING can be used together with DD_SERVICE_MAPPING_FILE. When the same source service appears in both places, the inline value takes precedence.
export DD_SERVICE_MAPPING_FILE=/etc/datadog/service-mapping.txt
export DD_SERVICE_MAPPING=mysql:checkout-db-v2
In this example, mysql is reported as checkout-db-v2, while all other mappings continue to come from the file.
Service Mapping File
DD_SERVICE_MAPPINGsupports remapping span service names before traces are reported. For large mapping sets, useDD_SERVICE_MAPPING_FILEto load mappings from a file.Environment Variables
DD_SERVICE_MAPPING: inline service mapping list.DD_SERVICE_MAPPING_FILE: path to a file containing service mappings.File Format
The mapping file uses the same
source:targetformat asDD_SERVICE_MAPPING.Each non-empty line can contain one mapping:
Single-line comma-separated mappings are also valid:
mysql:checkout-db,postgres:orders-db,redis:checkout-cache
Example
Create a mapping file:
/etc/datadog/service-mapping.txt
mysql:checkout-db
postgres:orders-db
redis:checkout-cache
legacy-payment:payments
Configure the tracer:
export DD_SERVICE_MAPPING_FILE=/etc/datadog/service-mapping.txt
With this configuration:
Inline Overrides
DD_SERVICE_MAPPING can be used together with DD_SERVICE_MAPPING_FILE. When the same source service appears in both places, the inline value takes precedence.
export DD_SERVICE_MAPPING_FILE=/etc/datadog/service-mapping.txt
export DD_SERVICE_MAPPING=mysql:checkout-db-v2
In this example, mysql is reported as checkout-db-v2, while all other mappings continue to come from the file.