From dcf20c5c639cf6e2771eabc2756cdd88d1a79767 Mon Sep 17 00:00:00 2001 From: Teo Date: Fri, 13 Dec 2024 17:18:57 -0600 Subject: [PATCH] `teleemtry` package base with OTELConfig export --- agentops/telemetry/__init__.py | 3 +++ agentops/telemetry/config.py | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 agentops/telemetry/__init__.py create mode 100644 agentops/telemetry/config.py diff --git a/agentops/telemetry/__init__.py b/agentops/telemetry/__init__.py new file mode 100644 index 00000000..d1083ebf --- /dev/null +++ b/agentops/telemetry/__init__.py @@ -0,0 +1,3 @@ +from .config import OTELConfig + +__all__ = [OTELConfig] diff --git a/agentops/telemetry/config.py b/agentops/telemetry/config.py new file mode 100644 index 00000000..3929cc42 --- /dev/null +++ b/agentops/telemetry/config.py @@ -0,0 +1,20 @@ +from dataclasses import dataclass +from typing import Dict, List, Optional + +from opentelemetry.sdk.trace.export import SpanExporter +from opentelemetry.sdk.trace.sampling import Sampler + + +@dataclass +class OTELConfig: + """Configuration for OpenTelemetry integration""" + + additional_exporters: Optional[List[SpanExporter]] = None + resource_attributes: Optional[Dict] = None + sampler: Optional[Sampler] = None + retry_config: Optional[Dict] = None + custom_formatters: Optional[List[callable]] = None + enable_metrics: bool = False + metric_readers: Optional[List] = None + enable_in_flight: bool = True + in_flight_interval: float = 1.0