Skip to content

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

Merged
mbissa merged 10 commits into
grpc:masterfrom
deepgolani4:master
Aug 11, 2026
Merged

mbissa merged 10 commits into
grpc:masterfrom
deepgolani4:master

Conversation

@deepgolani4

@deepgolani4 deepgolani4 commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

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.03%. Comparing base (1ecbd86) to head (5181343).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9215      +/-   ##
==========================================
- Coverage   83.11%   83.03%   -0.09%     
==========================================
  Files         423      423              
  Lines       35231    35224       -7     
==========================================
- Hits        29284    29247      -37     
- Misses       4432     4450      +18     
- Partials     1515     1527      +12     
Files with missing lines Coverage Δ
balancer/pickfirst/pickfirst.go 90.07% <100.00%> (+0.78%) ⬆️

... and 28 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
Contributor 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!

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 Resolved
Comment thread balancer/pickfirst/metrics_test.go Resolved
@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
Contributor 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 thread stats/opentelemetry/e2e_test.go Outdated
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

Comment thread balancer/pickfirst/metrics_test.go Resolved
@easwars

easwars commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

@deepgolani4 : Any updates on this one? Thanks

@easwars

easwars commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

@danielzhaotongliu

deepgolani4 and others added 4 commits August 9, 2026 13:15
CI vet.sh fails because 'go mod tidy -compat=1.25' under go1.25 removes
stale h1 hashes from the go.sum files of the stats/opencensus,
security/advancedtls and security/advancedtls/examples modules. These
entries are identical on upstream master; retidy them here so the vet
check passes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@deepgolani4

Copy link
Copy Markdown
Contributor Author

@deepgolani4 : Any updates on this one? Thanks

Sorry for the delay, i've pushed the relevant changes.

@mbissa mbissa 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

@mbissa
mbissa merged commit 5380ae2 into grpc:master Aug 11, 2026
20 checks passed
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 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