Skip to content

Commit 8884079

Browse files
docs: update OTel environment variable and config guides (#7221)
Signed-off-by: Adrian Cole <adrian@tetrate.io> Co-authored-by: Rizel Scarlett <rizel@squareup.com>
1 parent b5d8a3e commit 8884079

File tree

2 files changed

+52
-23
lines changed

2 files changed

+52
-23
lines changed

documentation/docs/guides/config-files.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ The following settings can be configured at the root level of your config.yaml f
4949
| `GOOSE_ALLOWLIST` | URL for allowed extensions | Valid URL | None | No |
5050
| `GOOSE_RECIPE_GITHUB_REPO` | GitHub repository for recipes | Format: "org/repo" | None | No |
5151
| `GOOSE_AUTO_COMPACT_THRESHOLD` | Set the percentage threshold at which goose [automatically summarizes your session](/docs/guides/sessions/smart-context-management#automatic-compaction). | Float between 0.0 and 1.0 (disabled at 0.0)| 0.8 | No |
52-
| `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP endpoint URL for [observability](/docs/guides/environment-variables#opentelemetry-protocol-otlp) | URL (e.g., `http://localhost:4318`) | None | No |
53-
| `OTEL_EXPORTER_OTLP_TIMEOUT` | Export timeout in milliseconds for [observability](/docs/guides/environment-variables#opentelemetry-protocol-otlp) | Integer (ms) | 10000 | No |
5452
| `SECURITY_PROMPT_ENABLED` | Enable [prompt injection detection](/docs/guides/security/prompt-injection-detection) to identify potentially harmful commands | true/false | false | No |
5553
| `SECURITY_PROMPT_THRESHOLD` | Sensitivity threshold for prompt injection detection (higher = stricter) | Float between 0.01 and 1.0 | 0.8 | No |
5654
| `SECURITY_PROMPT_CLASSIFIER_ENABLED` | Enable ML-based prompt injection detection for advanced threat identification | true/false | false | No |
@@ -96,10 +94,6 @@ GOOSE_SEARCH_PATHS:
9694
- "~/custom/tools"
9795
- "/opt/homebrew/bin"
9896

99-
# Observability (OpenTelemetry)
100-
OTEL_EXPORTER_OTLP_ENDPOINT: "http://localhost:4318"
101-
OTEL_EXPORTER_OTLP_TIMEOUT: 20000
102-
10397
# Security Configuration
10498
SECURITY_PROMPT_ENABLED: true
10599

@@ -155,6 +149,20 @@ GOOSE_SEARCH_PATHS:
155149

156150
These paths are prepended to the system PATH when running extension commands, ensuring your custom tools are found without modifying your global PATH.
157151

152+
## Observability Configuration
153+
154+
Configure goose to export telemetry to [OpenTelemetry](https://opentelemetry.io/docs/) compatible platforms. Environment variables override these settings and support additional options like per-signal configuration. See the [environment variables guide](/docs/guides/environment-variables#opentelemetry-protocol-otlp) for details.
155+
156+
| Setting | Purpose | Values | Default |
157+
|---------|---------|--------|---------|
158+
| `otel_exporter_otlp_endpoint` | OTLP endpoint URL | URL (e.g., `http://localhost:4318`) | None |
159+
| `otel_exporter_otlp_timeout` | Export timeout in milliseconds | Integer (ms) | 10000 |
160+
161+
```yaml
162+
otel_exporter_otlp_endpoint: "http://localhost:4318"
163+
otel_exporter_otlp_timeout: 20000
164+
```
165+
158166
## Recipe Command Configuration
159167
You can optionally set up [custom slash commands](/docs/guides/context-engineering/slash-commands) to run recipes that you create. List the command (without the leading `/`) along with the path to the recipe:
160168

documentation/docs/guides/environment-variables.md

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -462,29 +462,50 @@ Alternatively, proxy settings can be configured through your operating system's
462462

463463
Beyond goose's built-in [logging system](/docs/guides/logs), you can export telemetry to external observability platforms for advanced monitoring, performance analysis, and production insights.
464464

465-
### OpenTelemetry Protocol (OTLP)
465+
### Observability Configuration
466466

467-
Configure goose to export traces and metrics to any OTLP-compatible observability platform.
468-
OTLP is the standard protocol for sending telemetry collected by [OpenTelemetry](https://opentelemetry.io/docs/). When configured, goose exports telemetry asynchronously and flushes on exit.
467+
Configure goose to export telemetry to any [OpenTelemetry](https://opentelemetry.io/docs/) compatible platform.
468+
469+
To enable export, set a collector endpoint:
469470

470-
| Variable | Purpose | Values | Default |
471-
|----------|---------|--------|---------|
472-
| `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP endpoint URL | URL (e.g., `http://localhost:4318`) | None |
473-
| `OTEL_EXPORTER_OTLP_TIMEOUT` | Export timeout in milliseconds | Integer (ms) | `10000` |
474-
475-
**When to use OTLP:**
476-
- Diagnosing slow tool execution or LLM response times
477-
- Understanding intermittent failures across multiple sessions
478-
- Monitoring goose performance in production or CI/CD environments
479-
- Tracking usage patterns, costs, and resource consumption over time
480-
- Setting up alerts for performance degradation or high error rates
481-
482-
**Example:**
483471
```bash
484472
export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318"
485-
export OTEL_EXPORTER_OTLP_TIMEOUT=10000
486473
```
487474

475+
You can control each signal (traces, metrics, logs) independently with `OTEL_{SIGNAL}_EXPORTER`:
476+
477+
| Variable pattern | Purpose | Values |
478+
|---|---|---|
479+
| `OTEL_EXPORTER_OTLP_ENDPOINT` | Base OTLP endpoint (applies `/v1/traces`, etc.) | URL |
480+
| `OTEL_EXPORTER_OTLP_{SIGNAL}_ENDPOINT` | Override endpoint for a specific signal | URL |
481+
| `OTEL_{SIGNAL}_EXPORTER` | Exporter type per signal | `otlp`, `console`, `none` |
482+
| `OTEL_SDK_DISABLED` | Disable all OTel export | `true` |
483+
484+
Additional variables like `OTEL_SERVICE_NAME`, `OTEL_RESOURCE_ATTRIBUTES`,
485+
and `OTEL_EXPORTER_OTLP_TIMEOUT` are also supported.
486+
See the [OTel environment variable spec][otel-env] for the full list.
487+
488+
**Examples:**
489+
```bash
490+
# Export everything to a local collector
491+
export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318"
492+
493+
# Export only traces, disable metrics and logs
494+
export OTEL_TRACES_EXPORTER="otlp"
495+
export OTEL_METRICS_EXPORTER="none"
496+
export OTEL_LOGS_EXPORTER="none"
497+
export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318"
498+
499+
# Debug traces to console (no collector needed)
500+
export OTEL_TRACES_EXPORTER="console"
501+
502+
# Sample 10% of traces (reduce volume in production)
503+
export OTEL_TRACES_SAMPLER="parentbased_traceidratio"
504+
export OTEL_TRACES_SAMPLER_ARG="0.1"
505+
```
506+
507+
[otel-env]: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
508+
488509
### Langfuse Integration
489510

490511
These variables configure the [Langfuse integration for observability](/docs/tutorials/langfuse).

0 commit comments

Comments
 (0)