You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Export PROFILE query plans and Spanner client spans via OpenTelemetry (`spannerotel` + the Spanner client's native OTel instrumentation).
247
+
Export Spanner client spans and PROFILE query plans via OpenTelemetry (`spannerotel` + the Spanner client's native OTel instrumentation).
246
248
247
-
Export to Cloud Trace:
249
+
Plan node spans (`spannerotel/plantotrace`) appear only with **`--query-mode=PROFILE`** (or equivalent stats that include a query plan). NORMAL mode still records Spanner client spans, but not per-plan-node children.
250
+
251
+
Exactly one trace export flag may be set: `--experimental-trace-project`, `--experimental-trace-stdout`, or `--experimental-trace-otlp`.
252
+
253
+
#### Cloud Trace
248
254
249
255
```sh
250
-
$ execspansql $DATABASE_ID --sql "SELECT * FROM Singers@{FORCE_INDEX=SingersByFirstLastName}" --query-mode=PROFILE --experimental-trace-project=$PROJECT_ID
256
+
$ execspansql $DATABASE_ID --sql "SELECT * FROM Singers@{FORCE_INDEX=SingersByFirstLastName}" \
TraceProjectstring`name:"experimental-trace-project" xor:"trace" help:"Export traces to Cloud Trace in the given project."`
73
-
TraceStdoutbool`name:"experimental-trace-stdout" xor:"trace" help:"Export traces to stderr (local debugging; no Cloud Trace credentials required)."`
73
+
TraceStdoutbool`name:"experimental-trace-stdout" xor:"trace" help:"Export spans to stderr as pretty JSON (local debugging)."`
74
+
TraceOTLPbool`name:"experimental-trace-otlp" xor:"trace" help:"Export spans via OTLP/gRPC to a local OpenTelemetry collector."`
75
+
TraceOTLPEndpointstring`name:"experimental-trace-otlp-endpoint" default:"localhost:4317" help:"OTLP/gRPC endpoint used with --experimental-trace-otlp."`
74
76
EnablePartitionedDMLbool`name:"enable-partitioned-dml" help:"Execute DML statement using Partitioned DML"`
75
77
Timeout time.Duration`name:"timeout" default:"10m" help:"Maximum time to wait for the SQL query to complete"`
76
78
TryPartitionQuerybool`name:"try-partition-query" help:"(Experimental) Check whether the query can be executed as partition query or not"`
return tracing.Config{}, fmt.Errorf("exactly one of --experimental-trace-otlp, --experimental-trace-stdout, or --experimental-trace-project must be set")
32
+
}
18
33
switch {
19
-
caseo.TraceStdout&&o.TraceProject!="":
20
-
return tracing.Config{}, fmt.Errorf("use either --experimental-trace-stdout or --experimental-trace-project, not both")
0 commit comments