Skip to content

Commit

Permalink
Force the result object from OTEL as STRING
Browse files Browse the repository at this point in the history
This commit changes the `else` condition from `instrument_tracing` so
any object which is not properly mapped gets converted into `String`
before sending the dictionary to the span.

With this we expect to no longer have an OTEL unsupported type being
passed as a span value.

Refers to CLOUDDST-23028
  • Loading branch information
JAVGan committed Jul 2, 2024
1 parent a1cefc2 commit c7c59a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion iib/common/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def wrapper(*args, **kwargs):
span_result = {'response': response, 'http_code': code}
else:
# If the returned result is not of type dict, create one
span_result = {'result': result or 'success'}
span_result = {'result': str(result) or 'success'}
except Exception as exc:
span.set_status(Status(StatusCode.ERROR))
span.record_exception(exc)
Expand Down

0 comments on commit c7c59a6

Please sign in to comment.