* Add initial implementation of Anthropic Agents instrumentation - Introduced `opentelemetry-instrumentation-anthropic-agents` package for tracing LLM requests using the Anthropic Python SDK. - Added support for capturing request and response attributes in accordance with GenAI semantic conventions. - Included examples for both manual and zero-code instrumentation. - Created a CHANGELOG.md to document notable changes. - Added LICENSE and README files for package details and usage instructions. This commit lays the groundwork for enhanced observability in applications utilizing Anthropic's capabilities. * Enhance instrumentation for Anthropic Agents - Added support for the `opentelemetry-instrumentation-anthropic-agents` package, enabling tracing of requests made through the Claude Agent SDK. - Updated `pyproject.toml` and `tox.ini` to include new test environments and dependencies for the Anthropic Agents instrumentation. - Modified GitHub workflows to incorporate linting and testing for the new instrumentation. - Improved documentation in README files and examples to reflect changes in usage and setup. - Introduced new examples demonstrating both manual and zero-code instrumentation approaches. This commit strengthens observability for applications utilizing Claude Agents, ensuring comprehensive tracing and logging capabilities. * Remove outdated entries from CHANGELOG.md for Anthropic Agents instrumentation, streamlining the document to reflect current features and improvements. * Update Anthropic Agents instrumentation to use Claude Agent SDK - Changed dependency from `anthropic >= 0.16.0` to `claude-agent-sdk >= 0.1.14` in `README.md`, `pyproject.toml`, and related files. - Refactored `AnthropicAgentsInstrumentor` to align with the new SDK, including updates to initialization and logging. - Removed unused utility functions and cleaned up test configurations to reflect the new dependency. - Updated tests to ensure compatibility with the Claude Agent SDK. This commit enhances the instrumentation for applications using the Claude Agent SDK, ensuring accurate tracing and logging capabilities. * Update Python version requirements and clean up workflows for Anthropic Agents instrumentation - Updated `tox.ini` and `pyproject.toml` to require Python 3.10 or higher, removing support for Python 3.9. - Cleaned up GitHub workflows by removing outdated test jobs for Python 3.9 and adding new jobs for Python 3.10. - Updated `README.md` to reflect the new dependency on `claude-agent-sdk` and removed references to the old SDK. - Made minor code cleanups in example scripts and test files to improve readability. These changes ensure compatibility with the latest Python versions and streamline the testing process for the Anthropic Agents instrumentation. * Add Anirudha as a component owner for Anthropic instrumentation. * fixing precommit errors. * Update version comment in `version.py` to indicate future stable release * Refactor imports in `__init__.py` for Anthropic Agents instrumentation. * regenerate uv.lock file. * Update uv.lock to standardize package source URLs with trailing slashes * Rename instrumentation for Anthropic Agents to Claude Agent SDK, updating references in configuration files, workflows, and documentation. Add new files for the Claude Agent SDK instrumentation, including README, examples, and changelog. Ensure proper setup for testing and linting in CI/CD workflows. * Update release documentation and workflows to include new instrumentation for Anthropic and Claude Agent SDK. * Add Mike Goldsmith as a component owner for Anthropic and Claude Agent SDK instrumentation * Revert "Merge remote-tracking branch 'upstream/main' into feat/anthropic-agents-boilerplate" This reverts commit7ed01ecb2d, reversing changes made to7e83cd7d74. * Reapply "Merge remote-tracking branch 'upstream/main' into feat/anthropic-agents-boilerplate" This reverts commit7714e3c544. * Update Python version in workflows and adjust dependencies in uv.lock. * Fix source URLs in uv.lock to ensure proper registry formatting.
9.8 KiB
Release instructions
Preparing a new major or minor release
- Run the Prepare release branch workflow.
- Press the "Run workflow" button, and leave the default branch
mainselected.- If making a pre-release of stable components (e.g. release candidate),
enter the pre-release version number, e.g.
1.9.0rc2. (otherwise the workflow will pick up the version frommainand just remove the.devsuffix).
- If making a pre-release of stable components (e.g. release candidate),
enter the pre-release version number, e.g.
- Review the two pull requests that it creates.
(one is targeted to the release branch and one is targeted to
main).- The builds will fail for the release PR because of validation rules. Follow the release workflow for the core repo up until this same point.
- Close and reopen the PR so that the workflow will take into account the label automation we have in place
- Merge the release PR.
- Merge the PR to main (this can be done separately from making the release)
- Press the "Run workflow" button, and leave the default branch
Preparing a major or minor release for individual package
Note
Per-package release is supported for the following packages only:
- opentelemetry-propagator-aws-xray
- opentelemetry-resource-detector-azure
- opentelemetry-sdk-extension-aws
- opentelemetry-instrumentation-openai-v2
- opentelemetry-instrumentation-openai-agents-v2
- opentelemetry-instrumentation-vertexai
- opentelemetry-instrumentation-anthropic
- opentelemetry-instrumentation-claude-agent-sdk
- opentelemetry-instrumentation-google-genai
- opentelemetry-instrumentation-langchain
- opentelemetry-instrumentation-weaviate
- opentelemetry-util-genai
These libraries are also excluded from the general release.
Package release preparation is handled by the [Package] Prepare release workflow that allows
to pick a specific package to release. It follows the same versioning strategy and process as the general release.
Long-term package release branch follows package-release/{package-name}/v{major}.{minor}.x (or package-release/{package-name}/v{major}.{minor}bx) naming pattern.
The workflow will create two pull requests, one against the main and one against the package-release/ branch; both should be merged in order to proceed with the release.
To keep the process lightweight, it's OK to approve the PRs you generate and merge without additional reviews.
Preparing a new patch release
- Backport pull request(s) to the release branch.
- Run the Backport workflow.
- Press the "Run workflow" button, then select the release branch from the dropdown list,
e.g.
release/v1.9.x, then enter the pull request number that you want to backport, then click the "Run workflow" button below that. - Add the label
backportto the generated pull request. - In case label automation doesn't work, just close and reopen the PR so that the workflow will take into account the label automation we have in place.
- Review and merge the backport pull request that it generates.
- Merge a pull request to the release branch updating the
CHANGELOG.md.- The heading for the unreleased entries should be
## Unreleased.
- The heading for the unreleased entries should be
- Run the Prepare patch release workflow.
- Press the "Run workflow" button, then select the release branch from the dropdown list,
e.g.
release/v1.9.x, and click the "Run workflow" button below that. - Review and merge the pull request that it creates for updating the version.
- Press the "Run workflow" button, then select the release branch from the dropdown list,
e.g.
- Note: If you are doing a patch release in
-contribrepo, you should also do an equivalent patch release in-corerepo (even if there's no fix to release), otherwise tests in CI will fail.
Preparing a patch release for individual package
Note
Per-package release is supported only for packages included in the corresponding workflow. Libraries that support per-package release are currently excluded from the general patch release.
Per-package patch release preparation is handled by the [Package] Prepare patch release workflow that allows
to pick a specific package to release.
The workflow can only be run against long-term release branch such as package-release/{package-name}/v{major}.{minor}.x or package-release/{package-name}/v{major}.{minor}bx.
The workflow will create a pull request that should be merged in order to proceed with the release.
Making the release
- Run the Release workflow.
- Press the "Run workflow" button, then select the release branch from the dropdown list,
e.g.
release/v1.9.x, and click the "Run workflow" button below that. - This workflow will publish the artifacts and publish a GitHub release with release notes based on the change log.
- Review and merge the pull request that it creates for updating the change log in main (note that if this is not a patch release then the change log on main may already be up-to-date, in which case no pull request will be created).
- Verify that a new Github release has been created and that the CHANGELOGs look correct.
- Press the "Run workflow" button, then select the release branch from the dropdown list,
e.g.
Releasing individual package
Note
Per-package patch release is supported for the following packages only:
- opentelemetry-propagator-aws-xray
- opentelemetry-resource-detector-azure
- opentelemetry-sdk-extension-aws
- opentelemetry-instrumentation-openai-v2
- opentelemetry-instrumentation-openai-agents-v2
- opentelemetry-instrumentation-vertexai
- opentelemetry-instrumentation-anthropic
- opentelemetry-instrumentation-claude-agent-sdk
- opentelemetry-instrumentation-google-genai
- opentelemetry-instrumentation-langchain
- opentelemetry-instrumentation-weaviate
- opentelemetry-util-genai
- opentelemetry-exporter-credential-provider-gcp
These libraries are also excluded from the general patch release.
Per-package release is handled by the [Package] Release workflow that allows
to pick a specific package to release.
The workflow can only be run against long-term release branch such as package-release/{package-name}/v{major}.{minor}.x or package-release/{package-name}/v{major}.{minor}bx.
After the release
- Check PyPI
- This should be handled automatically on release by the publish action.
- Check the action logs to make sure packages have been uploaded to PyPI
- Check the release history (e.g. https://pypi.org/project/opentelemetry-instrumentation/#history) on PyPI
- If for some reason the action failed, see Publish failed below
Notes about version numbering for stable components
- The version number for stable components in the
mainbranch is alwaysX.Y.0.dev, whereX.Y.0represents the next minor release. - When the release branch is created, you can opt to make a "pre-release", e.g.
X.Y.0rc2. - If you ARE NOT making a "pre-release":
- A "long-term" release branch will be created, e.g.
release/v1.9.x-0.21bx(notice the wildcard x's). Later on, after the initial release, you can backport PRs to a "long-term" release branch and make patch releases from it. - The version number for stable components in the release branch will be bumped to remove the
.dev, e.g.X.Y.0. - The version number for stable components in the
mainbranch will be bumped to the next version, e.g.X.{Y+1}.0.dev.
- A "long-term" release branch will be created, e.g.
- If you ARE making a "pre-release":
- A "short-term" release branch will be created, e.g.
release/v1.9.0rc2-0.21b0(notice the precise version with no wildcard x's). "Short-term" release branches do not support backports or patch releases after the initial release. - The version number for stable components in the
mainbranch will not be bumped, e.g. it will remainX.Y.0.devsince the next minor release will still beX.Y.0.
- A "short-term" release branch will be created, e.g.
Notes about version numbering for unstable components
- The version number for unstable components in the
mainbranch is always0.Yb0.dev, where0.Yb0represents the next minor release.- Question: Is "b" (beta) redundant on "0." releases, or is this a python thing? I'm wondering if we can change it to
0.Y.0to match up with the practice in js and go repos.
- Question: Is "b" (beta) redundant on "0." releases, or is this a python thing? I'm wondering if we can change it to
- Unstable components do not need "pre-releases", and so whether or not you are making a "pre-release" of stable
components:
- The version number for unstable components in the release branch will be bumped to remove the
.dev, e.g.0.Yb0. - The version number for unstable components in the
mainbranch will be bumped to the next version, e.g.0.{Y+1}b0.dev.
- The version number for unstable components in the release branch will be bumped to remove the
Releasing dev version of new packages to claim namespace
When a contribution introduces a new package, in order to mitigate name-squatting incidents, release the current development version of the new package under the opentelemetry user to simply claim the namespace. This should be done shortly after the PR that introduced this package has been merged into main.
Troubleshooting
Publish failed
If for some reason the action failed, do it manually:
- Switch to the release branch (important so we don't publish packages with "dev" versions)
- Build distributions with
./scripts/build.sh - Delete distributions we don't want to push (e.g.
testutil) - Push to PyPI as
twine upload --skip-existing --verbose dist/* - Double check PyPI!