Skip to main content
In this lesson we address a common issue: traces showing up in Jaeger as unknown_service, which makes it difficult to identify which application produced them. The fix is to configure resource attributes. Resource attributes are an immutable set of key/value pairs that describe the entity producing telemetry (for example, service name, service version, host, and environment). When set correctly, observability backends such as Jaeger and Tempo can surface and filter traces by these attributes. Dependencies used in this demo:
Example run before configuring resource attributes:
What to change
  • Import Resource from opentelemetry.sdk.resources.
  • Create a Resource instance with semantic keys such as service.name and service.version.
  • Pass the Resource to the TracerProvider so spans inherit the resource metadata.
Compact, corrected tracer configuration and example payment function:
Quick checklist
  • Use standard semantic keys (for example, service.name, service.version) so observability backends can detect and display them.
  • Prefer attributes that describe the resource (the entity producing telemetry), not attributes that belong on individual spans.
  • Add other resource attributes as needed (for example: host.name, host.ip, deployment.environment) to support searching and filtering.
Common resource attribute examples
AttributeDescriptionExample
service.nameCanonical name of the service producing telemetrypayment-service
service.versionVersion of the service0.2.0
deployment.environmentDeployment environment (prod, staging, dev)production
host.nameHostname of the machine/containerweb-01
host.ipIP address of the host10.0.0.5
resource creation exampleHow to create a Resource in codeResource.create({ "service.name": "payment-service", "service.version": "0.2.0" })
Before configuring resource attributes, traces appeared as unknown_service in Jaeger (screenshot below). After adding the Resource to the tracer and rerunning the script, the CLI output remains the same but spans include the resource attributes (service name, service.version), and Jaeger now lists the correct service.
The image shows a screenshot of the Jaeger UI, displaying a search interface for tracing services with search results highlighting a trace for "unknown_service" related to a Payment Service.
Now the Jaeger UI shows the correct service name (payment-service) in the service list, making it much easier to find and analyze relevant traces.
Resource attributes are intended to describe the entity producing telemetry and are treated as immutable metadata for that entity. Use standard keys (for example, service.name, service.version) to maximize interoperability with observability backends.
The image shows a Jaeger UI trace analysis for a "Payment Service," detailing spans related to a payment process with specific tags and process information.
Inspecting individual traces in Jaeger will show the attached resource attributes (service name and version), along with automatically added SDK attributes such as the OpenTelemetry SDK language and version. These attributes make traces far easier to filter, group, and interpret. Links and references

Watch Video