Skip to content

Bug Report: VT_SPAN_CONTEXT ignored in some case #19942

@L3o-pold

Description

@L3o-pold

Overview of the Issue

Using a SQL client I manage to use VT_SPAN_CONTEXT for example this query will produce a vtgate log:

/*VT_SPAN_CONTEXT=s==*/select 1;
W0423 07:49:05.656132       7 plugin_mysql_server.go:213] Unable to parse VT_SPAN_CONTEXT: failed to decode span carrier: illegal base64 data at input byte 1

Execute 10.8.8.21:53820 user    'userData1'     'user'  2026-04-23 07:49:05.656227      2026-04-23 07:49:05.656399      0.000173        0.000130        0.000029 0.000000        SELECT  "/*VT_SPAN_CONTEXT=s==*/select :vtg1 /* INT64 */ from dual"     {"vtg1": {"type": "INT64", "value": 1}} 0       0       ""       "PRIMARY"       "7de71520-3ee5-11f1-8dde-dab18bb3b31d"  true    ["commerce.dual"]  "commerce" 0.000000        0.000000        ""      ""

The same query using Laravel framework do not work (no vtgate log saying VT_SPAN_CONTEXT is invalid)

Execute 172.18.0.3:52852        user    'userData1'     'user'  2026-04-23 07:57:44.591212      2026-04-23 07:57:44.591296      0.000084        0.0000660.000011 0.000000        SELECT  "/*VT_SPAN_CONTEXT=s==*/SELECT 1"       {}      0       0       ""      "PRIMARY"       "1c71ad9e-3eea-11f1-8dde-dab18bb3b31d"   false   ["commerce.dual"]  "commerce" 0.000000        0.000000        ""      ""

Reproduction Steps

running vtgate with

    --tracer=opentelemetry \
    --otel-endpoint=jaeger:4317 \
    --otel-insecure=true \
    --tracing-sampling-rate=1.0 \
    --log_queries_to_file=/tmp/query.log
/*VT_SPAN_CONTEXT=s==*/select 1;
DB::connection('vitess')->select('SELECT 1');

Binary Version

vtgate version Version: 24.0.0-rc1 (Git revision 4d416bbc4f652b3839ee393cc0eccf9519c10516 branch 'HEAD') built on Tue Apr 14 13:49:14 UTC 2026 by vitess@buildkitsandbox using go1.26.2 linux/amd64

Operating System and Environment details

docker

Log Fragments

Metadata

Metadata

Labels

Type: EnhancementLogical improvement (somewhere between a bug and feature)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions