lattrs := []any{ slog.String("env", "dev"), slog.String("service", version.Get().ServiceName), slog.String("version", version.Get().Version), slog.String("git.commit.sha", version.Get().GitCommit), slog.String("git.repository", version.Get().GitRepository), slog.String("trace.id", span.SpanContext().TraceID().String()), slog.String("span.id", span.SpanContext().SpanID().String()), slog.String("dd.service", version.Get().ServiceName), slog.String("dd.version", version.Get().Version), slog.String("dd.env", "dev"), slog.String("dd.git.commit.sha", version.Get().GitCommit), slog.String("dd.git.repository", version.Get().GitRepository), slog.String("dd.trace_id", span.SpanContext().TraceID().String()), slog.String("dd.span_id", span.SpanContext().SpanID().String()), } return append(lattrs, attrs...) } Span ID/Trace ID • ログに Span ID、Trace ID を仕込む • ログが発 生 した際にどこの Trace か がわかるようになる • backend-{sukina-name}/app/ api/handson/log.go に追加してみ よう • Context の中に trace 情報が 入 って いるので取り出して使う