Skip to content

fix: return on grpc.NewClient error and propagate probe context#1557

Open
Aprazor wants to merge 1 commit intoprometheus:masterfrom
Aprazor:fix/grpc-nil-conn-panic
Open

fix: return on grpc.NewClient error and propagate probe context#1557
Aprazor wants to merge 1 commit intoprometheus:masterfrom
Aprazor:fix/grpc-nil-conn-panic

Conversation

@Aprazor
Copy link

@Aprazor Aprazor commented Mar 22, 2026

Two fixes in ProbeGRPC:

  1. When grpc.NewClient returns an error, execution continued into
    a nil conn, causing a panic. Add 'return false' after the error.
  2. client.Check used context.Background() instead of the probe ctx,
    bypassing the scrape timeout. Use ctx to honor the deadline.

Signed-off-by: Aprazors Aprazors@gmail.com

Two fixes in ProbeGRPC: 1. When grpc.NewClient returns an error, execution continued into a nil conn, causing a panic. Add 'return false' after the error. 2. client.Check used context.Background() instead of the probe ctx, bypassing the scrape timeout. Use ctx to honor the deadline. Signed-off-by: Aprazors <Aprazors@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant