grpc-ecosystem / grpc-spring

Spring Boot starter module for gRPC framework.
https://grpc-ecosystem.github.io/grpc-spring/
Apache License 2.0
3.43k stars 809 forks source link

feat: Adds structure for gRPC client metrics instrumentation #1021

Closed DNVindhya closed 6 months ago

DNVindhya commented 6 months ago

This PR is one of the initial efforts to support gRFC A66: OpenTelemetry Metrics in gRPC-Spring. Even though the gRFC mentions OpenTelmetry, to keep it in sync with existing metrics, this PR as well as future ones will use Micrometer for instrumentation.

This PR adds the structure to collect gRPC metrics for ClientInterceptor. To start with I have only added instrumentation for a single metric i.e grpc.client.attempt.started.

ST-DDT commented 6 months ago

What is the difference between this and https://github.com/grpc-ecosystem/grpc-spring/pull/1010?

DNVindhya commented 6 months ago

Thanks for all your detailed comments. This PR was added with the intention to get the basic structure in place to add a single client metric, other metrics and unit tests will be added in subsequent PRs. Plan is to enable metric auto configuration, once all the metrics are in.

  • This should be implemented in the micrometer grpc instrumentation repo (where there are already two different implementations of it)

Since I am breaking down the metrics features (for ease of review and faster iteration) into multiple PRs, I am planning to move these to Micrometer GRPC instrumentation repo after the feature is completely checked in and ready to be enabled.

I hope I addressed your concerns. Please let me know if there are any blockers to merge the PR.

ST-DDT commented 6 months ago

Please let me know if there are any blockers to merge the PR.

All good. LGTM.