Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add net.host.name and net.host.ip to rpc server #2447

Merged
merged 4 commits into from
Apr 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ release.
extra reverse DNS lookup. And moved `net.peer.name` from common http attributes to
just client http attributes.
([#2446](https://github.com/open-telemetry/opentelemetry-specification/pull/2446))
- Add `net.host.name` and `net.host.ip` conventions for rpc server spans.
([#2447](https://github.com/open-telemetry/opentelemetry-specification/pull/2447))

### Compatibility

Expand Down
12 changes: 12 additions & 0 deletions semantic_conventions/trace/rpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ groups:
- net.peer.ip
- net.peer.name
- include: network

- id: rpc.server
prefix: rpc
extends: rpc
span_kind: server
brief: 'Semantic Convention for RPC server spans'
attributes:
- ref: net.host.name
- ref: net.host.ip

- id: rpc.grpc
prefix: rpc.grpc
extends: rpc
Expand Down Expand Up @@ -121,6 +131,7 @@ groups:
value: 16
required: always
brief: "The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request."

- id: rpc.jsonrpc
prefix: rpc.jsonrpc
extends: rpc
Expand Down Expand Up @@ -155,6 +166,7 @@ groups:
note: >
This is always required for jsonrpc. See the note in the general
RPC conventions for more information.

- id: rpc.message
prefix: "message" # TODO: Change the prefix to rpc.message?
type: event
Expand Down
14 changes: 12 additions & 2 deletions specification/trace/semantic_conventions/rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ This document defines how to describe remote procedure calls

- [Common remote procedure call conventions](#common-remote-procedure-call-conventions)
* [Span name](#span-name)
* [Attributes](#attributes)
* [Common attributes](#common-attributes)
+ [Service name](#service-name)
* [Server attributes](#server-attributes)
* [Events](#events)
* [Distinction from HTTP spans](#distinction-from-http-spans)
- [gRPC](#grpc)
Expand Down Expand Up @@ -51,7 +52,7 @@ Examples of span names:
`MyServiceReference.ICalculator/Add` reported by the client for .NET WCF calls
- `MyServiceWithNoPackage/theMethod`

### Attributes
### Common attributes

<!-- semconv rpc -->
| Attribute | Type | Description | Examples | Required |
Expand Down Expand Up @@ -105,6 +106,15 @@ Generally, a user SHOULD NOT set `peer.service` to a fully qualified RPC service
[`service.name`]: ../../resource/semantic_conventions/README.md#service
[`peer.service`]: span-general.md#general-remote-service-attributes

### Server attributes

<!-- semconv rpc.server -->
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| [`net.host.ip`](span-general.md) | string | Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host. | `192.168.0.1` | No |
| [`net.host.name`](span-general.md) | string | Local hostname or similar, see note below. | `localhost` | No |
<!-- endsemconv -->

### Events

In the lifetime of an RPC stream, an event for each message sent/received on
Expand Down