nat.plugins.opentelemetry.mixin.otlp_span_exporter_mixin#
Attributes#
Classes#
Mixin for OTLP span exporters. |
Module Contents#
- logger#
- class OTLPSpanExporterMixin( )#
Mixin for OTLP span exporters.
This mixin provides OTLP-specific functionality for OpenTelemetry span exporters. It handles OTLP protocol transmission using the standard OpenTelemetry OTLP HTTP exporter.
Key Features: - Standard OTLP HTTP protocol support for span export - Configurable endpoint and headers for authentication/routing - Integration with OpenTelemetry’s OTLPSpanExporter for reliable transmission - Works with any OTLP-compatible collector or service
This mixin is designed to be used with OtelSpanExporter as a base class:
Example:
class MyOTLPExporter(OtelSpanExporter, OTLPSpanExporterMixin): def __init__(self, endpoint, headers, **kwargs): super().__init__(endpoint=endpoint, headers=headers, **kwargs)
Initialize the OTLP span exporter.
- Args:
endpoint: OTLP service endpoint URL. headers: HTTP headers for authentication and metadata.
- _exporter#