This repository offers a collection of OpenTelemetry Collector templates designed to parse and structure various log formats into the OpenTelemetry Protocol (OTLP) format. These templates adhere to the OpenTelemetry Semantic Conventions, ensuring best practices for data representation.
- Download a Template:
Download your desired template into your OpenTelemetry Collector configuration
directory (e.g., /etc/otelcol-contrib on Linux):
wget https://raw.githubusercontent.com/CentreonLabs/centreon-otel-col-log-template/refs/heads/main/myfile.yaml -O /etc/otelcol-contrib/myfile.yamlReplace myfile.yaml with the actual template filename you wish to use.
- Update Collector Command:
Modify your OpenTelemetry Collector start command to include the downloaded configuration file:
otelcol-contrib --config /etc/otelcol-contrib/myfile.yamlEnsure otelcol-contrib is the correct command for your OpenTelemetry Collector installation.
Each template includes a pre-configured pipeline designed to process the parsed logs. By default, these pipelines perform the following actions:
- Batching: Collects logs into batches for efficient export.
- Resource Attributes: Automatically enriches logs with resource attributes from the host, Kubernetes pod, or container where the logs originated.
- OTLP Export: Exports data in OTLP format to an exporter named
otlphttp/centreon.
For more details on OpenTelemetry Collector pipelines, refer to the official documentation.
Examples:
service:
pipelines:
logs:
receivers: [filelog/mylog]
processors: [batch,resourcedetection]
exporters: [otlphttp/centreon]- Apache error: The log errors of apache.
- Centreon Broker: The log file of Centreon Broker.
- Centreon Engine: The log file of Centreon Engine.
- Centreon Gorgone: The log file of Centreon Gorgone.
- Centreon Web: The log file of Centreon Web.
- Access Log Combined: The http access log in combined format.
- MariaDB: The log files of MariaDB.
- Linux messages: The syslog system log file.
- Tomcat: The Tomcat log file.
- PostgreSQL base: The basic PostgreSQL log file. Log
prefix:
%m [%p].
- Redis: Redis log file, with paring role, component, level.
- Windows Event Log: Contains the event log application parsing with locale US and FR for level conversions.