Skip to content

Commit

Permalink
Mobile spec additions (open-telemetry#1759)
Browse files Browse the repository at this point in the history
* added spec changes per open-telemetry#1647

* added 'wired' as possible value to `net.host.connection_type`

* fixed spacing in CHANGELOG.md

* added mobile carrier attributes to  semantic_conventions/trace/general.yaml

* fixed issue revealed by

* reverted extra space per markdownlint

* made connection_type allow custom values

* added additional space

* removed manually added table & ran generator tool

* separated connection.type & connection.subtype

* updated changelog to reflect iteration

* added literal radio tech to connection.subtype table

* added  as option for connect.type

Co-authored-by: Armin Ruech <[email protected]>
Co-authored-by: Carlos Alberto Cortez <[email protected]>
  • Loading branch information
3 people authored Jul 12, 2021
1 parent e42da8c commit 483aa06
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ release.
- Add already specified `messaging.rabbitmq.routing_key` span attribute key to the respective YAML file. ([#1651](https://github.com/open-telemetry/opentelemetry-specification/pull/1651))
- Clarify usage of "otel." attribute namespace. ([#1640](https://github.com/open-telemetry/opentelemetry-specification/pull/1640))
- Add possibility to disable `db.statement` via instrumentation configuration. ([#1659](https://github.com/open-telemetry/opentelemetry-specification/pull/1659))
- Add mobile related network state: `net.host.connection.type`, `net.host.connection.subtype` & `net.host.carrier.*` [#1647](https://github.com/open-telemetry/opentelemetry-specification/issues/1647)

### Compatibility

Expand Down
80 changes: 80 additions & 0 deletions semantic_conventions/trace/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,86 @@ groups:
type: string
brief: 'Local hostname or similar, see note below.'
examples: 'localhost'
- id: host.connection.type
type:
allow_custom_values: true
members:
- id: wifi
value: "wifi"
- id: wired
value: "wired"
- id: cell
value: "cell"
- id: unavailable
value: "unavailable"
- id: unknown
value: "unknown"
brief: 'The internet connection type currently being used by the host.'
examples: 'wifi'
- id: host.connection.subtype
type:
allow_custom_values: true
members:
- id: GPRS
value: "GPRS"
- id: EDGE
value: "EDGE"
- id: UMTS
value: "UMTS"
- id: CDMA
value: "CDMA"
- id: EVDO_0
value: "EVDO_0"
- id: EVDO_A
value: "EVDO_A"
- id: 1xRTT
value: "1xRTT"
- id: HSDPA
value: "HSDPA"
- id: HSUPA
value: "HSUPA"
- id: HSPA
value: "HSPA"
- id: IDEN
value: "IDEN"
- id: EVDO_B
value: "EVDO_B"
- id: LTE
value: "LTE"
- id: EHRPD
value: "EHRPD"
- id: HSPAP
value: "HSPAP"
- id: GSM
value: "GSM"
- id: TD_SCDMA
value: "TD_SCDMA"
- id: IWLAN
value: "IWLAN"
- id: NR
value: "NR"
- id: NRNSA
value: "NRNSA"
- id: LTE_CA
value: "LTE_CA"
brief: 'This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection.'
examples: 'LTE'
- id: host.carrier.name
type: string
brief: "The name of the mobile carrier."
examples: "sprint"
- id: host.carrier.mcc
type: string
brief: "The mobile carrier country code."
examples: "310"
- id: host.carrier.mnc
type: string
brief: "The mobile carrier network code."
examples: "001"
- id: host.carrier.icc
type: string
brief: "The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network."
examples: "DE"
- id: peer
prefix: peer
brief: "Operations that access some remote service."
Expand Down
42 changes: 42 additions & 0 deletions specification/trace/semantic_conventions/span-general.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ the `net.peer.*` properties of a client are equal to the `net.host.*` properties
| `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 |
| `net.host.connection.type` | string | The internet connection type currently being used by the host. | `wifi` | No |
| `net.host.connection.subtype` | string | This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. | `LTE` | No |
| `net.host.carrier.name` | string | The name of the mobile carrier. | `sprint` | No |
| `net.host.carrier.mcc` | string | The mobile carrier country code. | `310` | No |
| `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 |

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

Expand All @@ -55,6 +61,42 @@ the `net.peer.*` properties of a client are equal to the `net.host.*` properties
| `other` | Something else (non IP-based). |

**[1]:** Signals that there is only in-process communication not using a "real" network protocol in cases where network attributes would normally be expected. Usually all other network attributes can be left out in that case.

`net.host.connection.type` MUST be one of the following or, if none of the listed values apply, a custom value:

| Value | Description |
|---|---|
| `wifi` | wifi |
| `wired` | wired |
| `cell` | cell |
| `unavailable` | unavailable |
| `unknown` | unknown |

`net.host.connection.subtype` MUST be one of the following or, if none of the listed values apply, a custom value:

| Value | Description |
|---|---|
| `GPRS` | GPRS |
| `EDGE` | EDGE |
| `UMTS` | UMTS |
| `CDMA` | CDMA |
| `EVDO_0` | EVDO_0 |
| `EVDO_A` | EVDO_A |
| `1xRTT` | 1xRTT |
| `HSDPA` | HSDPA |
| `HSUPA` | HSUPA |
| `HSPA` | HSPA |
| `IDEN` | IDEN |
| `EVDO_B` | EVDO_B |
| `LTE` | LTE |
| `EHRPD` | EHRPD |
| `HSPAP` | HSPAP |
| `GSM` | GSM |
| `TD_SCDMA` | TD_SCDMA |
| `IWLAN` | IWLAN |
| `NR` | NR |
| `NRNSA` | NRNSA |
| `LTE_CA` | LTE_CA |
<!-- endsemconv -->

For `Unix` and `pipe`, since the connection goes over the file system instead of being directly to a known peer, `net.peer.name` is the only attribute that usually makes sense (see description of `net.peer.name` below).
Expand Down

0 comments on commit 483aa06

Please sign in to comment.