test- otel span recording

This commit is contained in:
Ishaan Jaff 2024-07-11 08:47:16 -07:00
parent cb6ddaf1f9
commit 02ab3cb73d
5 changed files with 242 additions and 0 deletions

View file

@ -52,6 +52,12 @@ class OpenTelemetryConfig:
OTEL_HEADERS gets sent as headers = {"x-honeycomb-team": "B85YgLm96******"}
"""
from opentelemetry.sdk.trace.export.in_memory_span_exporter import (
InMemorySpanExporter,
)
if os.getenv("OTEL_EXPORTER") == "in_memory":
return cls(exporter=InMemorySpanExporter())
return cls(
exporter=os.getenv("OTEL_EXPORTER", "console"),
endpoint=os.getenv("OTEL_ENDPOINT"),