Configuring the Collector Metrics

The OpenTelemetry Collector exposes internal metrics that provide valuable insights into its performance and operational health. These metrics enable you to monitor the Collector's behavior and troubleshoot potential issues effectively.

Overview

The Collector provides metrics across several key areas:

  • Collector memory usage
  • CPU utilization
  • Number of active traces and spans processed
  • Dropped spans, logs, or metrics
  • Exporter and receiver statistics

When you deploy a Collector instance, the Operator provisions a dedicated monitoring service (<instance_name>-collector-monitoring) that serves these internal metrics on port 8888. You can point Prometheus or any compatible scraping tool at this service to collect the metrics.

NOTE

Setting spec.observability.metrics.enableMetrics to true in the OpenTelemetryCollector CR instructs the Operator to generate the corresponding Prometheus ServiceMonitor or PodMonitor resource automatically, so you do not need to create scrape configurations manually.

Enabling Collector Metrics

Procedure

Enable metrics collection for a Collector instance by setting spec.observability.metrics.enableMetrics to true in the CR:

apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
  name: <name>
  labels:
    prometheus: kube-prometheus
spec:
  observability:
    metrics:
      enableMetrics: true
  config:
    service:
      telemetry:
        metrics:
          readers:
          - pull:
              exporter:
                prometheus:
                  host: 0.0.0.0
                  port: 8888
                  without_scope_info: true
                  without_type_suffix: true
                  without_units: true
  1. prometheus=kube-prometheus is required in ACP prometheus.
  2. Enables the Operator to automatically create ServiceMonitor or PodMonitor resources that target the Collector's metrics endpoints, including both internal telemetry and Prometheus exporter ports.
  3. Configures the Collector to expose its internal metrics in Prometheus format on port 8888.

Verification

You can use the Prometheus web console to verify successful configuration:

  1. Access the Prometheus web console in your Alauda Container Platform cluster.

  2. Navigate to StatusTargets.

  3. Check that the ServiceMonitors or PodMonitors in the <instance_name>-collector format have the Up status.