Skip to content

Commit

Permalink
Add k8s.node in semantic conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
XSAM committed Jan 14, 2021
1 parent d4d2020 commit ede97e3
Show file tree
Hide file tree
Showing 20 changed files with 135 additions and 106 deletions.
16 changes: 16 additions & 0 deletions semantic_conventions/resource/k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@ groups:
The name of the cluster.
examples: ['opentelemetry-cluster']

- id: k8s.node
prefix: k8s.node
brief: >
A Kubernetes Node.
attributes:
- id: name
type: string
brief: >
The name of the node.
examples: ['opentelemetry-node']
- id: ip
type: string
brief: >
The address of the node (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6.
examples: ['127.0.0.1']

- id: k8s.namespace
prefix: k8s.namespace
brief: >
Expand Down
12 changes: 6 additions & 6 deletions specification/metrics/semantic_conventions/rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ Below is a table of labels that SHOULD be included on metric events and whether
or not they should be on the server, client or both.

<!-- semconv rpc -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| [`rpc.system`](../../trace/semantic_conventions/rpc.md) | string | A string identifying the remoting system. | `grpc`<br>`java_rmi`<br>`wcf` | Yes |
| [`rpc.service`](../../trace/semantic_conventions/rpc.md) | string | The full name of the service being called, including its package name, if applicable. | `myservice.EchoService` | Conditional<br>No, but recommended |
| [`rpc.method`](../../trace/semantic_conventions/rpc.md) | string | The name of the method being called, must be equal to the $method part in the span name. | `exampleMethod` | Conditional<br>No, but recommended |
| [`rpc.system`](../../trace/semantic_conventions/rpc.md) | string | A string identifying the remoting system. | `grpc`; `java_rmi`; `wcf` | Yes |
| [`rpc.service`](../../trace/semantic_conventions/rpc.md) | string | The full name of the service being called, including its package name, if applicable. | `myservice.EchoService` | No, but recommended |
| [`rpc.method`](../../trace/semantic_conventions/rpc.md) | string | The name of the method being called, must be equal to the $method part in the span name. | `exampleMethod` | No, but recommended |
| [`net.peer.ip`](../../trace/semantic_conventions/span-general.md) | string | Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6) | `127.0.0.1` | See below |
| [`net.peer.name`](../../trace/semantic_conventions/span-general.md) | string | Remote hostname or similar, see note below. | `example.com` | See below |
| [`net.peer.port`](../../trace/semantic_conventions/span-general.md) | number | Remote port number. | `80`<br>`8080`<br>`443` | Conditional<br>See below |
| [`net.transport`](../../trace/semantic_conventions/span-general.md) | string enum | Transport protocol used. See note below. | `IP.TCP` | Conditional<br>See below |
| [`net.peer.port`](../../trace/semantic_conventions/span-general.md) | number | Remote port number. | `80`; `8080`; `443` | See below |
| [`net.transport`](../../trace/semantic_conventions/span-general.md) | string | Transport protocol used. See note below. | `IP.TCP` | See below |

**Additional attribute requirements:** At least one of the following sets of attributes is required:

Expand Down
4 changes: 2 additions & 2 deletions specification/resource/semantic_conventions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The SDK MUST set a default value for the following attributes if they were not s
**Description:** A service instance.

<!-- semconv service -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| `service.name` | string | Logical name of the service. [1] | `shoppingcart` | Yes |
| `service.namespace` | string | A namespace for `service.name`. [2] | `Shop` | No |
Expand Down Expand Up @@ -90,7 +90,7 @@ The identifier `opentelemetry` is reserved and MUST NOT be used in this case.
The identifier SHOULD be stable across different versions of an implementation.

<!-- semconv telemetry -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| `telemetry.sdk.name` | string | The name of the telemetry SDK as defined above. | `opentelemetry` | No |
| `telemetry.sdk.language` | string | The language of the telemetry SDK. | `cpp` | No |
Expand Down
4 changes: 2 additions & 2 deletions specification/resource/semantic_conventions/cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
**Description:** A cloud infrastructure (e.g. GCP, Azure, AWS).

<!-- semconv cloud -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| `cloud.provider` | string | Name of the cloud provider. | `gcp` | No |
| `cloud.account.id` | string | The cloud account ID used to identify different entities. | `opentelemetry` | No |
| `cloud.region` | string | A specific geographical location where different entities can run. | `us-central1` | No |
| `cloud.zone` | string | Zones are a sub set of the region connected through low-latency links. [1] | `us-central1-a` | No |
| `cloud.infrastructure_service` | string | The cloud infrastructure resource in use. [2] | `aws_ec2`<br>`azure_vm`<br>`gcp_compute_engine` | No |
| `cloud.infrastructure_service` | string | The cloud infrastructure resource in use. [2] | `aws_ec2`; `azure_vm`; `gcp_compute_engine` | No |

**[1]:** In AWS, this is called availability-zone.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
**Description:** Resources used by AWS Elastic Container Service (ECS).

<!-- semconv aws.ecs -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| `aws.ecs.container.arn` | string | The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). | `arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9` | No |
| `aws.ecs.cluster.arn` | string | The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). | `arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster` | No |
| `aws.ecs.launchtype` | string enum | The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. | `EC2`<br>`Fargate` | No |
| `aws.ecs.launchtype` | string | The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. | `EC2`; `Fargate` | No |
| `aws.ecs.task.arn` | string | The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). | `arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b` | No |
| `aws.ecs.task.family` | string | The task definition family this task definition is a member of. | `opentelemetry-family` | No |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
**Description:** Log attributes for Amazon Web Services.

<!-- semconv aws.log -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| `aws.log.group.names` | string[] | The name(s) of the AWS log group(s) an application is writing to. [1] | `/aws/lambda/my-function`<br>`opentelemetry-service` | No |
| `aws.log.group.arns` | string[] | The Amazon Resource Name(s) (ARN) of the AWS log group(s). [2] | `arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*` | No |
| `aws.log.stream.names` | string[] | The name(s) of the AWS log stream(s) an application is writing to. | `logs/main/10838bed-421f-43ef-870a-f43feacbbb5b` | No |
| `aws.log.stream.arns` | string[] | The ARN(s) of the AWS log stream(s). [3] | `arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b` | No |
| `aws.log.group.names` | string[] | The name(s) of the AWS log group(s) an application is writing to. [1] | `[/aws/lambda/my-function, opentelemetry-service]` | No |
| `aws.log.group.arns` | string[] | The Amazon Resource Name(s) (ARN) of the AWS log group(s). [2] | `[arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*]` | No |
| `aws.log.stream.names` | string[] | The name(s) of the AWS log stream(s) an application is writing to. | `[logs/main/10838bed-421f-43ef-870a-f43feacbbb5b]` | No |
| `aws.log.stream.arns` | string[] | The ARN(s) of the AWS log stream(s). [3] | `[arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b]` | No |

**[1]:** Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group.

Expand Down
2 changes: 1 addition & 1 deletion specification/resource/semantic_conventions/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
**Description:** A container instance.

<!-- semconv container -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| `container.name` | string | Container name. | `opentelemetry-autoconf` | No |
| `container.id` | string | Container id. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | No |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
**Description:** The software deployment.

<!-- semconv deployment -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| `deployment.environment` | string | Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier). | `staging`<br>`production` | No |
| `deployment.environment` | string | Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier). | `staging`; `production` | No |
<!-- endsemconv -->
2 changes: 1 addition & 1 deletion specification/resource/semantic_conventions/faas.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
**Description:** A serverless instance.

<!-- semconv faas_resource -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| `faas.name` | string | The name of the function being executed. | `my-function` | Yes |
| `faas.id` | string | The unique ID of the function being executed. [1] | `arn:aws:lambda:us-west-2:123456789012:function:my-function` | Yes |
Expand Down
4 changes: 2 additions & 2 deletions specification/resource/semantic_conventions/host.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
**Description:** A host is defined as a general computing instance.

<!-- semconv host -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| `host.id` | string | Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. | `opentelemetry-test` | No |
| `host.name` | string | Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. | `opentelemetry-test` | No |
| `host.type` | string | Type of host. For Cloud, this must be the machine type. | `n1-standard-1` | No |
| `host.image.name` | string | Name of the VM image or OS install the host was instantiated from. | `infra-ami-eks-worker-node-7d4ec78312`<br>`CentOS-8-x86_64-1905` | No |
| `host.image.name` | string | Name of the VM image or OS install the host was instantiated from. | `infra-ami-eks-worker-node-7d4ec78312`; `CentOS-8-x86_64-1905` | No |
| `host.image.id` | string | VM image ID. For Cloud, this value is from the provider. | `ami-07b06b442921831e5` | No |
| `host.image.version` | string | The version string of the VM image as defined in [Version Attributes](README.md#version-attributes). | `0.1` | No |
<!-- endsemconv -->
33 changes: 23 additions & 10 deletions specification/resource/semantic_conventions/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,24 @@ Kubernetes object, but "name" is usually more user friendly so can be also set.
**Description:** A Kubernetes Cluster.

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

## Node

**type:** `k8s.node`

**Description:** A Kubernetes Node.

<!-- semconv k8s.node -->
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| `k8s.node.name` | string | The name of the node. | `opentelemetry-node` | No |
| `k8s.node.ip` | string | The address of the node (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6. | `127.0.0.1` | No |
<!-- endsemconv -->

## Namespace

Namespaces provide a scope for names. Names of objects need to be unique within
Expand All @@ -35,7 +48,7 @@ a namespace, but not across namespaces.
**Description:** A Kubernetes Namespace.

<!-- semconv k8s.namespace -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| `k8s.namespace.name` | string | The name of the namespace that the pod is running in. | `default` | No |
<!-- endsemconv -->
Expand All @@ -50,7 +63,7 @@ containers on your cluster.
**Description:** A Kubernetes Pod object.

<!-- semconv k8s.pod -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | 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 |
Expand All @@ -70,7 +83,7 @@ to a running container.
**Description:** A container in a [PodTemplate](https://kubernetes.io/docs/concepts/workloads/pods/#pod-templates).

<!-- semconv k8s.container -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| `k8s.container.name` | string | The name of the Container in a Pod template. | `redis` | No |
<!-- endsemconv -->
Expand All @@ -85,7 +98,7 @@ any given time.
**Description:** A Kubernetes ReplicaSet object.

<!-- semconv k8s.replicaset -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | 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 |
Expand All @@ -102,7 +115,7 @@ distributed among the nodes of a cluster.
**Description:** A Kubernetes Deployment object.

<!-- semconv k8s.deployment -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | 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 |
Expand All @@ -118,7 +131,7 @@ about the ordering and uniqueness of these Pods.
**Description:** A Kubernetes StatefulSet object.

<!-- semconv k8s.statefulset -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | 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 |
Expand All @@ -133,7 +146,7 @@ A DaemonSet ensures that all (or some) Nodes run a copy of a Pod.
**Description:** A Kubernetes DaemonSet object.

<!-- semconv k8s.daemonset -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | 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 |
Expand All @@ -149,7 +162,7 @@ successfully terminate.
**Description:** A Kubernetes Job object.

<!-- semconv k8s.job -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | 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 |
Expand All @@ -164,7 +177,7 @@ A CronJob creates Jobs on a repeating schedule.
**Description:** A Kubernetes CronJob object.

<!-- semconv k8s.cronjob -->
| Attribute | Type | Description | Example | Required |
| Attribute | Type | Description | Examples | 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 |
Expand Down
4 changes: 2 additions & 2 deletions specification/resource/semantic_conventions/os.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
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 |
| Attribute | Type | Description | Examples | 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.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]`; `Ubuntu 18.04.1 LTS` | No |

`os.type` MUST be one of the following or, if none of the listed values apply, a custom value:

Expand Down
Loading

0 comments on commit ede97e3

Please sign in to comment.