-
Download and install Sumo Logic OTC Distro
export SUMO_OTC_DISTRO_VERSION=0.56.0-sumo-0 curl -sLo otelcol-sumo "https://github.com/SumoLogic/sumologic-otel-collector/releases/download/v${SUMO_OTC_DISTRO_VERSION}/otelcol-sumo-${SUMO_OTC_DISTRO_VERSION}-linux_amd64"
-
Install the collector
sudo mkdir -p /usr/local/bin/otelcol-sumo sudo mv otelcol-sumo /usr/local/bin/otelcol-sumo sudo chmod +x /usr/local/bin/otelcol-sumo
-
Create a system user account for the collector
sudo groupadd --system opentelemetry sudo useradd --system --gid opentelemetry --home-dir /opt/opentelemetry --shell /bin/false --comment "OpenTelemetry Collector" opentelemetry
-
Verify the installation was successful
sudo -u opentelemetry otelcol-sumo --version
-
Obtain a Sumo Logic installation token (to register collectors)
See: Installation Tokens (help.sumologic.com)
Installation Tokens register installed collectors to your Sumo Logic account. They are assigned to your account, do not expire, and can only be used to register installed collectors. You can deactivate, reactivate, or delete tokens at any time.
Opposed to Access Keys, you can embed your installation tokens in installation scripts confident they can't be used to make API requests if compromised. You can also freely deactivate or delete users without worrying about updating Access Keys in installation scripts since Installation Tokens are associated with your account instead of users.
-
Set an environment variable containing the installation token
export SUMO_OTC_INSTALL_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-
Initialize collector statefile and config directories and/or files
sudo mkdir /etc/otelcol-sumo sudo touch /etc/otelcol-sumo/config.yaml sudo mkdir /var/lib/otelcol-sumo sudo chown -R opentelemetry:opentelemetry /etc/otelcol-sumo /var/lib/otelcol-sumo
Copy the following contents to
/etc/otelcol-sumo/config.yaml
:extensions: file_storage: directory: /var/lib/otelcol-sumo/file_storage sumologic: install_token: ${SUMO_OTC_INSTALL_TOKEN} collector_credentials_directory: /var/lib/otelcol-sumo collector_name: ${HOSTNAME} collector_category: mission-s3m collector_description: Sumo Logic OTC Distro Demo collector_fields: mission: s3m clobber: true ephemeral: true receivers: filelog: include_file_name: false include_file_path_resolved: true start_at: end include: - /tmp/sumologic-otc-example.log exporters: logging: loglevel: info sumologic: service: extensions: [file_storage, sumologic] pipelines: logs: receivers: [filelog] exporters: [sumologic, logging]
-
Start the collector
sudo -u opentelemetry --preserve-env=SUMO_OTC_INSTALL_TOKEN otelcol-sumo --config /etc/otelcol-sumo/config.yaml
You should see some log output as the collector starts reporting internal telemetry (Prometheus exporter), enables various extensions and their configuration (including the Sumo Logic exporter extension), starts the actual exporters (including exporters loaded from extensions), then starts the processors and receivers. The collector will then log a message like
"Everything is ready. Begin running and processing data."
and subsequent log messages should indicate that receivers are collecting data.