Repository navigation
Update tag attribution - #143
Merged
Merged
Conversation
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
NETFLIX_CONTAINER_NAMEandNETFLIX_PROCESS_NAME, and add anincludeEnvTagsoption toConfigSummary
nf.container: read fromNETFLIX_CONTAINER_NAMEfirst, falling back toTITUS_CONTAINER_NAME.nf.process: read fromNETFLIX_PROCESS_NAMEfirst, falling back toTITUS_PROCESS_NAME, which is now deprecated. Before this change, onlyTITUS_PROCESS_NAMEwas read.Configparameter:includeEnvTags, which defaults totrue. When it isfalse, neither tag is added from 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.NETFLIX_PROCESS_NAME: every other spectator client (Java, Go, Python, JavaScript) readsnf.processfromNETFLIX_PROCESS_NAME. This change makes C++ consistent with them.TITUS_PROCESS_NAMEis kept as a fallback, so existing setups keep working.includeEnvTags: the environment tags are applied to every meter id withMeterId::WithTags, which replaces any tag with the same key on the meter.nf.containeron each meter, and the agent's own container name would replace it.falseleaves those tags alone. Tags passed inextraTagsare still added.Behavior
NETFLIX_CONTAINER_NAMETITUS_CONTAINER_NAMEnf.containerappmainappmainmainappappnf.processfollows the same rules, withNETFLIX_PROCESS_NAMEfirst andTITUS_PROCESS_NAMEas the fallback.AddFirstNonEmptyhelper replaces the twogetenvblocks.Config(writerConfig)andConfig(writerConfig, extraTags)calls compile unchanged. Callers do need to rebuild, because the constructor's signature changed.Behavior change: an application whose environment has
NETFLIX_PROCESS_NAMEset now gets that value asnf.process. If it also setsTITUS_PROCESS_NAME, theNETFLIX_PROCESS_NAMEvalue wins. Applications that set onlyTITUS_PROCESS_NAMEsee no change.Docs
libs/config/README.md:TITUS_PROCESS_NAMEas deprecated.extraTags.NETFLIX_PROCESS_NAMEseparately for each process, and lists the allowed characters.includeEnvTagsoption, with an example.libs/config/config.h: a comment on the constructor explainsincludeEnvTags.