open-telemetry / open-telemetry/opentelemetry-python

Write Guidelines for Python Packages Extending OTel Python Main Packages

Open
#1,234 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
Python
Stars
2.6k
Forks
1k
Avg merge
4d 15h
Merged PRs (30d)
19

Description

Following the discussion in #1205 where we identified that the opentelemetry (i.e. the opentelemetry-api package) and (soon) the opentelemetry-sdkpackages are setup as Namespace Packages, we decided there was a need for guidelines which explain how subsequent extension packages should extend these base packages.

A Namespace Package allows other directories to extend the original namespace package by distributing packages under the same package name.

We already do this today with the instrumentation and exporter packages, which extend the OTel Python API package.

e.g. opentelemetry.instrumentation.* and opentelemetry.exporter.*

The guidelines should address how packages will extend the OTel Python SDK package and ensure that installing these extension packages don't disrupt the operation of the original package.

Regarding the proposal that OTel Python SDK package extensions should live under opentelemetry.sdk.extension, the following can be said:

Pros:

  • Extra functionality for vendor specific tools under the OTel name means they should be easier to find by users
  • This is consistent with the instrumentation and exporter models we have today
  • Encourages updates to OTel SDK to consider effects on SDK extensions which users will likely be using

Cons:

  • Maintaining this code becomes the responsibility of the open source community
  • Can still cause conflicts down the line as we as upstream cannot guarantee changing the directory structure in a way that breaks an unknown 3rd party package.
  • 3rd party packages should use their own import paths
    Inconsistent with other languages who have more complicated package importing

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the discussion in #1205 and inspecting the existing instrumentation and exporter package models. Document guidelines for extending the OpenTelemetry Python API and SDK namespace packages, including how extensions avoid disrupting the original packages. Done means the guidance addresses the proposed opentelemetry.sdk.extension path and the listed trade-offs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.