add --telemetry-outfile flag (#4689)

This commit is contained in:
smhendrickson
2025-07-23 17:48:24 -04:00
committed by GitHub
parent 209c8783b4
commit 9d3164621a
5 changed files with 133 additions and 6 deletions

View File

@@ -19,6 +19,7 @@ The following lists the precedence for applying telemetry settings, with items l
- `--telemetry-target <local|gcp>`: Overrides `telemetry.target`.
- `--telemetry-otlp-endpoint <URL>`: Overrides `telemetry.otlpEndpoint`.
- `--telemetry-log-prompts` / `--no-telemetry-log-prompts`: Overrides `telemetry.logPrompts`.
- `--telemetry-outfile <path>`: Redirects telemetry output to a file. See [Exporting to a file](#exporting-to-a-file).
1. **Environment variables:**
- `OTEL_EXPORTER_OTLP_ENDPOINT`: Overrides `telemetry.otlpEndpoint`.
@@ -50,6 +51,16 @@ The following code can be added to your workspace (`.gemini/settings.json`) or u
}
```
### Exporting to a file
You can export all telemetry data to a file for local inspection.
To enable file export, use the `--telemetry-outfile` flag with a path to your desired output file. This must be run using `--telemetry-target=local`.
```bash
gemini --telemetry --telemetry-target=local --telemetry-outfile=/path/to/telemetry.log "your prompt"
```
## Running an OTEL Collector
An OTEL Collector is a service that receives, processes, and exports telemetry data.