Skip to content

macOS Installation

Install the OpenTelemetry Collector on macOS as a LaunchDaemon (system-wide) or LaunchAgent (user-level).

Prerequisites

Quick Start

Run the following command to install the collector with default configuration:

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

Environment Variables

Required Variables

VariableRequiredDescription
CORALOGIX_PRIVATE_KEYYesYour Coralogix Send-Your-Data API key
CORALOGIX_MACOS_USER_AGENTNoSet to true to install as user-level LaunchAgent (default: system-wide LaunchDaemon)

Automatically Set Variables

The installer automatically sets these environment variables for the collector service:
VariableDefaultDescription
OTEL_MEMORY_LIMIT_MIB512Memory limit in MiB (set via --memory-limit flag)
OTEL_LISTEN_INTERFACE127.0.0.1Network interface for receivers (set via --listen-interface flag)

To use these in your configuration file:

processors:
  memory_limiter:
    limit_mib: ${env:OTEL_MEMORY_LIMIT_MIB:-512}

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

Note: Supervisor mode is not supported on macOS.

macOS LaunchAgent (User-Level)

Install as a user-level agent that runs at login (instead of system-wide at boot):

CORALOGIX_MACOS_USER_AGENT="true" CORALOGIX_PRIVATE_KEY="<your-private-key>" \
  bash -c "$(curl -sSL https://github.com/coralogix/telemetry-shippers/releases/latest/download/coralogix-otel-collector.sh)"

Install with Custom Configuration

To install with your own configuration file:

CORALOGIX_PRIVATE_KEY="<your-private-key>" \
  bash -c "$(curl -sSL https://github.com/coralogix/telemetry-shippers/releases/latest/download/coralogix-otel-collector.sh)" \
  -- --config /path/to/config.yaml

Install Specific Version

CORALOGIX_PRIVATE_KEY="<your-private-key>" \
  bash -c "$(curl -sSL https://github.com/coralogix/telemetry-shippers/releases/latest/download/coralogix-otel-collector.sh)" \
  -- --version 0.140.1

Install with Custom Memory Limit

CORALOGIX_PRIVATE_KEY="<your-private-key>" \
  bash -c "$(curl -sSL https://github.com/coralogix/telemetry-shippers/releases/latest/download/coralogix-otel-collector.sh)" \
  -- --memory-limit 2048

Note: Your configuration must reference ${env:OTEL_MEMORY_LIMIT_MIB} for this to take effect.

Install as Gateway (Listen on All Interfaces)

CORALOGIX_PRIVATE_KEY="<your-private-key>" \
  bash -c "$(curl -sSL https://github.com/coralogix/telemetry-shippers/releases/latest/download/coralogix-otel-collector.sh)" \
  -- --listen-interface 0.0.0.0

Note: Your configuration must reference ${env:OTEL_LISTEN_INTERFACE} for this to take effect.

Script Options

OptionDescription
-v, --version <version>Install specific collector version
-c, --config <path>Path to custom configuration file
-u, --upgradeUpgrade existing installation (preserves config)
--memory-limit <MiB>Total memory in MiB to allocate to the collector (default: 512)
--listen-interface <ip>Network interface for receivers to listen on (default: 127.0.0.1). Use 0.0.0.0 for all interfaces (gateway mode)
--uninstallRemove the collector (keeps config)
--uninstall --purgeRemove the collector and all configuration
-h, --helpShow help message

Note: --memory-limit sets the OTEL_MEMORY_LIMIT_MIB environment variable. Your configuration must reference ${env:OTEL_MEMORY_LIMIT_MIB} for this to take effect.

Note: --listen-interface sets the OTEL_LISTEN_INTERFACE environment variable. Your configuration must reference ${env:OTEL_LISTEN_INTERFACE} for this to take effect.

Installation Locations

ComponentLaunchDaemon (system-wide)LaunchAgent (user-level)
Binary/usr/local/bin/otelcol-contrib/usr/local/bin/otelcol-contrib
Configuration/etc/otelcol-contrib/config.yaml/etc/otelcol-contrib/config.yaml
Plist/Library/LaunchDaemons/com.coralogix.otelcol.plist~/Library/LaunchAgents/com.coralogix.otelcol.plist
Logs/var/log/otel-collector/otel-collector.log~/Library/Logs/otel-collector/otel-collector.log

Service Management

LaunchDaemon (System-Wide)

# Check status
sudo launchctl list | grep otelcol

# View logs
tail -f /var/log/otel-collector/otel-collector.log

# Restart
sudo launchctl bootout system /Library/LaunchDaemons/com.coralogix.otelcol.plist
sudo launchctl bootstrap system /Library/LaunchDaemons/com.coralogix.otelcol.plist

LaunchAgent (User-Level)

# Check status
launchctl list | grep otelcol

# View logs
tail -f ~/Library/Logs/otel-collector/otel-collector.log

# Restart
launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/com.coralogix.otelcol.plist
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.coralogix.otelcol.plist

Upgrade

Upgrade the collector while preserving your existing configuration:

CORALOGIX_PRIVATE_KEY="<your-private-key>" \
  bash -c "$(curl -sSL https://github.com/coralogix/telemetry-shippers/releases/latest/download/coralogix-otel-collector.sh)" \
  -- --upgrade

To upgrade and replace the configuration:

CORALOGIX_PRIVATE_KEY="<your-private-key>" \
  bash -c "$(curl -sSL https://github.com/coralogix/telemetry-shippers/releases/latest/download/coralogix-otel-collector.sh)" \
  -- --upgrade --config /path/to/new-config.yaml

Uninstall

Remove the collector while keeping configuration and logs:

bash coralogix-otel-collector.sh --uninstall

Remove the collector and all data:

bash coralogix-otel-collector.sh --uninstall --purge

Configuration Behavior

ScenarioAction
Fresh installCreates default empty config
Config existsPreserves existing config
With --configUses provided config
Upgrade (--upgrade)Preserves existing config

Environment Variables in Configuration

The installer automatically sets OTEL_MEMORY_LIMIT_MIB and OTEL_LISTEN_INTERFACE environment variables for the collector service. To use them in your custom configuration:

  • Memory Limiter: limit_mib: ${env:OTEL_MEMORY_LIMIT_MIB:-512}
  • Receiver Endpoint: endpoint: ${env:OTEL_LISTEN_INTERFACE:-127.0.0.1}:4317

The installer will warn you if you specify --memory-limit or --listen-interface but your configuration doesn't reference these variables.

Troubleshooting

Service fails to start

  1. Check plist exists: ls -la /Library/LaunchDaemons/com.coralogix.otelcol.plist
  2. Check logs: tail -f /var/log/otel-collector/otel-collector.log
  3. Validate config: /usr/local/bin/otelcol-contrib validate --config /etc/otelcol-contrib/config.yaml