Skip to content

Commit

Permalink
Add yaml for K8s and OS resource attributes (#1057)
Browse files Browse the repository at this point in the history
  • Loading branch information
thisthat authored Oct 9, 2020
1 parent acad95b commit 30ea75e
Show file tree
Hide file tree
Showing 4 changed files with 262 additions and 42 deletions.
145 changes: 145 additions & 0 deletions semantic_conventions/resource/k8s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
groups:
- id: k8s.cluster
prefix: k8s.cluster
brief: >
A Kubernetes Cluster.
attributes:
- id: name
type: string
brief: >
The name of the cluster.
examples: ['opentelemetry-cluster']

- id: k8s.namespace
prefix: k8s.namespace
brief: >
A Kubernetes Namespace.
attributes:
- id: name
type: string
brief: >
The name of the namespace that the pod is running in.
examples: ['default']

- id: k8s.pod
prefix: k8s.pod
brief: >
A Kubernetes Pod object.
attributes:
- id: uid
type: string
brief: >
The UID of the Pod.
examples: ['275ecb36-5aa8-4c2a-9c47-d8bb681b9aff']
- id: name
type: string
brief: >
The name of the Pod.
examples: ['opentelemetry-pod-autoconf']

- id: k8s.container
prefix: k8s.container
brief: >
A container in a [PodTemplate](https://kubernetes.io/docs/concepts/workloads/pods/#pod-templates).
attributes:
- id: name
type: string
brief: >
The name of the Container in a Pod template.
examples: ['redis']

- id: k8s.replicaset
prefix: k8s.replicaset
brief: >
A Kubernetes ReplicaSet object.
attributes:
- id: uid
type: string
brief: >
The UID of the ReplicaSet.
examples: ['275ecb36-5aa8-4c2a-9c47-d8bb681b9aff']
- id: name
type: string
brief: >
The name of the ReplicaSet.
examples: ['opentelemetry']

- id: k8s.deployment
prefix: k8s.deployment
brief: >
A Kubernetes Deployment object.
attributes:
- id: uid
type: string
brief: >
The UID of the Deployment.
examples: ['275ecb36-5aa8-4c2a-9c47-d8bb681b9aff']
- id: name
type: string
brief: >
The name of the Deployment.
examples: ['opentelemetry']

- id: k8s.statefulset
prefix: k8s.statefulset
brief: >
A Kubernetes StatefulSet object.
attributes:
- id: uid
type: string
brief: >
The UID of the StatefulSet.
examples: ['275ecb36-5aa8-4c2a-9c47-d8bb681b9aff']
- id: name
type: string
brief: >
The name of the StatefulSet.
examples: ['opentelemetry']

- id: k8s.daemonset
prefix: k8s.daemonset
brief: >
A Kubernetes DaemonSet object.
attributes:
- id: uid
type: string
brief: >
The UID of the DaemonSet.
examples: ['275ecb36-5aa8-4c2a-9c47-d8bb681b9aff']
- id: name
type: string
brief: >
The name of the DaemonSet.
examples: ['opentelemetry']

- id: k8s.job
prefix: k8s.job
brief: >
A Kubernetes Job object.
attributes:
- id: uid
type: string
brief: >
The UID of the Job.
examples: ['275ecb36-5aa8-4c2a-9c47-d8bb681b9aff']
- id: name
type: string
brief: >
The name of the Job.
examples: ['opentelemetry']

- id: k8s.cronjob
prefix: k8s.cronjob
brief: >
A Kubernetes CronJob object.
attributes:
- id: uid
type: string
brief: >
The UID of the CronJob.
examples: ['275ecb36-5aa8-4c2a-9c47-d8bb681b9aff']
- id: name
type: string
brief: >
The name of the CronJob.
examples: ['opentelemetry']
54 changes: 54 additions & 0 deletions semantic_conventions/resource/os.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
groups:
- id: os
prefix: os
brief: >
The operating system (OS) on which the process represented by this resource is running.
note: >
In case of virtualized environments, this is the operating system as it is observed by
the process, i.e., the virtualized guest rather than the underlying host.
attributes:
- id: type
type:
allow_custom_values: true
members:
- id: WINDOWS
value: 'WINDOWS'
brief: "Microsoft Windows"
- id: LINUX
value: 'LINUX'
brief: "Linux"
- id: DARWIN
value: 'DARWIN'
brief: "Apple Darwin"
- id: FREEBSD
value: 'FREEBSD'
brief: "FreeBSD"
- id: NETBSD
value: 'NETBSD'
brief: "NetBSD"
- id: OPENBSD
value: 'OPENBSD'
brief: "OpenBSD"
- id: DRAGONFLYBSD
value: 'DRAGONFLYBSD'
brief: "DragonFly BSD"
- id: HPUX
value: 'HPUX'
brief: "HP-UX (Hewlett Packard Unix)"
- id: AIX
value: 'AIX'
brief: "AIX (Advanced Interactive eXecutive)"
- id: SOLARIS
value: 'SOLARIS'
brief: "Oracle Solaris"
- id: ZOS
value: 'ZOS'
brief: "IBM z/OS"
required: always
brief: 'The operating system type.'
- id: description
type: string
brief: >
Human readable (not intended to be parsed) OS version information,
like e.g. reported by `ver` or `lsb_release -a` commands.
examples: ['Microsoft Windows [Version 10.0.18363.778]', 'Ubuntu 18.04.1 LTS']
94 changes: 57 additions & 37 deletions specification/resource/semantic_conventions/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ Kubernetes object, but "name" is usually more user friendly so can be also set.

**Description:** A Kubernetes Cluster.

| Attribute | Description | Example |
|---|---|---|
| k8s.cluster.name | The name of the cluster. | `opentelemetry-cluster` |
<!-- semconv k8s.cluster -->
| Attribute | Type | Description | Example | Required |
|---|---|---|---|---|
| `k8s.cluster.name` | string | The name of the cluster. | `opentelemetry-cluster` | No |
<!-- endsemconv -->

## Namespace

Expand All @@ -32,9 +34,11 @@ a namespace, but not across namespaces.

**Description:** A Kubernetes Namespace.

| Attribute | Description | Example |
|---|---|---|
| k8s.namespace.name | The name of the namespace that the pod is running in. | `default` |
<!-- semconv k8s.namespace -->
| Attribute | Type | Description | Example | Required |
|---|---|---|---|---|
| `k8s.namespace.name` | string | The name of the namespace that the pod is running in. | `default` | No |
<!-- endsemconv -->

## Pod

Expand All @@ -45,10 +49,12 @@ containers on your cluster.

**Description:** A Kubernetes Pod object.

| Attribute | Description | Example |
|---|---|---|
| k8s.pod.uid | The uid of the Pod. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` |
| k8s.pod.name | The name of the Pod. | `opentelemetry-pod-autoconf` |
<!-- semconv k8s.pod -->
| Attribute | Type | Description | Example | Required |
|---|---|---|---|---|
| `k8s.pod.uid` | string | The UID of the Pod. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | No |
| `k8s.pod.name` | string | The name of the Pod. | `opentelemetry-pod-autoconf` | No |
<!-- endsemconv -->

## Container

Expand All @@ -63,9 +69,11 @@ to a running container.

**Description:** A container in a [PodTemplate](https://kubernetes.io/docs/concepts/workloads/pods/#pod-templates).

| Attribute | Description | Example |
|---|---|---|
| k8s.container.name | The name of the Container in a Pod template. | `redis` |
<!-- semconv k8s.container -->
| Attribute | Type | Description | Example | Required |
|---|---|---|---|---|
| `k8s.container.name` | string | The name of the Container in a Pod template. | `redis` | No |
<!-- endsemconv -->

## ReplicaSet

Expand All @@ -76,10 +84,12 @@ any given time.

**Description:** A Kubernetes ReplicaSet object.

| Attribute | Description | Example |
|---|---|---|
| k8s.replicaset.uid | The uid of the ReplicaSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` |
| k8s.replicaset.name | The name of the ReplicaSet. | `opentelemetry` |
<!-- semconv k8s.replicaset -->
| Attribute | Type | Description | Example | Required |
|---|---|---|---|---|
| `k8s.replicaset.uid` | string | The UID of the ReplicaSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | No |
| `k8s.replicaset.name` | string | The name of the ReplicaSet. | `opentelemetry` | No |
<!-- endsemconv -->

## Deployment

Expand All @@ -91,10 +101,12 @@ distributed among the nodes of a cluster.

**Description:** A Kubernetes Deployment object.

| Attribute | Description | Example |
|---|---|---|
| k8s.deployment.uid | The uid of the Deployment. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` |
| k8s.deployment.name | The name of the Deployment. | `opentelemetry` |
<!-- semconv k8s.deployment -->
| Attribute | Type | Description | Example | Required |
|---|---|---|---|---|
| `k8s.deployment.uid` | string | The UID of the Deployment. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | No |
| `k8s.deployment.name` | string | The name of the Deployment. | `opentelemetry` | No |
<!-- endsemconv -->

## StatefulSet

Expand All @@ -105,10 +117,12 @@ about the ordering and uniqueness of these Pods.

**Description:** A Kubernetes StatefulSet object.

| Attribute | Description | Example |
|---|---|---|
| k8s.statefulset.uid | The uid of the StatefulSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` |
| k8s.statefulset.name | The name of the StatefulSet. | `opentelemetry` |
<!-- semconv k8s.statefulset -->
| Attribute | Type | Description | Example | Required |
|---|---|---|---|---|
| `k8s.statefulset.uid` | string | The UID of the StatefulSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | No |
| `k8s.statefulset.name` | string | The name of the StatefulSet. | `opentelemetry` | No |
<!-- endsemconv -->

## DaemonSet

Expand All @@ -118,10 +132,12 @@ A DaemonSet ensures that all (or some) Nodes run a copy of a Pod.

**Description:** A Kubernetes DaemonSet object.

| Attribute | Description | Example |
|---|---|---|
| k8s.daemonset.uid | The uid of the DaemonSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` |
| k8s.daemonset.name | The name of the DaemonSet. | `opentelemetry` |
<!-- semconv k8s.daemonset -->
| Attribute | Type | Description | Example | Required |
|---|---|---|---|---|
| `k8s.daemonset.uid` | string | The UID of the DaemonSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | No |
| `k8s.daemonset.name` | string | The name of the DaemonSet. | `opentelemetry` | No |
<!-- endsemconv -->

## Job

Expand All @@ -132,10 +148,12 @@ successfully terminate.

**Description:** A Kubernetes Job object.

| Attribute | Description | Example |
|---|---|---|
| k8s.job.uid | The uid of the Job. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` |
| k8s.job.name | The name of the Job. | `opentelemetry` |
<!-- semconv k8s.job -->
| Attribute | Type | Description | Example | Required |
|---|---|---|---|---|
| `k8s.job.uid` | string | The UID of the Job. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | No |
| `k8s.job.name` | string | The name of the Job. | `opentelemetry` | No |
<!-- endsemconv -->

## CronJob

Expand All @@ -145,7 +163,9 @@ A CronJob creates Jobs on a repeating schedule.

**Description:** A Kubernetes CronJob object.

| Attribute | Description | Example |
|---|---|---|
| k8s.cronjob.uid | The uid of the CronJob. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` |
| k8s.cronjob.name | The name of the CronJob. | `opentelemetry` |
<!-- semconv k8s.cronjob -->
| Attribute | Type | Description | Example | Required |
|---|---|---|---|---|
| `k8s.cronjob.uid` | string | The UID of the CronJob. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | No |
| `k8s.cronjob.name` | string | The name of the CronJob. | `opentelemetry` | No |
<!-- endsemconv -->
11 changes: 6 additions & 5 deletions specification/resource/semantic_conventions/os.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,25 @@

In case of virtualized environments, this is the operating system as it is observed by the process, i.e., the virtualized guest rather than the underlying host.

<!-- semconv os -->
| Attribute | Type | Description | Example | Required |
|---|---|---|---|---|
| `os.type` | string | The operating system type. | `"WINDOWS"` | Yes |
| `os.description` | string | Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. | `"Microsoft Windows [Version 10.0.18363.778]"`<br>`"Ubuntu 18.04.1 LTS"` | No |
| `os.type` | string | The operating system type. | `WINDOWS` | Yes |
| `os.description` | string | Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. | `Microsoft Windows [Version 10.0.18363.778]`<br>`Ubuntu 18.04.1 LTS` | No |

`os.type` SHOULD be set to one of the values listed below.
If none of the listed values apply, a custom value best describing the family the operating system belongs to CAN be used.
`os.type` MUST be one of the following or, if none of the listed values apply, a custom value:

| Value | Description |
|---|---|
| `WINDOWS` | Microsoft Windows |
| `LINUX` | Linux |
| `DARWIN` | Apple Darwin |
| `FREEBSD` | FreeBSD |
| `NETBSD` | NetBSD|
| `NETBSD` | NetBSD |
| `OPENBSD` | OpenBSD |
| `DRAGONFLYBSD` | DragonFly BSD |
| `HPUX` | HP-UX (Hewlett Packard Unix) |
| `AIX` | AIX (Advanced Interactive eXecutive) |
| `SOLARIS` | Oracle Solaris |
| `ZOS` | IBM z/OS |
<!-- endsemconv -->

0 comments on commit 30ea75e

Please sign in to comment.