Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into rename-http-body-si…
Browse files Browse the repository at this point in the history
…ze-metrics
  • Loading branch information
trask committed Sep 20, 2023
2 parents 44d706a + 203691d commit 26c0e51
Show file tree
Hide file tree
Showing 39 changed files with 2,546 additions and 787 deletions.
10 changes: 8 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,17 @@
/docs/logs/ @open-telemetry/specs-semconv-approvers @tigrannajaryan

# JVM semantic conventions approvers
/model/metrics/process-runtime-jvm-metrics.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-jvm-approvers
/model/metrics/process-runtime-jvm-metrics-experimental.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-jvm-approvers
/model/metrics/jvm-* @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-jvm-approvers
/docs/jvm/ @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-jvm-approvers

# HTTP semantic conventions approvers
/model/metrics/http.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
/model/trace/http.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers

# System semantic conventions approvers
/docs/system/ @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-system-approvers
/model/metrics/system-* @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-system-approvers
/docs/resource/host.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-system-approvers
/model/resource/host.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-system-approvers

# TODO - Add semconv area experts
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"MD040": false,
},
"yaml.schemas": {
"https://raw.githubusercontent.com/open-telemetry/build-tools/v0.20.0/semantic-conventions/semconv.schema.json": [
"https://raw.githubusercontent.com/open-telemetry/build-tools/v0.21.0/semantic-conventions/semconv.schema.json": [
"semantic_conventions/**/*.yaml"
]
},
Expand Down
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ release.

## Unreleased

- Add `cluster.name` and `node.name` attributes to Elasticsearch semantic conventions.
([#285](https://github.com/open-telemetry/semantic-conventions/pull/285))
- Fix the unit of metric.process.runtime.jvm.system.cpu.load_1m to be {run_queue_item}
([#95](https://github.com/open-telemetry/semantic-conventions/pull/95))
- Update `.count` metric naming convention so that it only applies to UpDownCounters,
and add that `.total` should not be used by either Counters or UpDownCounters
([#107](https://github.com/open-telemetry/semantic-conventions/pull/107))
- Add `oci.manifest.digest`, `container.image.repo_digests` attributes. Make `container.image.tag` array and in plural form.
([#159](https://github.com/open-telemetry/semantic-conventions/pull/159))
- BREAKING: Rename `http.client.duration` and `http.server.duration` metrics to
`http.client.request.duration` and `http.server.request.duration` respectively.
([#224](https://github.com/open-telemetry/semantic-conventions/pull/224))
Expand Down Expand Up @@ -48,6 +52,57 @@ release.
- Clarify that `http/dup` has higher precedence than `http` in case both values are present
in `OTEL_SEMCONV_STABILITY_OPT_IN`
([#249](https://github.com/open-telemetry/semantic-conventions/pull/249))
- Add `jvm.cpu.count` metric.
([#52](https://github.com/open-telemetry/semantic-conventions/pull/52))
- BREAKING: Rename metrics `jvm.buffer.usage` to `jvm.buffer.memory.usage`
and `jvm.buffer.limit` to `jvm.buffer.memory.limit`.
([#253](https://github.com/open-telemetry/semantic-conventions/pull/253))
- BREAKING: Rename `jvm.classes.current_loaded` metrics to `jvm.classes.count`
([#60](https://github.com/open-telemetry/semantic-conventions/pull/60))
- BREAKING: Remove pluralization from JVM metric namespaces.
([#252](https://github.com/open-telemetry/semantic-conventions/pull/252))
- Simplify HTTP metric briefs.
([#276](https://github.com/open-telemetry/semantic-conventions/pull/276))
- Add host cpu resource attributes.
([#209](https://github.com/open-telemetry/semantic-conventions/pull/209))
- Introduce `error.type` attribute and use it in HTTP conventions
([#205](https://github.com/open-telemetry/semantic-conventions/pull/205))
- BREAKING: Change HTTP span name when method is unknown (use `HTTP` instead of `_OTHER`)
([#270](https://github.com/open-telemetry/semantic-conventions/pull/270))
- Moved RPC streaming notes from metric brief section to notes section.
([#275](https://github.com/open-telemetry/semantic-conventions/pull/275))
- Updates `client.address` to allow domain names for consistency with `server.address`.
([#302](https://github.com/open-telemetry/semantic-conventions/pull/302))
- BREAKING: Generate System metrics semconv from YAML.
([#89](https://github.com/open-telemetry/semantic-conventions/pull/89))
- Rename attributes for `system.cpu.*` metrics:
- `state` to `system.cpu.state`
- `cpu` to `system.cpu.logical_number`
- Rename attributes for `system.memory.*` metrics:
- `state` to `system.memory.state`
- Rename attributes for `system.paging.*` metrics:
- `state` to `system.paging.state`
- `type` to `system.paging.type`
- `direction` to `system.paging.direction`
- Rename attributes for `system.disk.*` metrics:
- `device` to `system.device`
- `direction` to `system.disk.direction`
- Rename attributes for `system.filesystem.*` metrics:
- `device` to `system.device`
- `state` to `system.filesystem.state`
- `type` to `system.filesystem.type`
- `mode` to `system.filesystem.mode`
- `mountpoint` to `system.filesystem.mountpoint`
- Rename attributes for `system.network.*` metrics:
- `device` to `system.device`
- `direction` to `system.network.direction`
- `protocol` to `network.protocol`
- `state` to `system.network.state`
- Rename attributes for `system.processes.*` metrics:
- `status` to `system.processes.status`
- BREAKING: Rename `messaging.message.payload_size_bytes` to `messaging.message.body.size`,
remove `messaging.message.payload_compressed_size_bytes`.
([#229](https://github.com/open-telemetry/semantic-conventions/pull/229))
- BREAKING: Rename `http.server.request.size` metric to `http.server.request.body.size`
and `http.server.response.size` metric to `http.server.response.body.size`
([#247](https://github.com/open-telemetry/semantic-conventions/pull/247))
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ MISSPELL = $(TOOLS_DIR)/$(MISSPELL_BINARY)

# see https://github.com/open-telemetry/build-tools/releases for semconvgen updates
# Keep links in model/README.md and .vscode/settings.json in sync!
SEMCONVGEN_VERSION=0.20.0
SEMCONVGEN_VERSION=0.21.0

# TODO: add `yamllint` step to `all` after making sure it works on Mac.
.PHONY: all
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This repository is currently using [this specification version][SpecificationVer

## Read the docs

The documentation currently resides in the [doc](docs/README.md) folder.
The documentation currently resides in the [docs](docs/README.md) folder.

## Contributing

Expand Down
17 changes: 9 additions & 8 deletions docs/database/database-spans.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,25 @@ linkTitle: Client Calls
> [v1.20.0 of this document](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/trace/semantic_conventions/database.md)
> (or prior):
>
> * SHOULD NOT change the version of the networking attributes that they emit
> * SHOULD NOT change the version of the networking conventions that they emit
> until the HTTP semantic conventions are marked stable (HTTP stabilization will
> include stabilization of a core set of networking attributes which are also used
> in Database instrumentations).
> include stabilization of a core set of networking conventions which are also used
> in Database instrumentations). Conventions include, but are not limited to, attributes,
> metric and span names, and unit of measure.
> * SHOULD introduce an environment variable `OTEL_SEMCONV_STABILITY_OPT_IN`
> in the existing major version which is a comma-separated list of values.
> The only values defined so far are:
> * `http` - emit the new, stable networking attributes,
> and stop emitting the old experimental networking attributes
> * `http` - emit the new, stable networking conventions,
> and stop emitting the old experimental networking conventions
> that the instrumentation emitted previously.
> * `http/dup` - emit both the old and the stable networking attributes,
> * `http/dup` - emit both the old and the stable networking conventions,
> allowing for a seamless transition.
> * The default behavior (in the absence of one of these values) is to continue
> emitting whatever version of the old experimental networking attributes
> emitting whatever version of the old experimental networking conventions
> the instrumentation was emitting previously.
> * Note: `http/dup` has higher precedence than `http` in case both values are present
> * SHOULD maintain (security patching at a minimum) the existing major version
> for at least six months after it starts emitting both sets of attributes.
> for at least six months after it starts emitting both sets of conventions.
> * SHOULD drop the environment variable in the next major version (stable
> next major version SHOULD NOT be released prior to October 1, 2023).
Expand Down
42 changes: 26 additions & 16 deletions docs/database/elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ linkTitle: Elasticsearch

**Status**: [Experimental][DocumentStatus]

This document defines semantic conventions to apply when creating a span for requests to Elasticsearch.
The Semantic Conventions for [Elasticsearch](https://www.elastic.co/) extend and override the [Database Semantic Conventions](database-spans.md)
that describe common database operations attributes in addition to the Semantic Conventions
described on this page.

`db.system` MUST be set to `"elasticsearch"`.

## Span Name

Expand All @@ -30,25 +34,29 @@ in order to map the path part values to their names.

**[1]:** when the url has dynamic values

## Span attributes

`db.system` MUST be set to `"elasticsearch"`.
## Call-level attributes

<!-- semconv db.elasticsearch -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| [`db.operation`](database-spans.md) | string | The endpoint identifier for the request. [1] | `search`; `ml.close_job`; `cat.aliases` | Required |
| [`db.statement`](database-spans.md) | string | The request body for a [search-type query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html), as a json string. | `"{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}"` | Recommended: [2] |
| `http.request.method` | string | HTTP request method. [3] | `GET`; `POST`; `HEAD` | Required |
| [`server.address`](../general/attributes.md) | string | Server address - domain name if available without reverse DNS lookup, otherwise IP address or Unix domain socket name. [4] | `example.com` | See below |
| [`server.port`](../general/attributes.md) | int | Server port number [5] | `80`; `8080`; `443` | Recommended |
| [`url.full`](../url/url.md) | string | Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) [6] | `https://localhost:9200/index/_search?q=user.id:kimchy` | Required |
| `db.elasticsearch.cluster.name` | string | Represents the identifier of an Elasticsearch cluster. | `e9106fc68e3044f0b1475b04bf4ffd5f` | Recommended: [1] |
| `db.elasticsearch.node.name` | string | Represents the human-readable identifier of the node/instance to which a request was routed. | `instance-0000000001` | Recommended: [2] |
| [`db.operation`](database-spans.md) | string | The endpoint identifier for the request. [3] | `search`; `ml.close_job`; `cat.aliases` | Required |
| [`db.statement`](database-spans.md) | string | The request body for a [search-type query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html), as a json string. | `"{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}"` | Recommended: [4] |
| `http.request.method` | string | HTTP request method. [5] | `GET`; `POST`; `HEAD` | Required |
| [`server.address`](../general/attributes.md) | string | Server address - domain name if available without reverse DNS lookup, otherwise IP address or Unix domain socket name. [6] | `example.com` | See below |
| [`server.port`](../general/attributes.md) | int | Server port number [7] | `80`; `8080`; `443` | Recommended |
| [`url.full`](../url/url.md) | string | Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) [8] | `https://localhost:9200/index/_search?q=user.id:kimchy` | Required |

**[1]:** When communicating with an Elastic Cloud deployment, this should be collected from the "X-Found-Handling-Cluster" HTTP response header.

**[2]:** When communicating with an Elastic Cloud deployment, this should be collected from the "X-Found-Handling-Instance" HTTP response header.

**[1]:** When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted.
**[3]:** When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted.

**[2]:** Should be collected by default for search-type queries and only if there is sanitization that excludes sensitive information.
**[4]:** Should be collected by default for search-type queries and only if there is sanitization that excludes sensitive information.

**[3]:** HTTP request method value SHOULD be "known" to the instrumentation.
**[5]:** HTTP request method value SHOULD be "known" to the instrumentation.
By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)
and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).

Expand All @@ -63,12 +71,12 @@ HTTP method names are case-sensitive and `http.request.method` attribute value M
Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent.
Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value.

**[4]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent
**[6]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent
the server address behind any intermediaries (e.g. proxies) if it's available.

**[5]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries (e.g. proxies) if it's available.
**[7]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries (e.g. proxies) if it's available.

**[6]:** For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless.
**[8]:** For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless.
`url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password should be redacted and attribute's value should be `https://REDACTED:REDACTED@www.example.com/`.
`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes.
<!-- endsemconv -->
Expand All @@ -86,5 +94,7 @@ the server address behind any intermediaries (e.g. proxies) if it's available.
| `db.operation` | `"search"` |
| `url.full` | `"https://elasticsearch.mydomain.com:9200/my-index-000001/_search?from=40&size=20"` |
| `db.elasticsearch.path_parts.index` | `"my-index-000001"` |
| `db.elasticsearch.cluster.name` | `"e9106fc68e3044f0b1475b04bf4ffd5f"` |
| `db.elasticsearch.node.name` | `"instance-0000000001"` |

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md
2 changes: 1 addition & 1 deletion docs/general/attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ if they do not cause breaking changes to HTTP semantic conventions.
<!-- semconv client -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `client.address` | string | Client address - IP address or Unix domain socket name. [1] | `/tmp/my.sock`; `10.1.2.80` | Recommended |
| `client.address` | string | Client address - domain name if available without reverse DNS lookup, otherwise IP address or Unix domain socket name. [1] | `/tmp/my.sock`; `10.1.2.80` | Recommended |
| `client.port` | int | Client port number. [2] | `65123` | Recommended |
| `client.socket.address` | string | Client address of the socket connection - IP address or Unix domain socket name. [3] | `/tmp/my.sock`; `127.0.0.1` | Recommended: If different than `client.address`. |
| `client.socket.port` | int | Client port number of the socket connection. [4] | `35555` | Recommended: If different than `client.port`. |
Expand Down
6 changes: 4 additions & 2 deletions docs/general/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ over all attribute values SHOULD be equal to the **limit**.

- **utilization** - an instrument that measures the *fraction* of **usage**
out of its **limit** should be called `entity.utilization`. For example,
`system.memory.utilization` for the fraction of memory in use. Utilization
values are in the range `[0, 1]`.
`system.memory.utilization` for the fraction of memory in use. Utilization can
be with respect to a fixed limit or a soft limit. Utilization values are
represended as a ratio and are typically in the range `[0, 1]`, but may go above 1
in case of exceeding a soft limit.

- **time** - an instrument that measures passage of time should be called
`entity.time`. For example, `system.cpu.time` with attribute `state = idle | user
Expand Down
Loading

0 comments on commit 26c0e51

Please sign in to comment.