Skip to content

Commit c8155a4

Browse files
alexandra5000theletterfbmorelli25
authored
Add new troubleshooting page: Enable debug logging (for EDOT Collector) (#2230)
This PR introduces a new troubleshooting page that explains how to enable debug-level logging for the EDOT Collector. Closes [this issue](elastic/opentelemetry#327). --------- Co-authored-by: Fabrizio Ferri-Benedetti <[email protected]> Co-authored-by: Brandon Morelli <[email protected]>
1 parent 52dd675 commit c8155a4

File tree

2 files changed

+89
-0
lines changed

2 files changed

+89
-0
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
navigation_title: Enable debug logging
3+
description: Learn how to enable debug logging for the EDOT Collector in supported environments.
4+
applies_to:
5+
stack:
6+
serverless:
7+
observability:
8+
product:
9+
edot_collector: ga
10+
products:
11+
- id: cloud-serverless
12+
- id: observability
13+
- id: edot-collector
14+
---
15+
16+
# Enable debug logging
17+
18+
You can enable debug-level logging in the Elastic Distributions of OpenTelemetry (EDOT) Collector by either modifying the configuration file or passing a runtime override. This is useful when troubleshooting startup issues or configuration problems.
19+
20+
This guide shows how to enable debug logging in different environments.
21+
22+
## Standalone EDOT Collector
23+
24+
If you're running the EDOT Collector directly, you can choose between two approaches:
25+
26+
* [Configuration file](#configuration-file) - to persist debug logging across restarts
27+
* [Temporary override: runtime flag](#temporary-override-runtime-flag) - for temporary debugging or quick tests
28+
29+
Both approaches increase log verbosity and help surface misconfigurations.
30+
31+
### Configuration file
32+
33+
Add the following section to your EDOT Collector configuration file (typically `otel.yml`):
34+
35+
```yaml
36+
service:
37+
telemetry:
38+
logs:
39+
level: debug
40+
```
41+
42+
This method works across all deployment environments.
43+
44+
### Temporary override: runtime flag
45+
46+
Pass the log level as a runtime argument using the `--set` flag:
47+
48+
```bash
49+
otelcol --set=service.telemetry.logs.level=debug
50+
```
51+
52+
This applies debug-level logging without modifying your configuration file.
53+
54+
## Kubernetes (Helm deployment)
55+
56+
If you're deploying the EDOT Collector using the OpenTelemetry Helm charts, enable debug logging by adding the configuration directly in your values.yaml file:
57+
58+
```yaml
59+
config:
60+
service:
61+
telemetry:
62+
logs:
63+
level: debug
64+
```
65+
66+
Alternatively, use a CLI override when installing or upgrading the [OpenTelemetry Collector Helm Chart](https://github.com/open-telemetry/opentelemetry-helm-charts/tree/main/charts/opentelemetry-collector) release:
67+
68+
```bash
69+
helm upgrade my-opentelemetry-collector open-telemetry/opentelemetry-collector --set mode=daemonset --set image.repository="docker.elastic.co/elastic-agent/elastic-otel-collector" --set image.tag="9.1.0" --set config.service.telemetry.logs.level=debug
70+
```
71+
72+
This ensures the Collector logs at debug level when deployed into your cluster.
73+
74+
## Other environments
75+
76+
Standalone and Kubernetes are currently the only officially supported deployment environments for the EDOT Collector.
77+
78+
However, if you're running the Collector in a different context, such as a manually containerized setup, you can still enable debug logging using the same methods:
79+
80+
* Add it to your configuration file using the `service.telemetry.logs.level` setting
81+
82+
* Pass it at runtime with `--set=service.telemetry.logs.level=debug`
83+
84+
:::{{note}}
85+
Debug logging for the Collector is not currently configurable through {{fleet}}.
86+
:::
87+
88+

troubleshoot/ingest/opentelemetry/toc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ toc:
66
children:
77
- file: edot-collector/collector-oomkilled.md
88
- file: edot-collector/metadata.md
9+
- file: edot-collector/enable-debug-logging.md
910
- file: edot-collector/collector-not-starting.md
1011
- file: edot-sdks/index.md
1112
children:

0 commit comments

Comments
 (0)