Skip to main content

Manual collector configuration

The Generating an OTel collector configuration file page provides a simplified procedure covering certain data sources. If you cannot find the snippet you need in the list of available data sources, use the procedure below.

If you run into any problems, refer to the Troubleshooting page.

Prerequisites​

Log Management can process log batches up to 5 MiB in size. Beyond that, you will receive a 413 error. (If necessary, use the sending_queue.sizer.bytes parameter in your exporter to adjust the size of your batches.)

Step 1: Install OpenTelemetry Collector on your host​

Use the otelcol-contrib packages to install OpenTelemetry Collector on each device from which you want to collect logs.

wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.145.0/otelcol-contrib_0.145.0_linux_amd64.rpm
dnf install ./otelcol-contrib_0.145.0_linux_amd64.rpm

Step 2: Define the global parameters of the collector​

  1. Edit the config.yaml file that was created when you installed the collector:

    You must be logged in as root.

    /etc/otelcol-contrib/config.yaml
  2. In this file, enter the global log collection settings specific to this device. These will apply to all log sources for this device.

    Example:

    # Copyright 2025 Centreon.
    # SPDX-License-Identifier: Apache-2.0
    exporters:
    otlphttp/centreon:
    endpoint: "https://api.euwest1.obs.mycentreon.com/v1/ingress/otlp"
    headers:
    "X-Api-Key": "mytoken"
    debug:
    verbosity: detailed
    processors:
    batch:
    resourcedetection:
    detectors: ["system"]
    system:
    resource_attributes:
    host.name:
    enabled: true
    os.name:
    enabled: true
    os.type:
    enabled: true
    os.version:
    enabled: true

    The indentation of the parameters in your YAML file must be identical to that in the example. The indentations are two spaces for each level.

Step 3: Configure each log source for your host​

Configure a log source for each desired service (syslog, apache, etc.) in the form of a YAML file.

  1. Create the following directory:

    mkdir /etc/otelcol-contrib/conf.d/
  2. In this directory, create one file per log source. For example: the httpd-combined.yaml and httpd-error.yaml files will contain the configuration for the Apache access log and Apache error log, respectively.

  3. Retrieve from GitHub the sample file for the log source you want.

  4. On the source device, copy and paste the code snippet into the corresponding file, and adapt it to your environment and your OS. Save the file. If you are using several log sources for a collector, make sure you define the pipeline only once (in one of the files). The pipeline must mention all your receivers. In our example:

    service:
    pipelines:
    logs:
    receivers: [filelog/httpd-combined,filelog/apache-error]

    The indentation of the parameters in your YAML file must be identical to that in the example. The indentations are two spaces for each level.

  5. Declare each of the files you created: declare a --config option for each file, as in the following example (be sure to keep the declaration of the global configuration file config.yaml):

    In /etc/otelcol-contrib/otelcol-contrib.conf, add the following line (adapt it to your actual file names):

    OTELCOL_OPTIONS="--config=/etc/otelcol-contrib/config.yaml --config=/etc/otelcol-contrib/conf.d/httpd-combined.yaml --config=/etc/otelcol-contrib/conf.d/httpd-error.yaml"
  6. Restart the OpenTelemetry Collector service.

    systemctl restart otelcol-contrib.service