Add initial opentelemetry-instrumentation-genai-bedrock boilerplate - #359
Add initial opentelemetry-instrumentation-genai-bedrock boilerplate#359DylanRussell wants to merge 13 commits into
opentelemetry-instrumentation-genai-bedrock boilerplate#359Conversation
Pull request dashboard statusWaiting on the author · refreshed 2026-08-21 01:40 UTC Resolve merge conflicts. Investigate required status check failures. Status above doesn't look right?
|
There was a problem hiding this comment.
Pull request overview
Adds a new opentelemetry-instrumentation-genai-bedrock package scaffold to the monorepo, wiring it into the workspace and test matrix so future Bedrock (boto3) patching can be implemented incrementally.
Changes:
- Introduces the new Bedrock instrumentation package structure (packaging, versioning, README, license, changelog fragment).
- Adds basic lifecycle tests and tox env wiring for
oldest/latestfactors. - Registers the package in the workspace (
pyproject.toml/uv.lock) and docs dependency set.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds the new package as a workspace member and records boto3/botocore/s3transfer resolution entries. |
| tox.ini | Adds bedrock test+lint envs and dependency wiring for oldest/latest. |
| pyproject.toml | Registers the new package in workspace deps and pyright include/exclude lists. |
| instrumentation/README.md | Lists the new bedrock instrumentation package and its minimum boto3 version. |
| docs-requirements.txt | Adds boto3>=1.40.46 to doc build requirements. |
| instrumentation/opentelemetry-instrumentation-genai-bedrock/pyproject.toml | New package metadata, dependencies, extras, and entry point registration. |
| instrumentation/opentelemetry-instrumentation-genai-bedrock/README.rst | New package README describing installation/usage/configuration. |
| instrumentation/opentelemetry-instrumentation-genai-bedrock/LICENSE | Adds Apache-2.0 license file for the new package. |
| instrumentation/opentelemetry-instrumentation-genai-bedrock/.changelog/360.added | Towncrier fragment announcing initial package setup. |
| instrumentation/opentelemetry-instrumentation-genai-bedrock/.changelog/.gitignore | Keeps the changelog directory tracked. |
| instrumentation/opentelemetry-instrumentation-genai-bedrock/src/opentelemetry/instrumentation/genai/bedrock/init.py | Adds BedrockInstrumentor boilerplate and completion hook wiring. |
| instrumentation/opentelemetry-instrumentation-genai-bedrock/src/opentelemetry/instrumentation/genai/bedrock/package.py | Declares _instruments dependency tuple for instrumentation_dependencies(). |
| instrumentation/opentelemetry-instrumentation-genai-bedrock/src/opentelemetry/instrumentation/genai/bedrock/version.py | Sets the package version. |
| instrumentation/opentelemetry-instrumentation-genai-bedrock/tests/init.py | Initializes the test package. |
| instrumentation/opentelemetry-instrumentation-genai-bedrock/tests/conftest.py | Registers shared GenAI test fixtures and provides an instrumentation fixture. |
| instrumentation/opentelemetry-instrumentation-genai-bedrock/tests/test_instrumentor.py | Adds basic lifecycle tests for instrument/uninstrument. |
| instrumentation/opentelemetry-instrumentation-genai-bedrock/tests/requirements.oldest.txt | Documents that oldest relies on lowest-direct resolution without extra pins. |
| instrumentation/opentelemetry-instrumentation-genai-bedrock/tests/requirements.latest.txt | Installs latest boto3 plus editable util + instrumentation for latest-factor tests. |
|
@lmolkova Should we migrate bedrock? I was under the assumption that it is going to be left in contrib. |
|
i dont think boto3 is instrumented in contrib.. well I see boto3 sqs is instrumented: https://github.com/open-telemetry/opentelemetry-python-contrib/blob/e5e3af0ccdb9c3d85728f6d7cb03d77c72196425/instrumentation/opentelemetry-instrumentation-boto3sqs/README.rst but that isn't the API we care about |
…entation # Conflicts: # docs-requirements.txt # instrumentation/README.md
This comment has been minimized.
This comment has been minimized.
The one in contrib instruments botocore that is what powers boto3. So the layer would be different but you'll still get duplicated telemetry.
|
|
Hmm ok I missed that, so there's a gen ai instrumentation of the botocore library (which underlies boto3) in contrib.. It seems not great to have just 1 gen ai instrumentation in contrib and the rest in this repo going forward.. I also think it has some gaps: it doesn't use gen ai utils (is missing stuff like the completion hook and the content capture flag), and doesn't instrument aiobotocore for the gen AI stuff.. So my proposal is we deprecate that one and add one atop of boto3 here in this library.. WDYT ? Also I think it's mostly fine that we instrument boto3 here and in the contrib repo, since the one contrib monkey patches just the SQS methods: https://github.com/open-telemetry/opentelemetry-python-contrib/blob/b4e7e098f81c3713798a5747c76e87f8c03b1e7e/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/__init__.py#L338-L342 -- we will instrument a different set of methods in this repo, so there's no conflict.. I think we also need to be careful of the entry point name we use for auto instrumentation boto3 has been taken --- https://github.com/open-telemetry/opentelemetry-python-contrib/blob/b4e7e098f81c3713798a5747c76e87f8c03b1e7e/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml#L40 -- so we have to use something different there.. I have "bedrock" here now but we can use something else.. Proposal for how to deprecate the existing bedrock instrumentation: Add a deprecation warning: Disable |
Sounds good to me but the question is when we deprecate that? I would like to do so only once this has feature parity. And also when |
|
Yeah definitely don't deprecate until feature parity + release. I think https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4927/changes will fix that issue with |
…tation # Conflicts: # docs-requirements.txt
Installing shellcheck via apt in tox.ini commands_pre can fail or hang in CI when system package mirrors time out. Replace the apt installation with shellcheck-py in tox deps, and exclude virtual environment directories from the shellcheck find command. Assisted-by: Antigravity
Assisted-by: Antigravity
Description
Add initial
opentelemetry-instrumentation-genai-bedrockboilerplate.boto3doesn't have any reference to open telemetry in it's repo, so no native instrumentation.Created the package structure targeting "boto3 >= 1.40.46" (matching openinference-instrumentation-bedrock),
Type of change
How has this been tested?
Unit tests
Checklist