Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(logging): Documentation for automatic trace/span ID extraction #10536

Merged
merged 7 commits into from
Jul 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated opentelemetry/otelhttp documentation
gkevinzheng committed Jul 15, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 607d32897f0919003b71125cda0de493a994c0c5
3 changes: 2 additions & 1 deletion logging/doc.go
Original file line number Diff line number Diff line change
@@ -160,7 +160,7 @@ within the Entry's HTTPRequest field:

When Entry with an [http.Request] is logged, its Trace, SpanID, and TraceSampled fields may be automatically populated as follows:

1. If you are instrumenting your application with [otelhttp],
1. If you are instrumenting your application with [OpenTelemetry], more specifically [otelhttp],
the Entry's Trace, SpanID, and TraceSampled will be populated with information from the [http.Request]'s span context.
2. Trace, SpanID, and TraceSampled fields will be populated from information from the http.Request's [W3C Traceparent]
or [X-Cloud-Trace-Context] headers, if those headers exist.
@@ -169,6 +169,7 @@ Note that if Trace, SpanID, or TraceSampled are explicitly provided within an En
extracted values.

[http.Request]: https://pkg.go.dev/net/http#Request
[OpenTelemetry]: https://opentelemetry.io/docs/languages/go/
[otelhttp]: https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
[W3C Traceparent]: https://www.w3.org/TR/trace-context
[X-Cloud-Trace-Context]: https://cloud.google.com/trace/docs/trace-context#legacy-http-header