If the number of services exceeds what is specified in the data volume guidelines, try following these best practices for service naming conventions.
Exclude environment tag values from service names
By default, the environment (env
) is the primary tag for Datadog APM.
A service is typically deployed in multiple environments, such as prod
, staging
, and dev
. Performance metrics like request counts, latency, and error rate differ across various environments. The environment dropdown in the Service Catalog allows you to scope the data in the Performance tab to a specific environment.
One pattern that often leads to issues with an overwhelming number of services is including the environment value in service names. For example, you might have two unique services instead of one since they are operating in two separate environments: prod-web-store
and dev-web-store
.
Datadog recommends tuning your instrumentation by renaming your services.
Trace metrics are unsampled, which means your instrumented application shows all data instead of subsections of them. The volume guidelines are also applied.
Use the second primary tag instead of putting metric partitions or grouping variables into service names
Second primary tags are additional tags that you can use to group and aggregate your trace metrics. You can use the dropdown to scope the performance data to a given cluster name or data center value.
Including metric partitions or grouping variables in service names instead of applying the second primary tag unnecessarily inflates the number of unique services in an account and results in potential delay or data loss.
For example, instead of the service web-store
, you might decide to name different instances of a service web-store-us-1
, web-store-eu-1
, and web-store-eu-2
to see performance metrics for these partitions side-by-side. Datadog recommends implementing the region value (us-1
, eu-1
, eu-2
) as a second primary tag.