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: update usage of otelgrpc interceptors to use stat handlers #4753

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

jsternberg
Copy link
Collaborator

@jsternberg jsternberg commented Mar 12, 2024

The otelgrpc interceptors were deprecated. This updates the areas where these were used to use the stat handlers instead of the interceptors. This helps with creating a single method for both unary and stream rpcs and also ensures we aren't using a deprecated function for the future.

Fixes #4681.

@jsternberg
Copy link
Collaborator Author

Need to test this out a bit to ensure that I didn't accidentally remove any existing functionality. I did some basic testing and I think this should work though.

@jsternberg jsternberg force-pushed the otelgrpc-update-deprecated branch from c27393d to b0183dd Compare March 28, 2024 20:59
@jsternberg jsternberg marked this pull request as ready for review March 28, 2024 20:59
@jsternberg jsternberg force-pushed the otelgrpc-update-deprecated branch 2 times, most recently from 4eb7c24 to 78b1a3c Compare March 29, 2024 14:18
Copy link

@nicksieger nicksieger left a comment

Choose a reason for hiding this comment

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

Nice cleanup, overall changes look right

}

func (s *statsFilter) HandleRPC(ctx context.Context, rpcStats stats.RPCStats) {
if ctx.Value(filterContextKey) != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Where is it defined that not handling rpc stats blocks the request?

Copy link
Member

Choose a reason for hiding this comment

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

I think I misunderstood the extent of this deprecation before. It seemed to me that the whole interceptors concept in grpc was deprecated and replaced with "stats" what left me confused as they don't seem to have similar capabilities.

But looks like that only thing that is deprecated is the interceptor implementations for otel library. In that case I think the only change I would like is to make it more clear that the "stats_filter" is the filter only for otel handlers. Maybe call it "otelfilter" or even put it under "util/tracing". As we don't actually use any of the "stats" feature and it just seems to be how the otel interceptor now exposes itself then better to avoid that naming as much as possible.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated to move this into the tracing package as something that's unexported and now we just create the stats handlers from the tracing package.

@jsternberg jsternberg force-pushed the otelgrpc-update-deprecated branch from 78b1a3c to 472f2eb Compare March 29, 2024 20:17
@jsternberg jsternberg requested a review from tonistiigi March 29, 2024 20:18
client/client.go Outdated Show resolved Hide resolved
cmd/buildkitd/main.go Outdated Show resolved Hide resolved
session/session.go Outdated Show resolved Hide resolved
The otelgrpc interceptors were deprecated. This updates the areas where
these were used to use the stat handlers instead of the interceptors.
This helps with creating a single method for both unary and stream rpcs
and also ensures we aren't using a deprecated function for the future.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
@jsternberg jsternberg force-pushed the otelgrpc-update-deprecated branch from 472f2eb to c3105e4 Compare March 29, 2024 21:39
@jsternberg jsternberg requested a review from tonistiigi March 29, 2024 21:39
@tonistiigi tonistiigi merged commit 4d94abf into moby:master Apr 2, 2024
72 checks passed
@jsternberg jsternberg deleted the otelgrpc-update-deprecated branch April 2, 2024 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OTEL: update code to remove use of some deprecated options
3 participants