Skip to content

Commit 2977d8d

Browse files
committed
docs(ydb_go_sdk): add info about jaeger trace id logging
1 parent bd68c36 commit 2977d8d

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

ydb/docs/en/core/recipes/ydb-sdk/debug-jaeger.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
```

ydb/docs/ru/core/recipes/ydb-sdk/debug-jaeger.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,22 @@
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+
```

0 commit comments

Comments
 (0)