Skip to content

Cross-repository distribution for a Python OpenTelemetry platform

Research date: 2026-09-18
Scope: Python packaging, local cross-repository development, Collector configuration delivery, artifact identity and provenance, and compatibility metadata.
Sources: Primary specifications and official project documentation only.

Decision summary

The strongest distribution boundary is to release two independently installable artifact classes from the platform repository and tie them together with one machine-readable compatibility manifest:

  1. A conventional Python wheel and source distribution for the reusable application-side API, runtime, exporters, instrumentation integrations, test helpers, and read-only configuration templates.
  2. A platform-owned Collector OCI image, or when independent config rollout is required, a config-only OCI artifact, always consumed by digest rather than by a mutable tag.

A Python dependency cannot accurately express or install a compatible Collector binary or image. Python core metadata can constrain Python and Python distributions, while Requires-External is only a downstream-maintainer hint with no installer semantics. The Collector distribution, required components, configuration bundle, and OCI digests therefore need a project-defined compatibility record checked by tooling and CI. PyPA core metadata

Ordinary development does not need a package-registry publication. Contributors can clone the two repositories as siblings and use a local editable dependency. pip supports both regular and editable local-project installation, while uv can preserve a normal published dependency in [project.dependencies] and override only its development source with a relative path or external workspace in [tool.uv.sources]. pip local project installs, uv dependency sources, uv external workspaces

The default release shape should therefore be:

Concern Release artifact Immutable identity Ordinary local source
Python platform Wheel and sdist Normalized package name and PEP 440 version; file digest and attestation at release Editable sibling checkout
Collector runtime plus platform base config OCI image Fully qualified image reference by manifest digest, plus provenance attestation Locally built image from the platform checkout
Human-readable/config-generation assets Package resources in the wheel, produced from the same source directory as the image config Wheel RECORD, release-file digest, and platform version Files in the platform checkout
Consumer-specific Collector overlay Consumer repository Consumer commit and deployment artifact Files in the consumer checkout
Cross-artifact compatibility Versioned JSON or TOML manifest in the Python package and release assets Included file hash plus release attestation Generated or validated from platform source

This keeps Recommendation-specific configuration in the consumer without making the consumer own the reusable Collector safety baseline.

1. Python package and optional-dependency constraints

The platform should be an ordinary PEP 621 project. [project.optional-dependencies] is the standard mechanism for extras: each group is translated to Provides-Extra and conditional Requires-Dist metadata. requires-python, dependency version specifiers, and environment markers carry the compatibility information understood by Python installers. PyPA pyproject.toml specification, PyPA dependency specifiers

The base dependency set should stay narrow. OpenTelemetry's Python guidance says an instrumented library should depend on opentelemetry-api and leave SDK selection and initialization to the application; an application that initializes telemetry uses the SDK. The reusable platform may provide that application bootstrap, but the SDK, OTLP exporters, and framework instrumentations can still be grouped behind explicit extras such as sdk, otlp, and framework-specific extras rather than imposed on every importer. OpenTelemetry Python instrumentation guidance, OpenTelemetry Python contrib packaging guidance

Important constraints for later package design:

  • Extras are additive feature requests, not mutually exclusive variants. Conflicting extras need explicit resolver/tool handling rather than an assumption that only one will be installed. uv optional dependency documentation
  • A reusable library should state compatible ranges in package metadata; each consuming application should lock exact resolved versions. uv describes pyproject.toml as broad requirements and uv.lock as exact, reproducible resolution data checked into version control. uv project layout and lockfile
  • OpenTelemetry Python instrumentations are separate packages and can have their own supported library ranges and stability. The contrib project requires stable instrumentations to test all supported versions, and its published table records per-instrumentation ranges and semantic convention status. The platform's compatibility tests need both the oldest and newest supported dependency combinations rather than only a single lock resolution. OpenTelemetry Python contrib release criteria, instrumentation compatibility table
  • Build both a wheel and sdist. A wheel contains the exact installed files and a RECORD with their hashes, which makes it possible to verify that all configuration resources actually shipped. PyPA package format guidance

2. No-registry contributor and CI workflows

pip install -e ../observability-platform is a standardized ordinary contributor workflow for a checked-out local project. Editable installation reflects source changes immediately, but pip warns that editable behavior can differ from a regular installation and recommends regular installs for CI and deployment. pip local project installs

For a uv-managed consumer, retain the intended release constraint by name in [project.dependencies], then add an uv-only relative-path source in [tool.uv.sources]. uv explicitly supports editable path sources and a path to an external workspace. Because sources are uv-specific, other tools see only the standard dependency declaration. A release gate should run uv build --no-sources (and resolution with --no-sources) to prove the project does not depend on the developer-only override. uv path dependencies, uv disabling sources

This workflow requires only a documented sibling checkout layout; it does not require publishing every platform commit to a registry. It also keeps repository histories and release authority separate.

Cross-repository CI should check out the exact platform commit, build its wheel, and install that wheel into an isolated consumer test environment. This exercises the regular install path that users receive rather than relying solely on editable behavior. The installed distribution records its direct source in direct_url.json when installed from a local directory or URL, which is useful diagnostic evidence but is not a compatibility contract. PyPA direct-URL-origin specification

Other supported mechanisms

Mechanism What it provides Constraint and recommended use
PEP 508 direct URL or VCS requirement A Python dependency can refer to a specific remote artifact or repository revision Requires network access; use a full commit hash or artifact hash for CI/transition, not as the ordinary offline loop. Direct references are part of the dependency grammar, and pip supports Git commit references while preferring a full hash. PyPA dependency specifiers, pip VCS support
Git submodule The consumer records the platform repository at one exact commit while histories remain separate Adds clone/update ergonomics and places the platform checkout inside the consumer; use only if one-command source acquisition is worth that coupling. Git submodules
Locally built wheel Closest no-registry representation of a release artifact Preferred in CI and pre-release integration; rebuild after platform changes.
Registry package Normal resolver and upgrade experience Needed for released consumers, but not for ordinary platform/consumer co-development.

Absolute filesystem paths must not become published dependency metadata. A normal named and versioned dependency remains the portable contract; local source selection is a development-tool override.

3. Ways to ship or pin Collector configuration

A. Embed read-only templates in the Python distribution

Configuration YAML, schemas, and compatibility manifests can live inside the import package and be included as package data in both wheel and sdist. Setuptools recommends package-internal data for runtime package resources; the equivalent inclusion mechanism must be configured when another build backend is selected. importlib.resources.files() reads resources without assuming a source checkout, and as_file() temporarily materializes a real path when an external process such as the Collector requires one. setuptools data-file guidance, Python importlib.resources

This is the simplest atomic link between Python API version and reference configuration. The resources should be treated as immutable templates. A platform CLI or API can copy them to a caller-selected directory rather than encouraging callers to mutate installed package files.

B. Bake the tested base configuration into a platform Collector image

The platform can build a thin image from an official Collector distribution and copy the validated base profiles into it. The consuming deployment then refers to the whole binary-plus-config unit by digest. Docker documents that tags are mutable and digest references select the same immutable image content; the OCI descriptor specification defines a digest as the content identifier and requires SHA-256 verification support. Docker digest pinning, OCI content descriptors

This is the strongest default when the platform owns both the Collector component set and the base safety configuration. Consumer-specific settings can remain a second file supplied by the consumer. The Collector accepts multiple --config inputs, merges partial files, supports file, env, yaml, http, and https providers, and has a validate command. Collector configuration

C. Publish a config-only OCI artifact

When configuration must release independently from the Collector image, OCI permits non-image content in an image manifest. ORAS can push individual YAML files or a tarred directory with an artifact type and pull them from a compatible registry. The resulting manifest digest is the immutable bundle identity. OCI artifact guidance, ORAS push and pull

The stock Collector providers documented above do not include an OCI scheme. An entrypoint, bootstrap step, init container, or custom provider must pull the bundle, verify the digest, and pass a local file path to the Collector. This additional moving part is justified only when config-only release cadence or independent reuse is required.

D. Reference an HTTPS configuration

The Collector can load configuration by https: URI, but its documented configuration interface does not attach an expected content digest to that URI. HTTPS authenticates the endpoint in transit; it is not an immutable artifact reference. A raw URL should therefore not be the release pin unless a bootstrap layer verifies an independently recorded hash before startup. Collector configuration providers

Keep one base configuration source tree in the platform repository. Build the wheel resources and the platform Collector image from that same tree, and record their hashes in the compatibility manifest. This avoids separately maintained copies while supporting both Python-side inspection and an operationally complete image. Add a separate config-only OCI artifact later only if its independent lifecycle is demonstrated.

4. Integrity, signing, and provenance

Digest pinning and provenance answer different questions:

  • An OCI or release-file digest proves which bytes were retrieved.
  • A signature or attestation ties those bytes to an expected build identity and workflow.
  • Neither proves that the contents are safe; the consumer must define and enforce an identity and policy. GitHub explicitly describes attestations as provenance/integrity evidence rather than a security guarantee. GitHub artifact-attestation model

For Python releases published to PyPI, use Trusted Publishing rather than a long-lived upload token. PyPI exchanges an OIDC workload identity for a project-scoped token that expires after 15 minutes. The official PyPA GitHub publishing action generates PEP 740 attestations for each distribution by default, and PyPI exposes provenance that consumers can verify against the source repository identity. PyPI Trusted Publishing, PyPA publishing workflow, consuming PyPI attestations

If wheels and sdists are distributed as GitHub release assets instead of through PyPI, GitHub Actions can attest arbitrary build files. It can also attest an OCI subject using its fully qualified image name and digest and store the attestation with the registry. Verification is done with gh attestation verify. Availability for private/internal repositories depends on the GitHub plan, so that must be confirmed before selecting it as the organization-wide mechanism. GitHub artifact-attestation workflow

Cosign is a registry-neutral alternative for OCI images and config artifacts. Identity-based verification checks the expected certificate identity and OIDC issuer; normal image verification also checks that the signed digest claim matches the image. Whichever mechanism is chosen, sign and verify the digest reference, not a mutable tag. Cosign verification

Local editable development does not need release signing. Trust comes from the checked-out source and local Git revision. Signing begins at the immutable release artifact boundary.

5. Compatibility metadata and release gates

Standard metadata

Use Python metadata for what Python tooling understands:

  • Package version and PEP 440 dependency ranges.
  • Requires-Python for the supported interpreter range.
  • Requires-Dist and Provides-Extra for runtime and optional Python dependencies.
  • Environment markers for platform- or interpreter-specific Python dependencies.

Use the consumer application's committed lockfile for exact resolved Python artifacts. A lockfile is deployment evidence, not a substitute for the platform library's supported ranges. PyPA core metadata, PyPA pylock.toml specification

Platform-defined compatibility manifest

No cited Python or OpenTelemetry standard provides one metadata field that binds a Python package to an exact Collector distribution, component inventory, and configuration bundle. The platform should therefore version a JSON or TOML manifest that records at least:

  • manifest schema version;
  • platform Python distribution name and version;
  • supported Python and OpenTelemetry API/SDK/instrumentation ranges;
  • telemetry schema/semantic-convention version or stability selection;
  • exact Collector distribution name and version;
  • required Collector components and their stability expectations;
  • tested Collector image reference by digest;
  • base configuration bundle version and digest;
  • supported consumer-contract version range; and
  • source revision and build provenance identity.

Standard OCI annotations can additionally record source, revision, and version, while custom annotations must be namespaced string values. Keep the structured compatibility record in a file or OCI blob rather than flattening it into annotations. OCI annotations

Gates before a release becomes consumable

  1. Build wheel and sdist from a clean checkout; inspect both to prove that package resources and the compatibility manifest are present.
  2. Build and resolve with uv sources disabled, then install the wheel into every supported Python version and exercise every advertised extra.
  3. Test the oldest and newest supported OpenTelemetry dependency combinations, plus the exact consumer lock used for qualification.
  4. Pull the exact Collector image digest, query its component inventory with otelcol components, and fail if a required receiver, processor, exporter, connector, or extension is absent.
  5. Run otelcol validate against every complete platform profile and every supported platform-plus-consumer composition, using the same image digest that will be published.
  6. Execute an end-to-end OTLP smoke test for every promised signal and transport and verify shutdown/failure behavior.
  7. Verify wheel/sdist and OCI attestations against the allowed repository/workflow identity.
  8. Run the consumer's cross-repository contract suite against the candidate wheel and Collector digest before promoting the manifest.

The exact Collector digest matters because distributions contain different components, and component stability varies by signal. The Collector's versioning policy says experimental v0 artifacts may change, while stable component configuration carries stronger compatibility rules; the component-stability document also permits quicker configuration changes for alpha components. Collector versioning policy, Collector component stability, Collector distributions

6. Decision implications for the Wayfinder map

The research supports these defaults for later decisions:

  1. Distribution: separate Python and OCI artifacts; do not make a Python install operate or install the Collector.
  2. Local integration: sibling editable checkout for fast development, regular locally built wheel for CI, and standard name/version metadata for releases.
  3. Collector assets: keep the reusable base config in the platform repository, embed it as read-only package resources, and bake the operational copy into a platform image. Keep consumer overlays in the consumer repository.
  4. Pinning: consumers pin Collector images and any standalone config bundle by digest. Tags are discovery labels only.
  5. Compatibility: introduce one versioned, machine-readable compatibility manifest because Python metadata cannot model the full Python/Collector/config tuple.
  6. Provenance: use PyPI Trusted Publishing plus PEP 740 for indexed Python releases; use either GitHub artifact attestations or Cosign for OCI artifacts, with explicit verification policy.
  7. Upgrade path: automation may propose new dependency versions and image digests, but a candidate becomes supported only after the full cross-artifact and first-consumer gate passes.

The remaining choices are policy rather than missing technical facts: whether the first release needs a config-only OCI artifact in addition to the baked image, which registry and attestation service the organization can support, the exact compatibility window, and which optional extras form the public Python installation surface.

Time-sensitive facts to recheck at implementation

OpenTelemetry Python and Collector release numbers, minimum Python versions, component inventories, component stability, GitHub Action majors, ORAS/Cosign CLI syntax, and registry support for OCI referrers will change. Release automation should discover and record exact candidate versions and digests, but repository policy should never derive a supported release from an unpinned main, latest, or floating tag.