Enrichment status code #2178#2213
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2213 +/- ##
==========================================
+ Coverage 67.52% 68.91% +1.39%
==========================================
Files 320 320
Lines 42409 42446 +37
==========================================
+ Hits 28635 29252 +617
+ Misses 12148 11489 -659
- Partials 1626 1705 +79
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| Enrichment EnrichmentConfig `yaml:"enrichment"` | ||
| } | ||
|
|
||
| type HTTPResponseStatusCodeRange struct { |
There was a problem hiding this comment.
question: should we reuse MatchDefinition in pkg/filter/matcher.go which is more complete and already implemented?
There was a problem hiding this comment.
I will use MatchDefinition, i had not noticed it earlier
There was a problem hiding this comment.
seems like there's an import cycle, we should probably move MatchDefinition somewhere else (maybe config?)
| URLPathPatterns []services.GlobAttr `yaml:"url_path_patterns"` | ||
| // Methods is a list of HTTP methods this rule applies to (shared). Empty means all methods. | ||
| Methods []HTTPMethod `yaml:"methods"` | ||
| // HTTPResponseStatusCode filters this rule to only when the response code matches teh given |
There was a problem hiding this comment.
| // HTTPResponseStatusCode filters this rule to only when the response code matches teh given | |
| // HTTPResponseStatusCode filters this rule to only when the response code matches the given |
| Methods []HTTPMethod `yaml:"methods"` | ||
| // HTTPResponseStatusCode filters this rule to only when the response code matches teh given | ||
| // range | ||
| HTTPResponseStatusCode *HTTPResponseStatusCodeRange `yaml:"http_response_status_code"` |
There was a problem hiding this comment.
nit: this is already part of an "http_"-named struct, so I would omit the http_ prefix from the field name and yaml tag
There was a problem hiding this comment.
Removed the http_ prefix — field and yaml tag are now response_status_code.
| | `greater_equals` | `integer` | | Matches if the response status code is greater than or equal to this value | | ||
| | `less_equals` | `integer` | | Matches if the response status code is less than or equal to this value | |
There was a problem hiding this comment.
maybe just call these min and max? or is there prior convention on the _equals pattern?
There was a problem hiding this comment.
Kept _equals since MatchDefinition in pkg/filter/matcher.go already establishes that convention in this codebase.
|
@hectar-glitches if you run |
Summary
Add HTTP response status code matching to enrichment rules
Closes #2178
Add http_response_status_code to the enrichment rule block, allowing rules to filter by response status code range. This lets users capture HTTP body data only for specific responses (e.g. 5xx errors) without dropping entire traces.
Validation