Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 16 additions & 0 deletions instrumentation/opentelemetry-instrumentation-botocore/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@ Tool calls with InvokeModel and InvokeModelWithResponseStream APIs are supported

If you don't have an application using Bedrock APIs yet, try our `zero-code examples <examples/bedrock-runtime/zero-code>`_.

Thread Context Propagation
--------------------------

boto3's S3 ``upload_file`` and ``download_file`` methods use background threads
for multipart transfers. To ensure trace context is propagated to these threads,
also enable the threading instrumentation::

from opentelemetry.instrumentation.threading import ThreadingInstrumentor
from opentelemetry.instrumentation.botocore import BotocoreInstrumentor

ThreadingInstrumentor().instrument()
BotocoreInstrumentor().instrument()

When using auto-instrumentation (``opentelemetry-instrument``), both instrumentors
are enabled automatically if their packages are installed.

Installation
------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,24 @@ def response_hook(span, service_name, operation_name, result):
)
ec2 = session.create_client("ec2", region_name="us-west-2")
ec2.describe_instances()

Thread Context Propagation
--------------------------

boto3's S3 ``upload_file`` and ``download_file`` methods use background threads
for multipart transfers. To ensure trace context is propagated to these threads,
also enable the threading instrumentation:

.. code:: python

from opentelemetry.instrumentation.threading import ThreadingInstrumentor
from opentelemetry.instrumentation.botocore import BotocoreInstrumentor

ThreadingInstrumentor().instrument()
BotocoreInstrumentor().instrument()

When using auto-instrumentation (``opentelemetry-instrument``), both instrumentors
are enabled automatically if their packages are installed.
"""

import logging
Expand Down