Anatomy of a Resource
| Term | What it means |
|---|---|
| Describes | Answers the question “who is sending this telemetry?” |
| Entity | Service name, environment, host, pod, container — anything that identifies the producer. |
| Immutable | Does not change during the process lifetime. The same Resource is attached to every span, metric, and log. |
| Metadata | Key-value pairs. |
Configuring a Resource
Resource.create(...) rather than the class constructor Resource(attributes=...). create() merges your attributes with the defaults from the built-in resource detectors.
Arize AX–Specific Resource Attributes
Arize AX reads two resource attributes to route spans to the right project:| Attribute | Status | Notes |
|---|---|---|
openinference.project.name | Canonical | The name of the project in Arize AX. Defined by the OpenInference resource semconv — exposed as ResourceAttributes.PROJECT_NAME in the openinference.semconv.resource Python package, and as SEMRESATTRS_PROJECT_NAME in @arizeai/openinference-semantic-conventions for JS/TS. |
model_id | Legacy alias | Not part of the OpenInference semconv. The Arize AX collector accepts it as an ingest-side compatibility shim for older docs and examples. Both keys route to the same project. |
openinference.project.name. If you’re maintaining an older codebase, model_id will continue to work.
Environment Variables
The OpenTelemetry SDK can auto-detect Resource attributes from the environment, so you can avoid hardcoding them:| Environment variable | Purpose |
|---|---|
OTEL_SERVICE_NAME | Sets service.name. |
OTEL_RESOURCE_ATTRIBUTES | Comma-separated key=value pairs. Sets arbitrary resource attributes. |
OTEL_EXPERIMENTAL_RESOURCE_DETECTORS | Comma-separated list of built-in detectors to enable or disable. |
Resource.create(...) takes precedence.
The SDK also runs built-in resource detectors by default — they automatically fill in host, OS, process, and other infrastructure attributes. Disable them with OTEL_EXPERIMENTAL_RESOURCE_DETECTORS="" if you don’t want them.
For the full list, see the OpenTelemetry SDK environment variables reference.
Common Pitfalls
A few more things that trip people up:- Not following semantic conventions — using your own attribute names instead of
service.name,deployment.environment.name, etc. means other tools (and Arize AX) can’t interpret them. Stick with the resource semconv whenever there’s a standard key. - Using the class constructor
Resource(attributes=...)instead ofResource.create(...)— bypasses built-in detectors, so you lose the auto-populated host/process attributes. - Forgetting to set a project name — without
openinference.project.name(or themodel_idalias), spans land in the default project and are hard to organize.