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.

AttributeExampleWhy
service.namecheckoutGroups everything for the service
service.version2026.10.23-1Deploy markers, before/after comparisons
deployment.environment.nameproductionSeparates production from staging
service.namespacepaymentsGroups services by domain or team
host.name, k8s.pod.nameip-10-0-1-7, checkout-7d9fLocating the instance
cloud.provider, cloud.regionaws, eu-west-1Multi-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

AttributeExample
http.request.methodPOST
http.route/orders/:id
http.response.status_code500
url.full (client) / url.path (server)https://api.example.com/v1/orders
server.address, server.portapi.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

AttributeExample
db.system (newer: db.system.name)postgresql
db.namespaceshop
db.operation.nameSELECT
db.query.textSELECT * 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

  1. service.name matches the name used everywhere else (dashboards, alerts, on-call).
  2. service.version set from the build, so deploys show up.
  3. deployment.environment.name set to production, staging and so on.
  4. Server spans have http.route.
  5. Database spans have sanitized query text.
  6. 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.