Skip to content

Commit 65441b5

Browse files
docs(readme): add headers/resource-attributes examples and security note
1 parent 92bb54a commit 65441b5

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ An [opencode](https://opencode.ai) plugin that exports telemetry via OpenTelemet
88
- [Installation](#installation)
99
- [Configuration](#configuration)
1010
- [Quick start](#quick-start)
11+
- [Headers and resource attributes](#headers-and-resource-attributes)
1112
- [Datadog example](#datadog-example)
1213
- [Honeycomb example](#honeycomb-example)
1314
- [Claude Code dashboard compatibility](#claude-code-dashboard-compatibility)
@@ -71,8 +72,20 @@ All configuration is via environment variables. Set them in your shell profile (
7172
| `OPENCODE_OTLP_METRICS_INTERVAL` | `60000` | Metrics export interval in milliseconds |
7273
| `OPENCODE_OTLP_LOGS_INTERVAL` | `5000` | Logs export interval in milliseconds |
7374
| `OPENCODE_METRIC_PREFIX` | `opencode.` | Prefix for all metric names (e.g. set to `claude_code.` for Claude Code dashboard compatibility) |
74-
| `OPENCODE_OTLP_HEADERS` | _(unset)_ | Comma-separated `key=value` headers added to all OTLP exports (e.g. for auth tokens) |
75-
| `OPENCODE_RESOURCE_ATTRIBUTES` | _(unset)_ | Comma-separated `key=value` pairs merged into the OTel resource |
75+
| `OPENCODE_OTLP_HEADERS` | _(unset)_ | Comma-separated `key=value` headers added to all OTLP exports. Example: `api-key=abc123,x-tenant=my-org`. **Keep out of version control — may contain sensitive auth tokens.** |
76+
| `OPENCODE_RESOURCE_ATTRIBUTES` | _(unset)_ | Comma-separated `key=value` pairs merged into the OTel resource. Example: `service.version=1.2.3,deployment.environment=production` |
77+
78+
### Headers and resource attributes
79+
80+
```bash
81+
# Auth token for a managed collector (e.g. Honeycomb, Grafana Cloud)
82+
export OPENCODE_OTLP_HEADERS="x-honeycomb-team=your-api-key,x-honeycomb-dataset=opencode"
83+
84+
# Tag every metric and log with deployment context
85+
export OPENCODE_RESOURCE_ATTRIBUTES="service.version=1.2.3,deployment.environment=production"
86+
```
87+
88+
> **Security note:** `OPENCODE_OTLP_HEADERS` typically contains auth tokens. Set it in your shell profile (`~/.zshrc`, `~/.bashrc`) or a secrets manager — never commit it to version control or print it in CI logs.
7689
7790
### Quick start
7891

0 commit comments

Comments
 (0)