Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
$ als gewone gebruiker# als root (of met sudo)
Know it before you install
A pipeline = receivers (how data comes in) → processors (change it) → exporters (where it goes), one pipeline per signal (traces, metrics, logs). Extensions add health checks and debugging. Apps send with the OTLP protocol (gRPC 4317, HTTP 4318).
| Item | Value |
|---|---|
| Distributions | otelcol (core) and **otelcol-contrib** (many more receivers/exporters — use this one) |
| Packages | .rpm / .deb from github.com/open-telemetry/opentelemetry-collector-releases/releases |
| Service | otelcol-contrib.service |
| Config | /etc/otelcol-contrib/config.yaml |
| Ports | 4317 (OTLP gRPC), 4318 (OTLP HTTP), 13133 (health), 8888 (own metrics) |
| In Kubernetes | Helm chart open-telemetry/opentelemetry-collector or the OTel Operator |
Install on RHEL and Ubuntu
Choose the version from the releases page:
OVER=0.138.0
curl -fsSLO https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v$OVER/otelcol-contrib_${OVER}_linux_amd64.rpm
dnf -y install ./otelcol-contrib_${OVER}_linux_amd64.rpm
curl -fsSLO https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v$OVER/otelcol-contrib_${OVER}_linux_amd64.deb
apt-get install -y ./otelcol-contrib_${OVER}_linux_amd64.deb
otelcol-contrib --version
systemctl status otelcol-contrib --no-pager(Use the .rpm lines on RHEL, the .deb lines on Ubuntu.)
First configuration: one pipeline for all signals
Apps send OTLP; the host sends its own metrics and logs; traces go to Tempo/Jaeger, metrics to Prometheus, logs to Loki:
extensions:
health_check:
endpoint: 127.0.0.1:13133
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
hostmetrics:
collection_interval: 30s
scrapers:
cpu: {}
memory: {}
disk: {}
filesystem: {}
network: {}
load: {}
filelog:
include: [/var/log/nginx/access.log]
start_at: end
processors:
memory_limiter:
check_interval: 1s
limit_percentage: 80
spike_limit_percentage: 20
resourcedetection:
detectors: [env, system]
attributes/scrub:
actions:
- key: http.request.header.authorization
action: delete
- key: user.email
action: hash
batch: {}
exporters:
otlphttp/tempo:
endpoint: http://tempo.example.com:4318
prometheusremotewrite:
endpoint: http://prometheus.example.com:9090/api/v1/write
otlphttp/loki:
endpoint: http://loki.example.com:3100/otlp
debug:
verbosity: basic
service:
extensions: [health_check]
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, resourcedetection, attributes/scrub, batch]
exporters: [otlphttp/tempo]
metrics:
receivers: [otlp, hostmetrics]
processors: [memory_limiter, resourcedetection, batch]
exporters: [prometheusremotewrite]
logs:
receivers: [otlp, filelog]
processors: [memory_limiter, resourcedetection, attributes/scrub, batch]
exporters: [otlphttp/loki]| Part | Why |
|---|---|
memory_limiter first | Refuses data before the Collector runs out of memory. |
batch last | Sends data in batches — fewer, bigger requests. |
resourcedetection | Adds host.name and environment attributes to everything. |
attributes/scrub | Deletes or hashes sensitive fields before data leaves. |
| One pipeline per signal | Traces, metrics and logs can go to different backends. |
(Prometheus must accept remote write: start it with --web.enable-remote-write-receiver. Loki 3 accepts OTLP on /otlp.)
Check and start; open 4317/4318 only for app networks:
otelcol-contrib validate --config /etc/otelcol-contrib/config.yaml
usermod -aG adm otelcol-contrib
systemctl restart otelcol-contrib
curl -s http://127.0.0.1:13133/
{"status":"Server available", …}
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.1.0/24" port port="4317-4318" protocol="tcp" accept'
firewall-cmd --reload(adm lets the Collector user read /var/log files on Ubuntu; on RHEL check the file group and modes.)
Send data from an app
Most languages have OTel SDKs and auto-instrumentation. Only environment variables are needed:
export OTEL_SERVICE_NAME=shop-api
export OTEL_RESOURCE_ATTRIBUTES=deployment.environment=prod
export OTEL_EXPORTER_OTLP_ENDPOINT=http://otel.example.com:4318
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
pip install opentelemetry-distro opentelemetry-exporter-otlp
opentelemetry-bootstrap -a install
opentelemetry-instrument python app.pyDaily use: the commands and the real uses
journalctl -u otelcol-contrib -f
curl -s http://127.0.0.1:8888/metrics | grep -E 'otelcol_(receiver_accepted|exporter_sent|exporter_send_failed)_' | head
curl -s http://127.0.0.1:13133/
otelcol-contrib validate --config /etc/otelcol-contrib/config.yaml
otelcol-contrib components | head -40Add the debug exporter to a pipeline for a few minutes to see what arrives in the log.
Real uses at work:
- One agent per host (or a DaemonSet in Kubernetes) plus a central gateway Collector.
- Vendor freedom: switch from one APM/observability vendor to another by changing exporters.
- Data hygiene: remove secrets and personal data, drop noisy spans, sample traces (
tail_sampling).
Make it safe
Security checklist:
- OTLP ports only from app networks; TLS (and auth with the
bearertokenauthoroidcextension) when data crosses networks. - Scrub sensitive attributes (tokens, cookies, emails) in the Collector.
memory_limiterin every pipeline; watchotelcol_exporter_send_failed_*.- Health and metrics endpoints on localhost or the monitoring network only.
- Pin the Collector version; read the changelog (components change between versions).
Update and remove
Install the new .rpm/.deb the same way (dnf install ./… / apt install ./…), then validate the config and restart. Remove: dnf remove otelcol-contrib / apt purge otelcol-contrib.
Fix common problems
| Problem | Cause | Fix |
|---|---|---|
Service does not start: 'exporters' unknown type | The component is not in this distribution (core vs contrib). | Use otelcol-contrib; otelcol-contrib components. |
validate fails | YAML indentation, or a component used in a pipeline but not defined. | Read the error line; every name in pipelines must exist above. |
| No data from apps | Wrong endpoint/port/protocol (gRPC 4317 vs HTTP 4318), or firewall. | Match OTEL_EXPORTER_OTLP_PROTOCOL and the port; test with curl -v http://HOST:4318/v1/traces. |
data refused due to high memory usage | memory_limiter protecting the process. | More memory, smaller batches, sampling; check the backend is fast enough. |
| Exporter errors 4xx/5xx | Backend URL, auth or format wrong. | Read the log; check the backend endpoint (for example /otlp for Loki, remote write enabled in Prometheus). |
permission denied reading log files | The Collector user can not read them. | Add it to the right group; check modes. |
Next steps
- Quick how-tos: Trace requests with OpenTelemetry.
- Command page: otelcol.
- At work: One pipeline for all signals, OTel in DevOps.
- The backends: Jaeger, Prometheus, Loki, Grafana.
1Why is memory_limiter the first processor?
It must refuse data before other processors use memory, so the Collector does not crash.
2How do apps find the Collector without code changes?
With environment variables like OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_SERVICE_NAME plus auto-instrumentation.