Skip to content

Commit

Permalink
Move peer.service / rpc.service relationship explanation to rpc doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuraag Agrawal committed Jun 29, 2020
1 parent 43520c0 commit 870cb40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions specification/trace/semantic_conventions/rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion specification/trace/semantic_conventions/span-general.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. <br/> 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. <br/> 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`.
Expand Down

0 comments on commit 870cb40

Please sign in to comment.