You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: specification/trace/semantic_conventions/rpc.md
+7-2
Original file line number
Diff line number
Diff line change
@@ -65,14 +65,19 @@ Furthermore, setting [net.transport][] is required for non-IP connection like na
65
65
66
66
#### Service name
67
67
68
-
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`.
68
+
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.
69
+
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`.
70
+
Likewise, on clients sending RPC requests to a server, the service name provided in `rpc.service` does not have to match the [`peer.service`][] span attribute.
69
71
70
72
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.
71
73
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`).
74
+
In this example, spans representing client request should have their `peer.service` attribute set to `QuoteService` as well to match the server's `service.name` resource attribute.
75
+
Generally, a user SHOULD NOT set `peer.service` to a fully qualified RPC service name.
@@ -67,6 +70,20 @@ If `net.transport` is `"unix"` or `"pipe"`, the absolute path to the file repres
67
70
If there is no such file (e.g., anonymous pipe),
68
71
the name should explicitly be set to the empty string to distinguish it from the case where the name is just unknown or not covered by the instrumentation.
69
72
73
+
## General remote service attributes
74
+
75
+
This attribute may be used for any operation that accesses some remote service.
76
+
Users can define what the name of a service is based on their particular semantics in their distributed system.
77
+
Instrumentations SHOULD provide a way for users to configure this name.
|`peer.service`| The [`service.name`](../../resource/semantic_conventions/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. |
82
+
83
+
Examples of `peer.service` that users may specify:
84
+
- A Redis cache of auth tokens as `peer.service="AuthTokenCache"`.
85
+
- A gRPC service `rpc.service="io.opentelemetry.AuthService"` may be hosted in both a gateway, `peer.service="ExternalApiService"` and a backend, `peer.service="AuthService"`.
86
+
70
87
## General identity attributes
71
88
72
89
These attributes may be used for any operation with an authenticated and/or authorized enduser.
0 commit comments