census-instrumentation / opencensus-python

A stats collection and distributed tracing framework
Apache License 2.0
667 stars 248 forks source link

Add str fallback to envelope serialization in ext.azure #1197

Closed ddeschepper closed 10 months ago

ddeschepper commented 1 year ago

Within ext.azure, when serialization of a single envelope that was to be sent to Application Insights fails (e.g. when a non-JSON-serializable value is added to the properties) the entire batch that envelope belongs to does not get sent. Falling back to to str as a means of serialization when JSON serialization fails seems like a sane default that greatly reduces the risk of missed telemetry.

ddeschepper commented 1 year ago

I've create a pull request (#1196) that would add the required fallback