Skip to content

Commit

Permalink
Remove _with_tracer_wrapper in favor of partial
Browse files Browse the repository at this point in the history
  • Loading branch information
aabmass committed Dec 3, 2024
1 parent 2a8a2c5 commit 11a6dc2
Showing 1 changed file with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@

"""OpenTelemetry Vertex AI instrumentation"""

from functools import partial
import logging
import types
from functools import partial
from typing import Collection, Optional

from wrapt import wrap_function_wrapper

from opentelemetry._events import (
EventLogger,
EventLoggerProvider,
Event,
get_event_logger,
)
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
Expand Down Expand Up @@ -311,19 +310,6 @@ def _handle_response(span, event_logger: EventLogger, response, llm_model):
span.set_status(Status(StatusCode.OK))


def _with_tracer_wrapper(func):
"""Helper for providing tracer for wrapper functions."""

def _with_tracer(tracer, to_wrap):
def wrapper(wrapped, instance, args, kwargs):
return func(tracer, to_wrap, wrapped, instance, args, kwargs)

return wrapper

return _with_tracer


# @_with_tracer_wrapper
async def _awrap(
tracer, event_logger: EventLogger, to_wrap, wrapped, instance, args, kwargs
):
Expand Down Expand Up @@ -372,7 +358,6 @@ async def _awrap(
return response


# @_with_tracer_wrapper
def _wrap(
tracer, event_logger: EventLogger, to_wrap, wrapped, instance, args, kwargs
):
Expand Down

0 comments on commit 11a6dc2

Please sign in to comment.