diff --git a/CHANGELOG.md b/CHANGELOG.md index 52f1a762b1f..f14390c8e4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -85,6 +85,8 @@ release. ([#1890](https://github.com/open-telemetry/opentelemetry-specification/pull/1890)) - Add HTTP request and response headers semantic conventions. ([#1898](https://github.com/open-telemetry/opentelemetry-specification/pull/1898)) +- Add `k8s.container.restart_count` Resource attribute. + ([#1945](https://github.com/open-telemetry/opentelemetry-specification/pull/1945)) ### Compatibility diff --git a/semantic_conventions/resource/k8s.yaml b/semantic_conventions/resource/k8s.yaml index d25bcda2c10..10cefc05ad4 100644 --- a/semantic_conventions/resource/k8s.yaml +++ b/semantic_conventions/resource/k8s.yaml @@ -63,6 +63,13 @@ groups: brief: > The name of the Container in a Pod template. examples: ['redis'] + - id: restart_count + type: int + brief: > + Number of times the container was restarted. This attribute can be + used to identify a particular container (running or stopped) within a + container spec. + examples: [0, 2] - id: k8s.replicaset prefix: k8s.replicaset diff --git a/specification/resource/semantic_conventions/k8s.md b/specification/resource/semantic_conventions/k8s.md index 0ed9a477b4c..8414fbe2462 100644 --- a/specification/resource/semantic_conventions/k8s.md +++ b/specification/resource/semantic_conventions/k8s.md @@ -88,6 +88,7 @@ to a running container. | Attribute | Type | Description | Examples | Required | |---|---|---|---|---| | `k8s.container.name` | string | The name of the Container in a Pod template. | `redis` | No | +| `k8s.container.restart_count` | int | Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. | `0`; `2` | No | ## ReplicaSet