-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Documentation update for OpenTelemetry (#915)
* docs: Documentation update for OpenTelemetry * updated documentation * Update docs/auto-trace-span-extraction.rst Co-authored-by: Aaron Abbott <[email protected]> --------- Co-authored-by: Aaron Abbott <[email protected]>
- Loading branch information
1 parent
6266f39
commit 2a0539a
Showing
3 changed files
with
41 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Automatic Trace/Span ID Extraction | ||
================================== | ||
|
||
.. note:: | ||
All `LogEntry fields`_ populated :ref:`manually<Manual-Metadata>` will override those populated via methods referred to in this | ||
section. | ||
|
||
The Google Cloud Logging library can automatically populate `LogEntry fields`_ | ||
`trace`, `span_id`, and `trace_sampled` via OpenTelemetry integration, or extracting header information from an HTTP request. | ||
|
||
OpenTelemetry Integration | ||
------------------------- | ||
|
||
If you have the OpenTelemetry SDK package installed and are logging from within an active OpenTelemetry span, that log entry will automatically | ||
have the `trace`, `span_id`, and `trace_sampled` fields populated from that span. More information about OpenTelemetry can be found | ||
`here <https://opentelemetry.io/docs/languages/python/>`_. | ||
|
||
HTTP headers | ||
------------ | ||
|
||
Another possible method of automatic `trace` / `span_id` is via extraction from HTTP headers. | ||
This is prioritized after OpenTelemetry and requires a :doc:`supported Python web framework </web-framework-integration>`. | ||
Trace information is automatically populated from either the `W3C Traceparent <https://www.w3.org/TR/trace-context>`_ | ||
or `X-Cloud-Trace-Context <https://cloud.google.com/trace/docs/trace-context#legacy-http-header>`_ headers. | ||
Populating trace information this way also automatically populates the `http_request` field in the `LogEntry` as well. | ||
|
||
.. _LogEntry fields: https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters