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.
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:
prometheus=kube-prometheusis required in ACP prometheus.- Enables the Operator to automatically create
ServiceMonitororPodMonitorresources that target the Collector's metrics endpoints, including both internal telemetry and Prometheus exporter ports. - 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:
-
Access the Prometheus web console in your Alauda Container Platform cluster.
-
Navigate to Status → Targets.
-
Check that the
ServiceMonitorsorPodMonitorsin the<instance_name>-collectorformat have the Up status.