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: Documentation update for OpenTelemetry #915

Merged
merged 4 commits into from
Jul 15, 2024
Merged

docs: Documentation update for OpenTelemetry #915

merged 4 commits into from
Jul 15, 2024

Conversation

gkevinzheng
Copy link
Contributor

@gkevinzheng gkevinzheng commented Jul 10, 2024

  • Added page with more info about automatic trace/span ID extraction
  • Updated Automatic Metadata Detection section with reference to new page

Sphinx preview:
image
image

@gkevinzheng gkevinzheng requested review from a team as code owners July 10, 2024 18:59
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Jul 10, 2024
@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/python-logging API. label Jul 10, 2024
HTTP headers
------------

Another possible method of automatic `trace`/ `span_id` is via extraction from HTTP headers. This feature requires a :doc:`supported Python web framework </web-framework-integration>`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to mention that this is prioritized after OpenTelemetry?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's probably a good idea.

==================================

The Google Cloud Logging library can automatically populate `LogEntry fields <https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry>`_
`trace`, `span_id`, and`trace_sampled` via OpenTelemetry integration, or extracting header information from an HTTP request.
Copy link
Contributor

@cindy-peng cindy-peng Jul 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow andtrace_sampled is not rendered correctly in the screenshot.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there's a space needed between "and" and "trace_sampled".

==================================

The Google Cloud Logging library can automatically populate `LogEntry fields <https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry>`_
`trace`, `span_id`, and`trace_sampled` via OpenTelemetry integration, or extracting header information from an HTTP request.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there's a space needed between "and" and "trace_sampled".

HTTP headers
------------

Another possible method of automatic `trace`/ `span_id` is via extraction from HTTP headers. This feature requires a :doc:`supported Python web framework </web-framework-integration>`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's probably a good idea.

OpenTelemetry Integration
-------------------------

If you have the OpenTelemetry SDK package installed and are logging from within an active OpenTelemetry span, that log entry will automatically
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit the SDK is not technically necessary here. Does this suggestion make sense to you? I think it's a little more precise

Suggested change
If you have the OpenTelemetry SDK package installed and are logging from within an active OpenTelemetry span, that log entry will automatically
If you are using OpenTelemetry and there is an active span in the OpenTelemetry Context, that log entry will automatically

docs/auto-trace-span-extraction.rst Outdated Show resolved Hide resolved
@gkevinzheng gkevinzheng enabled auto-merge (squash) July 15, 2024 14:25
@gkevinzheng gkevinzheng added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 15, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 15, 2024
@gkevinzheng gkevinzheng merged commit 2a0539a into main Jul 15, 2024
16 of 17 checks passed
@gkevinzheng gkevinzheng deleted the otel-docs branch July 15, 2024 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/python-logging API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants