Skip to content

Commit 8578958

Browse files
Merge pull request #64772 from pavolloffay/otel-troubleshoot
TRACING-3258 | Document troubleshooting OTEL
2 parents d0cb5d8 + 00dbd94 commit 8578958

File tree

5 files changed

+109
-0
lines changed

5 files changed

+109
-0
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3650,6 +3650,8 @@ Topics:
36503650
File: distr-tracing-otel-configuring
36513651
- Name: Use
36523652
File: distr-tracing-otel-using
3653+
- Name: Troubleshooting
3654+
File: distr-tracing-otel-troubleshooting
36533655
- Name: Migration
36543656
File: distr-tracing-otel-migrating
36553657
- Name: Removal
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
:_content-type: ASSEMBLY
2+
[id="distr-tracing-otel-troubleshoot"]
3+
= Troubleshooting the {OTELShortName}
4+
include::_attributes/common-attributes.adoc[]
5+
:context: distr-tracing-otel-troubleshoot
6+
7+
toc::[]
8+
9+
The OpenTelemetry Collector offers multiple ways to measure its health as well as investigate data ingestion issues.
10+
11+
include::modules/distr-tracing-otel-troubleshoot-logs.adoc[leveloffset=+1]
12+
include::modules/distr-tracing-otel-troubleshoot-metrics.adoc[leveloffset=+1]
13+
include::modules/distr-tracing-otel-troubleshoot-logging-exporter.adoc[leveloffset=+1]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * /distr_tracing/distr_tracing_otel/distr-tracing-otel-troubleshooting.adoc
4+
:_content-type: PROCEDURE
5+
[id="distr-tracing-otel-troubleshoot-logging-exporter_{context}"]
6+
= Logging exporter
7+
8+
You can configure the logging exporter to export the collected data to the standard output.
9+
10+
.Procedure
11+
12+
. Configure the OpenTelemetry Collector custom resource as follows:
13+
+
14+
[source,yaml]
15+
----
16+
config: |
17+
exporters:
18+
logging:
19+
verbosity: detailed
20+
service:
21+
pipelines:
22+
traces:
23+
exporters: [logging]
24+
metrics:
25+
exporters: [logging]
26+
logs:
27+
exporters: [logging]
28+
----
29+
30+
. Use the `oc logs` command or the OpenShift console to export the logs to the standard output.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * /distr_tracing/distr_tracing_otel/distr-tracing-otel-troubleshooting.adoc
4+
:_content-type: PROCEDURE
5+
[id="distr-tracing-otel-troubleshoot-logs_{context}"]
6+
= Getting the OpenTelemetry Collector logs
7+
8+
You can get the logs for the OpenTelemetry Collector as follows.
9+
10+
.Procedure
11+
12+
. Set the relevant log level in the OpenTelemetry Collector custom resource (CR):
13+
+
14+
[source,yaml]
15+
----
16+
config: |
17+
service:
18+
telemetry:
19+
logs:
20+
level: debug <1>
21+
----
22+
<1> Collector's log level. Select one of the following values: `info`, `warn`, `error`, or `debug`. Defaults to `info`.
23+
24+
. Use the `oc logs` command or the OpenShift console to retrieve the logs.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * /distr_tracing/distr_tracing_otel/distr-tracing-otel-troubleshooting.adoc
4+
:_content-type: PROCEDURE
5+
[id="distr-tracing-otel-troubleshoot-metrics_{context}"]
6+
= Exposing the metrics
7+
8+
The OpenTelemetry Collector exposes the metrics about the data volumes it has processed. The following metrics are for spans, although similar metrics are exposed for metrics and logs signals:
9+
10+
`otelcol_receiver_accepted_spans`:: The number of spans successfully pushed into the pipeline.
11+
`otelcol_receiver_refused_spans`:: The number of spans that could not be pushed into the pipeline.
12+
`otelcol_exporter_sent_spans`:: The number of spans successfully sent to destination.
13+
`otelcol_exporter_enqueue_failed_spans`:: The number of spans failed to be added to the sending queue.
14+
15+
The operator creates a `<cr-name>-collector-monitoring` telemetry service that you can use to scrape the metrics endpoint.
16+
17+
.Procedure
18+
19+
. Enable the telemetry service by adding the following lines in the OpenTelemetry Collector custom resource:
20+
21+
+
22+
[source,yaml]
23+
----
24+
config: |
25+
service:
26+
telemetry:
27+
metrics:
28+
address: ":8888" <1>
29+
----
30+
<1> The address on which internal collector metrics are exposed. Defaults to `:8888`.
31+
// TODO Operator 0.82.0 has spec.observability.metrics.enableMetrics config that creates ServiceMonitors for users
32+
33+
. Retrieve the metrics by running the following command, which uses the port forwarding collector pod:
34+
+
35+
[source,terminal]
36+
----
37+
$ oc port-forward <collector-pod>
38+
----
39+
40+
. Access the metrics endpoint at `+http://localhost:8888/metrics+`.

0 commit comments

Comments
 (0)