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 semantic convention attributes for capturing the application layer protocol #2602

Merged
merged 5 commits into from
Jun 11, 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ release.

### Semantic Conventions

- Add `net.app.protocol.*` attributes
([#2602](https://github.com/open-telemetry/opentelemetry-specification/pull/2602)).

### Compatibility

### OpenTelemetry Protocol
Expand Down
12 changes: 12 additions & 0 deletions semantic_conventions/trace/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ groups:
brief: 'Something else (non IP-based).'
brief: >
Transport protocol used. See note below.
- id: app.protocol.name
type: string
brief: 'Application layer protocol used. The value SHOULD be normalized to lowercase.'
examples: ['amqp', 'http', 'mqtt']
- id: app.protocol.version
pyohannes marked this conversation as resolved.
Show resolved Hide resolved
type: string
brief: 'Version of the application layer protocol used. See note below.'
examples: '3.1.1'
note: >
`net.app.protocol.version` refers to the version of the protocol used and might be
different from the protocol client's version. If the HTTP client used has a version
of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`.
- id: peer.ip
type: string
brief: >
Expand Down
8 changes: 6 additions & 2 deletions specification/trace/semantic_conventions/span-general.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ the `net.peer.*` properties of a client are equal to the `net.host.*` properties
| Attribute | Type | Description | Examples | Required |
pyohannes marked this conversation as resolved.
Show resolved Hide resolved
|---|---|---|---|---|
| `net.transport` | string | Transport protocol used. See note below. | `ip_tcp` | No |
| `net.app.protocol.name` | string | Application layer protocol used. The value SHOULD be normalized to lowercase. | `amqp`; `http`; `mqtt` | No |
| `net.app.protocol.version` | string | Version of the application layer protocol used. See note below. [1] | `3.1.1` | No |
| `net.peer.ip` | string | Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6) | `127.0.0.1` | No |
| `net.peer.port` | int | Remote port number. | `80`; `8080`; `443` | No |
| `net.peer.name` | string | Remote hostname or similar, see note below. [1] | `example.com` | No |
| `net.peer.name` | string | Remote hostname or similar, see note below. [2] | `example.com` | No |
| `net.host.ip` | 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.port` | int | Like `net.peer.port` but for the host port. | `35555` | No |
| `net.host.name` | string | Local hostname or similar, see note below. | `localhost` | No |
Expand All @@ -48,7 +50,9 @@ the `net.peer.*` properties of a client are equal to the `net.host.*` properties
| `net.host.carrier.mnc` | string | The mobile carrier network code. | `001` | No |
| `net.host.carrier.icc` | string | The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. | `DE` | No |

**[1]:** `net.peer.name` SHOULD NOT be set if capturing it would require an extra DNS lookup.
**[1]:** `net.app.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`.

**[2]:** `net.peer.name` SHOULD NOT be set if capturing it would require an extra DNS lookup.

`net.transport` MUST be one of the following:

Expand Down