Attach OpenTelemetry resource attributes to the entity that emits telemetry
Answer: A resource represents the entity producing telemetry, recorded as resource attributes. You attach it to a TracerProvider or MetricProvider at initialization. That association cannot be changed later.
What goes on a resource
A process running in a container on Kubernetes might include a process name, a pod name, a namespace, and a deployment name. All four of those attributes can be included in the resource. Backends can use that data to narrow latency or errors to one container, pod, or deployment. SDKs also add telemetry.sdk.name, telemetry.sdk.language, and telemetry.sdk.version.
| service.name | OTEL_SERVICE_NAME | |---|---| | service.name | logical name of the service | | unknown_service | SDK default if you do not set service.name | | OTEL_SERVICE_NAME | environment variable for service.name | | detectors | OS, host, process, container, Kubernetes, cloud |
SDK rules
The SDK must allow creation of Resources and association with telemetry. After a resource is added, spans and metrics from a Tracer or Meter on that provider carry it. Set service.name explicitly, in code or with OTEL_SERVICE_NAME. Most language SDKs ship detectors that fill resource information from the environment.
See also
Claims
- id: C1 claim: A resource represents the entity that produces telemetry. source: S1 evidence: "A resource represents the entity producing telemetry as resource attributes."
- id: C2 claim: Once attached, a resource association cannot be changed later. source: S1 evidence: "This association cannot be changed later."
- id: C3 claim: The SDK must allow creating Resources and associating them with telemetry. source: S2 evidence: "The SDK MUST allow for creation of 'Resources' and for associating them with telemetry."
Sources
- [S1] Resources. OpenTelemetry. https://opentelemetry.io/docs/concepts/resources/ . License: CC-BY-4.0. Accessed 2026-11-20.
- [S2] Resource SDK. open-telemetry/opentelemetry-specification. https://raw.githubusercontent.com/open-telemetry/opentelemetry-specification/main/specification/resource/sdk.md . License: Apache-2.0. Accessed 2026-11-20.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: OpenTelemetry, Resources; open-telemetry/opentelemetry-specification, Resource SDK. CC-BY-4.0; Apache-2.0. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: OpenTelemetry, Resources; open-telemetry/opentelemetry-specification, Resource SDK. CC-BY-4.0; Apache-2.0.
Cite this
iinventedlight. 2026. "Attach OpenTelemetry resource attributes to the entity that emits telemetry." iinventedlight Library, iil:note:z4erz8r4, version of 2026-11-20. https://iinventedlight.com/library/notes/otel-resources/. License: CC-BY-4.0.
@misc{iil_note_z4erz8r4,
author = {{iinventedlight}},
title = {{Attach OpenTelemetry resource attributes to the entity that emits telemetry}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-20},
url = {https://iinventedlight.com/library/notes/otel-resources/},
note = {Permanent ID iil:note:z4erz8r4. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- otel-resources.table.json (table; CC-BY-4.0)
- otel-resources.schema.json (schema; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/otel-resources.md.