Skip to content

Docker Installation

Deploy the OpenTelemetry Collector in Docker with Coralogix integration.

Overview

This script runs the Coralogix OpenTelemetry Collector as a Docker container, supporting: - Regular mode: Local configuration file - Supervisor mode: Remote configuration via Fleet Management

Prerequisites

Quick Start

Regular Mode

CORALOGIX_PRIVATE_KEY="<your-private-key>" \
  bash -c "$(curl -sSL https://github.com/coralogix/telemetry-shippers/releases/latest/download/docker-install.sh)" \
  -- --config /path/to/config.yaml
VariableDescription
CORALOGIX_PRIVATE_KEYYour Coralogix Send-Your-Data API key

Supervisor Mode (Fleet Management)

CORALOGIX_DOMAIN="<your-domain>" CORALOGIX_PRIVATE_KEY="<your-private-key>" \
  bash -c "$(curl -sSL https://github.com/coralogix/telemetry-shippers/releases/latest/download/docker-install.sh)" \
  -- --supervisor

Environment Variables

Required Variables

VariableRequiredDescription
CORALOGIX_PRIVATE_KEYYesCoralogix Send-Your-Data API key
CORALOGIX_DOMAINSupervisor onlyCoralogix domain

Optional Variables

VariableDefaultDescription
OTLP_GRPC_PORT4317Host port for OTLP gRPC
OTLP_HTTP_PORT4318Host port for OTLP HTTP
HEALTH_CHECK_PORT13133Host port for health check
MEMORY_LIMIT_MIB512Memory limit in MiB for the collector
LISTEN_INTERFACE127.0.0.1Network interface for receivers to bind to

Configuration Environment Variables

The collector configuration can reference these environment variables:

  • ${env:OTEL_MEMORY_LIMIT_MIB} - Memory limit for the memory_limiter processor
  • ${env:OTEL_LISTEN_INTERFACE} - Network interface for receiver endpoints

Example configuration:

processors:
  memory_limiter:
    check_interval: 5s
    limit_mib: ${env:OTEL_MEMORY_LIMIT_MIB:-512}

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: ${env:OTEL_LISTEN_INTERFACE:-127.0.0.1}:4317
      http:
        endpoint: ${env:OTEL_LISTEN_INTERFACE:-127.0.0.1}:4318

extensions:
  health_check:
    endpoint: ${env:OTEL_LISTEN_INTERFACE:-127.0.0.1}:13133

Notes: - MEMORY_LIMIT_MIB controls the collector's memory usage to prevent OOM kills - LISTEN_INTERFACE determines network binding: - 127.0.0.1 (default): Local only, suitable for agent mode - 0.0.0.0: All interfaces, suitable for gateway mode - Specific IP: Bind to a particular network interface

Script Options

OptionDescription
-v, --version <version>Default version (default: from Helm chart)
--collector-version <version>Collector image version
--supervisor-version <version>Supervisor image version
-c, --config <path>Path to custom configuration file
-s, --supervisorUse supervisor mode
-f, --foregroundRun in foreground (default: detached)
--uninstallStop and remove the container
-h, --helpShow help message

Container Images

ModeImage
Regularotel/opentelemetry-collector-contrib
Supervisorcoralogixrepo/otel-supervised-collector

Exposed Ports

PortPurposeOverride
4317OTLP gRPC receiverOTLP_GRPC_PORT
4318OTLP HTTP receiverOTLP_HTTP_PORT
13133Health check endpointHEALTH_CHECK_PORT

If ports conflict with existing services, override them:

OTLP_GRPC_PORT=14317 OTLP_HTTP_PORT=14318 CORALOGIX_PRIVATE_KEY="<your-private-key>" \
  ./docker-install.sh --config config.yaml

Examples

Basic Usage

## With custom config (recommended)
CORALOGIX_PRIVATE_KEY="<your-private-key>" ./docker-install.sh --config /path/to/config.yaml

## Specific version
CORALOGIX_PRIVATE_KEY="<your-private-key>" ./docker-install.sh --config config.yaml --version 0.140.1

## Supervisor mode
CORALOGIX_DOMAIN="eu2.coralogix.com" CORALOGIX_PRIVATE_KEY="<your-private-key>" ./docker-install.sh --supervisor

## Run in foreground
CORALOGIX_PRIVATE_KEY="<your-private-key>" ./docker-install.sh --config config.yaml --foreground

Gateway Mode with Custom Memory

## Gateway mode with 2GB memory limit and listen on all interfaces
MEMORY_LIMIT_MIB=2048 LISTEN_INTERFACE=0.0.0.0 \
  CORALOGIX_PRIVATE_KEY="<your-private-key>" \
  ./docker-install.sh --config gateway-config.yaml

Custom Ports

## Use non-default ports to avoid conflicts
OTLP_GRPC_PORT=14317 OTLP_HTTP_PORT=14318 \
  CORALOGIX_PRIVATE_KEY="<your-private-key>" \
  ./docker-install.sh --config config.yaml

Supervisor Mode with Custom Settings

## Supervisor mode with custom memory limit
MEMORY_LIMIT_MIB=1024 LISTEN_INTERFACE=0.0.0.0 \
  CORALOGIX_DOMAIN="eu2.coralogix.com" \
  CORALOGIX_PRIVATE_KEY="<your-private-key>" \
  ./docker-install.sh --supervisor

Management Commands

## Stop and remove
./docker-install.sh --uninstall

Container Management

## View logs
docker logs -f coralogix-otel-collector

## Check status
docker ps | grep coralogix-otel-collector

## Health check
curl -s http://localhost:13133/health

## Restart
docker restart coralogix-otel-collector

## Stop and remove
docker stop coralogix-otel-collector && docker rm coralogix-otel-collector

Upgrade

Running the script again automatically replaces the existing container with the new version:

## Upgrade to latest
CORALOGIX_PRIVATE_KEY="<your-private-key>" ./docker-install.sh --config config.yaml

## Upgrade to specific version
CORALOGIX_PRIVATE_KEY="<your-private-key>" ./docker-install.sh --config config.yaml --version 0.141.0

## Upgrade and change memory limit
MEMORY_LIMIT_MIB=2048 CORALOGIX_PRIVATE_KEY="<your-private-key>" \
  ./docker-install.sh --config config.yaml

Note: You can change environment variables (like MEMORY_LIMIT_MIB or LISTEN_INTERFACE) during an upgrade by setting them when running the script again.

Uninstall

./docker-install.sh --uninstall

Or manually:

docker stop coralogix-otel-collector && docker rm coralogix-otel-collector

Notes

  • Config storage: Config files are stored in ~/.coralogix-otel-collector/ and persist across reboots
  • Regular mode: Requires a config file (--config). Without it, uses a placeholder config with nop receivers/exporters
  • Supervisor mode: Config is managed remotely via Coralogix Fleet Management. The --config flag is ignored in supervisor mode with a warning
  • Port conflicts: Script checks for port availability before starting and provides clear error messages
  • Environment variables: Configuration files should use environment variable substitution (e.g., ${env:OTEL_MEMORY_LIMIT_MIB}) to leverage the script's environment variable support
  • Memory management: The MEMORY_LIMIT_MIB environment variable helps prevent OOM kills by configuring the memory_limiter processor
  • Network binding: Use LISTEN_INTERFACE=0.0.0.0 for gateway mode (accepts external connections) or 127.0.0.1 for agent mode (local only)
  • Container name: coralogix-otel-collector
  • Container restarts automatically unless stopped (--restart unless-stopped)