gemini-cli - 💡(How to fix) Fix Support for disabling Logs and Metrics via environment variables [3 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#26494Fetched 2026-05-06 06:36:11
View on GitHub
Comments
3
Participants
2
Timeline
6
Reactions
0
Timeline (top)
commented ×3labeled ×1mentioned ×1subscribed ×1

Fix Action

Fix / Workaround

Attempted Workarounds: I have attempted to suppress logs and metrics using the following standard OTel environment variables, but the CLI continues to export them:

OTEL_LOGS_EXPORTER=none
OTEL_METRICS_EXPORTER=none
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=""
OTEL_SDK_DISABLED_INSTRUMENTATIONS=logs
OTEL_INSTRUMENTATION_LOGS_ENABLED=false

Code Example

# Gemini CLI telemetry configuration
ENV GEMINI_TELEMETRY_ENABLED=true
ENV GEMINI_TELEMETRY_TRACES_ENABLED=true
ENV GEMINI_TELEMETRY_USE_COLLECTOR=true
ENV GEMINI_TELEMETRY_OTLP_ENDPOINT=https://otlp.us5.datadoghq.com
ENV GEMINI_TELEMETRY_OTLP_PROTOCOL=http
ENV OTEL_EXPORTER_OTLP_HEADERS=dd-api-key=${DATADOG_API_KEY}
# Enable Datadog LLM Observability
ENV OTEL_EXPORTER_OTLP_TRACES_HEADERS=dd-otlp-source=llmobs
# Datadog supports only delta metrics
ENV OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta

---

OTEL_LOGS_EXPORTER=none
OTEL_METRICS_EXPORTER=none
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=""
OTEL_SDK_DISABLED_INSTRUMENTATIONS=logs
OTEL_INSTRUMENTATION_LOGS_ENABLED=false

---

GEMINI_TELEMETRY_LOGS_ENABLED=false
GEMINI_TELEMETRY_METRICS_ENABLED=false
RAW_BUFFERClick to expand / collapse

We use the Gemini CLI within our CI pipelines and have integrated Datadog LLM Observability for tracing. While the trace integration is working as expected, we want to disable the export of Logs and Metrics to reduce noise and unnecessary ingestion costs, as the traces provide sufficient visibility for our use case.

Currently, the CLI appears to ignore standard OpenTelemetry exporter(OTEL_LOGS_EXPORTER: none) configurations.

Current Configuration:

# Gemini CLI telemetry configuration
ENV GEMINI_TELEMETRY_ENABLED=true
ENV GEMINI_TELEMETRY_TRACES_ENABLED=true
ENV GEMINI_TELEMETRY_USE_COLLECTOR=true
ENV GEMINI_TELEMETRY_OTLP_ENDPOINT=https://otlp.us5.datadoghq.com
ENV GEMINI_TELEMETRY_OTLP_PROTOCOL=http
ENV OTEL_EXPORTER_OTLP_HEADERS=dd-api-key=${DATADOG_API_KEY}
# Enable Datadog LLM Observability
ENV OTEL_EXPORTER_OTLP_TRACES_HEADERS=dd-otlp-source=llmobs
# Datadog supports only delta metrics
ENV OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta

Attempted Workarounds: I have attempted to suppress logs and metrics using the following standard OTel environment variables, but the CLI continues to export them:

OTEL_LOGS_EXPORTER=none
OTEL_METRICS_EXPORTER=none
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=""
OTEL_SDK_DISABLED_INSTRUMENTATIONS=logs
OTEL_INSTRUMENTATION_LOGS_ENABLED=false

Desired Behavior: We need a way to explicitly disable Logs and Metrics while keeping Traces active. Ideally, this would be handled by honoring the OTEL_LOGS_EXPORTER=none standard or by providing specific Gemini CLI toggles, such as:

GEMINI_TELEMETRY_LOGS_ENABLED=false
GEMINI_TELEMETRY_METRICS_ENABLED=false

Environment: Version: 0.40.1 Platform: CI Pipeline (Docker/Linux) Observability Provider: Datadog (OTLP)

extent analysis

TL;DR

Disable logs and metrics export by setting specific environment variables or configuring the Gemini CLI to honor standard OpenTelemetry exporter configurations.

Guidance

  • Verify that the Gemini CLI version 0.40.1 supports the standard OpenTelemetry exporter configurations, specifically OTEL_LOGS_EXPORTER and OTEL_METRICS_EXPORTER.
  • Attempt to use the proposed Gemini CLI toggles, such as GEMINI_TELEMETRY_LOGS_ENABLED=false and GEMINI_TELEMETRY_METRICS_ENABLED=false, to disable logs and metrics export.
  • Check the Datadog documentation to ensure that the OTLP endpoint and protocol are correctly configured for trace integration.
  • Consider reaching out to the Gemini CLI support team to report the issue and request guidance on disabling logs and metrics export.

Example

# Disable logs and metrics export using proposed Gemini CLI toggles
ENV GEMINI_TELEMETRY_LOGS_ENABLED=false
ENV GEMINI_TELEMETRY_METRICS_ENABLED=false

Notes

The Gemini CLI may not currently support the standard OpenTelemetry exporter configurations, which could be the root cause of the issue. The proposed solution relies on the availability of specific Gemini CLI toggles, which may not be implemented in version 0.40.1.

Recommendation

Apply workaround by setting GEMINI_TELEMETRY_LOGS_ENABLED=false and GEMINI_TELEMETRY_METRICS_ENABLED=false, as this approach is more targeted and may be supported by the Gemini CLI.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

gemini-cli - 💡(How to fix) Fix Support for disabling Logs and Metrics via environment variables [3 comments, 2 participants]