Skip to content

Commit

Permalink
teleemtry package base with OTELConfig export
Browse files Browse the repository at this point in the history
  • Loading branch information
teocns committed Jan 5, 2025
1 parent 9b36d7a commit dcf20c5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions agentops/telemetry/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .config import OTELConfig

Check warning on line 1 in agentops/telemetry/__init__.py

View check run for this annotation

Codecov / codecov/patch

agentops/telemetry/__init__.py#L1

Added line #L1 was not covered by tests

__all__ = [OTELConfig]

Check warning on line 3 in agentops/telemetry/__init__.py

View check run for this annotation

Codecov / codecov/patch

agentops/telemetry/__init__.py#L3

Added line #L3 was not covered by tests
20 changes: 20 additions & 0 deletions agentops/telemetry/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from dataclasses import dataclass
from typing import Dict, List, Optional

Check warning on line 2 in agentops/telemetry/config.py

View check run for this annotation

Codecov / codecov/patch

agentops/telemetry/config.py#L1-L2

Added lines #L1 - L2 were not covered by tests

from opentelemetry.sdk.trace.export import SpanExporter
from opentelemetry.sdk.trace.sampling import Sampler

Check warning on line 5 in agentops/telemetry/config.py

View check run for this annotation

Codecov / codecov/patch

agentops/telemetry/config.py#L4-L5

Added lines #L4 - L5 were not covered by tests


@dataclass
class OTELConfig:

Check warning on line 9 in agentops/telemetry/config.py

View check run for this annotation

Codecov / codecov/patch

agentops/telemetry/config.py#L8-L9

Added lines #L8 - L9 were not covered by tests
"""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

Check warning on line 20 in agentops/telemetry/config.py

View check run for this annotation

Codecov / codecov/patch

agentops/telemetry/config.py#L12-L20

Added lines #L12 - L20 were not covered by tests

0 comments on commit dcf20c5

Please sign in to comment.