Skip to content
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

Closed
wants to merge 6 commits into from

Conversation

yashykt
Copy link
Member

@yashykt yashykt commented Mar 28, 2024

Also addressing a TODO from previous PRs where authority is not being populated in the ChannelScope.

src/core/lib/surface/legacy_channel.cc Outdated Show resolved Hide resolved
include/grpcpp/ext/otel_plugin.h Outdated Show resolved Hide resolved
const ChannelScope& scope)
ClientScopeConfig(
const OpenTelemetryPlugin* otel_plugin,
const grpc_core::experimental::StatsPluginChannelScope& scope)
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -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&
Copy link
Member

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.

Copy link
Member Author

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()
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants