-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(routingprocessor): add option to drop resource attribute used for routing #8990
feat(routingprocessor): add option to drop resource attribute used for routing #8990
Conversation
19372c0
to
34f0e08
Compare
I'll take a look soon, but I might have the chance to look at it only next week (Tue perhaps). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of minor comments, but LGTM overall.
@@ -22,6 +22,7 @@ The following settings can be optionally configured: | |||
- `attribute_source` defines where to look for the attribute in `from_attribute`. The allowed values are: | |||
- `context` (the default) - to search the [context][context_docs], which includes HTTP headers | |||
- `resource` - to search the resource attributes. | |||
- `drop_resource_routing_attribute` - controls whether to remove the resource attribute used for routing. This is only relevant if AttributeSource is set to resource. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit verbose for my taste, but I can't come up with a better name :-)
assert.False(t, ok, "routing attribute should be dropped") | ||
v, ok := attrs.Get("attr") | ||
assert.True(t, ok, "non routing attributes shouldn't be dropped") | ||
assert.Equal(t, "acme", v.StringVal()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto for those two lines
assert.False(t, ok, "routing attribute should be dropped") | ||
v, ok := attrs.Get("attr") | ||
assert.True(t, ok, "non routing attributes shouldn't be dropped") | ||
assert.Equal(t, "acme", v.StringVal()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the other comments
Co-authored-by: Juraci Paixão Kröhling <[email protected]>
6f68233
to
4f3acce
Compare
Unrelated test failure:
|
Description: add an option to drop the attribute used for routing
Link to tracking Issue: #7407
Testing: Added UTs
Documentation: Added change in processor's README.