Skip to content

Commit

Permalink
remove instrument
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-gtokernliang committed Dec 19, 2024
1 parent 049b404 commit 27bcac5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/core/trulens/experimental/otel_tracing/core/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import Any, Callable, Optional, Union

from opentelemetry import trace
from trulens.apps.custom import instrument as custom_instrument
from trulens.experimental.otel_tracing.core.init import TRULENS_SERVICE_NAME
from trulens.experimental.otel_tracing.core.semantic import (
TRULENS_SELECTOR_NAME,
Expand Down Expand Up @@ -46,25 +45,22 @@ def wrapper(*args, **kwargs):
)
) as parent_span:
span = trace.get_current_span()
_instrumented_object, *rest_args = args

span.set_attribute("name", func.__name__)
span.set_attribute("kind", "SPAN_KIND_TRULENS")
span.set_attribute(
"parent_span_id", parent_span.get_span_context().span_id
)

ret = custom_instrument(func)(*args, **kwargs)
ret = func(*args, **kwargs)

try:
attributes_to_add = {}

# Set the user provider attributes.
if attributes:
if callable(attributes):
attributes_to_add = attributes(
ret, *rest_args, **kwargs
)
attributes_to_add = attributes(ret, *args, **kwargs)
else:
attributes_to_add = attributes

Expand Down

0 comments on commit 27bcac5

Please sign in to comment.