macOS Installation
Install the OpenTelemetry Collector on macOS as a LaunchDaemon (system-wide) or LaunchAgent (user-level).
Prerequisites
- macOS (Intel or Apple Silicon)
curlandtarcommands- Root/sudo access
- Coralogix Send-Your-Data API key
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
| Variable | Required | Description |
|---|---|---|
| CORALOGIX_PRIVATE_KEY | Yes | Your Coralogix Send-Your-Data API key |
| CORALOGIX_MACOS_USER_AGENT | No | Set 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:
| Variable | Default | Description |
|---|---|---|
| OTEL_MEMORY_LIMIT_MIB | 512 | Memory limit in MiB (set via --memory-limit flag) |
| OTEL_LISTEN_INTERFACE | 127.0.0.1 | Network 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
| Option | Description |
|---|---|
-v, --version <version> | Install specific collector version |
-c, --config <path> | Path to custom configuration file |
-u, --upgrade | Upgrade 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) |
--uninstall | Remove the collector (keeps config) |
--uninstall --purge | Remove the collector and all configuration |
-h, --help | Show help message |
Note:
--memory-limitsets theOTEL_MEMORY_LIMIT_MIBenvironment variable. Your configuration must reference${env:OTEL_MEMORY_LIMIT_MIB}for this to take effect.Note:
--listen-interfacesets theOTEL_LISTEN_INTERFACEenvironment variable. Your configuration must reference${env:OTEL_LISTEN_INTERFACE}for this to take effect.
Installation Locations
| Component | LaunchDaemon (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:
Remove the collector and all data:
Configuration Behavior
| Scenario | Action |
|---|---|
| Fresh install | Creates default empty config |
| Config exists | Preserves existing config |
With --config | Uses 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
- Check plist exists:
ls -la /Library/LaunchDaemons/com.coralogix.otelcol.plist - Check logs:
tail -f /var/log/otel-collector/otel-collector.log - Validate config:
/usr/local/bin/otelcol-contrib validate --config /etc/otelcol-contrib/config.yaml