Skip to content

Commit 593f99e

Browse files
fenilfaldudot-agi
andauthored
Refactor Agno token metrics (#1164)
Refactor metrics wrapper in instrumentor.py Co-authored-by: Pratyush Shukla <[email protected]>
1 parent 0851fb9 commit 593f99e

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

agentops/instrumentation/agentic/agno/instrumentor.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -601,17 +601,7 @@ def wrapper(wrapped, instance, args, kwargs):
601601
for key, value in attributes.items():
602602
span.set_attribute(key, value)
603603

604-
# Execute the original function
605-
result = wrapped(*args, **kwargs)
606-
607-
# Set result attributes
608-
result_attributes = get_metrics_attributes(args=(instance,) + args, kwargs=kwargs, return_value=result)
609-
for key, value in result_attributes.items():
610-
if key not in attributes: # Avoid duplicates
611-
span.set_attribute(key, value)
612-
613604
span.set_status(Status(StatusCode.OK))
614-
return result
615605

616606
except Exception as e:
617607
span.set_status(Status(StatusCode.ERROR, str(e)))

0 commit comments

Comments
 (0)