-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Adding static config resource detector for tracing #34944
Adding static config resource detector for tracing #34944
Conversation
Signed-off-by: Juan Manuel Ollé <jolle@mulesoft.com>
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
Signed-off-by: Juan Manuel Ollé <jolle@mulesoft.com>
Signed-off-by: Juan Manuel Ollé <jolle@mulesoft.com>
Signed-off-by: Juan Manuel Ollé <jolle@mulesoft.com>
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.
Thanks for your contribution. And some comments are added to the implementation.
/lgtm api
private: | ||
const envoy::extensions::tracers::opentelemetry::resource_detectors::v3:: | ||
StaticConfigResourceDetectorConfig config_; |
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.
Rather than storing the whole proto config here, I think you could just to store the attributes by a flat_hash_map
typed_config: | ||
"@type": type.googleapis.com/envoy.extensions.tracers.opentelemetry.resource_detectors.v3.StaticConfigResourceDetectorConfig |
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.
The integration test is a little weird. I think at least we should add a case where valid attributes are work?
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.
Yes, I just take a look what the other 2 detectors were doing. But I agree the use case you mention is better
Signed-off-by: Juan Manuel Ollé <jolle@mulesoft.com>
Signed-off-by: Juan Manuel Ollé <jolle@mulesoft.com>
/retest |
for (const auto& pair : attributes_) { | ||
const std::string& key = pair.first; | ||
const std::string& value = pair.second; |
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.
for(const auto& [key, value] : attributes_)
would be simpler.
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.
Only two comments to the implementation and test. Others are fine. Thanks for the update. :)
], | ||
extension_names = ["envoy.tracers.opentelemetry.resource_detectors.static_config"], | ||
deps = [ | ||
"//source/exe:main_common_lib", |
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.
This is not a good practice to depend the whole main. You should figure out what lib is actually be depended and list the actually dependency here.
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.
true, sorry, I have copied it and it is not needed this lib at all.
Signed-off-by: Juan Manuel Ollé <jolle@mulesoft.com>
@wbpcode friendly ping |
Ping @wbpcode PTAL |
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.
LGTM overall. Only one comment to the comment. And please merge the main. Thanks. 🌹
EXPECT_TRUE(resource.attributes_.empty()); | ||
} | ||
|
||
// Test detector with valid values in attributes config |
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.
nit: invalid
/wait |
Signed-off-by: Juan Manuel Ollé <jolle@mulesoft.com>
cc @juanmolle Hi, please merge main then we can try to merge it. :) |
Signed-off-by: Juan Manuel Ollé <jolle@mulesoft.com>
My apologies, I didn't understand your comment. |
Implementation for new trace resource detector.
This new Detector allows to use static config for resource attributes.
Risk Level: low
Testing: yes
Docs Changes: yes
Release Notes: yes
Platform Specific Features: No