MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / _record_entity_output

Function _record_entity_output

agentops/sdk/decorators/utility.py:152–162  ·  view source on GitHub ↗

Record operation output value to span if content tracing is enabled

(span: trace.Span, result: Any, entity_kind: str = "entity")

Source from the content-addressed store, hash-verified

150
151
152def _record_entity_output(span: trace.Span, result: Any, entity_kind: str = "entity") -> None:
153 """Record operation output value to span if content tracing is enabled"""
154 try:
155 json_data = safe_serialize(result)
156
157 if _check_content_size(json_data):
158 span.set_attribute(SpanAttributes.AGENTOPS_DECORATOR_OUTPUT.format(entity_kind=entity_kind), json_data)
159 else:
160 logger.debug("Operation output exceeds size limit, not recording")
161 except Exception as err:
162 logger.warning(f"Failed to serialize operation output: {err}")
163
164
165# Helper functions for HTTP request/response data extraction

Callers 5

__aexit__Method · 0.90
_wrapped_http_asyncFunction · 0.90
wrapperFunction · 0.90
_wrapped_session_asyncFunction · 0.90
_wrapped_asyncFunction · 0.90

Calls 4

safe_serializeFunction · 0.90
_check_content_sizeFunction · 0.85
set_attributeMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…