Repository navigation
Read nf.container from NETFLIX_CONTAINER_NAME - #134
Merged
Merged
Conversation
brharrington
approved these changes
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Title: Read
nf.containerfromNETFLIX_CONTAINER_NAME, and addNewConfigWithoutEnvTagsSummary
nf.containeris now read fromNETFLIX_CONTAINER_NAMEfirst, falling back toTITUS_CONTAINER_NAME.nf.processis unchanged and still comes fromNETFLIX_PROCESS_NAME.NewConfigWithoutEnvTagsis the same asNewConfigWithBuffer, but it does not addnf.containerandnf.processfrom the environment.Why
NETFLIX_CONTAINER_NAME:TITUS_CONTAINER_NAMEexists only on Titus, so containers on other platforms get nonf.containertag today.NETFLIX_CONTAINER_NAMEis a platform-neutral variable that holds the container's name (the Kubernetes container name). Reading it first, with the Titus variable as the fallback, adds coverage for other platforms and leaves Titus unchanged.NewConfigWithoutEnvTags: the environment tags are merged last into the extra common tags, and those are applied to every meter id, so they replace any tag with the same key on each meter.nf.containerandnf.processon every metric it forwards, replacing the senders' values.Behavior
NETFLIX_CONTAINER_NAMETITUS_CONTAINER_NAMEnf.containerappmainappmainmainappappaddNonEmptyhelper, which already accepts several variables. Values are trimmed and blank values are skipped, as before.NETFLIX_CONTAINER_NAMEis unset, the tags are exactly what they are today.NewConfigandNewConfigWithBufferstill add the environment tags, and those still take precedence overextraCommonTags.newConfighelper carries anincludeEnvTagsflag, andcalculateExtraCommonTagsskips the environment tags when it is false.Docs
tagsFromEnvVarscomment: lists the variables and the fallback.NewConfigdoc comment: says the environment tags take precedence overextraCommonTags, and points toNewConfigWithoutEnvTags.NewConfigWithoutEnvTagsdoc comment: explains when to use it.flushIntervalcomment on the new constructor: reads "used when bufferSize > 0; NewConfig uses 5 seconds". The existing "defaults to 5 seconds" comment onNewConfigWithBufferisn't accurate, so I didn't copy it. I left that existing comment unchanged.