spanner: unsupported sampler error occurs while keeping the session alive #11431
Labels
api: spanner
Issues related to the Spanner API.
samples
Issues that are directly related to samples.
triage me
I really want to be triaged.
Client
go-spanner
Environment
GKE
Go Environment
$ go version
1.22.9
Using https://pkg.go.dev/cloud.google.com/go/spanner v1.73.0
Code and Dependencies
go library for Spanner suggests that there is no need to handle session on our own and we are not doing any of the thing on our own. It's the HealthCheckWorker which is doing all of the things on it's own.
Why is this error occurring?
L299
octrace.WithSampler(octrace.NeverSample())
specifies the sampler.See: https://github.com/googleapis/google-cloud-go/blob/main/spanner/session.go#L299-L300
However, if you check the opentelemetry-go implementation, it returns an error if sampler is not nil.
See: https://github.com/open-telemetry/opentelemetry-go/blob/main/bridge/opencensus/internal/oc2otel/tracer_start_options.go#L32
Why is it calling
StartSpan
even though it is not sampling?Also, only this code uses OpenCensus to run
StartSpan
.How about erasing the L299 to L300 code based on the following two points
StartSpan
with OpenCeusus is deprecated. See: https://github.com/googleapis/google-cloud-go/blob/main/internal/trace/trace.go#L38If you have other ideas, I would appreciate your input.
Expected behavior
There should not be any error while executing Select 1 .
Actual behavior
Getting Below error
starting span "cloud.google.com/go/spanner.ping": unsupported sampler: 0x158af20
Additional context
A similar Issue has been created previously, but the problem still persists.
The text was updated successfully, but these errors were encountered: