Record operation input parameters to span if content tracing is enabled
(span: trace.Span, args: tuple, kwargs: Dict[str, Any], entity_kind: str = "entity")
| 136 | |
| 137 | |
| 138 | def _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 | |
| 152 | def _record_entity_output(span: trace.Span, result: Any, entity_kind: str = "entity") -> None: |
no test coverage detected
searching dependent graphs…