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 49fa2e1bc..ed0e1f8ec 100644 --- a/contrib/opencensus-ext-azure/opencensus/ext/azure/common/transport.py +++ b/contrib/opencensus-ext-azure/opencensus/ext/azure/common/transport.py @@ -111,13 +111,16 @@ def _transmit(self, envelopes): token = self.options.credential.get_token(_MONITOR_OAUTH_SCOPE) headers["Authorization"] = "Bearer {}".format(token.token) endpoint += '/v2.1/track' + proxies = json.loads(self.options.proxies) + allow_redirects = len(proxies) != 0 + response = requests.post( url=endpoint, data=json.dumps(envelopes, default=str), headers=headers, timeout=self.options.timeout, - proxies=json.loads(self.options.proxies), - allow_redirects=False, + proxies=proxies, + allow_redirects=allow_redirects, ) except requests.Timeout as ex: if not self._is_stats_exporter():