feat(internal): Add VECTOR_HOSTNAME env variable #21789
Open
+27
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
By default, Vector uses the hostname returned by the gethostname. However, in cases when Vector is running in containers, it is meaningless because hostname is always the name of the container, e.g., the name of a pod in Kubernetes cluster.
This commit adds the way to override a hostname by using the env variable. In Kubernetes it can be used like this to see the name of a node where the Vector process is running (which is more meaningful).
Change Type
Is this a breaking change?
How did you test this PR?
Tested manually in the kubernetes cluster.
Does this PR include user facing changes?
Checklist
Cargo.lock
), pleaserun
dd-rust-license-tool write
to regenerate the license inventory and commit the changes (if any). More details here.References
Closes #20481