Open henripqt opened 8 months ago
Thanks @henripqt Its known and expected that sometimes response metadata header is missing, and below lines will fail if that's the case
if len(md.Get("server-timing")) == 0 && otConfig.gfeHeaderMissingCount != nil { // at this point otConfig.gfeHeaderMissingCount is nil
otConfig.gfeHeaderMissingCount.Add(ctx, 1, metric.WithAttributes(attr...))
return nil
}
I have raised a PR which will initialize all the configs related to open telemetry by default irrespective of whether the Opentelemetry is enabled or not that will take care of this scenario
Thanks
Client
Spanner
Environment
e.g. Alpine Docker on GKE
Go Environment
go1.22.0
Code
When enabling open telemetry after creating the client the configuration set on the client is invalid resulting in potential panic.
e.g.
In the above example the new client created would have a default
openTelemetryConfig
with all instruments being nil possibly leading to a panic during a call torecordGFELatencyMetricsOT
(see bellow with added comments)Expected behavior
Actual behavior
Additional context
e.g. Started after upgrading to v1.57.0 and using the
EnableOpenTelemetryMetrics
function as shown above