Record operation output value to span if content tracing is enabled
(span: trace.Span, result: Any, entity_kind: str = "entity")
| 150 | |
| 151 | |
| 152 | def _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 |
no test coverage detected
searching dependent graphs…