Full lesson
Explore the full explanation, examples, and visuals at your own pace.
Part 1
A pipeline connects a receiver to an exporter. The receiver, here otlp, takes data in from your app. The exporter, otlp_grpc, sends it out to a backend. Between them, processors can change the data, but they're optional. That's the whole path telemetry follows through the Collector.
config.yaml: defining components
Here we define two components. The otlp receiver listens for gRPC on port 4317 and HTTP on port 4318. The otlp_grpc exporter sends data onward to otelcol on port 4317. But configuring them doesn't enable them. They stay off until a pipeline uses them.
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
exporters:
otlp_grpc:
endpoint: otelcol:4317
sending_queue:
batch:service section: turning components on
The service section is where components actually get turned on. Each pipeline is named for a signal type: traces, metrics, or logs. Inside, receivers and exporters just point to names defined earlier, otlp and otlp_grpc. That reference is what enables them. Without it, they stay configured but off.
service:
pipelines:
traces:
receivers: [otlp]
exporters: [otlp_grpc]
metrics:
receivers: [otlp]
exporters: [otlp_grpc]
logs:
receivers: [otlp]
exporters: [otlp_grpc]One receiver, three pipelines
One otlp receiver feeds three separate pipelines: traces, metrics and logs. All three send to the same otlp_grpc exporter. You define each component once, then reuse it. The sections only define components. The service pipelines are what plug them together.
Processors run in the order listed
Processors sit between the receiver and the exporter, and their order matters. Here, data from otlp hits memory_limiter first, then filter, and only then goes to otlp_grpc. The list order is the processing order. If you reuse a processor in another pipeline, that pipeline gets its own separate instance.
type[/name]: a second traces pipeline
Need a second receiver or exporter? Add a slash and a name. Here otlp/2 is another otlp receiver, listening on port 55690. otlp_grpc/2 sends to otelcol2. The traces/2 pipeline wires them together, separate from traces. Each identifier just has to be unique.
receivers:
otlp/2:
protocols:
grpc:
endpoint: 0.0.0.0:55690
exporters:
otlp_grpc/2:
endpoint: otelcol2:4317
service:
pipelines:
traces/2:
receivers: [otlp/2]
exporters: [otlp_grpc/2]Connector: exporter for one pipeline, receiver for another
A connector sits between two pipelines. Here, the count connector is listed as the exporter of the traces pipeline, and as the receiver of the metrics pipeline. It turns matching span events into a metric called my.prod.event.count. Notice that the original traces aren't exported anywhere in this example.
Your first config
Define your components in their sections, then wire them together in the service pipelines. Anything you define but don't list stays off. Before you start the Collector, run otelcol validate --config=customconfig.yaml to catch incomplete configs early.
- Define components in their sections
- List them in service pipelines
- Check with otelcol validate
