open-telemetry / opentelemetry-python-contrib

OpenTelemetry instrumentation for Python modules
https://opentelemetry.io
Apache License 2.0
733 stars 604 forks source link

GenAI project and code organization in Python #2858

Open lmolkova opened 1 month ago

lmolkova commented 1 month ago

We're trying to find the space for GenAI-related instrumentation libraries (related to the https://github.com/open-telemetry/community/pull/2326 project).

TL;DR: we need to host OTel gen-ai instrumentations somewhere in otel, we're going to evolve them along with semantic conventions, we need to ship them more frequently and with different versions than other contrib components.

Where instrumentations live

Based on the discussions in Python SIG, we have the following options:

Option 1. In a separate repo

Pros:

Option 2. In the contrib, manual release per-component

Pros:

Option 3. In the contrib, but as a separate group of instrumentations


I'd like to explore Option 3 since it can potentially satisfy all the needs.

lmolkova commented 1 month ago

Option 3 proposal:

The scope is initially limited to any new instrumentation (gen-ai or not) and can be expanded to old instrumentations later.

Support per-package ownership with approval powers

Use component-owners and CODEOWNERS to assign reviewers AND to allow hypothetical python-genai-approvers to approve changes

Support per-package release model

Per-package ownership/versioning/releases is supported by otel-dotnet-contrib and otel-js-contrib, we can learn from them.

Each new component will have individual changelog

Central changelog may:

Each new component will have individual version

We should be able to release components individually or all-together


Would it be harder to implement Option 3 comparing to the new repo?

If we do the new repo:

Given the limitations and the complexity of creating a new repo + revisiting tooling decisions, I think there is no immediate gain in having a separate repo.

I'd propose to try release-please for new components including GenAI and expand it to existing instrumentations later.