Open brettmc opened 3 years ago
@brettmc thanks for opening the issue. I'll transfer this to elastic/apm, as I think we'll want to treat this feature holistically -- server, agents, and UI.
Most (all?) elastic agents support a configuration environment
, which you can use. You can also filter it in Kibana, see e.g. https://www.elastic.co/guide/en/kibana/current/services.html.
The equivalent for environment
in OpenTelemetry is deployment.environment
, which the APM Server understands and maps.
We use environment
to label traces as production/test/dev etc, which I believe is its intended purpose (and we do have multiple environments' traces going into the one elastic instance, so it's important that we use it for this purpose). If it was unused though, that would be an interesting workaround.
Ok, you want namespaces inside environments.
You may use labels (e.g. for the java agent: global_labels=service_namespace=...
) as workaround.
Describe the feature. Using APM or opentelemetry for tracing, I would like to have the ability to namespace services so that we do not get naming collisions between generically-named services (eg "auth", "api", ...). I would also like to be able to see the namespace in the APM view, and potentially filter by namespace. As a workaround, we are prefixing namespaces into our service names (eg service.name='NAMESPACE_SERVICENAME'). The opentelemetry specification has the concept of a namespace: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/README.md#service but there doesn't appear to be a place in APM server to map that namespace to.