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

Function _record_entity_input

agentops/sdk/decorators/utility.py:138–149  ·  view source on GitHub ↗

Record operation input parameters to span if content tracing is enabled

(span: trace.Span, args: tuple, kwargs: Dict[str, Any], entity_kind: str = "entity")

Source from the content-addressed store, hash-verified

136
137
138def _record_entity_input(span: trace.Span, args: tuple, kwargs: Dict[str, Any], entity_kind: str = "entity") -> None:
139 """Record operation input parameters to span if content tracing is enabled"""
140 try:
141 input_data = {"args": args, "kwargs": kwargs}
142 json_data = safe_serialize(input_data)
143
144 if _check_content_size(json_data):
145 span.set_attribute(SpanAttributes.AGENTOPS_DECORATOR_INPUT.format(entity_kind=entity_kind), json_data)
146 else:
147 logger.debug("Operation input exceeds size limit, not recording")
148 except Exception as err:
149 logger.warning(f"Failed to serialize operation input: {err}")
150
151
152def _record_entity_output(span: trace.Span, result: Any, entity_kind: str = "entity") -> None:

Callers 5

__init__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…