OpenTelemetry
A guide on how to collect logs using OpenTelemetry on Linux from installation to ingestion
Install otelcol-contrib
At the time of writing, the latest version of otelcol-contrib is v0.121.0
See releases for later versions
For DEB-based:
For RHEL-based:
Configure Collector
Edit /etc/otelcol-contrib/config.yaml
and replace the content with the below
Replace the following values:
<your_log_file_path>
Physical path to your log file
<your_domain>
Hostname of your Apica environment (example.apica.io)
<your_token>
Your ingest token, see how to obtain your ingest token
<namespace>
A name for high-level grouping of logs, isolating different projects, environments, or teams.
<application>
A name for logs generated by a specific service or process
line_start_pattern
The above example uses a regex to match on the timestamp of a log entry to capture the entire entry. This needs to be adjusted to match the beginning of your log structure. See below example of entries that matches this pattern.
Validate and apply
When you're done with your edits, execute the below command to validate the config is valid (it should return nothing if everything is in order)
Restart OTel to apply your changes
Ascent view
Assuming everything has been done correctly, your logs will start to appear in Explore > Logs & Insight on your Ascent environment. They will show up based on the namespace and application names that you set in your config.yaml file.
Last updated
Was this helpful?