{"id":3194,"library":"opentelemetry-instrumentation-boto","title":"OpenTelemetry Boto Instrumentation","description":"This library provides instrumentation for the `boto` (AWS SDK v2) Python library, allowing it to emit traces and metrics compatible with OpenTelemetry. It helps monitor interactions with AWS services made using `boto`. The current version is `0.61b0`, and it's released as part of the `opentelemetry-python-contrib` project, with frequent beta releases.","status":"active","version":"0.61b0","language":"python","source_language":"en","source_url":"https://github.com/open-telemetry/opentelemetry-python-contrib","tags":["opentelemetry","observability","tracing","boto","aws","instrumentation"],"install":[{"cmd":"pip install opentelemetry-instrumentation-boto","lang":"bash","label":"Install library"}],"dependencies":[{"reason":"This instrumentation targets the `boto` library (AWS SDK v2). You must install `boto` separately for the instrumentation to function.","package":"boto","optional":false}],"imports":[{"wrong":"from opentelemetry.instrumentation.boto import BotoInstrumentor","symbol":"BotoInstrumentor","correct":"from opentelemetry.instrumentation.boto import BotoInstrumentor"}],"quickstart":{"code":"import os\nimport boto\nfrom opentelemetry import trace\nfrom opentelemetry.sdk.trace import TracerProvider\nfrom opentelemetry.sdk.trace.export import ConsoleSpanExporter, SimpleSpanProcessor\nfrom opentelemetry.instrumentation.boto import BotoInstrumentor\n\n# Configure OpenTelemetry TracerProvider\nprovider = TracerProvider()\nprocessor = SimpleSpanProcessor(ConsoleSpanExporter())\nprovider.add_span_processor(processor)\ntrace.set_tracer_provider(provider)\n\n# Instrument boto\nBotoInstrumentor().instrument()\n\n# Example boto usage (requires AWS credentials or configuration)\n# For a real application, ensure AWS credentials are set up via env vars, ~/.aws/credentials, etc.\n# Using dummy credentials for a non-functional example to demonstrate instrumentation.\n# DO NOT use real credentials in quickstart.\nos.environ['AWS_ACCESS_KEY_ID'] = os.environ.get('AWS_ACCESS_KEY_ID', 'DUMMY_KEY_ID')\nos.environ['AWS_SECRET_ACCESS_KEY'] = os.environ.get('AWS_SECRET_ACCESS_KEY', 'DUMMY_SECRET_KEY')\n\nprint('Attempting to create S3 connection (may fail without real credentials, but traces will appear if instrumentation works):')\ntry:\n    conn = boto.connect_s3(is_secure=False, port=8000, host='localhost') # Use a dummy host to avoid actual calls\n    # Attempt to list buckets, this will likely fail but trigger instrumentation\n    conn.get_all_buckets()\n    print('S3 buckets retrieved (this might be an empty list or error out gracefully)')\nexcept Exception as e:\n    print(f'S3 operation failed: {e}')\nfinally:\n    # Explicitly shutdown the provider to ensure all spans are exported\n    provider.shutdown()\n","lang":"python","description":"This quickstart demonstrates how to instrument the `boto` library. It initializes a simple `ConsoleSpanExporter` to print traces to the console, then calls `BotoInstrumentor().instrument()`. An example `boto` S3 operation is included, which will show traces even if the AWS call itself fails due to missing or invalid credentials. Ensure you have `boto` installed (`pip install boto`) for this to run."},"warnings":[{"fix":"If using `boto3`, install `opentelemetry-instrumentation-botocore` and ensure you use the correct instrumentor: `BotocoreInstrumentor().instrument()`.","message":"This instrumentation is for the `boto` library (AWS SDK v2) only. It will NOT instrument `boto3` (AWS SDK v3). For `boto3`, use `opentelemetry-instrumentation-botocore` instead.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Monitor release notes for potential breaking changes when upgrading. Consider pinning to specific beta versions if stability is critical.","message":"The library is currently in a beta release (`0.61b0`). APIs and behavior may not be stable and could change in future releases without adhering to strict semantic versioning.","severity":"gotcha","affected_versions":"All `0.x.x` beta versions"},{"fix":"Ensure `BotoInstrumentor().instrument()` is called early in your application's startup process, typically after setting up your `TracerProvider` and `SpanProcessor`.","message":"You must explicitly call `BotoInstrumentor().instrument()` after configuring your OpenTelemetry `TracerProvider` for the instrumentation to become active.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Run `pip install boto` alongside `pip install opentelemetry-instrumentation-boto`.","message":"The `boto` library itself must be installed separately. `opentelemetry-instrumentation-boto` does not automatically install `boto` as a dependency.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'0.61':40 'allow':16 'aw':11,31,63 'b0':41 'beta':57 'boto':2,10,35,62 'compat':23 'contrib':53 'current':37 'emit':19 'frequent':56 'help':27 'instrument':3,7,64 'interact':29 'librari':5,15 'made':33 'metric':22 'monitor':28 'observ':60 'opentelemetri':1,25,51,59 'opentelemetry-python-contrib':50 'part':47 'project':54 'provid':6 'python':14,52 'releas':45,58 'sdk':12 'servic':32 'trace':20,61 'use':34 'v2':13 'version':38","created_at":"2026-04-11T09:25:03.001421+00:00","updated_at":"2026-04-16T19:06:50.410442+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmp58i7fobp/venv/lib/python3.12/site-packages/opentelemetry/instrumentation/boto/__init__.py\", line 48, in <module>\n    from boto.connection import AWSAuthConnection, AWSQueryConnection\nModuleNotFoundError: No mod"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.61b0","cli_name":"","cli_version":null,"type":"library","homepage":"https://opentelemetry.io","github":"https://github.com/open-telemetry/opentelemetry-python-contrib","docs":null,"changelog":null,"pypi":"https://pypi.org/project/opentelemetry-instrumentation-boto/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["observability","aws","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-08-28","next_check":"2026-07-10","install_tag":null}}