You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
= Configuration for sending metrics to the monitoring stack
8
8
9
-
One of two following custom resources (CR) configures the sending of metrics to the monitoring stack:
10
-
11
-
* OpenTelemetry Collector CR
12
-
* Prometheus `PodMonitor` CR
13
-
14
-
A configured OpenTelemetry Collector CR can create a Prometheus `ServiceMonitor` CR for scraping the Collector's pipeline metrics and the enabled Prometheus exporters.
9
+
You can configure the `OpenTelemetryCollector` custom resource (CR) to create a Prometheus `ServiceMonitor` CR or a `PodMonitor` CR for a sidecar deployment. A `ServiceMonitor` can scrape Collector's internal metrics endpoint and Prometheus exporter metrics endpoints.
15
10
16
11
.Example of the OpenTelemetry Collector CR with the Prometheus exporter
17
12
[source,yaml]
@@ -38,7 +33,15 @@ spec:
38
33
receivers: [otlp]
39
34
exporters: [prometheus]
40
35
----
41
-
<1> Configures the Operator to create the Prometheus `ServiceMonitor` CR to scrape the Collector's internal metrics endpoint and Prometheus exporter metric endpoints. The metrics will be stored in the OpenShift monitoring stack.
36
+
<1> Configures the {OTELOperator} to create the Prometheus `ServiceMonitor` CR or `PodMonitor` CR to scrape the Collector's internal metrics endpoint and the Prometheus exporter metrics endpoints.
37
+
38
+
[NOTE]
39
+
====
40
+
Setting `enableMetrics` to `true` creates the following two `ServiceMonitor` instances:
41
+
42
+
* One `ServiceMonitor` instance for the `<instance_name>-collector-monitoring` service. This `ServiceMonitor` instance scrapes the Collector's internal metrics.
43
+
* One `ServiceMonitor` instance for the `<instance_name>-collector` service. This `ServiceMonitor` instance scrapes the metrics exposed by the Prometheus exporter instances.
44
+
====
42
45
43
46
Alternatively, a manually created Prometheus `PodMonitor` CR can provide fine control, for example removing duplicated labels added during Prometheus scraping.
44
47
@@ -71,4 +74,4 @@ spec:
71
74
----
72
75
<1> The name of the OpenTelemetry Collector CR.
73
76
<2> The name of the internal metrics port for the OpenTelemetry Collector. This port name is always `metrics`.
74
-
<3> The name of the Prometheus exporter port for the OpenTelemetry Collector.
77
+
<3> The name of the Prometheus exporter port for the OpenTelemetry Collector.
<1> Exposes the Prometheus port from the Collector pod and service. You can enable scraping of metrics by Prometheus by using the port name in `ServiceMonitor` or `PodMonitor` custom resource.
183
-
<2> The network endpoint where the metrics are exposed.
184
-
<3> The server-side TLS configuration. Defines paths to TLS certificates.
185
-
<4> If set, exports metrics under the provided value. No default.
186
-
<5> Key-value pair labels that are applied for every exported metric. No default.
187
-
<6> If `true`, metrics are exported using the OpenMetrics format. Exemplars are only exported in the OpenMetrics format and only for histogram and monotonic sum metrics such as `counter`. Disabled by default.
188
-
<7> If `enabled` is `true`, all the resource attributes are converted to metric labels by default. Disabled by default.
189
-
<8> Defines how long metrics are exposed without updates. The default is `5m`.
190
-
<9> Adds the metrics types and units suffixes. Must be disabled if the monitor tab in Jaeger console is enabled. The default is `true`.
178
+
<1> The network endpoint where the metrics are exposed. The {OTELOperator} automatically exposes the port specified in the `endpoint` field to the `<instance_name>-collector` service.
179
+
<2> The server-side TLS configuration. Defines paths to TLS certificates.
180
+
<3> If set, exports metrics under the provided value.
181
+
<4> Key-value pair labels that are applied for every exported metric.
182
+
<5> If `true`, metrics are exported by using the OpenMetrics format. Exemplars are only exported in the OpenMetrics format and only for histogram and monotonic sum metrics such as `counter`. Disabled by default.
183
+
<6> If `enabled` is `true`, all the resource attributes are converted to metric labels. Disabled by default.
184
+
<7> Defines how long metrics are exposed without updates. The default is `5m`.
185
+
<8> Adds the metrics types and units suffixes. Must be disabled if the monitor tab in the Jaeger console is enabled. The default is `true`.
186
+
187
+
188
+
[NOTE]
189
+
====
190
+
When the `spec.observability.metrics.enableMetrics` field in the `OpenTelemetryCollector` custom resource (CR) is set to `true`, the `OpenTelemetryCollector` CR automatically creates a Prometheus `ServiceMonitor` or `PodMonitor` CR to enable Prometheus to scrape your metrics.
Copy file name to clipboardExpand all lines: observability/otel/otel-configuring-otelcol-metrics.adoc
+19-6Lines changed: 19 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,22 @@
4
4
include::_attributes/common-attributes.adoc[]
5
5
:context: otel-configuring-metrics
6
6
7
-
//[id="setting-up-monitoring-for-otel"]
8
-
//== Setting up monitoring for the {OTELShortName}
9
-
//The {OTELOperator} supports monitoring and alerting of each OpenTelemtry Collector instance and exposes upgrade and operational metrics about the Operator itself.
7
+
The following list shows some of these metrics:
10
8
11
-
You can enable metrics and alerts of OpenTelemetry Collector instances.
9
+
* Collector memory usage
10
+
* CPU utilization
11
+
* Number of active traces and spans processed
12
+
* Dropped spans, logs, or metrics
13
+
* Exporter and receiver statistics
14
+
15
+
The {OTELOperator} automatically creates a service named `<instance_name>-collector-monitoring` that exposes the Collector's internal metrics. This service listens on port `8888` by default.
16
+
17
+
You can use these metrics for monitoring the Collector's performance, resource consumption, and other internal behaviors. You can also use a Prometheus instance or another monitoring tool to scrape these metrics from the mentioned `<instance_name>-collector-monitoring` service.
18
+
19
+
[NOTE]
20
+
====
21
+
When the `spec.observability.metrics.enableMetrics` field in the `OpenTelemetryCollector` custom resource (CR) is set to `true`, the `OpenTelemetryCollector` CR automatically creates a Prometheus `ServiceMonitor` or `PodMonitor` CR to enable Prometheus to scrape your metrics.
22
+
====
12
23
13
24
.Prerequisites
14
25
@@ -34,7 +45,9 @@ spec:
34
45
35
46
You can use the *Administrator* view of the web console to verify successful configuration:
36
47
37
-
* Go to *Observe*->*Targets*, filter by *Source: User*, and check that the *ServiceMonitors* in the `opentelemetry-collector-<instance_name>` format have the *Up* status.
48
+
. Go to *Observe* -> *Targets*.
49
+
. Filter by *Source: User*.
50
+
. Check that the *ServiceMonitors* or *PodMonitors* in the `opentelemetry-collector-<instance_name>` format have the *Up* status.
38
51
39
52
.Additional resources
40
-
* xref:../../observability/monitoring/enabling-monitoring-for-user-defined-projects.adoc#enabling-monitoring-for-user-defined-projects[Enabling monitoring for user-defined projects]
53
+
* xref:../../observability/monitoring/enabling-monitoring-for-user-defined-projects.adoc#enabling-monitoring-for-user-defined-projects[Enabling monitoring for user-defined projects]
0 commit comments