OpenTelemetry's semantic conventions define standard names for attributes: http.route instead of route, path or endpoint depending on who wrote the code. When everyone uses the same names, backends can build views automatically: endpoints from http.route, database views from db.system, service maps from client and server spans.
Automatic instrumentation sets most of these for you. Knowing them matters when you add custom spans, write Collector processors or wonder why a view is empty.
Resource attributes: who sent this
Resource attributes describe the process emitting telemetry and apply to every span, metric and log from it.
| Attribute | Example | Why |
|---|---|---|
service.name | checkout | Groups everything for the service |
service.version | 2026.10.23-1 | Deploy markers, before/after comparisons |
deployment.environment.name | production | Separates production from staging |
service.namespace | payments | Groups services by domain or team |
host.name, k8s.pod.name | ip-10-0-1-7, checkout-7d9f | Locating the instance |
cloud.provider, cloud.region | aws, eu-west-1 | Multi-cloud and regional views |
Set them with OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES, or in code. Consistency across services matters more than any single value.
HTTP spans
| Attribute | Example |
|---|---|
http.request.method | POST |
http.route | /orders/:id |
http.response.status_code | 500 |
url.full (client) / url.path (server) | https://api.example.com/v1/orders |
server.address, server.port | api.example.com, 443 |
http.route is the most important: it is the low-cardinality template that turns millions of URLs into a manageable list of endpoints. Server span names should be METHOD route, such as POST /orders/:id.
Database spans
| Attribute | Example |
|---|---|
db.system (newer: db.system.name) | postgresql |
db.namespace | shop |
db.operation.name | SELECT |
db.query.text | SELECT * FROM orders WHERE id = ? |
Query text should be sanitized (values replaced with placeholders), both to keep secrets out and to group identical queries.
Messaging and RPC
Messaging spans carry messaging.system (kafka, rabbitmq), messaging.destination.name (the topic or queue) and an operation type. RPC spans carry rpc.system, rpc.service and rpc.method. Producers and consumers use span kinds PRODUCER and CONSUMER so tools can link them.
Errors and exceptions
Set the span status to ERROR for failed operations and record exceptions as events with exception.type, exception.message and exception.stacktrace. Error tracking tools group issues from these.
Conventions evolve
Semantic conventions have been stabilising area by area, and some names changed along the way (for example http.method became http.request.method, and deployment.environment became deployment.environment.name). SDKs and instrumentation libraries may emit old or new names depending on version. When a view looks empty after an upgrade, check which names your services emit; the Collector's transform processor can rename attributes during a transition.
Custom attributes
For your own data, use a namespace you own (shop.cart.items, billing.plan), keep values low-cardinality when you will group by them, and never include secrets or personal data. See what is a span for naming spans well.
In VitalRix
VitalRix APM reads service.name, service.version, the environment, http.route and database attributes to build the service catalog, endpoints, database view and deploy markers, and normalizes routes when IDs slip into URLs. See OpenTelemetry in VitalRix.
Setting resource attributes
export OTEL_SERVICE_NAME=checkout
export OTEL_RESOURCE_ATTRIBUTES=service.version=2026.10.23-1,deployment.environment.name=production,service.namespace=payments
In Kubernetes, put these in the Deployment's environment, and let the Collector add pod and node attributes with the k8sattributes processor.
Custom spans that follow the conventions
import { trace, SpanKind } from '@opentelemetry/api';
const tracer = trace.getTracer('pricing');
await tracer.startActiveSpan('calculate tax', { kind: SpanKind.INTERNAL, attributes: { 'shop.cart.items': cart.items.length } }, async (span) => {
try { return await calculateTax(cart); } finally { span.end(); }
});
For outgoing calls to systems that have conventions, such as a cache or a queue, prefer an existing instrumentation library over hand-written spans; it sets the right attributes and span kinds for you.
Renaming during upgrades
If a library upgrade switches from old to new attribute names, dashboards and alerts that use the old names go quiet. A Collector transform can copy the new attribute to the old name for a transition period:
processors:
transform/compat:
trace_statements:
- context: span
statements:
- set(attributes["http.method"], attributes["http.request.method"]) where attributes["http.request.method"] != nil
Remove it once dashboards and alerts use the new names.
Checklist for a new service
service.namematches the name used everywhere else (dashboards, alerts, on-call).service.versionset from the build, so deploys show up.deployment.environment.nameset to production, staging and so on.- Server spans have
http.route. - Database spans have sanitized query text.
- Errors set span status and record exceptions.
Related reading: distributed tracing, context propagation and what is APM.
Do I need to set semantic convention attributes myself?
Mostly not: automatic instrumentation sets them. You set resource attributes (service name, version, environment) and follow the conventions in custom spans.
Why are my endpoints showing raw URLs?
The server span lacks http.route, often because the framework is not instrumented or routing happens outside it. Fix the instrumentation or set the route yourself.
Are semantic conventions stable?
Core areas such as HTTP have been declared stable; others are still evolving. Pin instrumentation versions and check release notes when upgrading.
Try VitalRix free
Uptime monitoring, APM, logs, real user monitoring and status pages in one place. No credit card needed.