Skip to content

Update docs for entrypoints #4701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sginji
Copy link

@sginji sginji commented Jul 27, 2025

Description

Update docs with content about entrypoints and how they can they be setup

Fixes # issue

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • View in browser

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@sginji sginji requested a review from a team as a code owner July 27, 2025 16:55
Entry Points
============

OpenTelemetry Python uses Python's **entry points** mechanism to provide a pluggable architecture. Entry points allow you to register custom components (exporters, samplers, etc.) that can be discovered and loaded at runtime.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we link to the official entry point documentation here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

Configuration
-------------

Entry points are controlled via environment variables:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe -- the name (I think that is the official term from the entry points doc) of the entry point is set to environment variables

Copy link
Contributor

@xrmx xrmx Jul 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I agree with the PR here, e.g. for -contrib this is not true. Entry points is what we use for providing extensibility without coupling the code (i.e. a plugin system) from different python packages and in practice they are a system we use to load code from a configuration. Then you can add that some options leverage entry points, as Dylan wrote, requiring to specify the entry point name in order to load some specific code.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! i've updated this - please lmk if this looks better

Configuration
-------------

Entry points are controlled via environment variables:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we link to something that lists all the environment variables

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think we could link the API environment variables doc (sourced here and here) instead of duplicating here in the SDK docs.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!


Entry points are controlled via environment variables:

* ``OTEL_TRACES_EXPORTER`` - Trace exporters (e.g., ``console``, ``otlp_proto_grpc``)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should have a 3 column table -- environment variables, entry point name, available options provided by otel python SDK/exporter package ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done and added a 4th column to link to the base class as mentioned in one of the other comments!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there's not enough room for all four columns without hidden overflow. Another possibility would be to convert each row into its own block.


**Exporters** - Send telemetry data to backends:

* ``opentelemetry_traces_exporter`` - Trace exporters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think when the code loads it in it checks the type, it'd be good if we could link to the actual type here. Maybe the actual definition in the .py file is best?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree


* ``opentelemetry_traces_sampler`` - Decide which traces to collect
* ``opentelemetry_id_generator`` - Generate trace/span IDs
* ``opentelemetry_resource_detector`` - Detect environment info
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again if possible can we link to the expected type? I appreciate the very brief explanation of what the thing is tho..

* ``opentelemetry_meter_provider`` - Create meters
* ``opentelemetry_logger_provider`` - Create loggers

Creating a Custom Exporter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this section is useful. It would be good to put this information somewhere without duplicating what the API and SDK docs already describe (e.g. the env vars mentioned above). Alternative locations could be as a new example or as a special exporters topic. Or maybe in the otel.io docs.

* - OTEL_LOGS_EXPORTER
- opentelemetry_logs_exporter
- ``console``, ``otlp_proto_grpc``, ``otlp_proto_http``
- LogExporter
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an _internal class - should it still be linked here? is it relevant still?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants