Snippets · Sources
Receive OTLP over gRPC and HTTP
The front door of a pipeline. Accept OTLP from application SDKs and from other collectors, on both transports, for traces, metrics and logs.
- Category
- Collection
- Source
- OTLP
- Destination
- OTLP/HTTP endpoint
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
processors:
memory_limiter:
check_interval: 1s
limit_percentage: 80
batch: {}
exporters:
otlphttp:
endpoint: https://your-backend:4318
service:
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlphttp]
metrics:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlphttp]
logs:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlphttp]
// stability: generally-available — runs on a default Alloy install.
otelcol.receiver.otlp "default" {
grpc {
endpoint = "0.0.0.0:4317"
}
http {
endpoint = "0.0.0.0:4318"
}
output {
traces = [otelcol.processor.memory_limiter.default.input]
metrics = [otelcol.processor.memory_limiter.default.input]
logs = [otelcol.processor.memory_limiter.default.input]
}
}
otelcol.processor.memory_limiter "default" {
check_interval = "1s"
limit_percentage = 80
output {
traces = [otelcol.processor.batch.default.input]
metrics = [otelcol.processor.batch.default.input]
logs = [otelcol.processor.batch.default.input]
}
}
otelcol.processor.batch "default" {
output {
traces = [otelcol.exporter.otlphttp.default.input]
metrics = [otelcol.exporter.otlphttp.default.input]
logs = [otelcol.exporter.otlphttp.default.input]
}
}
otelcol.exporter.otlphttp "default" {
client {
endpoint = "https://your-backend:4318"
}
}
Complete config files, each checked with the tool's own validate command (otelcol-contrib v0.161.0, Grafana Alloy v1.19.2). Replace https://your-backend:4318 with your own OTLP endpoint before you run it.
The gotcha
The bind address decides who can reach it. Bound to localhost, other containers cannot connect; bound to 0.0.0.0 without TLS, anyone who can reach the port can send to it. This config binds 0.0.0.0, so put it behind your network controls or add TLS.
Skip the YAML on every host
LinkMesh has this job built in as the OTLP gRPC and OTLP HTTP source templates: activate it on a collector from the control plane instead of editing config files host by host. The first 25 Collectors are free after a no-card registration in the OpenSight Customer Portal (5 without one).
Related snippets
- Receive syslog (RFC 5424 and RFC 3164)Accept modern and legacy syslog on one collector, from network gear and hosts that speak nothing else.
- Tail a log fileShip an application log file to your backend, and keep your place in it across collector restarts.
- memory_limiter and batch, in the right orderThe two processors every pipeline needs, so a traffic spike neither kills the collector nor floods the backend.
- Prove data is flowing with the debug exporterThe first thing to reach for when nothing arrives: print what the collector actually receives.