nat.plugins.phoenix.mixin.phoenix_mixin#
Attributes#
Classes#
Mixin for Phoenix exporters. |
Module Contents#
- logger#
- class PhoenixMixin(*args, endpoint: str, project: str, **kwargs)#
Mixin for Phoenix exporters.
This mixin provides Phoenix-specific functionality for OpenTelemetry span exporters. It handles Phoenix project scoping and uses the HTTPSpanExporter from the phoenix.otel module.
Key Features: - Automatic Phoenix project name injection into resource attributes - Phoenix project scoping via using_project() context manager - Integration with Phoenix’s HTTPSpanExporter for telemetry transmission
This mixin is designed to be used with OtelSpanExporter as a base class:
Example:
class MyPhoenixExporter(OtelSpanExporter, PhoenixMixin): def __init__(self, endpoint, project, **kwargs): super().__init__(endpoint=endpoint, project=project, **kwargs)
Initialize the Phoenix exporter.
- Args:
endpoint: Phoenix service endpoint URL. project: Phoenix project name for trace grouping.
- _exporter#
- _project#