fix: show canonical env var names in adapter messages#379
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Thank you for following the naming conventions! 🙏 |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (14)
📝 WalkthroughWalkthroughThis PR standardizes environment-variable messaging: it adds formatPublicEnvKeys to shared config, updates adapters to use it for user-facing error messages (while still accepting NUXT_* aliases at runtime), adjusts adapter templates/skills, updates docs/README, and adds tests for formatting and deprecation warnings. ChangesAdapter environment variable messaging standardization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/docs/content/3.integrate/adapters/cloud/02.otlp.md (1)
134-152:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate the remaining OTLP examples to the canonical OTEL_ vars.*
The env-var table now uses
OTEL_EXPORTER_OTLP_*, but the quick-start and provider-specific snippets below still tell users to setOTLP_ENDPOINT/OTLP_HEADERS. That leaves the page with two incompatible setup paths.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/docs/content/3.integrate/adapters/cloud/02.otlp.md` around lines 134 - 152, Update all remaining OTLP examples that reference OTLP_ENDPOINT/OTLP_HEADERS to use the canonical OTEL_* names used in the env-var table: replace OTLP_ENDPOINT -> OTEL_EXPORTER_OTLP_ENDPOINT and OTLP_HEADERS -> OTEL_EXPORTER_OTLP_HEADERS (and any OTLP_* variants) in the quick-start and provider-specific snippets; keep the Nuxt runtimeConfig key (otlp.endpoint) but ensure its comment and examples state it is set via OTEL_EXPORTER_OTLP_ENDPOINT to keep both paths consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/docs/content/3.integrate/adapters/01.overview.md`:
- Around line 350-375: Unify the Better Stack environment variable name across
the docs by choosing a single public name (replace BETTER_STACK_API_KEY with
BETTER_STACK_SOURCE_TOKEN): update the env block example, any prose mentions,
and all Better Stack table rows so they consistently use
BETTER_STACK_SOURCE_TOKEN; ensure any explanatory text that refers to the
variable name is adjusted accordingly (search for BETTER_STACK_API_KEY and
BETTER_STACK_SOURCE_TOKEN and standardize them to the chosen symbol in the code
block and tables).
---
Outside diff comments:
In `@apps/docs/content/3.integrate/adapters/cloud/02.otlp.md`:
- Around line 134-152: Update all remaining OTLP examples that reference
OTLP_ENDPOINT/OTLP_HEADERS to use the canonical OTEL_* names used in the env-var
table: replace OTLP_ENDPOINT -> OTEL_EXPORTER_OTLP_ENDPOINT and OTLP_HEADERS ->
OTEL_EXPORTER_OTLP_HEADERS (and any OTLP_* variants) in the quick-start and
provider-specific snippets; keep the Nuxt runtimeConfig key (otlp.endpoint) but
ensure its comment and examples state it is set via OTEL_EXPORTER_OTLP_ENDPOINT
to keep both paths consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 54127822-b3bb-440b-a979-0991a234468a
⛔ Files ignored due to path filters (1)
packages/evlog/test/toolkit/__snapshots__/api-surface.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (27)
.agents/skills/create-adapter/SKILL.md.agents/skills/create-adapter/references/adapter-template.md.changeset/adapter-env-messages-dx.mdapps/docs/content/3.integrate/adapters/01.overview.mdapps/docs/content/3.integrate/adapters/cloud/01.axiom.mdapps/docs/content/3.integrate/adapters/cloud/02.otlp.mdapps/docs/content/3.integrate/adapters/cloud/03.posthog.mdapps/docs/content/3.integrate/adapters/cloud/04.sentry.mdapps/docs/content/3.integrate/adapters/cloud/05.better-stack.mdapps/docs/content/3.integrate/adapters/cloud/06.datadog.mdapps/docs/content/3.integrate/adapters/cloud/07.hyperdx.mdapps/docs/content/3.integrate/adapters/self-hosted/03.memory.mdapps/docs/content/5.extend/8.custom-drains.mdapps/docs/skills/review-logging-patterns/SKILL.mdpackages/evlog/README.mdpackages/evlog/src/adapters/axiom.tspackages/evlog/src/adapters/better-stack.tspackages/evlog/src/adapters/datadog.tspackages/evlog/src/adapters/hyperdx.tspackages/evlog/src/adapters/memory.tspackages/evlog/src/adapters/otlp.tspackages/evlog/src/adapters/posthog.tspackages/evlog/src/adapters/sentry.tspackages/evlog/src/shared/config.tspackages/evlog/test/adapters/axiom.test.tspackages/evlog/test/adapters/better-stack.test.tspackages/evlog/test/shared/config.test.ts
| Each adapter reads from standard environment variables — the same names work in every framework: | ||
|
|
||
| ```bash [.env] | ||
| # Axiom (NUXT_AXIOM_* or AXIOM_*) | ||
| # Axiom | ||
| AXIOM_API_KEY=xaat-xxx | ||
| AXIOM_DATASET=my-logs | ||
|
|
||
| # OTLP (NUXT_OTLP_* or OTEL_*) | ||
| OTLP_ENDPOINT=https://otlp.example.com | ||
| # OTLP | ||
| OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp.example.com | ||
|
|
||
| # HyperDX (NUXT_HYPERDX_* or HYPERDX_*) | ||
| # HyperDX | ||
| HYPERDX_API_KEY=<YOUR_HYPERDX_API_KEY_HERE> | ||
|
|
||
| # PostHog (NUXT_POSTHOG_* or POSTHOG_*) | ||
| # PostHog | ||
| POSTHOG_API_KEY=phc_xxx | ||
|
|
||
| # Sentry (NUXT_SENTRY_* or SENTRY_*) | ||
| # Sentry | ||
| SENTRY_DSN=https://key@o0.ingest.sentry.io/123 | ||
|
|
||
| # Better Stack (NUXT_BETTER_STACK_* or BETTER_STACK_*) | ||
| # Better Stack | ||
| BETTER_STACK_API_KEY=your-source-token | ||
|
|
||
| # Datadog (NUXT_DATADOG_* or DATADOG_* or DD_*) | ||
| # Datadog | ||
| DD_API_KEY=your-api-key | ||
| DD_SITE=datadoghq.eu | ||
| ``` |
There was a problem hiding this comment.
Better Stack env-var naming is still inconsistent across the docs.
Both files now mention BETTER_STACK_API_KEY, but the Better Stack tables still list BETTER_STACK_SOURCE_TOKEN. Update the prose/example and the table rows to one public name in both files.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/docs/content/3.integrate/adapters/01.overview.md` around lines 350 -
375, Unify the Better Stack environment variable name across the docs by
choosing a single public name (replace BETTER_STACK_API_KEY with
BETTER_STACK_SOURCE_TOKEN): update the env block example, any prose mentions,
and all Better Stack table rows so they consistently use
BETTER_STACK_SOURCE_TOKEN; ensure any explanatory text that refers to the
variable name is adjusted accordingly (search for BETTER_STACK_API_KEY and
BETTER_STACK_SOURCE_TOKEN and standardize them to the chosen symbol in the code
block and tables).
The NUXT_* env aliases were never part of the public contract, so the deprecation warning no longer surfaces them. It now only points to the canonical config field. Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
commit: |
Drop the BETTER_STACK_SOURCE_TOKEN env alias from user-facing docs so the public name is BETTER_STACK_API_KEY everywhere. The legacy sourceToken config field stays documented; the env alias keeps working silently. Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
| # OTLP (NUXT_OTLP_* or OTEL_*) | ||
| OTLP_ENDPOINT=https://otlp.example.com | ||
| # OTLP | ||
| OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp.example.com |
There was a problem hiding this comment.
@linear Why aren't there any OTLP endpoints anymore? Because I see that we're using an OTL exporter OTLP endpoint, which is a longer key, whereas an OTL endpoint is shorter and perhaps clearer. Is there a logical explanation for this? Is it a standardized format, etc.? And in that case, no problem, should we leave it as is? Or can we keep the OTLP endpoint? Or at least have both?
There was a problem hiding this comment.
There is a logical reason: OTEL_EXPORTER_OTLP_ENDPOINT is the standard OpenTelemetry env var, and the adapter already treats that as the canonical public name in packages/evlog/src/adapters/otlp.ts. OTLP_ENDPOINT is shorter, but it’s not currently a real supported alias in code — the remaining mentions in apps/docs/content/3.integrate/adapters/cloud/02.otlp.md look like stale docs, not an intended API.
So I’d leave the canonical docs on OTEL_EXPORTER_OTLP_ENDPOINT. If you want the shorter form too, that should be an explicit product decision: add OTLP_ENDPOINT as a real silent alias in code, then decide whether to document it or keep it purely as compatibility sugar.
There was a problem hiding this comment.
I think I'd like to have that added. It'll make things easier. Just as an alias for DX.
There was a problem hiding this comment.
Started working on this.
AgentSession
Add the shorter OTLP_ENDPOINT and OTLP_HEADERS env vars as real aliases for the standard OTEL_EXPORTER_OTLP_* names. The OpenTelemetry standard names remain supported; the shorthand is purely a DX convenience. Docs and the missing-endpoint error now reference both. Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
Summary by CodeRabbit
Documentation
Bug Fixes
Refactor
Tests