OTELGRPCClientHandler returns a gRPC StatsHandler that creates spans only for query-related Flight SQL RPCs (GetFlightInfo, DoGet, DoPut), filtering out noisy control-plane calls (DoAction for health checks, session management). DoPut covers ExecuteUpdate (non-result-returning queries: CTAS, INSERT,
()
| 15 | // CTAS, INSERT, UPDATE, DELETE, DDL) — without it those queries had no |
| 16 | // Flight wall-time visibility in traces. |
| 17 | func OTELGRPCClientHandler() grpc.DialOption { |
| 18 | return grpc.WithStatsHandler(otelgrpc.NewClientHandler( |
| 19 | otelgrpc.WithFilter(isQueryFlightRPC), |
| 20 | )) |
| 21 | } |
| 22 | |
| 23 | // OTELGRPCServerHandler returns a gRPC StatsHandler that extracts trace |
| 24 | // context and creates server spans for query-related Flight SQL RPCs. |
| 25 | func OTELGRPCServerHandler() grpc.ServerOption { |
| 26 | return grpc.StatsHandler(otelgrpc.NewServerHandler( |
| 27 | otelgrpc.WithFilter(isQueryFlightRPC), |
| 28 | )) |