feat: set Alias on auto-generated namespace-routing rewrite_tag filters - #2052
Open
ruben-chainalysis wants to merge 2 commits into
Open
feat: set Alias on auto-generated namespace-routing rewrite_tag filters#2052ruben-chainalysis wants to merge 2 commits into
ruben-chainalysis wants to merge 2 commits into
Conversation
The auto-generated rewrite_tag filter used for namespace routing did not set the Alias field, causing Fluent Bit filter metrics to report opaque names like rewrite_tag.0 instead of meaningful identifiers. Set Alias to "namespace-routing-<namespace>" unconditionally so that each FluentBitConfig's rewrite_tag filter is distinguishable in metrics. The value is derived from the config's namespace (always available) and does not require any CRD schema changes. Fixes: fluent#2051 Signed-off-by: Rubén Cabrera Martínez <ruben.cabrera@chainalysis.com>
Signed-off-by: Rubén Cabrera Martínez <ruben.cabrera@chainalysis.com>
Contributor
Author
|
I didn't find the right place to document this, but always happy to put some docs in my PR if you help me with it. As I said in the linked issue, I don't have an opinion about the naming convention for the Alias, just used the first thing that came to mind. Would putting the namespace name first help for things like dashboard fonts not fitting a very long name? That way the least relevant part of the alias goes at the end. |
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.
What this PR does / why we need it:
Auto-generated namespace-routing
rewrite_tagfilters (created bygenerateRewriteTagConfig) produce metrics with opaque names likerewrite_tag.0,rewrite_tag.1. This makes it impossible to correlate filter pipeline metrics (fluentbit_filter_records,fluentbit_filter_emit_records) back to the namespace they route for.This PR sets
Aliason each auto-generatedrewrite_tagfilter using the patternnamespace-routing-<namespace>, so filter metrics become identifiable (e.g.namespace-routing-kube-systeminstead ofrewrite_tag.3).FluentBit core already uses
Aliasas thenamelabel in Prometheus metrics (fluent/fluent-bit#4694). CRD-defined filters already supportAlias(#356, #370). After #2019 refactoredgenerateRewriteTagConfigto use afilter.RewriteTagstruct,CommonParams.AddCommonParams()handles emission, so this is a one-field addition.Alias uniqueness is guaranteed because Kubernetes namespace names are unique per cluster, so
namespace-routing-<ns>cannot collide (fluent/fluent-bit#6076 does not apply).Which issue(s) this PR fixes:
Fixes #2051
Does this PR introduced a user-facing change?
Additional documentation, usage docs, etc.: