Skip to content

Commit

Permalink
Merge branch 'main' into pod-annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
tokaplan committed Nov 15, 2023
2 parents c8bbeb9 + a4c60f7 commit 7a35e0d
Show file tree
Hide file tree
Showing 10 changed files with 277 additions and 175 deletions.
15 changes: 15 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@
# 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
/model/registry/http.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
/model/registry/server.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
/model/registry/client.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
/model/registry/network.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
/model/registry/error.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
/model/registry/url.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
/model/registry/user-agent.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
/docs/http/ @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
/docs/attribute-registry/http.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
/docs/attribute-registry/server.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
/docs/attribute-registry/client.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
/docs/attribute-registry/network.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
/docs/attribute-registry/error.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
/docs/attribute-registry/url.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
/docs/attribute-registry/user-agent.md @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
Expand Down
1 change: 1 addition & 0 deletions docs/attributes-registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Currently, the following namespaces exist:
* [Error](error.md)
* [Host](host.md)
* [HTTP](http.md)
* [K8s](k8s.md)
* [Network](network.md)
* [OCI](oci.md)
* [OS](os.md)
Expand Down
52 changes: 52 additions & 0 deletions docs/attributes-registry/k8s.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Kubernetes

## Kubernetes Resource Attributes

<!-- semconv registry.k8s -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `k8s.cluster.name` | string | The name of the cluster. | `opentelemetry-cluster` | Recommended |
| `k8s.cluster.uid` | string | A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. [1] | `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` | Recommended |
| `k8s.container.name` | string | The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). | `redis` | Recommended |
| `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` | Recommended |
| `k8s.cronjob.name` | string | The name of the CronJob. | `opentelemetry` | Recommended |
| `k8s.cronjob.uid` | string | The UID of the CronJob. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
| `k8s.daemonset.name` | string | The name of the DaemonSet. | `opentelemetry` | Recommended |
| `k8s.daemonset.uid` | string | The UID of the DaemonSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
| `k8s.deployment.name` | string | The name of the Deployment. | `opentelemetry` | Recommended |
| `k8s.deployment.uid` | string | The UID of the Deployment. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
| `k8s.job.name` | string | The name of the Job. | `opentelemetry` | Recommended |
| `k8s.job.uid` | string | The UID of the Job. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
| `k8s.namespace.name` | string | The name of the namespace that the pod is running in. | `default` | Recommended |
| `k8s.node.name` | string | The name of the Node. | `node-1` | Recommended |
| `k8s.node.uid` | string | The UID of the Node. | `1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2` | Recommended |
| `k8s.pod.name` | string | The name of the Pod. | `opentelemetry-pod-autoconf` | Recommended |
| `k8s.pod.uid` | string | The UID of the Pod. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
| `k8s.replicaset.name` | string | The name of the ReplicaSet. | `opentelemetry` | Recommended |
| `k8s.replicaset.uid` | string | The UID of the ReplicaSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
| `k8s.statefulset.name` | string | The name of the StatefulSet. | `opentelemetry` | Recommended |
| `k8s.statefulset.uid` | string | The UID of the StatefulSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |

**[1]:** K8s doesn't have support for obtaining a cluster ID. If this is ever
added, we will recommend collecting the `k8s.cluster.uid` through the
official APIs. In the meantime, we are able to use the `uid` of the
`kube-system` namespace as a proxy for cluster ID. Read on for the
rationale.

Every object created in a K8s cluster is assigned a distinct UID. The
`kube-system` namespace is used by Kubernetes itself and will exist
for the lifetime of the cluster. Using the `uid` of the `kube-system`
namespace is a reasonable proxy for the K8s ClusterID as it will only
change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are
UUIDs as standardized by
[ISO/IEC 9834-8 and ITU-T X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html).
Which states:

> If generated according to one of the mechanisms defined in Rec.
ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be
different from all other UUIDs generated before 3603 A.D., or is
extremely likely to be different (depending on the mechanism chosen).

Therefore, UIDs between clusters should be extremely unlikely to
conflict.
<!-- endsemconv -->
3 changes: 3 additions & 0 deletions docs/attributes-registry/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@
| `process.owner` | string | The username of the user that owns the process. | `root` |
| `process.parent_pid` | int | Parent Process identifier (PID). | `111` |
| `process.pid` | int | Process identifier (PID). | `1234` |
| `process.runtime.description` | string | An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. | `Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0` |
| `process.runtime.name` | string | The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. | `OpenJDK Runtime Environment` |
| `process.runtime.version` | string | The version of the runtime of this process, as returned by the runtime without modification. | `14.0.2` |
<!-- endsemconv -->
42 changes: 21 additions & 21 deletions docs/resource/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Kubernetes object, but "name" is usually more user friendly so can be also set.
<!-- semconv k8s.cluster -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `k8s.cluster.name` | string | The name of the cluster. | `opentelemetry-cluster` | Recommended |
| `k8s.cluster.uid` | string | A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. [1] | `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` | Recommended |
| [`k8s.cluster.name`](../attributes-registry/k8s.md) | string | The name of the cluster. | `opentelemetry-cluster` | Recommended |
| [`k8s.cluster.uid`](../attributes-registry/k8s.md) | string | A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. [1] | `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` | Recommended |

**[1]:** K8s doesn't have support for obtaining a cluster ID. If this is ever
added, we will recommend collecting the `k8s.cluster.uid` through the
Expand Down Expand Up @@ -60,8 +60,8 @@ conflict.
<!-- semconv k8s.node -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `k8s.node.name` | string | The name of the Node. | `node-1` | Recommended |
| `k8s.node.uid` | string | The UID of the Node. | `1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2` | Recommended |
| [`k8s.node.name`](../attributes-registry/k8s.md) | string | The name of the Node. | `node-1` | Recommended |
| [`k8s.node.uid`](../attributes-registry/k8s.md) | string | The UID of the Node. | `1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2` | Recommended |
<!-- endsemconv -->

## Namespace
Expand All @@ -76,7 +76,7 @@ a namespace, but not across namespaces.
<!-- semconv k8s.namespace -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `k8s.namespace.name` | string | The name of the namespace that the pod is running in. | `default` | Recommended |
| [`k8s.namespace.name`](../attributes-registry/k8s.md) | string | The name of the namespace that the pod is running in. | `default` | Recommended |
<!-- endsemconv -->

## Pod
Expand All @@ -92,8 +92,8 @@ containers on your cluster.
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `k8s.pod.labels.<key>` | string | The labels placed on the Pod, the `<key>` being the label name, the value being the label value. | `pod.labels.app=my-app,pod.labels.mycompany.io/arch=x64` | Recommended |
| `k8s.pod.name` | string | The name of the Pod. | `opentelemetry-pod-autoconf` | Recommended |
| `k8s.pod.uid` | string | The UID of the Pod. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
| [`k8s.pod.name`](../attributes-registry/k8s.md) | string | The name of the Pod. | `opentelemetry-pod-autoconf` | Recommended |
| [`k8s.pod.uid`](../attributes-registry/k8s.md) | string | The UID of the Pod. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
<!-- endsemconv -->

## Container
Expand All @@ -112,8 +112,8 @@ to a running container.
<!-- semconv k8s.container -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `k8s.container.name` | string | The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). | `redis` | Recommended |
| `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` | Recommended |
| [`k8s.container.name`](../attributes-registry/k8s.md) | string | The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). | `redis` | Recommended |
| [`k8s.container.restart_count`](../attributes-registry/k8s.md) | 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` | Recommended |
<!-- endsemconv -->

## ReplicaSet
Expand All @@ -128,8 +128,8 @@ any given time.
<!-- semconv k8s.replicaset -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `k8s.replicaset.name` | string | The name of the ReplicaSet. | `opentelemetry` | Recommended |
| `k8s.replicaset.uid` | string | The UID of the ReplicaSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
| [`k8s.replicaset.name`](../attributes-registry/k8s.md) | string | The name of the ReplicaSet. | `opentelemetry` | Recommended |
| [`k8s.replicaset.uid`](../attributes-registry/k8s.md) | string | The UID of the ReplicaSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
<!-- endsemconv -->

## Deployment
Expand All @@ -145,8 +145,8 @@ distributed among the nodes of a cluster.
<!-- semconv k8s.deployment -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `k8s.deployment.name` | string | The name of the Deployment. | `opentelemetry` | Recommended |
| `k8s.deployment.uid` | string | The UID of the Deployment. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
| [`k8s.deployment.name`](../attributes-registry/k8s.md) | string | The name of the Deployment. | `opentelemetry` | Recommended |
| [`k8s.deployment.uid`](../attributes-registry/k8s.md) | string | The UID of the Deployment. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
<!-- endsemconv -->

## StatefulSet
Expand All @@ -161,8 +161,8 @@ about the ordering and uniqueness of these Pods.
<!-- semconv k8s.statefulset -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `k8s.statefulset.name` | string | The name of the StatefulSet. | `opentelemetry` | Recommended |
| `k8s.statefulset.uid` | string | The UID of the StatefulSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
| [`k8s.statefulset.name`](../attributes-registry/k8s.md) | string | The name of the StatefulSet. | `opentelemetry` | Recommended |
| [`k8s.statefulset.uid`](../attributes-registry/k8s.md) | string | The UID of the StatefulSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
<!-- endsemconv -->

## DaemonSet
Expand All @@ -176,8 +176,8 @@ A DaemonSet ensures that all (or some) Nodes run a copy of a Pod.
<!-- semconv k8s.daemonset -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `k8s.daemonset.name` | string | The name of the DaemonSet. | `opentelemetry` | Recommended |
| `k8s.daemonset.uid` | string | The UID of the DaemonSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
| [`k8s.daemonset.name`](../attributes-registry/k8s.md) | string | The name of the DaemonSet. | `opentelemetry` | Recommended |
| [`k8s.daemonset.uid`](../attributes-registry/k8s.md) | string | The UID of the DaemonSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
<!-- endsemconv -->

## Job
Expand All @@ -192,8 +192,8 @@ successfully terminate.
<!-- semconv k8s.job -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `k8s.job.name` | string | The name of the Job. | `opentelemetry` | Recommended |
| `k8s.job.uid` | string | The UID of the Job. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
| [`k8s.job.name`](../attributes-registry/k8s.md) | string | The name of the Job. | `opentelemetry` | Recommended |
| [`k8s.job.uid`](../attributes-registry/k8s.md) | string | The UID of the Job. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
<!-- endsemconv -->

## CronJob
Expand All @@ -207,8 +207,8 @@ A CronJob creates Jobs on a repeating schedule.
<!-- semconv k8s.cronjob -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `k8s.cronjob.name` | string | The name of the CronJob. | `opentelemetry` | Recommended |
| `k8s.cronjob.uid` | string | The UID of the CronJob. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
| [`k8s.cronjob.name`](../attributes-registry/k8s.md) | string | The name of the CronJob. | `opentelemetry` | Recommended |
| [`k8s.cronjob.uid`](../attributes-registry/k8s.md) | string | The UID of the CronJob. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended |
<!-- endsemconv -->

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md
6 changes: 3 additions & 3 deletions docs/resource/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ In that case it MUST be interpreted as if it was `process.command_args`.
<!-- semconv process.runtime -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `process.runtime.description` | string | An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. | `Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0` | Recommended |
| `process.runtime.name` | string | The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. | `OpenJDK Runtime Environment` | Recommended |
| `process.runtime.version` | string | The version of the runtime of this process, as returned by the runtime without modification. | `14.0.2` | Recommended |
| [`process.runtime.description`](../attributes-registry/process.md) | string | An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. | `Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0` | Recommended |
| [`process.runtime.name`](../attributes-registry/process.md) | string | The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. | `OpenJDK Runtime Environment` | Recommended |
| [`process.runtime.version`](../attributes-registry/process.md) | string | The version of the runtime of this process, as returned by the runtime without modification. | `14.0.2` | Recommended |
<!-- endsemconv -->

How to set these attributes for particular runtime kinds is described in the following subsections.
Expand Down
Loading

0 comments on commit 7a35e0d

Please sign in to comment.