A resource attribute is a key/value pair containing information about the entity producing telemetry.
Resource attributes are mapped to Elastic Common Schema (ECS) fields like
These fields describe the service and the environment that the service runs in.
The examples below set the Elastic (ECS)
service.environment field for the resource, i.e. service, that is producing trace events.
Note that Elastic maps the OpenTelemetry
deployment.environment field to
service.environment field on ingestion.
OTEL_RESOURCE_ATTRIBUTES environment variable to pass resource attributes at process invocation.
Use the resource processor to set or apply changes to resource attributes.
... processors: resource: attributes: - key: deployment.environment action: insert value: production ...
Need to add event attributes instead? Use attributes—not to be confused with resource attributes—to add data to span, log, or metric events. Attributes can be added as a part of the OpenTelemetry instrumentation process or with the attributes processor.
Elastic integrates with OpenTelemetry, allowing you to reuse your existing instrumentation to easily send observability data to the Elastic Stack.
For more information on how to combine Elastic and OpenTelemetry, see OpenTelemetry integration.
Intro to Kibana
ELK for Logs & Metrics