diff --git a/specification/trace/semantic_conventions/rpc.md b/specification/trace/semantic_conventions/rpc.md index 7c326184a96..dfd7fa3926c 100644 --- a/specification/trace/semantic_conventions/rpc.md +++ b/specification/trace/semantic_conventions/rpc.md @@ -65,14 +65,17 @@ Furthermore, setting [net.transport][] is required for non-IP connection like na #### Service name -On the server process receiving and handling the remote procedure call, the service name provided in `rpc.service` does not necessarily have to match the [`service.name` resource attribute][]. One process can expose multiple RPC endpoints and thus have multiple RPC service names. From a deployment perspective, as expressed by the `service.*` resource attributes, it will be treated as one deployed service with one `service.name`. +On the server process receiving and handling the remote procedure call, the service name provided in `rpc.service` does not necessarily have to match the [`service.name`][] or [`peer.service`][] resource attributes. One process can expose multiple RPC endpoints and thus have multiple RPC service names. From a deployment perspective, as expressed by the `service.*` resource attributes, it will be treated as one deployed service with one `service.name`. As an example, given a process deployed as `QuoteService`, this would be the name that goes into the `service.name` resource attribute which applies to the entire process. This process could expose two RPC endpoints, one called `CurrencyQuotes` (= `rpc.service`) with a method called `getMeanRate` (= `rpc.method`) and the other endpoint called `StockQuotes` (= `rpc.service`) with two methods `getCurrentBid` and `getLastClose` (= `rpc.method`). +Generally, a user SHOULD not set `peer.service` to a fully qualified RPC service name as that will be redundant with `rpc.service`. + [network attributes]: span-general.md#general-network-connection-attributes [net.transport]: span-general.md#nettransport-attribute -[`service.name` resource attribute]: ../../resource/semantic_conventions/README.md#service +[`service.name`]: ../../resource/semantic_conventions/README.md#service +[`peer.service`]: span-general.md#general-remote-service-attributes ### Distinction from HTTP spans diff --git a/specification/trace/semantic_conventions/span-general.md b/specification/trace/semantic_conventions/span-general.md index bf777ff4c9a..dfb6094291b 100644 --- a/specification/trace/semantic_conventions/span-general.md +++ b/specification/trace/semantic_conventions/span-general.md @@ -74,7 +74,7 @@ Instrumentation is expected to provide a way for users to configure this name. | Attribute name | Notes and examples | | :-------------- | :-------------------------------------------------------------------------------- | -| `peer.service` | Logical name of the service.
MUST be the same for all instances of horizontally scaled services. Generally, a user SHOULD not set this to a fully qualified RPC service name as it would be a duplicate of `rpc.service`. | +| `peer.service` | Logical name of the service.
MUST be the same for all instances of horizontally scaled services. | Examples of `peer.service` that users may specify: - A Redis cache of auth tokens. `peer.service=AuthTokenCache`.