Chapter 5. Configuring the OpenTelemetry Collector for RHEL on public cloud platforms


When running RHEL on Amazon Web Services (AWS), you can use the OpenTelemetry (OTel) framework to maintain and debug your RHEL instances.

RHEL includes the OTel Collector service, which you can use to manage logs. The OTel Collector gathers, processes, transforms, and exports logs to and from various formats and external back ends. You can also use the OTel Collector to aggregate the collected data and generate metrics useful for analytics services.

5.1. How the OpenTelemetry Collector works

For RHEL on AWS, you can configure the OTel Collector service to receive, process, and export logs between the RHEL instance and the AWS telemetry analytics service to automatically manage telemetry data on your RHEL instance. The OTel Collector is a component of the OTel ecosystem, and has three stages in its workflow: a receiver, a processor, and an exporter.

You can configure the workflow for any of these components in a YAML file based on your specific use case. Typically, the OTel Collector works as follows:

  1. A receiver collects telemetry data from data sources, such as applications and services.
  2. After the receiver ingest data, it passes to a processing phase, in which a chain of processors may be defined to transform the data.
  3. The exporter sends the telemetry data to the required destination.

5.2. Integration of OpenTelemetry with AWS CloudWatch Logs

Integrating OTel with Amazon Web Services (AWS) for log management involves configuring the OTel Collector to use RHEL on AWS as exporter for logs. It works as follows:

  • Configuring the exporter for the OTel Collector
  • Enabling log connections
  • Exporting data from the RHEL instance to AWS CloudWatch logs.

As a result, you can gather log data from various sources at a single location to effectively manage log analysis.

From the available features of AWS CloudWatch, RHEL instances currently support only logging. For details, see AWS Cloudwatch Logs exporter.

5.3. Configuring the OpenTelemetry Collector for journald logging

To configure the OpenTelemetry (OTel) Collector, you need to modify the default configuration of the filelog receiver for capturing the journald service logs. This configuration involves defining the file path, log format, and parsing rules. With this setup, the collector processes and exports logs to services, such as AWS CloudWatch logs, to improve observability and metrics analysis of system components.

Procedure

  1. Install the opentelemetry-collector package on a RHEL instance:

    # dnf install -y opentelemetry-collector
    Copy to Clipboard Toggle word wrap
  2. Enable and start the service to transfer the logs from the RHEL instance to AWS CloudWatch Logs:

    # systemctl enable --now opentelemetry-collector.service
    Copy to Clipboard Toggle word wrap
  3. To configure the OTel Collector to forward journald logs from the RHEL instance, create and edit the /etc/opentelemetry-collector/configs/10-cloudwatch-exporter.yaml file:

    ...
    exporters:
      awscloudwatchlogs:
        log_group_name: testing-logs-emf
        log_stream_name: testing-integrations-stream-emf
        raw_log: true
        region: us-east-1
        endpoint: logs.us-east-1.amazonaws.com
        log_retention: 365
        tags:
          sampleKey: sampleValue
    service:
      pipelines:
        logs:
          receivers:
            - journald
          exporters:
            - awscloudwatchlogs
    ...
    Copy to Clipboard Toggle word wrap
  4. Restart the OTel Collector service:

    # systemctl restart opentelemetry-collector.service
    Copy to Clipboard Toggle word wrap
  5. Create an IAM role for AWS CloudWatch agent from AWS console. For instructions, see Create IAM roles and users for use with the CloudWatch agent.
  6. Attach the role to the RHEL instance through AWS Console. For instructions, see Attach an IAM role to an instance.
  7. Restart the RHEL instance from AWS console to enable log exportation automatically.
  8. Optional: If you no longer want to export logs, stop logs transfer from the RHEL instance:

    # systemctl stop opentelemetry-collector.service
    Copy to Clipboard Toggle word wrap
  9. Optional: If you no longer need this service, permanently disable logs transfer:

    # systemctl disable opentelemetry-collector.service
    Copy to Clipboard Toggle word wrap

5.4. Receivers for the OTel Collector

Depending on the configuration, receivers gather telemetry based data such as logs and patterns of software use, from various devices and services at a single location for improved observability.

Journald receiver

The journald receiver in the OTel Collector captures logs from the journald service. This receiver accepts logs from system and application services, such as logs from the kernel, user, and applications, to provide improved observability. You can use journald logging for attributes like binary storage for faster indexing, user based permissions, and log size management.

For details, see config option in Journald Receiver.

5.5. Processors for the OTel Collector

Processors act as an intermediary between the receiver and the exporter and manipulate the data by, for example, adding, filtering, deleting, or transforming fields. Selection and order of processor depends on the signal type.

Resource detection for AWS environment

The resource detection processor collects a list of processors and detects information about the managed environment. It manages the details for telemetry data before exportation.

For the snippet, see AWS EC2 configuration.

5.6. Exporters for the OTel Collector

Exporters transmit processed data to specified devices or services, such as AWS CloudWatch Logs and the Debug exporter, based on the configuration and signal type. Exporters ensure compatibility with target services and facilitate integration with various systems.

AWS Cloudwatch Logs exporter

Note that, the given configuration currently supports only log type signals. Typically, it works as follows:

  • Receiver sends logs to the OTel Collector.
  • Processor processes logs in terms of modification or enhancement for exportation.
  • The awscloudwatchlogs configuration sends processed telemetry to AWS CloudWatch Logs.

For details, see:

In addition, the Collector provides extensions and processors to filter sensitive data, limit memory usage, and keep telemetry data on the disk for a certain period of time in case of a connection loss.

Debug exporter

The Debug Exporter prints traces and metrics to the standard output. Note that this exporter supports all signal types. You can modify the OTel Collector YAML configuration to include a console exporter, which will print the telemetry data to the console. Also, to make sure that journald captures the output, you can configure the receiver service if required.

For details, see Debug exporter

Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동