VitalRix guide
What is OpenTelemetry?
OpenTelemetry is the open, vendor-neutral standard for producing traces, metrics and logs from your software. This guide explains the pieces, how data flows from your code to a backend and how to start without locking yourself in.
13 min read16 sectionsUpdated
On this page
Key takeaways
- One way to instrument, any place to send. Your code produces telemetry in a standard format; the destination is configuration.
- It is a toolkit, not a product. APIs, SDKs, a wire protocol (OTLP), naming conventions and an optional Collector. You still need a backend to store and analyse the data.
- Traces come first. Most teams adopt OpenTelemetry for distributed tracing, then add metrics and log correlation.
- Resource attributes make data useful.
service.name,service.versionanddeployment.environment.namedecide how well a backend can organise what you send. - The Collector is optional. Small setups export straight from the SDK; larger ones put a Collector between services and backends.
OpenTelemetry in plain words
Every monitoring vendor used to ship its own agent. The agent hooked into your code, collected data in a private format and sent it to that vendor. That worked until you wanted to switch, add a second tool or understand what the agent was actually collecting. Changing vendor meant re-instrumenting every service.
OpenTelemetry (often shortened to OTel) replaces that with a shared standard. It is an open-source project of the Cloud Native Computing Foundation (CNCF) with libraries for most languages. You add the OpenTelemetry SDK to your service once. It produces traces, metrics and logs in a standard shape and sends them over a standard protocol. Any compatible backend can receive them, so moving or adding a destination is a configuration change instead of a rewrite.
The important detail is what OpenTelemetry is not. It does not store data, draw charts or send alerts. It is the producing and shipping half of observability. A backend such as VitalRix is the half that turns the data into APM, error tracking and a service map.
The API and the SDK
The API is what instrumentation code calls to create spans and record metrics. The SDK is the implementation behind it: sampling, batching, exporting. Libraries depend only on the API, so they can be instrumented without forcing an exporter on you.
Instrumentation libraries
Packages that create spans for you around popular frameworks, HTTP clients and database drivers. Many languages also offer a zero-code agent or a loader that applies them at startup, so you can start tracing without editing business logic.
OTLP, the wire protocol
The OpenTelemetry Protocol carries traces, metrics and logs over gRPC or HTTP, encoded as protobuf or JSON. Because every compatible tool speaks it, an exporter written once works everywhere.
The Collector
A standalone service that receives telemetry, processes it (batch, filter, add attributes, sample) and exports it to one or more backends. It decouples your services from vendors and handles retries so applications do not have to.
Semantic conventions
Agreed names for common things, such as `service.name`, `http.route` and `deployment.environment.name`. Shared names are why two tools can show the same span as the same thing instead of a pile of custom fields.
Resources
The description of who produced the data: service name, version, environment, host. A resource is attached to everything a process emits, which is what lets a backend group spans into services.
| Feature | Traces | Metrics | Logs |
|---|---|---|---|
| What it is | The path of one request across services, as spans | Numbers measured over time | Timestamped events, as text or structured fields |
| Best at | Finding which step of a request was slow or failed | Trends, alerting, capacity | Detail about what the code was doing |
| Volume | High, so it is often sampled | Low and predictable | Can be very high |
| Example | POST /checkout took 2.4 s, 1.3 s of it in SQL | p95 latency, requests per second, heap size | Payment declined for order 4821 |
| Link to the others | Trace ID ties logs to the request | Exemplars and shared attributes | Include the trace ID in each line |
The signals are most valuable when linked: a metric shows latency rising, a trace shows the slow request, and the logs written during that trace's request explain the decision the code made. The glue is the trace ID, a 32-character hex string. Put it in your log lines and a backend can jump both ways.
What the data becomes
Standard spans in, understandable views out. Below is a distributed trace waterfall built from OpenTelemetry spans, and the service map a backend can draw from the same spans by looking at who calls whom.
How data flows, step by step
1. A span is created
A request arrives at your service. The HTTP instrumentation starts a span named after the method and route, such as GET /orders/:id, records the start time and puts the span in the current context, a small bag of values that follows the code through the request.
2. Context travels between services
When your code calls another service, the HTTP client instrumentation reads the context and adds a W3C traceparent header. It looks like this: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01. The four fields are the version (00), the 32-hex trace ID, the 16-hex ID of the calling span and the trace flags (01 means sampled). The receiving service reads the header and creates its spans as children of the caller's span.
3. The SDK decides what to keep
A sampler decides whether the trace is recorded. The usual choice is a parent-based sampler: if the caller sampled the request, so does everyone downstream, so you never keep half of a request.
4. Spans are batched and exported
Finished spans are queued in memory and a batch processor exports them in groups, in the background, with a bounded queue. Requests never wait on the network. If the queue fills, the SDK drops spans rather than hurting your application.
5. The Collector (optional) processes them
A Collector pipeline has receivers (how data comes in), processors (batch, limit memory, add or drop attributes, sample) and exporters (where it goes). One pipeline can export to several backends at once.
6. The backend stores and aggregates
The backend stores spans so you can open a request, and aggregates them into rate, error and latency numbers per service and route. Metrics use histograms, which can be merged correctly, so percentiles stay honest across time and instances.
| Question | Export straight from the SDK | Use a Collector |
|---|---|---|
| How many services? | One to a few | Many, or in several languages |
| Which protocol can your SDK send? | Whatever the backend accepts directly | Anything: it converts and forwards |
| Need sampling, filtering or redaction in one place? | Per service, in SDK config | Once, in the Collector |
| Want to send to two backends? | Awkward | Add a second exporter |
| Moving parts | None to run | A service to deploy and monitor |
| Retries and buffering | Basic, in the SDK | Configurable queue and retry |
VitalRix accepts OTLP over HTTP, with protobuf or JSON bodies, authenticated with an API key in the x-api-key header. Every OpenTelemetry SDK can export that way directly. gRPC is not accepted directly, so services that export gRPC send it to a Collector, which forwards to VitalRix. Below is a minimal Collector configuration that does exactly that.
receivers:
otlp:
protocols:
grpc: { endpoint: 0.0.0.0:4317 } # your SDKs talk standard OTLP to the Collector
http: { endpoint: 0.0.0.0:4318 }
processors:
memory_limiter: { check_interval: 1s, limit_mib: 512 }
batch: { send_batch_size: 1000, timeout: 5s }
exporters:
otlphttp/vitalrix:
traces_endpoint: https://api.vitalrix.com/api/v1/traces/otlp/v1/traces
headers: { x-api-key: ${env:VITALRIX_API_KEY} }
retry_on_failure: { enabled: true }
service:
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlphttp/vitalrix]Run the Collector with VITALRIX_API_KEY in its environment, and give the key only the permission to write traces (and metrics if you export them). Keep it on the server; never put it in browser code.
A worked example: a small shop with three services
Numbers are illustrative.
The system. shop-web (Node.js, Next.js), orders-api (Python) and pricing (Go) behind a Postgres database. The team wants traces across all three, with the option of changing vendors later.
The plan. shop-web gets @vitalrix/node, orders-api gets pip install vitalrix and pricing the VitalRix Go module. Each is a thin layer over the official OpenTelemetry SDK with HTTP, framework and Postgres instrumentation, and exports OTLP/HTTP protobuf straight to VitalRix with an API key that can write traces, metrics and logs.
The environment variables each service sets: VITALRIX_URL, VITALRIX_API_KEY, OTEL_SERVICE_NAME (the application slug), DEPLOYMENT_ENVIRONMENT=production and SERVICE_VERSION=1.4.2.
What happens to one request. A customer opens an order. shop-web creates a root span, calls orders-api with a traceparent header, which calls pricing the same way. Postgres queries become child spans of the orders-api span. A few seconds later each service's batch processor exports its spans to VitalRix in one HTTP request. The backend joins everything by trace ID.
Sampling in numbers. The shop gets about 20,000 requests an hour. At first it sends everything. After a traffic spike, the team sets a parent-based sampler at 10%. Now about 2,000 traces an hour arrive, and every dashboard count reads one tenth of reality. The team keeps this in mind when comparing request counts with the load balancer, and leaves error alerts on rates rather than raw counts.
The payoff. The service map shows shop-web calling orders-api, which calls pricing and Postgres. A slow-order complaint becomes one trace where pricing spent 900 ms in a loop. Six months later, the team adds a Collector to send to a second backend for a pilot, changing only the endpoint each service exports to.
No service name
Without `service.name`, backends label everything "unknown_service". Set it on every process, and use a stable name rather than a hostname.
Missing version and environment
Without `service.version` you cannot compare releases; without `deployment.environment.name` staging and production blur together.
Lost context
Message queues, background jobs and some HTTP clients drop the trace header unless instrumented. Check the service map for gaps and broken traces.
High-cardinality span names
Put IDs in attributes, never in the span name. `GET /orders/84213` creates a new endpoint for every order; `GET /orders/:id` creates one.
Secrets in attributes
Do not record tokens, passwords or full SQL values. Redact in the SDK or the Collector, and rely on the backend as a second line of defence, as VitalRix does for headers, tokens and query values.
Unbounded exporters
Exporters without batching, timeouts and a bounded queue can hold memory or add latency under load. Use the batch processor defaults and a memory limiter in the Collector.
| Topic | How it relates | Read |
|---|---|---|
| APM | The practice that OpenTelemetry traces make possible without a vendor agent | [What is APM](/guides/what-is-apm) |
| Logs, metrics and traces | The three signals together and how they link | [Logs, metrics and traces](/product/logs-metrics-traces) |
| Error tracking | Exceptions recorded on spans become grouped issues | [Error tracking](/product/error-tracking) |
| Real user monitoring | Browser-side data comes from a separate script, not the server SDK | [What is real user monitoring](/guides/what-is-real-user-monitoring) |
| Synthetic monitoring | Scheduled checks from outside, which need no instrumentation | [What is synthetic monitoring](/guides/what-is-synthetic-monitoring) |
Getting started with OpenTelemetry on VitalRix
- Create an API key. In Settings, add a key that can write traces, metrics and logs. Use one key per environment, and keep it in a server-side environment variable.
- Choose your path. Node.js, Python, Go, Ruby and PHP: install the VitalRix package. Java and .NET: the OpenTelemetry agent or SDK. All export directly; a Collector is only needed for gRPC.
- Set resource attributes.
service.nameas the application slug,deployment.environment.nameandservice.version. These three decide how your data is organised. - Point the exporter at VitalRix. Use the OTLP/HTTP endpoints (protobuf or JSON) and the
x-api-keyheader. If you already use OpenTelemetry, only the endpoint and header change. - Send a test span. The setup guide includes a one-line curl that sends a span, so you can check the key and the address before deploying.
- Open APM and check. Within a minute the service appears in APM, and its requests under Traces. If a call between services is missing from the service map, check context propagation.
- Link logs to traces. Put the 32-hex trace ID in your log entries and send them to the VitalRix logs API. Each trace then lists its logs and each log links back.
- Decide on sampling. Leave it at 100% until volume makes that expensive, then use a parent-based sampler and remember that counts reflect what you send.
Details: the APM setup guide and APM docs. Product page: OpenTelemetry on VitalRix.
Glossary
- OpenTelemetry (OTel): the CNCF project that defines APIs, SDKs, a protocol and conventions for telemetry.
- Telemetry: data a system emits about itself: traces, metrics and logs.
- Span: a timed unit of work with attributes, part of a trace.
- Trace: all spans that belong to one request.
- Context propagation: carrying trace context between services, usually in the
traceparentheader. - OTLP: the OpenTelemetry Protocol, carried over gRPC or HTTP.
- Collector: a service that receives, processes and exports telemetry.
- Exporter: the component that sends data to a destination.
- Resource: attributes describing the producer, such as service name and version.
- Semantic conventions: standard attribute names and meanings.
- Sampler: the rule that decides which traces are kept.
- Auto-instrumentation: libraries or agents that create spans without code changes.
When you do not need OpenTelemetry yet
- A single script or a static site. Logs and an uptime check cover it.
- A managed platform that already traces your requests for you, where a built-in view is enough.
- You only need to know that it is up. Uptime monitoring needs no instrumentation at all.
Reach for it the day a request crosses two services, or the day you worry about being tied to one vendor.
What OpenTelemetry does not do
- It does not store or visualise anything. You need a backend.
- It does not see the browser unless you add browser instrumentation or use a real user monitoring script.
- It is not a guarantee of good data. Poor naming, lost context and missing attributes produce confusing traces, with any backend.
- It does not decide what to alert on. That is still your job; see alerts and incidents.
What is OpenTelemetry in simple terms?
A free, open standard for producing traces, metrics and logs from your software, with libraries for most languages and a common protocol for sending the data. You instrument once and can send the result to any compatible tool.
Is OpenTelemetry free?
Yes. It is an open-source project of the Cloud Native Computing Foundation (CNCF). The software is free; the backend you send data to may charge for storage and analysis.
Is OpenTelemetry an APM tool?
No. It produces and ships telemetry. An APM tool receives that data, stores it and turns it into charts, alerts, service maps and error tracking. VitalRix APM is built from standard OpenTelemetry traces.
What is OTLP?
The OpenTelemetry Protocol, the standard way to send telemetry. It runs over gRPC or HTTP and encodes data as protobuf or JSON. VitalRix accepts OTLP over HTTP with protobuf or JSON; for gRPC use a Collector in front.
Do I need the Collector?
Not always. Most setups export directly from the SDK. A Collector helps when you run many services, use gRPC, want one place for sampling and redaction, or need to send to more than one backend.
What is the traceparent header?
The W3C standard header that carries trace context between services. It contains a version, a 32-hex trace ID, the calling span ID and flags such as whether the trace is sampled. It is how spans from different services become one trace.
Which languages does OpenTelemetry support?
Most mainstream ones, including Java, JavaScript and Node.js, Python, Go, .NET, Ruby and PHP. Maturity and the amount of automatic instrumentation vary by language, so check the SDK status for yours.
What attributes should I always set?
service.name, service.version and deployment.environment.name. They let a backend group spans into services, compare releases and separate production from staging.
Can I send the same data to two vendors?
Yes, that is one of the main advantages. Add a second exporter to the Collector, or to the SDK, and the same spans go to both. It makes trials and migrations low-risk.
Does OpenTelemetry slow my application down?
The overhead is small when configured well: spans are created in memory and exported in batches in the background with a bounded queue. For very high traffic, sample a share of traces.
How do I link logs to traces?
Include the trace ID, 32 hex characters, in each log entry. In VitalRix, send logs to the logs API with that field and the trace page lists its logs, while each log line links to its trace.
How do I leave a vendor later?
Your code contains only standard OpenTelemetry, so you change the exporter endpoint or the Collector configuration. Nothing proprietary has to be uninstalled or rewritten.
Related reading
- OpenTelemetry backends compared: Where to send OpenTelemetry data in 2026: open-source and commercial backends compared on OTLP support, views, cost and hosting, with criteria for choosing one.
- OpenTelemetry for Java: the agent, step by step: Instrument any Java application with the OpenTelemetry Java agent: no code changes, environment configuration, Docker and Kubernetes setup and troubleshooting.
- What is a telemetry pipeline?: Telemetry pipelines explained: collecting, processing and routing logs, metrics and traces, redacting sensitive data, cutting volume.
- OpenTelemetry Collector troubleshooting guide: Troubleshoot the OpenTelemetry Collector: dropped data, exporter errors, memory limits and missing spans, using zpages, internal metrics and the debug exporter.
- What is a span in tracing?: What a span is in distributed tracing: its fields, parent and child spans, span kinds, attributes and status, with an annotated example you can read.
- OpenTelemetry for FastAPI: Trace a FastAPI service with OpenTelemetry: instrument the app, async database drivers and httpx, run uvicorn workers correctly and export.
Send your first trace in ten minutes
Create a free account, copy the endpoint and key from the OpenTelemetry page and watch your service appear in APM.