praval.observability.export.otlp_exporter
OTLP (OpenTelemetry Protocol) HTTP exporter.
Sends traces to OTLP-compatible collectors like: - Jaeger - Zipkin - Honeycomb - DataDog - New Relic - etc.
Functions
|
Export traces from local storage to OTLP endpoint. |
Classes
|
OTLP HTTP exporter for sending traces to collectors. |
- class praval.observability.export.otlp_exporter.OTLPExporter(endpoint, headers=None)[source]
Bases:
objectOTLP HTTP exporter for sending traces to collectors.
- Parameters:
endpoint (str)
headers (Dict[str, str] | None)
- __init__(endpoint, headers=None)[source]
Initialize OTLP exporter.
- Parameters:
endpoint (
str) – OTLP HTTP endpoint URL (e.g., “http://localhost:4318/v1/traces”)headers (
Optional[Dict[str,str]]) – Optional HTTP headers (e.g., API keys)
- praval.observability.export.otlp_exporter.export_traces_to_otlp(endpoint, trace_ids=None, limit=100, headers=None)[source]
Export traces from local storage to OTLP endpoint.
- Parameters:
endpoint (
str) – OTLP HTTP endpoint URLtrace_ids (
Optional[List[str]]) – Optional list of specific trace IDs to export (None = recent traces)limit (
int) – Maximum number of traces to export (default: 100)headers (
Optional[Dict[str,str]]) – Optional HTTP headers
- Return type:
bool- Returns:
True if export successful, False otherwise