Skip to content

Collector on a VM

This page installs the upstream OpenTelemetry Collector (otelcol-contrib) on a Linux machine from the official packages. It runs as a systemd service, receives OTLP from apps on the machine and forwards it to FuseScope.

Use this page when your apps run on a virtual machine or bare-metal server, outside Docker and Kubernetes, or when you want host metrics from that machine.

For why a local collector helps (batching, retries, enrichment, one egress point), see Collector on Docker.

Packages are published on the opentelemetry-collector-releases page. This example pins 0.139.0 on amd64; use arm64 in the file name for ARM machines.

Terminal window
curl -fLO https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.139.0/otelcol-contrib_0.139.0_linux_amd64.deb
sudo dpkg -i otelcol-contrib_0.139.0_linux_amd64.deb

The deb and rpm packages set up:

Item Value
Binary /usr/bin/otelcol-contrib
systemd service otelcol-contrib, enabled and started on install
Config file /etc/otelcol-contrib/config.yaml (a sample; kept on upgrade)
Options file /etc/otelcol-contrib/otelcol-contrib.conf, sets OTELCOL_OPTIONS
User otelcol-contrib, a system user without a shell

Replace the sample /etc/otelcol-contrib/config.yaml. This is the same base config as on Docker, with OTLP bound to localhost so only apps on this machine can send:

/etc/otelcol-contrib/config.yaml
receivers:
otlp:
protocols:
grpc:
endpoint: localhost:4317
http:
endpoint: localhost:4318
processors:
memory_limiter:
check_interval: 1s
limit_percentage: 80
spike_limit_percentage: 25
batch: {}
exporters:
otlphttp:
endpoint: http://fusescope-collector.example.com:4318
extensions:
health_check:
endpoint: localhost:13133
service:
extensions: [health_check]
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]
  • Replace fusescope-collector.example.com with your FuseScope collector address; see From outside the cluster. Self-hosted FuseScope needs no ingestion key.
  • To accept data from other machines, use 0.0.0.0:4317 and 0.0.0.0:4318, and restrict access with a firewall: the receivers have no authentication.
  • Point apps on the machine at http://localhost:4318 with OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf, or http://localhost:4317 with grpc.

Command-line flags go in /etc/otelcol-contrib/otelcol-contrib.conf:

/etc/otelcol-contrib/otelcol-contrib.conf
OTELCOL_OPTIONS="--config=/etc/otelcol-contrib/config.yaml"

The service reads this file as its systemd EnvironmentFile. Variables you add there are also available in the config as ${env:NAME}.

  1. Validate the config:

    Terminal window
    sudo -u otelcol-contrib otelcol-contrib validate --config=/etc/otelcol-contrib/config.yaml
  2. Restart the service and check its state:

    Terminal window
    sudo systemctl restart otelcol-contrib
    sudo systemctl status otelcol-contrib
  3. Read its logs:

    Terminal window
    sudo journalctl -u otelcol-contrib -f

    Look for Everything is ready. Begin running and processing data. Export errors, such as connection refused, also appear here.

  4. Check the health endpoint:

    Terminal window
    curl http://localhost:13133/
  5. If data still doesn’t show in FuseScope, add the debug exporter (verbosity: detailed) to a pipeline, restart, and watch the journal to see what the collector receives. See Collector on Docker.

Install the newer package the same way. Your config.yaml and otelcol-contrib.conf are kept, and the service restarts.