What Is OpenTelemetry? A Beginner's Guide to Seeing Inside Your Software
OpenTelemetry is the open, vendor-neutral standard for collecting traces, metrics, and logs from your applications, so you can understand what your software is really doing and why it sometimes misbehaves.
Imagine you own a busy restaurant. Orders arrive, the kitchen cooks, waiters carry plates, and the cashier takes payment. One evening a customer says, “My pasta took forty minutes!” Where did the delay happen? Did the waiter forget the order? Was the kitchen overloaded? Did the pasta wait on the counter? Without any record of what happened to that single order, you can only guess.
Modern software is exactly like that restaurant, only much bigger. A single click on a shopping website may wake up dozens of small programs running on many computers. When something is slow or broken, finding the cause without good records is painful. OpenTelemetry is the standard way of keeping those records. This guide explains it from zero, using plain words and everyday comparisons.
1OpenTelemetry in One Sentence
Before the details, let us get a simple picture of what this thing is.
OpenTelemetry (often shortened to OTel) is a free, open-source collection of tools, rules, and agreements that help software describe its own behavior. It tells programs how to record things like “this request took 200 milliseconds” or “the server is using 70 percent of its memory,” and how to send those records to any tool that can store and display them.
It belongs to the Cloud Native Computing Foundation (CNCF), the same neutral organization that hosts Kubernetes. Because no single company owns it, many vendors and open-source tools support it. That neutrality is one of its biggest strengths.
Think of OpenTelemetry as the universal power plug standard for monitoring data. Before such a standard, every appliance needed its own special plug. With a standard, any device fits any socket. OpenTelemetry does this for monitoring data: any application can send data to any compatible tool.
What OpenTelemetry is not
Beginners often think OpenTelemetry is a monitoring product with dashboards and alerts. It is not. It does not store your data and does not draw charts. It focuses on one job: generating, collecting, and delivering telemetry data. Storing, searching, and visualizing are done by other tools called backends.
2First, What Is Telemetry?
The word sounds scary, but the idea is very old.
Telemetry means measuring something from a distance and sending the measurements to a place where people can study them. Weather stations send temperature readings to a central office. A hospital heart monitor sends your pulse to a screen at the nurse’s desk. A race car sends tire pressure to engineers in the garage.
In software, telemetry is the stream of information that a running program produces about itself: how fast it responds, how many errors it makes, which steps it performed, and what messages it wrote down. The people who look after the software, such as developers and operations engineers, use this information to keep the system healthy.
A car dashboard is telemetry. The speedometer, fuel gauge, and warning lights are your car describing itself to you while you drive. Without them you would only learn about a problem when the engine stops on the highway.
Monitoring versus observability
Monitoring means watching for problems you already know about. You decide in advance, “alert me when the error rate goes above 5 percent.” It answers known questions.
Observability is the ability to understand the inside of a system by looking at the data it gives out, even for problems you never predicted. It lets you ask new questions such as “why are only customers in one region seeing slow checkouts on Tuesday evenings?” The richer and better connected your telemetry is, the more observable your system is.
OpenTelemetry is the foundation that makes good observability possible, because it produces the high-quality raw data that every observability tool depends on.
3Why Software Became Hard to Watch
To appreciate OpenTelemetry, it helps to see the problem it solves.
Twenty years ago, many applications were a single big program on one server. If it broke, you opened one log file and read it. Today, most large systems are built from many small services that talk to each other over the network. This style is called microservices. Services may run in containers, move between machines, appear and disappear in seconds, and be written in different programming languages.
A single user action, like pressing “Pay now,” may pass through a login service, a cart service, a pricing service, a payment service, and a notification service. If the whole action is slow, which service is guilty? The old habit of reading one log file no longer works, because the story is scattered across dozens of places.
flowchart LR
U[User clicks Pay] --> G[API Gateway]
G --> A[Auth Service]
G --> C[Cart Service]
C --> P[Pricing Service]
G --> Y[Payment Service]
Y --> N[Notification Service]
Many beginners believe “more logs” solves everything. Logs alone tell you what each service said, but not how the pieces of one request connect across services. That missing connection is what traces provide.
4A Short History: Two Projects Become One
OpenTelemetry was born from a merger that ended a confusing split.
Before OpenTelemetry, the open-source world had two popular but competing projects. OpenTracing defined a common way to write tracing code, but it was only an interface, with no real implementation. OpenCensus, which came out of Google, offered both tracing and metrics along with working libraries. Developers had to choose between them, and tools often supported one but not the other.
In 2019 the two communities decided that fighting helped nobody and merged their efforts into a single project: OpenTelemetry. It took the best ideas from both and was placed under the CNCF. Since then it has grown into one of the most active projects in the cloud-native world, with contributions from cloud providers, observability vendors, and thousands of individual engineers.
The Proprietary Era
Each monitoring vendor shipped its own agent and format. Switching vendors meant rewriting how your application reported data.
OpenTracing and OpenCensus
Two open efforts appeared, each solving part of the problem, but they were incompatible with each other.
The Merger
The two projects joined to form OpenTelemetry, giving the industry one shared standard to rally around.
Maturity and Adoption
Tracing and metrics became stable in the main languages, logging support matured, and major vendors added native support for the standard format.
5The Three Signals: Traces, Metrics, and Logs
A “signal” is simply a type of telemetry data. OpenTelemetry focuses on three main ones.
Traces
The story of a single request as it travels through your system, step by step, with timing for each step.
Metrics
Numbers measured over time, such as requests per second, memory used, or average response time.
Logs
Timestamped text records of events, such as “payment failed for order 123 because the card expired.”
Baggage
Small pieces of information, like a customer tier, that travel along with a request from service to service.
Picture a package delivery. A trace is the tracking page showing every stop your parcel made. Metrics are the company’s statistics, such as parcels delivered per hour. Logs are the driver’s diary notes, like “nobody home, left a card.”
Each signal answers a different question. Metrics tell you that something is wrong (“errors jumped”). Traces tell you where it is wrong (“the payment step is slow”). Logs tell you why (“the bank rejected the connection”). Used together, they let you move from a vague alert to a precise cause in minutes instead of hours.
| Signal | Best Question It Answers | Typical Example |
|---|---|---|
| Metrics | Is something wrong right now? | Error rate rose to 8 percent |
| Traces | Where in the journey is the problem? | Payment step took 4 seconds |
| Logs | What exactly happened and why? | Card issuer timed out |
6Traces and Spans Explained
Tracing is the signal that makes distributed systems understandable.
A trace represents the complete journey of one request. It is made of smaller pieces called spans. A span is one unit of work, such as “call the pricing service,” “run a database query,” or “send an email.” Every span records when it started, how long it lasted, whether it succeeded, and some descriptive details.
Spans are arranged like a family tree. The first span is the root span, representing the whole request. Inside it, child spans represent the smaller jobs it triggered. Together they form a map that shows exactly where time was spent.
flowchart TD
R[Root span: Checkout request] --> A[Child span: Validate cart]
R --> B[Child span: Charge payment]
B --> B1[Child span: Call bank]
B --> B2[Child span: Save receipt]
R --> C[Child span: Send confirmation]
What a span carries
Name and Timing
A human-readable name plus the start time and duration of the work.
Attributes
Key and value details, like the HTTP method, the page address, or the customer region.
Events
Notable moments inside a span, such as “retry started,” each with its own timestamp.
Status
Whether the work finished fine, ended in an error, or was left unset.
Links
References to other related traces, useful when one job is triggered by many others, like a batch process.
Kind
The role of the span: server, client, producer, consumer, or internal.
When you see a trace drawn as horizontal bars on a timeline (often called a waterfall view), the longest bar is usually your first suspect. Trace tools make slow steps stand out immediately.
7Metrics Explained
Metrics are the cheap, fast, always-on view of system health.
A metric is a number measured repeatedly over time. Because numbers are small to store and quick to add up, metrics are ideal for dashboards and alerts. You can keep months of them without much cost, and you can see trends such as “traffic doubles every Friday.”
OpenTelemetry defines several kinds of measuring tools, called instruments, each suited to a different kind of number.
Counter
A number that only goes up, like total orders placed or total errors seen.
Up-Down Counter
A number that can rise and fall, like the number of people currently in a queue.
Gauge
A snapshot of a value at a moment, like the current temperature or memory in use.
Histogram
A spread of values grouped into buckets, ideal for response times so you can see the slow tail, not just the average.
A counter is a car’s odometer, which only climbs. A gauge is the fuel meter, which shows the level right now. A histogram is a school’s report of how many students scored in each grade band, showing the whole picture rather than one average.
Relying only on averages hides pain. If 95 users get a fast page and 5 wait ten seconds, the average looks fine while some customers suffer. Histograms help you see those slow outliers.
Watch out for too many labels
Metrics can carry labels (called attributes) such as region or service name. Each unique combination creates a separate series of numbers. If you add a label with endless possible values, like a user ID, the number of series explodes, costs rise, and tools slow down. This problem is known as high cardinality, and avoiding it is a core skill.
8Logs and Their Place in OpenTelemetry
Logs are the oldest signal, and OpenTelemetry connects them to the newer ones.
A log is a timestamped record of something that happened. Programmers have written logs for decades, and every language already has favorite logging libraries. OpenTelemetry does not ask you to throw them away. Instead, it provides a way to bridge existing logging into the same pipeline as traces and metrics.
The big benefit is correlation. When a log line automatically carries the identifier of the trace and span that were active when it was written, you can jump from a slow trace straight to the exact log messages from that moment. Without this link, engineers waste time searching through thousands of unrelated lines.
Example: Connecting a Log to a Trace
A customer reports a failed payment. You find the failing trace, see the error on the “Charge payment” span, and click through to the log lines that shared its trace identifier. You read “bank gateway refused connection” and know the cause in under a minute.
Structured logs, where each entry has named fields instead of one long sentence, are much easier for tools to filter and connect to traces than free-form text.
9The Architecture: Main Building Blocks
OpenTelemetry is not one program. It is a set of cooperating pieces.
Specification
The written rulebook describing how every signal should look and behave, so all languages act consistently.
API
The lightweight set of calls your code uses to create spans, record metrics, and emit logs. It does little by itself.
SDK
The real engine behind the API. It decides how data is sampled, batched, processed, and exported.
Instrumentation Libraries
Ready-made add-ons that watch popular frameworks, databases, and web clients so you do not have to write the code yourself.
Collector
A separate program that receives telemetry, cleans it, and forwards it to one or more destinations.
OTLP
The OpenTelemetry Protocol, the shared language used to move telemetry between components.
Why split the API from the SDK?
This design is clever. Library authors, such as the people who build a web framework, can add observability calls using only the tiny API. If the application owner has not installed an SDK, those calls do almost nothing and cost almost nothing. When the owner does install an SDK, the same calls spring to life. This means libraries can be instrumented without forcing a heavy dependency on anyone.
The API is like a light switch on the wall, simple and the same everywhere. The SDK is the wiring and power supply behind it. Builders can install switches in every room without deciding which electric company you will use.
10How Data Flows From App to Dashboard
Follow one piece of telemetry on its complete journey.
flowchart LR
A[Your Application] --> B[OTel API calls]
B --> C[OTel SDK]
C --> D[Exporter using OTLP]
D --> E[OTel Collector]
E --> F[Backend for traces]
E --> G[Backend for metrics]
E --> H[Backend for logs]
Generate
Your application, or an instrumentation library watching it, creates spans, metric readings, and log records through the API.
Process
The SDK attaches helpful context, applies sampling decisions, and groups data into batches so the network is not flooded with tiny messages.
Export
An exporter sends the batches out, usually using OTLP over gRPC or HTTP.
Collect and Transform
The Collector receives the data, can filter or enrich it, and decides where each signal should go next.
Store and Visualize
A backend keeps the data and offers search, charts, and alerts for humans to use.
Batching is an important detail. Sending each span the instant it finishes would create enormous network traffic and slow the application. The SDK collects data in memory for a short time and ships it in groups, trading a tiny delay for much better efficiency.
11Context Propagation: The Secret That Links Everything
This is the idea that turns separate records into one connected story.
When service A calls service B over the network, how does B know it is part of the same journey? The answer is context propagation. Service A attaches a small identifier, containing the trace ID and the ID of the calling span, to the outgoing message. Service B reads it, and starts its own spans as children of that caller. Repeat this across every hop and the whole journey becomes one tree.
OpenTelemetry uses an industry standard called W3C Trace Context for this. The identifier travels in a message header, invisible to users. Because it is a standard, services written in different languages, even by different companies, can still join the same trace.
sequenceDiagram
participant U as User
participant A as Service A
participant B as Service B
participant C as Service C
U->>A: Request
A->>B: Call with trace context
B->>C: Call with same trace context
C-->>B: Response
B-->>A: Response
A-->>U: Final answer
It is like a hospital wristband. Wherever the patient goes, whether the lab, the X-ray room, or the pharmacy, staff scan the same band and add notes to the same patient file. Without the band, each department would create a new, unrelated file.
Broken traces are almost always caused by a gap in propagation, for example a message queue, a gateway, or an older service that drops the header. If your trace suddenly splits into separate pieces, check what sits between the two halves.
12Instrumentation: Automatic and Manual
“Instrumentation” simply means adding the ability to report telemetry to your software.
There are two main ways to do it, and most real projects use both.
Automatic Instrumentation
- Works with little or no change to your code
- Covers common frameworks, web servers, and database clients quickly
- Great for getting started in an afternoon
- Gives a consistent baseline across many services
Manual Instrumentation
- Lets you capture business meaning, such as “discount applied”
- Gives full control over names and attributes
- Needs developer time and ongoing care
- Easy to be inconsistent between teams without guidelines
Automatic instrumentation understands technology: “an HTTP request arrived,” “a database call happened.” Manual instrumentation understands your business: “a loyalty reward was redeemed.” The best approach is to start automatic to get broad coverage fast, then add manual spans and attributes only where business insight is missing.
Zero-Code Approach
For many popular languages, OpenTelemetry offers an agent or launcher that attaches to the application when it starts and instruments supported libraries on its own. Teams can switch it on through configuration, which is ideal for legacy services nobody wants to modify.
Code-Based Approach
Developers use the API inside their own code to create custom spans and metrics that reflect domain concepts, like order value or fraud-check result.
13Resources and Semantic Conventions
Good data needs good labels, and everyone must use the same labels.
A resource describes the thing that produced the telemetry: the service name, its version, the host, the container, the cloud region. Every span, metric, and log from that service carries the same resource details, so you can always answer “which service and which version did this come from?”
Semantic conventions are the agreed naming rules for common attributes. For example, they define standard names for an HTTP method, a database system, or a messaging queue. If every team invented its own names, one team might write “http_method,” another “verb,” and a third “request type,” and no tool could compare them. Shared names make dashboards reusable and queries portable.
Semantic conventions are like the standard labels on food packages: calories, sugar, fat, always in the same place with the same names. Because of the shared format, you can compare any two products at a glance.
Always set a clear service name and version. Telemetry with no service name ends up under a vague default label, making it nearly useless in a busy system.
14The Collector in Depth
The Collector is the Swiss army knife of the OpenTelemetry world.
The OpenTelemetry Collector is a standalone service that sits between your applications and your backends. Applications can send data to it quickly and then forget about it, while the Collector handles the heavy lifting. Inside the Collector, a pipeline is built from three kinds of parts.
Receivers
The doors where data enters. They can accept OTLP and also formats from other popular tools.
Processors
The workshop. They batch data, add or remove attributes, filter noise, and apply sampling.
Exporters
The exits. They send processed data to one or many backends, in whatever format each one expects.
flowchart LR
R1[OTLP Receiver] --> P1[Batch Processor]
R2[Other Format Receiver] --> P1
P1 --> P2[Attribute Processor]
P2 --> E1[Exporter to Tracing Backend]
P2 --> E2[Exporter to Metrics Backend]
Why use a Collector at all?
Applications could export straight to a backend, but a Collector adds real value. It lets you change backends without touching application code, because only the Collector’s exit settings change. It keeps secret credentials out of every application. It can remove sensitive fields in one central place. And it absorbs traffic spikes, protecting applications from slow backends.
The Collector is the post office sorting center. Senders drop letters in one place, workers check addresses, repack bundles, and route each parcel to the correct destination, so senders never need to know every delivery route.
15Collector Deployment Patterns
There is more than one way to place a Collector in your environment.
| Pattern | Where It Runs | Good For | Watch Out For |
|---|---|---|---|
| No Collector | Not used; apps export directly | Small experiments and demos | Backend changes require app changes |
| Agent | Beside each application or on each host | Local batching, adding host details | Many small instances to manage |
| Gateway | A central shared service | Policy, filtering, routing, tail sampling | Needs scaling and high availability |
| Agent plus Gateway | Both layers together | Large production systems | More moving parts to operate |
Many organizations begin with a simple gateway and later add agents as their needs grow. The right choice depends on scale, team skills, and how much central control you want.
16Sampling: Keeping What Matters
Recording every trace in a huge system can be expensive, so teams choose what to keep.
Sampling means keeping only a portion of traces. A busy system may produce millions of traces an hour, and most look boringly alike. Keeping everything costs money for storage and network, while keeping a smart selection preserves the useful stories.
Head Sampling
The decision is made at the very start of a trace, such as “keep one in ten.” It is simple and cheap, but it cannot know yet whether the request will turn out slow or broken.
Tail Sampling
The decision is made after the trace finishes, so you can keep every error and every slow request. It needs more memory and a central place that sees whole traces.
Head sampling is like a bouncer picking every tenth guest at the door without knowing who they are. Tail sampling is like a reporter who waits until the party ends and then keeps only the most interesting stories.
Sampling too aggressively with a purely random rule can throw away the very errors you need. Many teams combine a small random share with a rule that always keeps failures and slow requests.
17OpenTelemetry and Other Tools
People often ask how OpenTelemetry fits with tools they have already heard of.
The key idea is the split between producing data and using data. OpenTelemetry sits on the producing side. Tools for storing and viewing data sit on the using side. Open-source projects for tracing, metrics, and dashboards, plus many commercial observability platforms, can all accept OpenTelemetry data. Check each tool’s documentation for the exact level of support, since coverage and maturity vary by tool and by signal.
| Question | Role of OpenTelemetry | Role of a Backend Tool |
|---|---|---|
| Create spans, metrics, logs? | Yes, this is its main job | No |
| Move data between systems? | Yes, through OTLP and the Collector | Receives it |
| Store data for months? | No | Yes |
| Draw charts and send alerts? | No | Yes |
18Security and Privacy
Telemetry can accidentally carry secrets, so treat it with care.
Telemetry describes what your system does, and sometimes it captures details about users. If a careless setup records a full web address containing a secret token, an email address, or a card number, that private information may end up stored in many places and seen by many people. Good observability must not become a data leak.
Redact Sensitive Data
Remove or mask personal and secret values before data leaves your network, ideally in the Collector.
Encrypt in Transit
Use secure connections between applications, Collectors, and backends so nobody can read data on the wire.
Control Access
Use authentication on Collector endpoints and limit who can view data in the backend.
Limit What You Record
Record only attributes you truly need. Data never collected can never leak.
Problem
Teams attach whole request contents, such as user names, emails, or payment details, to spans so that debugging feels easier.
Why It’s Harmful
Sensitive information spreads into storage systems with weaker protection, creating legal and trust risks and making cleanup extremely hard.
Correct Approach
Record safe identifiers instead of raw personal data, and apply redaction rules centrally so one mistake in one service cannot expose everything.
19Advantages and Trade-offs
No technology is perfect. Here is an honest balance sheet.
Advantages
- Vendor neutral, so you can change backends without rewriting application code
- One standard for traces, metrics, and logs instead of separate tools
- Wide language support and a large community
- Shared naming rules that make data comparable across teams
- Collector gives central control over filtering, routing, and security
- Supported by many cloud providers and vendors
Disadvantages / Trade-offs
- Maturity differs between languages and between signals, so check before committing
- Telemetry adds some overhead in CPU, memory, and network
- The Collector is another component to deploy, secure, and scale
- It does not give you dashboards by itself; you still need a backend
- Poor naming and high-cardinality labels can make costs and confusion grow
20Best Practices and Common Mistakes
A few habits make the difference between useful telemetry and expensive noise.
Start with the questions
Decide what you need to know, such as slow checkouts or failing logins, and instrument for those questions first.
Begin with automatic instrumentation
Get broad coverage quickly, then add manual detail where the business story is missing.
Name things consistently
Follow semantic conventions and agree on team rules for custom names so data stays comparable.
Use a Collector
Centralize routing, redaction, and sampling so applications stay simple and backends stay replaceable.
Control cost
Sample thoughtfully, avoid high-cardinality labels, and review what you collect from time to time.
Problem
A team instruments absolutely everything, creating a span for every tiny internal function.
Why It’s Harmful
Traces become cluttered and enormous, performance suffers, storage bills climb, and the important steps are buried in noise.
Correct Approach
Create spans for meaningful units of work, such as network calls, database queries, and key business steps, and leave trivial internals alone.
21Real-World Scenarios
See how the pieces help in everyday situations.
Online Shop with Slow Checkout
Customers complain that paying takes too long. A trace shows the payment call to an outside bank taking most of the time. The team adds a timeout and a retry rule, and the metric for checkout time drops back to normal.
Streaming Service During a Big Event
Traffic surges when a popular show launches. Metrics show request volume and memory climbing, alerting engineers early. Traces reveal one recommendation service struggling, so they scale just that piece rather than the entire platform.
Bank Migrating Between Vendors
A bank wants to switch observability vendors. Because its applications already speak OTLP through a Collector, the team changes only the Collector’s export settings and the move happens without touching hundreds of services.
Mixed-Language Platform
A company has services written in several languages. Using one standard, all of them produce compatible traces, so a single request can be followed from a mobile app backend written in one language to a legacy service written in another.
22A Simple Adoption Roadmap
You do not need to do everything at once. Grow step by step.
Pilot one service
Pick a single important service, turn on automatic instrumentation, and send data to a backend you already have.
Add a Collector
Place a gateway Collector between the service and the backend to gain flexibility and central control.
Spread to more services
Roll the same approach to neighboring services, checking that traces connect across the boundaries.
Enrich with business detail
Add manual spans, metrics, and attributes that answer your real business questions.
Tune and govern
Introduce sampling, redaction rules, naming guidelines, and cost reviews so the system stays healthy over time.
23Frequently Asked Questions
No. OpenTelemetry produces and delivers data. You still need a backend to store the data and show it. Think of OpenTelemetry as the supply pipe and the backend as the tap and sink.
No. Many teams start with traces or metrics alone and add the others later. The signals work best together, but you can adopt them gradually.
Any telemetry adds a little overhead, but batching, sampling, and sensible instrumentation keep it small for most applications. It is wise to test in a realistic environment and measure the effect on your own workload.
It is optional, since applications can export directly to a backend. However, most production setups use one because it makes changing backends, filtering data, and protecting secrets much easier.
OTLP is the OpenTelemetry Protocol, the standard format and transport used to send traces, metrics, and logs between applications, Collectors, and backends. It typically runs over gRPC or HTTP.
Yes. OpenTelemetry provides ways to connect existing loggers to its pipeline so log lines can carry trace identifiers without a full rewrite.
A span is a single piece of work with a start and an end. A trace is the whole collection of related spans that together describe one request’s journey.
It shines in distributed systems, but even a single application benefits from metrics, logs, and traces of its internal steps, such as database calls and outside requests.
Yes. It runs equally well on your own servers, in containers, in virtual machines, or in any cloud, because it is just software and open standards.
24Summary and Key Takeaways
OpenTelemetry gives software a common voice. Instead of every tool inventing its own way for applications to report their health, there is now one open standard for traces, metrics, and logs. Applications use a small API, an SDK does the processing, a Collector routes the data, and the shared protocol carries it to whichever backend you choose. The result is clearer insight into complex systems, freedom to change tools, and a faster path from “something is wrong” to “here is exactly why.”
You do not need to master everything on day one. Begin with one service, enable automatic instrumentation, connect a Collector, and grow from there. Each step makes your system a little easier to understand, and understanding is the first step toward reliability.
Key Takeaways
- OpenTelemetry is a standard, not a dashboard — it generates and delivers telemetry, while backends store and display it.
- Three signals work together — metrics show that something is wrong, traces show where, and logs explain why.
- Context propagation connects everything — a trace identifier travels with each request so separate services join one story.
- API and SDK are separate on purpose — libraries stay lightweight while applications choose the real engine.
- The Collector adds control — it centralizes routing, filtering, redaction, and sampling, and keeps backends swappable.
- Consistency and care matter — follow semantic conventions, avoid high-cardinality labels, and keep sensitive data out of telemetry.
- Grow gradually — start automatic on one service, then add business detail, sampling, and governance as you learn.