ROX-33893: Support glob patterns in telemetry header names#19687
Closed
parametalol wants to merge 4 commits intomasterfrom
Closed
ROX-33893: Support glob patterns in telemetry header names#19687parametalol wants to merge 4 commits intomasterfrom
parametalol wants to merge 4 commits intomasterfrom
Conversation
Change telemetry campaign header matching from exact string keys to glob pattern keys. This allows matching multiple headers with a single pattern (e.g., "Rh-*" instead of hardcoding specific header names). Changes: - Updated APICallCampaignCriterion.Headers from map[string]glob.Pattern to map[glob.Pattern]glob.Pattern - Added HeadersFilter func to RequestParams for pattern-based filtering - Implemented Headers.GetAll method for glob-based header matching - Updated ServiceNow integration to use "Rh-*" pattern - Added comprehensive test coverage This change was requested to make telemetry header tracking more flexible for integrations that may use varying header names with common prefixes. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
Skipping CI for Draft Pull Request. |
Contributor
|
Images are ready for the commit at f52b5a2. To use with deploy scripts, first |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #19687 +/- ##
==========================================
+ Coverage 49.37% 49.66% +0.28%
==========================================
Files 2742 2747 +5
Lines 206953 207310 +357
==========================================
+ Hits 102187 102959 +772
+ Misses 97182 96697 -485
- Partials 7584 7654 +70
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
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.
Description
Support glob patterns in telemetry header names, not just values. Previously, campaigns could only match exact header names. Now both header names and values support globs (e.g.,
"Rh-*": NoHeaderOrAnyValue).Additionally, refactored
RequestParamsto replaceHeaders func(string) []stringfield withHeaders Headersfield.Key changes:
APICallCampaignCriterion.Headers:map[string]glob.Pattern->map[glob.Pattern]glob.PatternRequestParams:Headersfield type is nowHeadersHeaders.GetAll: matches both header names and values using globsNewHeaders(metadata.MD): canonicalizes gRPC metadata lowercase keys intohttp.Headerformat"Rh-*"pattern instead of hardcoded header nameMotivation:
ServiceNow sets headers with a common
Rh-prefix, but the exact name may vary. Glob patterns for header names allow tracking related headers without hardcoding each variant.User-facing documentation
Testing and quality
Automated testing
How I validated my change
Headersfield"Rh-*"pattern matchinggo test ./pkg/telemetry/phonehome/... ./central/telemetry/centralclient/...