Introduce service.peer.name and service.peer.namespace; deprecate peer.service by mmanciop · Pull Request #3097 · open-telemetry/semantic-conventions (original) (raw)
hi @mmanciop!
thanks for taking this on.
we discussed this in yesterday's Service and Deployment Semconv SIG meeting (https://zoom.us/rec/share/W7L9lhkmwN6GGzh1ykMxcF-dr2B0frjOAaO52BSe-8VP-Zag6n15gQObv_sFtqM.OCG1dIwmHpD2D2rP starting around 34:00 minute marker).
I believe we're onboard with renaming
peer.servicetoservice.peer.name.
Very nice!
We'd like a bit more understanding of whether
service.peer.namespaceis needed, since we haven't had that previously, and so it would need to go through a bit more prototyping / discussion.
The identity of a service is the combination of its service.name and, if set, its service.namespace. From https://opentelemetry.io/docs/specs/semconv/resource/:
service.namespace: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. service.name is expected to be unique within the same namespace. If service.namespace is not specified in the Resource then service.name is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace).
The canonical example in my head is the frontend service: most complex systems have one, and this is where the service.namespace kicks in. If the service on the other side cannot say which application is talking to, but just that it is "some frontend", that nuance is lost.
For
service.peer.name, we want to make sure we have a clear path towards stabilizing, as we have strong preference for "defacto stable" things likepeer.serviceto only break once when going to (true) stable. Similar to what we did for HTTP and database semconv.We still need to decide whether we want to recommend
OTEL_SEMCONV_STABILITY_OPT_INas part of this migration.Can you investigate the existing usages of
peer.servicein OpenTelemetry repositories? We'd like to understand how widespread the usage is (outside of the Java agent where we know it has decent usage).
Sure, I had already done the research before coming up with the proposal, and I just spent some more time with GitHuib search to make sure I did not miss anything. To my knowledge, the list is as follow, going through SDKs and contribs in alphabetical order:
- C++: Found nothing relevant
- Erlang: Found nothing relevant
- Go: There's some examples in contrib, but I do not see any automation built into the SDK or instrumentations
- Java: Various Java instrumentations can automatically add peer.service based on configurable mappings of peer services (see e.g. PeerServiceResolverImpl). These functionalities are in incubation.
- JS: Found nothing relevant
- .NET: Found nothing relevant, besides the Zipkin exporter mentioned below
- PHP: Found nothing relevant, besides the Zipkin exporter mentioned below
- Python: Found nothing relevant
- Ruby: Some instrumentations allow to configure peer.service
- Rust: Found nothing relevant
- Collector:
- Datadog exporter in the collector, which is used to generate metrics about how services interact, and
peer.serviceis one of the dimensions. It is opt-in. - Service Graph Connector (in alpha) uses
peer.serviceas a way to look up connections. From the code, it seems to me it is the default way it uses, but I am not quite sure. - The AWS XRay Exporter uses
peer.serviceas a fallback for naming segments.
- Datadog exporter in the collector, which is used to generate metrics about how services interact, and
Others:
- Zipkin exporters, e.g., the .NET one of the [PHP one] (https://github.com/open-telemetry/opentelemetry-php/blob/569eac08ce735a945fee5719c010580f1c90d304/src/Contrib/Zipkin/SpanConverter.php#L31), use
peer.service(and other fallbacks based onserver.*and other semconvs) to determine the remote endpoint, which in turn, AFAICT, is used by Zipkin's dependency graph. However, Zipkin exporters are deprecated.
Once we decide on the migration and stabilization plan, we want to communicate it via a short blog post, to hopefully avoid the surprises that folks had with the
deployment.environment->deployment.environment.namechange.
Sounds good to me.
I also think that adding one more fallback case for service.peer.name to most of the projects above is not difficult. There is, however, the fact that their semantics of service identity is going to be incomplete anyhow if the logic is not extended to also support service.peer.namespace. But I suspect most stakeholders will answer with "service.namespace, what's that?".