spanner: out of range [0] with length 0 when OTMetrics enabled after client creation #9740
Labels
api: spanner
Issues related to the Spanner API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
Client
Spanner
Environment
N/A
Go Environment
N/A
Code
e.g.
Expected behavior
No panic
Actual behavior
panic with
out of range [0] with length 0
at https://github.com/googleapis/google-cloud-go/blob/main/spanner/ot_metrics.go#L245 .Screenshots
N/A
Additional context
I'm using Spanner Emulator, so there is no
server-timing
metadata in the response.And client.otConfig is always empty before EnableOpenTelemetryMetrics called.
Our codebase is modular monolith, so some service creates client without EnableOpenTelemetryMetrics but other service creates client with EnableOpenTelemetryMetrics and panics.
The code should be
The text was updated successfully, but these errors were encountered: