Skip to content

Commit f43c75b

Browse files
author
Israel Blancas
committed
TRACING-4562:Improve Prometheus port and services documentation
Signed-off-by: Israel Blancas <iblancas@redhat.com>
1 parent c9ea368 commit f43c75b

File tree

3 files changed

+53
-36
lines changed

3 files changed

+53
-36
lines changed

modules/otel-config-send-metrics-monitoring-stack.adoc

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@
66
[id="configuration-for-sending-metrics-to-the-monitoring-stack_{context}"]
77
= Configuration for sending metrics to the monitoring stack
88

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.
1510

1611
.Example of the OpenTelemetry Collector CR with the Prometheus exporter
1712
[source,yaml]
@@ -38,7 +33,15 @@ spec:
3833
receivers: [otlp]
3934
exporters: [prometheus]
4035
----
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+
====
4245

4346
Alternatively, a manually created Prometheus `PodMonitor` CR can provide fine control, for example removing duplicated labels added during Prometheus scraping.
4447

@@ -71,4 +74,4 @@ spec:
7174
----
7275
<1> The name of the OpenTelemetry Collector CR.
7376
<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.

observability/otel/otel-collector/otel-collector-exporters.adoc

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -153,41 +153,42 @@ include::snippets/technology-preview.adoc[]
153153
[source,yaml]
154154
----
155155
# ...
156-
ports:
157-
- name: promexporter # <1>
158-
port: 8889
159-
protocol: TCP
160156
config: |
161157
exporters:
162158
prometheus:
163-
endpoint: 0.0.0.0:8889 # <2>
164-
tls: # <3>
159+
endpoint: 0.0.0.0:8889 # <1>
160+
tls: # <2>
165161
ca_file: ca.pem
166162
cert_file: cert.pem
167163
key_file: key.pem
168-
namespace: prefix # <4>
169-
const_labels: # <5>
164+
namespace: prefix # <3>
165+
const_labels: # <4>
170166
label1: value1
171-
enable_open_metrics: true # <6>
172-
resource_to_telemetry_conversion: # <7>
167+
enable_open_metrics: true # <5>
168+
resource_to_telemetry_conversion: # <6>
173169
enabled: true
174-
metric_expiration: 180m # <8>
175-
add_metric_suffixes: false # <9>
170+
metric_expiration: 180m # <7>
171+
add_metric_suffixes: false # <8>
176172
service:
177173
pipelines:
178174
metrics:
179175
exporters: [prometheus]
180176
# ...
181177
----
182-
<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.
191+
====
191192

192193
[id="prometheus-remote-write-exporter_{context}"]
193194
== Prometheus Remote Write Exporter
@@ -276,4 +277,4 @@ include::snippets/technology-preview.adoc[]
276277
[role="_additional-resources"]
277278
[id="additional-resources_otel-collector-exporters_{context}"]
278279
== Additional resources
279-
* link:https://opentelemetry.io/docs/specs/otlp/[OpenTelemetry Protocol (OTLP) documentation]
280+
* link:https://opentelemetry.io/docs/specs/otlp/[OpenTelemetry Protocol (OTLP) documentation]

observability/otel/otel-configuring-otelcol-metrics.adoc

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,22 @@
44
include::_attributes/common-attributes.adoc[]
55
:context: otel-configuring-metrics
66

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:
108

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+
====
1223

1324
.Prerequisites
1425

@@ -34,7 +45,9 @@ spec:
3445

3546
You can use the *Administrator* view of the web console to verify successful configuration:
3647

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.
3851

3952
.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

Comments
 (0)