Skip to content

Commit

Permalink
tracer provider
Browse files Browse the repository at this point in the history
  • Loading branch information
axiomofjoy committed Jan 16, 2025
1 parent 66aa4b0 commit db8f9a0
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
detach,
set_value,
)
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.id_generator import IdGenerator
from opentelemetry.trace import (
INVALID_SPAN_ID,
Expand Down Expand Up @@ -668,6 +669,25 @@ def start_span(
return span


class OpenInferenceTracerProvider(TracerProvider):
def __init__(
self,
*args: Any,
config: Optional[TraceConfig] = None,
**kwargs: Any,
) -> None:
super().__init__(*args, **kwargs)
self._oi_trace_config = config or TraceConfig()

def get_tracer(
self,
*args: Any,
**kwargs: Any,
) -> OITracer:
tracer = super().get_tracer(*args, **kwargs)
return OITracer(tracer, config=self._oi_trace_config)


def is_base64_url(url: str) -> bool:
if not isinstance(url, str):
return False
Expand Down

0 comments on commit db8f9a0

Please sign in to comment.