# Resource semantic conventions

**Status**: [Mixed][DocumentStatus]

This document defines standard attributes for resources. These attributes are typically used in the [Resource](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.54.0/specification/resource/sdk.md) and are also recommended to be used anywhere else where there is a need to describe a resource in a consistent manner. The majority of these attributes are inherited from
[OpenCensus Resource standard](https://github.com/census-instrumentation/opencensus-specs/blob/master/resource/StandardResources.md).


## TODOs

* Add more compute units: AppEngine unit, etc.
* Add Web Browser.
* Decide if lower case strings only.
* Consider to add optional/required for each attribute and combination of attributes
  (e.g when supplying a k8s resource all k8s may be required).

## Document conventions

**Status**: [Stable][DocumentStatus]

Attributes are grouped logically by the type of the concept that they described. Attributes in the same group have a common prefix that ends with a dot. For example all attributes that describe Kubernetes properties start with "k8s."

See [Attribute Requirement Levels](../general/attribute-requirement-level.md) for details on when attributes
should be included.

## Attributes with special handling

**Status**: [Stable][DocumentStatus]

Given their significance some resource attributes are treated specifically as described below.

### Semantic attributes with dedicated environment variable

These are the attributes which MAY be configurable via a dedicated environment variable
as specified in [OpenTelemetry Environment Variable Specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.54.0/specification/configuration/sdk-environment-variables.md):

- [`service.name`](#service)

### Semantic attributes with SDK-provided default value

These are the attributes which MUST be provided by the SDK
as specified in the [Resource SDK specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.54.0/specification/resource/sdk.md#sdk-provided-resource-attributes):

- [`service.name`](#service)
- [`telemetry.sdk` group](#telemetry-sdk)

## Service

Logical grouping of components.

- [Service](service.md).

## Telemetry SDK

<!-- semconv entity.telemetry.sdk -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

**Status:** ![Stable](https://img.shields.io/badge/-stable-lightgreen)

**type:** `telemetry.sdk`

**Description:** The telemetry SDK used to capture data recorded by the instrumentation libraries.

**Attributes:**

| Role | Key | Stability | [Requirement Level](/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- | --- |
| Identity | [`telemetry.sdk.language`](/docs/specs/semconv/registry/attributes/telemetry.md) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Required` | string | The language of the telemetry SDK. | `cpp`; `dotnet`; `erlang` |
| Identity | [`telemetry.sdk.name`](/docs/specs/semconv/registry/attributes/telemetry.md) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Required` | string | The name of the telemetry SDK as defined above. [1] | `opentelemetry` |
| Description | [`telemetry.sdk.version`](/docs/specs/semconv/registry/attributes/telemetry.md) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Required` | string | The version string of the telemetry SDK. | `1.2.3` |

**[1] `telemetry.sdk.name`:** The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`.
If another SDK, like a fork or a vendor-provided implementation, is used, this SDK MUST set the
`telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point
or another suitable identifier depending on the language.
The identifier `opentelemetry` is reserved and MUST NOT be used in this case.
All custom identifiers SHOULD be stable across different versions of an implementation.

---

`telemetry.sdk.language` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
| --- | --- | --- |
| `cpp` | cpp | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `dotnet` | dotnet | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `erlang` | erlang | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `go` | go | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `java` | java | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `nodejs` | nodejs | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `php` | php | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `python` | python | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `ruby` | ruby | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `rust` | rust | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `swift` | swift | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `webjs` | webjs | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

## Telemetry distro

<!-- semconv entity.telemetry.distro -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

**Status:** ![Development](https://img.shields.io/badge/-development-blue)

**type:** `telemetry.distro`

**Description:** The distribution of telemetry SDK used to capture data recorded by the instrumentation libraries.

> [!warning]
> This entity definition contains attributes without a role.
> Stable Entities MUST NOT have attributes without a defined role.

**Attributes:**

| Role | Key | Stability | [Requirement Level](/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- | --- |
| Other | [`telemetry.distro.name`](/docs/specs/semconv/registry/attributes/telemetry.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The name of the auto instrumentation agent or distribution, if used. [1] | `parts-unlimited-java` |
| Other | [`telemetry.distro.version`](/docs/specs/semconv/registry/attributes/telemetry.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The version string of the auto instrumentation agent or distribution, if used. | `1.2.3` |

**[1] `telemetry.distro.name`:** Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to
a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`.
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

## Compute unit

**Status**: [Development][DocumentStatus]

Attributes defining a compute unit (e.g. Container, Process, Function as a Service):

- [Container](./container.md)
- [Function as a Service](./faas.md)
- [Process](./process.md)
- [Web engine](./webengine.md)

## Compute instance

**Status**: [Development][DocumentStatus]

Attributes defining a computing instance (e.g. host):

- [Host](./host.md)

## Environment

**Status**: [Development][DocumentStatus]

Attributes defining a running environment (e.g. Operating System, Cloud, Data Center, Deployment Service):

- [Operating System](./os.md)
- [Device](./device.md)
- [Cloud](./cloud.md)
- [CICD](./cicd.md)
- Deployment:
  - [Deployment Environment](./deployment-environment.md)
  - [Kubernetes](k8s/README.md)
  - [Openshift](k8s/openshift.md)
  - [CloudFoundry](./cloudfoundry.md)
- [Browser](./browser.md)

## Version attributes

**Status**: [Stable][DocumentStatus]

Version attributes, such as `service.version`, are values of type `string`. They are
the exact version used to identify an artifact. This may be a semantic version, e.g., `1.2.3`, git hash, e.g.,
`8ae73a`, or an arbitrary version string, e.g., `0.1.2.20210101`, whatever was used when building the artifact.

## Cloud-Provider-specific attributes

**Status**: [Development][DocumentStatus]

Attributes that are only applicable to resources from a specific cloud provider. Currently, these
resources can only be defined for providers listed as a valid `cloud.provider` in
[Cloud](./cloud.md) and below. Provider-specific attributes all reside in the `cloud-provider` directory.
Valid cloud providers are:

- [Alibaba Cloud](https://www.alibabacloud.com/) (`alibaba_cloud`)
- [Amazon Web Services](https://aws.amazon.com/) ([`aws`](cloud-provider/aws/README.md))
- [Google Cloud Platform](https://cloud.google.com/) ([`gcp`](cloud-provider/gcp/README.md))
- [Microsoft Azure](https://azure.microsoft.com/) (`azure`)
- [Tencent Cloud](https://www.tencentcloud.com/) (`tencent_cloud`)
- [Heroku dyno](./cloud-provider/heroku.md)

[DocumentStatus]: /docs/specs/otel/document-status

---

Section pages:

- [Android](/docs/specs/semconv/resource/android/)
- [Browser](/docs/specs/semconv/resource/browser/)
- [CICD](/docs/specs/semconv/resource/cicd/)
- [Cloud](/docs/specs/semconv/resource/cloud/)
- [Cloud provider](/docs/specs/semconv/resource/cloud-provider/)
- [CloudFoundry](/docs/specs/semconv/resource/cloudfoundry/)
- [Container](/docs/specs/semconv/resource/container/)
- [Deployment](/docs/specs/semconv/resource/deployment-environment/)
- [Device](/docs/specs/semconv/resource/device/)
- [Function as a Service](/docs/specs/semconv/resource/faas/)
- [Host](/docs/specs/semconv/resource/host/)
- [Kubernetes](/docs/specs/semconv/resource/k8s/)
- [Operating system](/docs/specs/semconv/resource/os/)
- [Process and process runtime resources](/docs/specs/semconv/resource/process/)
- [Service semantic conventions](/docs/specs/semconv/resource/service/)
- [Webengine](/docs/specs/semconv/resource/webengine/)
- [z/OS software](/docs/specs/semconv/resource/zos/)
