-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[OTel C++] Add API to set channel scope filter #36189
Conversation
src/cpp/ext/otel/otel_plugin.h
Outdated
const ChannelScope& scope) | ||
ClientScopeConfig( | ||
const OpenTelemetryPlugin* otel_plugin, | ||
const grpc_core::experimental::StatsPluginChannelScope& scope) |
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 should probably refer to this type as OpenTelemetryPluginBuilder::ChannelScope
, for consistency with the rest of this code.
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.
Done
src/cpp/ext/otel/otel_plugin.h
Outdated
@@ -337,7 +338,8 @@ class OpenTelemetryPlugin : public grpc_core::StatsPlugin { | |||
|
|||
// StatsPlugin: | |||
std::pair<bool, std::shared_ptr<grpc_core::StatsPlugin::ScopeConfig>> | |||
IsEnabledForChannel(const ChannelScope& scope) const override; | |||
IsEnabledForChannel(const grpc_core::experimental::StatsPluginChannelScope& |
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 here: This should probably refer to this type as OpenTelemetryPluginBuilder::ChannelScope
, for consistency with the rest of this code.
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.
Done
target, args.GetOwnedString(GRPC_ARG_DEFAULT_AUTHORITY).value_or("")); | ||
experimental::StatsPluginChannelScope scope( | ||
target, args.GetOwnedString(GRPC_ARG_DEFAULT_AUTHORITY) | ||
.value_or(CoreConfiguration::Get() |
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.
I've done some digging to remind myself of the flow here (details originally came from #14615 (comment)), and I've convinced myself that this approach makes sense. There's some more cleanup that will be needed here, but I'll take care of that in the v3 stack.
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!
Also addressing a TODO from previous PRs where
authority
is not being populated in theChannelScope
.