Skip to content

docs: Add valid character restrictions for env var interpolation#25801

Open
balobe wants to merge 1 commit into
vectordotdev:masterfrom
balobe:patch-1
Open

docs: Add valid character restrictions for env var interpolation#25801
balobe wants to merge 1 commit into
vectordotdev:masterfrom
balobe:patch-1

Conversation

@balobe

@balobe balobe commented Jul 10, 2026

Copy link
Copy Markdown

Summary

Vector's environment variable interpolation silently ignores variable names containing hyphens (e.g. ${my-var}), passing them through as literal strings. This is because the interpolation regex in src/config/vars.rs (lines 5–17) restricts variable names to letters (upper and lowercase), digits, underscores, and dots. This constraint was undocumented, making it hard to
debug.
This PR adds a note to the environment variables reference to document this restriction.

Vector configuration

NA

How did you test this PR?

Ran the website locally with make serve and verified the guide renders correctly, including the embedded configuration files.

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • [ x] Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • [ x] No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

NA

@balobe balobe requested review from a team as code owners July 10, 2026 18:51
@github-actions github-actions Bot added the docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. label Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Before we can merge this PR, please sign our Contributor License Agreement.

To sign, copy and post the phrase below as a new comment on this PR.

Note: If the bot says your username was not found, the email used in your git commit may not be linked to your GitHub account. Fix this at github.com/settings/emails, then comment recheck to retry.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@datadog-vectordotdev

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

🚦 1 Pipeline job failed

CLA Assistant | CLAAssistant   View in Datadog   GitHub Actions

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1a990f2 | Docs | Give us feedback!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a990f2aa9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

## Variable name restrictions

Environment variable names used in interpolation are restricted to letters, digits plus `_` and `.` characters.
Names containing other characters (such as hyphens `-`) will not be interpolated.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clarify that hyphens can still trigger interpolation

For hyphenated placeholders this says they “will not be interpolated,” but the interpolation regex in src/config/vars.rs still matches the valid prefix for $FOO-BAR and treats ${FOO-BAR} as the documented - default-value form. In configs that contain Kubernetes-style names or other hyphenated placeholders, users following this reference may expect the text to remain literal when Vector can instead substitute $FOO, emit a missing-var error, or resolve ${FOO-BAR} to BAR; the docs should say unsupported characters terminate the variable name / enter operator syntax and advise escaping or preprocessing.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant