Skip to content

Latest commit

 

History

History
138 lines (97 loc) · 4.45 KB

File metadata and controls

138 lines (97 loc) · 4.45 KB

Contributing

Welcome to the OpenTelemetry Python GenAI Instrumentations repository!

New to OpenTelemetry? Read the New Contributor Guide first — it covers the CLA, Code of Conduct, and other prerequisites.

If you are using AI agents to assist with contributions, please also read AGENTS.md for guidance on how to use them responsibly in this project.

Prerequisites

  • Python — see tox.ini for the supported versions.
  • uv — used to manage the workspace and to back the tox test environments.

Code structure

├── instrumentation/
│   └── opentelemetry-instrumentation-<name>/  # one package per GenAI library
│       ├── src/opentelemetry/instrumentation/<name>/
│       ├── tests/
│       └── pyproject.toml
└── util/
    └── opentelemetry-util-genai/              # shared GenAI utilities
        ├── src/opentelemetry/util/genai/
        ├── tests/
        └── pyproject.toml

The monorepo uses uv workspaces; each package owns its own pyproject.toml, version, and entry points. tox.ini defines the test matrix.

Making a change

1. Set up the environment

Install all packages and dev tools into a single workspace virtual environment:

uv sync --frozen --all-packages

2. Lint

uv run pre-commit run ruff --all-files

3. Test

Run the test environment for the package you changed (append -oldest or -latest for the version variants defined in tests/requirements.{oldest,latest}.txt):

uv run tox -e py312-test-instrumentation-openai-v2-latest

Run type checking across the workspace:

uv run tox -e typecheck

4. Update the changelog

This repo uses towncrier to manage changelogs. Each PR with user-visible impact must add a changelog fragment under the affected package's .changelog/ directory rather than editing CHANGELOG.md directly.

Fragment path: <package>/.changelog/<PR_NUMBER>.<TYPE>

Types: added, changed, deprecated, removed, fixed.

The file contains a one-line description. For example, instrumentation/opentelemetry-instrumentation-anthropic/.changelog/123.fixed:

fix request hook not being called when stream=True

Don't include the PR number in the body — towncrier appends it from the filename.

Preview the rendered changelogs locally:

uv run tox -e changelog-preview

If your change doesn't need an entry (pure docs/tooling), add the Skip Changelog label to the PR.

Keep PRs small

One logical change per PR. Don't bundle unrelated fixes, refactors, or features — split them so each can be reviewed and reverted independently. Small, focused PRs are much easier to review, and therefore much more likely to land quickly.

If a PR review surfaces contentious or difficult points, consider splitting those into follow-up PRs so the uncontroversial parts can land and each of the harder points gets its own focused discussion and review.

Asking questions

Post in #otel-genai-instrumentation on CNCF Slack or join the next GenAI SIG meeting and add your topic to the meeting agenda. See the community repo for current meeting times.

Approvers and Maintainers

Maintainers

For more information about the maintainer role, see the community repository.

Approvers

For more information about the approver role, see the community repository.