Skip to content

fix: reload span_name_sanitization overrides during runtime - #6435

Merged
electron0zero merged 5 commits into
grafana:mainfrom
electron0zero:fix_span_name_sanitizer_loading
Feb 11, 2026
Merged

fix: reload span_name_sanitization overrides during runtime#6435
electron0zero merged 5 commits into
grafana:mainfrom
electron0zero:fix_span_name_sanitizer_loading

Conversation

@electron0zero

@electron0zero electron0zero commented Feb 11, 2026

Copy link
Copy Markdown
Member

What this PR does:

Before this fix, we were just loading the MetricsGeneratorSpanNameSanitization overrides just at startup, and never checking or reloading after that.

If the overrides were updated (which they can without restart), we won't reload them and the MetricsGeneratorSpanNameSanitization config change in the overrides won't take effact without restart

we missed this detail and the reload in the #6098, so fixing it now in a follow up PR

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
…time

before this fix, we were just loading the MetricsGeneratorSpanNameSanitization of the overrides at startup

if the overrides were updated (which they can without restart), we won't reload them and the MetricsGeneratorSpanNameSanitization
config change in the overrides won't take effact without restart
@electron0zero electron0zero changed the title fix: reload SpanNameSanitization overrides during runtime Feb 11, 2026
if sanitizationMode := overrides.MetricsGeneratorSpanNameSanitization(tenant); sanitizationMode != SpanNameSanitizationDisabled {
sanitizer = NewDrainSanitizer(tenant, sanitizationMode == SpanNameSanitizationDryRun, cfg.StaleDuration)
}
sanitizer := NewDrainSanitizer(tenant, overrides.MetricsGeneratorSpanNameSanitization, cfg.StaleDuration)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is following the same pattern we follow in the NewTracker in the modules/distributor/usage/tracker.go

another way we can do it pass overrides down and call MetricsGeneratorSpanNameSanitization instead of taking func as argument.

@electron0zero
electron0zero enabled auto-merge (squash) February 11, 2026 19:18
@electron0zero
electron0zero merged commit 871f97c into grafana:main Feb 11, 2026
39 of 40 checks passed
@electron0zero
electron0zero deleted the fix_span_name_sanitizer_loading branch February 11, 2026 19:21
mattdurham pushed a commit to mattdurham/tempo that referenced this pull request Jun 18, 2026
…6435)

* fix: reload MetricsGeneratorSpanNameSanitization overrides during runtime

before this fix, we were just loading the MetricsGeneratorSpanNameSanitization of the overrides at startup

if the overrides were updated (which they can without restart), we won't reload them and the MetricsGeneratorSpanNameSanitization
config change in the overrides won't take effact without restart

* Add CHANGELOG.md

* cleanup noopSanitizer because we don't need it anymore

* Add a test to ensure toggle works

* replace assert with require
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants