Skip to content

balancer: remove grpc.lb.pick_first.* metrics#9215

Open
deepgolani4 wants to merge 6 commits into
grpc:masterfrom
deepgolani4:master
Open

balancer: remove grpc.lb.pick_first.* metrics#9215
deepgolani4 wants to merge 6 commits into
grpc:masterfrom
deepgolani4:master

Conversation

@deepgolani4

@deepgolani4 deepgolani4 commented Jun 30, 2026

Copy link
Copy Markdown

Fixes #8752

The changes remove the three grpc.lb.pick_first.* metric registrations and their recording calls from pickfirst.go (along with the now-unneeded metricsRecorder/target fields), then update all tests and examples to assert on the equivalent grpc.subchannel.* metrics instead.

RELEASE NOTES:

  • Remove grpc.lb.pick_first.* metrics.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 30, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: deepgolani4 / name: deepgolani4 (643ead2)

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.31%. Comparing base (2a112a8) to head (b5627a3).
⚠️ Report is 17 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9215      +/-   ##
==========================================
- Coverage   83.33%   83.31%   -0.03%     
==========================================
  Files         420      420              
  Lines       34028    34021       -7     
==========================================
- Hits        28358    28343      -15     
- Misses       4253     4257       +4     
- Partials     1417     1421       +4     
Files with missing lines Coverage Δ
balancer/pickfirst/pickfirst.go 90.55% <100.00%> (+0.79%) ⬆️

... and 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@deepgolani4

Copy link
Copy Markdown
Author

@mbissa @arjan-bal @Pranjali-2501 @easwars

Sorry for pinging everyone like this, but I'd really appreciate it if someone could take a quick look and review this when you have a chance. Thanks!

Comment thread examples/features/opentelemetry/server/main.go
Comment thread balancer/pickfirst/pickfirst_ext_test.go
if holds[1].Wait(ctx) != true {
t.Fatalf("Timeout waiting for server %d with address %q to be contacted", 1, addrs[1])
}
if got, _ := tmr.Metric("grpc.lb.pick_first.connection_attempts_failed"); got != 1 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@mbissa : For all of these removed lines, what was the original plan? Would the pick_first tests continue to track the subchannel metrics or did we plan to have other tests that would track with these metrics?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The plan was to move the tests to different place which is more apt for subchannel and not keep them in pickfirst.

Comment thread balancer/pickfirst/metrics_test.go Outdated
Comment thread balancer/pickfirst/metrics_test.go Outdated
@easwars easwars assigned deepgolani4 and mbissa and unassigned easwars Jul 8, 2026
@easwars easwars added Area: Observability Includes Stats, Tracing, Channelz, Healthz, Binlog, Reflection, Admin, GCP Observability Type: Behavior Change Behavior changes not categorized as bugs labels Jul 8, 2026
@easwars easwars added this to the 1.83 Release milestone Jul 8, 2026
@mbissa

mbissa commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@deepgolani4 can you please move the tests to a separate place in the otel package where we run e2e tests instead of changing just the existing tests.

@deepgolani4

Copy link
Copy Markdown
Author

@deepgolani4 can you please move the tests to a separate place in the otel package where we run e2e tests instead of changing just the existing tests.

@mbissa Moved the OTel e2e metric coverage into stats/opentelemetry/e2e_test.go, and removed the duplicate pickfirst metric tests from balancer/pickfirst.

@deepgolani4
deepgolani4 requested review from easwars and mbissa July 9, 2026 15:51
@easwars easwars modified the milestones: 1.83 Release, 1.84 Release Jul 14, 2026
@easwars easwars assigned mbissa and unassigned deepgolani4 Jul 15, 2026

@easwars easwars left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, modulo one minor nit

Comment on lines +2090 to +2095
ss := &stubserver.StubServer{
EmptyCallF: func(context.Context, *testpb.Empty) (*testpb.Empty, error) {
return &testpb.Empty{}, nil
},
}
ss.StartServer()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: This could be replaced with a single line call to stubserver.StartTestService

@mbissa mbissa Jul 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@deepgolani4 , thanks for the changes - We should no longer be needing this file as practically there are no pick first metrics left. We should move all the relevant tests out and delete metrics_test.go altogether. I think other than that (and the nit that is pointed out by easwars) we are good. Once done, we can merge the changes.

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

Labels

Area: Observability Includes Stats, Tracing, Channelz, Healthz, Binlog, Reflection, Admin, GCP Observability Status: Requires Reporter Clarification Type: Behavior Change Behavior changes not categorized as bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove pickfirst metrics

3 participants