Skip to content

Commit

Permalink
Add container.restart_count Resource attribute
Browse files Browse the repository at this point in the history
This change adds a Resource attribute to represent number of container restarts. This is can be used in k8s logs collection to identify a particular container instance, where the number of container restarts is a part of a log file path.
  • Loading branch information
dmitryax committed Sep 21, 2021
1 parent 02a1679 commit 6128c67
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ release.
([#1810](https://github.com/open-telemetry/opentelemetry-specification/pull/1810))
- Clarifications for `http.client_ip` and `http.host`.
([#1890](https://github.com/open-telemetry/opentelemetry-specification/pull/1890))
- Add `container.restart_count` Resource attribute.
([#1945](https://github.com/open-telemetry/opentelemetry-specification/pull/1945))

### Compatibility

Expand Down
5 changes: 5 additions & 0 deletions semantic_conventions/resource/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ groups:
brief: >
Container image tag.
examples: ['0.1']
- id: restart_count
type: int
brief: >
Number of times the container was restarted by container orchestrator.
examples: [0, 2]
1 change: 1 addition & 0 deletions specification/resource/semantic_conventions/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
| `container.runtime` | string | The container runtime managing this container. | `docker`; `containerd`; `rkt` | No |
| `container.image.name` | string | Name of the image the container was built on. | `gcr.io/opentelemetry/operator` | No |
| `container.image.tag` | string | Container image tag. | `0.1` | No |
| `container.restart_count` | int | Number of times the container was restarted by container orchestrator. | `0`; `2` | No |
<!-- endsemconv -->

0 comments on commit 6128c67

Please sign in to comment.