OpenTelemetry Boto Integration

Instrument Boto to trace service requests.

There are two options for instrumenting code. The first option is to use the opentelemetry-instrument executable which will automatically instrument your Boto client. The second is to programmatically enable instrumentation via the following code:


from opentelemetry import trace
from opentelemetry.ext.boto import BotoInstrumentor
from opentelemetry.sdk.trace import TracerProvider
import boto


# Instrument Boto

# This will create a span with Boto-specific attributes
ec2 = boto.ec2.connect_to_region("us-west-2")


class opentelemetry.ext.boto.BotoInstrumentor[source]

Bases: opentelemetry.instrumentation.instrumentor.BaseInstrumentor

A instrumentor for Boto

See BaseInstrumentor

opentelemetry.ext.boto.truncate_arg_value(value, max_len=1024)[source]

Truncate values which are bytes and greater than max_len. Useful for parameters like “Body” in put_object operations.

opentelemetry.ext.boto.add_span_arg_tags(span, endpoint_name, args, args_names, args_traced)[source]
opentelemetry.ext.boto.flatten_dict(dict_, sep='.', prefix='')[source]

Returns a normalized dict of depth 1 with keys in order of embedding

opentelemetry.ext.boto.unwrap(obj, attr)[source]