From c15132e4b83e35d7602223d28de4f84febefbf95 Mon Sep 17 00:00:00 2001 From: Aleksandra Spilkowska Date: Wed, 23 Jul 2025 13:51:40 +0200 Subject: [PATCH 1/4] Add enable-debug-logging.md --- .../edot-collector/enable-debug-logging.md | 63 +++++++++++++++++++ troubleshoot/ingest/opentelemetry/toc.yml | 1 + 2 files changed, 64 insertions(+) create mode 100644 troubleshoot/ingest/opentelemetry/edot-collector/enable-debug-logging.md diff --git a/troubleshoot/ingest/opentelemetry/edot-collector/enable-debug-logging.md b/troubleshoot/ingest/opentelemetry/edot-collector/enable-debug-logging.md new file mode 100644 index 0000000000..27be0b27dd --- /dev/null +++ b/troubleshoot/ingest/opentelemetry/edot-collector/enable-debug-logging.md @@ -0,0 +1,63 @@ +--- +navigation_title: Enable debug logging +description: Learn how to enable debug logging for the EDOT Collector in supported environments. +applies_to: + stack: + serverless: + observability: + product: + edot_collector: ga +products: + - id: cloud-serverless + - id: observability + - id: edot-collector +--- + +# Enable debug logging + +You can enable debug logging in the Elastic Distributions of OpenTelemetry (EDOT) Collector by setting the `--log-level=debug` flag. This is useful when troubleshooting startup issues or configuration problems. + +This guide shows how to enable debug logging in different environments. + +## Standalone EDOT Collector + +If you're running the EDOT Collector directly, add the flag to your command: + +```bash +edot-collector --config=/path/to/otel-collector-config.yaml --log-level=debug +``` + +This increases log verbosity and helps surface misconfigurations. + +## Kubernetes (Helm deployment) + +If you're deploying the EDOT Collector using the Elastic Helm charts, set the `logLevel` in your values file or CLI override: + +```yaml +logLevel: debug +``` + +Example usage with `helm install`: + +```bash +helm upgrade --install my-collector elastic/otel-collector \ +--set logLevel=debug +``` + +This adds `--log-level=debug` to the Collector container’s command line. + +## Other environments + +Standalone and Kubernetes are the currently the only officially supported deployment environments for the EDOT Collector. + +However, if you're running the Collector in a different context, such as a manually containerized setup, you can still enable debug logging by passing the `--log-level=debug` flag as a runtime argument: + +```bash +otel-collector --config=/path/to/config.yaml --log-level=debug +``` + +:::{{note}} +Debug logging for the Collector is not currently configurable through {{fleet}}. +::: + + diff --git a/troubleshoot/ingest/opentelemetry/toc.yml b/troubleshoot/ingest/opentelemetry/toc.yml index c3d2f4afb2..8c6c8b88c1 100644 --- a/troubleshoot/ingest/opentelemetry/toc.yml +++ b/troubleshoot/ingest/opentelemetry/toc.yml @@ -6,6 +6,7 @@ toc: children: - file: edot-collector/collector-oomkilled.md - file: edot-collector/metadata.md + - file: edot-collector/enable-debug-logging.md - file: edot-sdks/index.md children: - file: edot-sdks/dotnet/index.md From 3549baff62f371e4186bf002a621227caf243aa5 Mon Sep 17 00:00:00 2001 From: Fabrizio Ferri-Benedetti Date: Thu, 24 Jul 2025 10:59:42 +0200 Subject: [PATCH 2/4] Update troubleshoot/ingest/opentelemetry/edot-collector/enable-debug-logging.md Co-authored-by: Brandon Morelli --- .../ingest/opentelemetry/edot-collector/enable-debug-logging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/troubleshoot/ingest/opentelemetry/edot-collector/enable-debug-logging.md b/troubleshoot/ingest/opentelemetry/edot-collector/enable-debug-logging.md index 27be0b27dd..af7c514a44 100644 --- a/troubleshoot/ingest/opentelemetry/edot-collector/enable-debug-logging.md +++ b/troubleshoot/ingest/opentelemetry/edot-collector/enable-debug-logging.md @@ -48,7 +48,7 @@ This adds `--log-level=debug` to the Collector container’s command line. ## Other environments -Standalone and Kubernetes are the currently the only officially supported deployment environments for the EDOT Collector. +Standalone and Kubernetes are currently the only officially supported deployment environments for the EDOT Collector. However, if you're running the Collector in a different context, such as a manually containerized setup, you can still enable debug logging by passing the `--log-level=debug` flag as a runtime argument: From 878b44384514a48eb4aae1cb0d9e2f563edd6613 Mon Sep 17 00:00:00 2001 From: Aleksandra Spilkowska Date: Mon, 4 Aug 2025 11:02:02 +0200 Subject: [PATCH 3/4] Change incorrect examples --- .../edot-collector/enable-debug-logging.md | 54 ++++++++++++++----- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/troubleshoot/ingest/opentelemetry/edot-collector/enable-debug-logging.md b/troubleshoot/ingest/opentelemetry/edot-collector/enable-debug-logging.md index af7c514a44..d9499c4318 100644 --- a/troubleshoot/ingest/opentelemetry/edot-collector/enable-debug-logging.md +++ b/troubleshoot/ingest/opentelemetry/edot-collector/enable-debug-logging.md @@ -15,46 +15,72 @@ products: # Enable debug logging -You can enable debug logging in the Elastic Distributions of OpenTelemetry (EDOT) Collector by setting the `--log-level=debug` flag. This is useful when troubleshooting startup issues or configuration problems. +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. This guide shows how to enable debug logging in different environments. ## Standalone EDOT Collector -If you're running the EDOT Collector directly, add the flag to your command: +If you're running the EDOT Collector directly, you can choose between two approaches: + +* [Configuration file](#configuration-file) - to persist debug logging across restarts +* [Temporary override: runtime flag](#temporary-override-runtime-flag) - for temporary debugging or quick tests + +Both approaches increase log verbosity and help surface misconfigurations. + +### Configuration file + +Add the following section to your EDOT Collector configuration file (typically `otel-collector-config.yaml`): + +```yaml +service: + telemetry: + logs: + level: debug +``` + +This method works across all deployment environments. + +### Temporary override: runtime flag + +Pass the log level as a runtime argument using the `--set` flag: ```bash -edot-collector --config=/path/to/otel-collector-config.yaml --log-level=debug +otelcol --set=service.telemetry.logs.level=debug ``` -This increases log verbosity and helps surface misconfigurations. +This applies debug-level logging without modifying your configuration file. ## Kubernetes (Helm deployment) -If you're deploying the EDOT Collector using the Elastic Helm charts, set the `logLevel` in your values file or CLI override: +If you're deploying the EDOT Collector using the Elastic Helm charts, enable debug logging by adding the configuration directly in your values.yaml file: ```yaml -logLevel: debug +config: + service: + telemetry: + logs: + level: debug ``` -Example usage with `helm install`: +Alternatively, use a CLI override when installing or upgrading the Helm release: ```bash -helm upgrade --install my-collector elastic/otel-collector \ ---set logLevel=debug +helm upgrade --install my-collector/otel-collector \ + --set config.service.telemetry.logs.level=debug ``` -This adds `--log-level=debug` to the Collector container’s command line. +This ensures the Collector logs at debug level when deployed into your cluster. ## Other environments Standalone and Kubernetes are currently the only officially supported deployment environments for the EDOT Collector. -However, if you're running the Collector in a different context, such as a manually containerized setup, you can still enable debug logging by passing the `--log-level=debug` flag as a runtime argument: +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: -```bash -otel-collector --config=/path/to/config.yaml --log-level=debug -``` +* Add it to your configuration file using the `service.telemetry.logs.level` setting + +* Pass it at runtime with `--set=service.telemetry.logs.level=debug` :::{{note}} Debug logging for the Collector is not currently configurable through {{fleet}}. From 97c3182146290038c4c87ed9c91cc9c012116340 Mon Sep 17 00:00:00 2001 From: Aleksandra Spilkowska Date: Tue, 5 Aug 2025 12:20:00 +0200 Subject: [PATCH 4/4] Apply comments --- .../opentelemetry/edot-collector/enable-debug-logging.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/troubleshoot/ingest/opentelemetry/edot-collector/enable-debug-logging.md b/troubleshoot/ingest/opentelemetry/edot-collector/enable-debug-logging.md index d9499c4318..522721281c 100644 --- a/troubleshoot/ingest/opentelemetry/edot-collector/enable-debug-logging.md +++ b/troubleshoot/ingest/opentelemetry/edot-collector/enable-debug-logging.md @@ -30,7 +30,7 @@ Both approaches increase log verbosity and help surface misconfigurations. ### Configuration file -Add the following section to your EDOT Collector configuration file (typically `otel-collector-config.yaml`): +Add the following section to your EDOT Collector configuration file (typically `otel.yml`): ```yaml service: @@ -53,7 +53,7 @@ This applies debug-level logging without modifying your configuration file. ## Kubernetes (Helm deployment) -If you're deploying the EDOT Collector using the Elastic Helm charts, enable debug logging by adding the configuration directly in your values.yaml file: +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: ```yaml config: @@ -63,11 +63,10 @@ config: level: debug ``` -Alternatively, use a CLI override when installing or upgrading the Helm release: +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: ```bash -helm upgrade --install my-collector/otel-collector \ - --set config.service.telemetry.logs.level=debug +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 ``` This ensures the Collector logs at debug level when deployed into your cluster.