File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -134,3 +134,22 @@ Below are examples of the code enabling Jaeger tracing in different {{ ydb-short
134134 ```
135135
136136{% endlist %}
137+
138+ {{ ydb-short-name }} Go SDK now outputs the Jaeger Trace ID to the logs.
139+ This makes it easier to correlate log entries with traces in Jaeger during debugging and performance analysis.
140+
141+ It’s important to connect the adapters in a specific order: first ` otel ` , then ` logger ` .
142+
143+ ``` go
144+ import (
145+ ydbOtel " github.com/ydb-platform/ydb-go-sdk-otel"
146+ ydbZap " github.com/ydb-platform/ydb-go-sdk-zap"
147+ )
148+ ...
149+ db , err := ydb.Open (ctx,
150+ os.Getenv (" YDB_CONNECTION_STRING" ),
151+ ydbOtel.WithTraces (tracing.WithDetails (trace.DetailsAll )),
152+ ydbZap.WithTraces (logger, trace.DetailsAll ),
153+ )
154+ ...
155+ ```
Original file line number Diff line number Diff line change 135135
136136
137137{% endlist %}
138+
139+ {{ ydb-short-name }} Go SDK теперь выводит Jaeger Trace ID в логи.
140+ Это позволяет проще сопоставлять записи логов с трэйсами в Jaeger при отладке и анализе производительности.
141+
142+ Важно, чтобы адаптеры подключались в определенном порядке, сначала ` otel` потом ` logger` .
143+
144+ ` ` ` go
145+ import (
146+ ydbOtel "github.com/ydb-platform/ydb-go-sdk-otel"
147+ ydbZap "github.com/ydb-platform/ydb-go-sdk-zap"
148+ )
149+ ...
150+ db, err := ydb.Open(ctx,
151+ os.Getenv("YDB_CONNECTION_STRING"),
152+ ydbOtel.WithTraces(tracing.WithDetails(trace.DetailsAll)),
153+ ydbZap.WithTraces(logger, trace.DetailsAll),
154+ )
155+ ...
156+ ` ` `
You can’t perform that action at this time.
0 commit comments