From 3a2d8dfe1db4e0129dc691c35901a0d12127afc1 Mon Sep 17 00:00:00 2001 From: Daan de Schepper Date: Thu, 16 Mar 2023 23:10:07 +0100 Subject: [PATCH] Adds str fallback to envelope serialization (#1196) --- contrib/opencensus-ext-azure/CHANGELOG.md | 2 ++ .../opencensus/ext/azure/common/transport.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/opencensus-ext-azure/CHANGELOG.md b/contrib/opencensus-ext-azure/CHANGELOG.md index 1de245cbb..942671a12 100644 --- a/contrib/opencensus-ext-azure/CHANGELOG.md +++ b/contrib/opencensus-ext-azure/CHANGELOG.md @@ -6,6 +6,8 @@ ([#1187](https://github.com/census-instrumentation/opencensus-python/pull/1187)) - Modify metrics exporter to include setting export interval to 60s ([#1193](https://github.com/census-instrumentation/opencensus-python/pull/1193)) +- Add str fallback to envelope serialization +([#1196](https://github.com/census-instrumentation/opencensus-python/pull/1196)) ## 1.1.8 diff --git a/contrib/opencensus-ext-azure/opencensus/ext/azure/common/transport.py b/contrib/opencensus-ext-azure/opencensus/ext/azure/common/transport.py index 2392f5df7..49fa2e1bc 100644 --- a/contrib/opencensus-ext-azure/opencensus/ext/azure/common/transport.py +++ b/contrib/opencensus-ext-azure/opencensus/ext/azure/common/transport.py @@ -113,7 +113,7 @@ def _transmit(self, envelopes): endpoint += '/v2.1/track' response = requests.post( url=endpoint, - data=json.dumps(envelopes), + data=json.dumps(envelopes, default=str), headers=headers, timeout=self.options.timeout, proxies=json.loads(self.options.proxies),