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 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions docs/sdk/entry_points.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
Entry Points
============

OpenTelemetry Python uses Python's `entry points <https://setuptools.pypa.io/en/stable/userguide/entry_point.html>`_ 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.

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

The SDK supports configuring entry points via environment variables by specifying the entry point name. For a complete list of supported environment variables, see :doc:`../api/environment_variables`.

Entry Point Configuration Reference
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Logs Exporter**

:Environment Variable: ``OTEL_LOGS_EXPORTER``
:Entry Point Group: ``opentelemetry_logs_exporter``
:Available Names: ``console``, ``otlp_proto_grpc``, ``otlp_proto_http``
:Base Type: ``LogExporter`` *(experimental)*

**Metrics Exporter**

:Environment Variable: ``OTEL_METRICS_EXPORTER``
:Entry Point Group: ``opentelemetry_metrics_exporter``
:Available Names: ``console``, ``otlp``, ``otlp_proto_grpc``, ``otlp_proto_http``, ``prometheus``
:Base Type: :class:`MetricExporter <opentelemetry.sdk.metrics.export.MetricExporter>` or :class:`MetricReader <opentelemetry.sdk.metrics.export.MetricReader>`

**Propagators**

:Environment Variable: ``OTEL_PROPAGATORS``
:Entry Point Group: ``opentelemetry_propagator``
:Available Names: ``b3``, ``b3multi``, ``baggage``, ``jaeger``, ``tracecontext``
:Base Type: :class:`TextMapPropagator <opentelemetry.propagators.textmap.TextMapPropagator>`

**Traces Sampler**

:Environment Variable: ``OTEL_TRACES_SAMPLER``
:Entry Point Group: ``opentelemetry_traces_sampler``
:Available Names: ``always_off``, ``always_on``, ``parentbased_always_off``, ``parentbased_always_on``, ``parentbased_traceidratio``, ``traceidratio``
:Base Type: :class:`Sampler <opentelemetry.sdk.trace.sampling.Sampler>`

**Resource Detectors**

:Environment Variable: ``OTEL_EXPERIMENTAL_RESOURCE_DETECTORS``
:Entry Point Group: ``opentelemetry_resource_detector``
:Available Names: ``host``, ``os``, ``otel``, ``process``
:Base Type: :class:`ResourceDetector <opentelemetry.sdk.resources.ResourceDetector>`

**ID Generator**

:Environment Variable: ``OTEL_PYTHON_ID_GENERATOR``
:Entry Point Group: ``opentelemetry_id_generator``
:Available Names: ``random``
:Base Type: :class:`IdGenerator <opentelemetry.sdk.trace.id_generator.IdGenerator>`

**Traces Exporter**

:Environment Variable: ``OTEL_TRACES_EXPORTER``
:Entry Point Group: ``opentelemetry_traces_exporter``
:Available Names: ``console``, ``otlp``, ``otlp_proto_grpc``, ``otlp_proto_http``, ``zipkin``, ``zipkin_json``, ``zipkin_proto``
Copy link
Contributor

Choose a reason for hiding this comment

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

Most of these names depend on an exporter package installed, we should make that clear somehow. Same applies to other groups.

:Base Type: :class:`SpanExporter <opentelemetry.sdk.trace.export.SpanExporter>`

**Tracer Provider**

:Environment Variable: ``OTEL_PYTHON_TRACER_PROVIDER``
:Entry Point Group: ``opentelemetry_tracer_provider``
:Available Names: ``default_tracer_provider``, ``sdk_tracer_provider``
:Base Type: :class:`TracerProvider <opentelemetry.trace.TracerProvider>`

**Meter Provider**

:Environment Variable: ``OTEL_PYTHON_METER_PROVIDER``
:Entry Point Group: ``opentelemetry_meter_provider``
:Available Names: ``default_meter_provider``, ``sdk_meter_provider``
:Base Type: :class:`MeterProvider <opentelemetry.metrics.MeterProvider>`

**Logger Provider**

:Environment Variable: ``OTEL_PYTHON_LOGGER_PROVIDER``
:Entry Point Group: ``opentelemetry_logger_provider``
:Available Names: ``sdk_logger_provider``
:Base Type: :class:`LoggerProvider <opentelemetry._logs.LoggerProvider>`

**Event Logger Provider**

:Environment Variable: ``OTEL_PYTHON_EVENT_LOGGER_PROVIDER``
:Entry Point Group: ``opentelemetry_event_logger_provider`` *(not implemented)*
:Available Names: *None - no entry point implementations exist*
:Base Type: ``EventLoggerProvider`` *(experimental)*

.. note::
The Events API is `experimental <https://github.com/open-telemetry/opentelemetry-python#project-status>`_ and currently has no entry point implementations.

See Also
--------

* :doc:`trace` - Trace SDK documentation
* :doc:`metrics` - Metrics SDK documentation
* :doc:`environment_variables` - Environment variable reference
1 change: 1 addition & 0 deletions docs/sdk/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ OpenTelemetry Python SDK
metrics
error_handler
environment_variables
entry_points