opencensus-ext-azure trace_exported request.success value is always False on Python2
See original GitHub issue- Python 2.7.13
- django==1.11.20
- opencensus == 0.7.1
- opencensus-ext-django == 0.7.0
- opencensus-ext-azure == 0.7.0
Looks like on Python2 exported request success status is wrong, because of objects comparison on this line
Steps to reproduce.
data.success = (status_code >= 200 and status_code <= 399)
if status_code
type is string, than:
>>> ("200" >= 200 and "200" <= 399)
>>> False
since in python2 int
is always less than str
Otherwise:
>>> (200 >= 200 and 200 <= 399)
>>> True
This mainly affects all requests success
status displayed in Azure Monitor Log which is set to False
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Request name is empty when export grpc service to Azure ...
I'm trying to integrate our python application with Azure Application Insights. The python application is used for providing grpc service.
Read more >Filter and preprocess telemetry in the Application Insights SDK
To filter out telemetry from being exported, make sure the callback function returns False . You can see the schema for Azure Monitor...
Read more >New Relic (Stats and Tracing) - OpenCensus
The stats exporter allows metrics to be exported from opencensus to New Relic. The example code assumes you've set the following environment variables:....
Read more >OpenTelemetry: beyond getting started | by Sergey Kanzhelev
Use Azure Monitor, Google StackDriver or other telemetry vendor and ... of code to capture metrics and traces — call AddOpenTelemetry and ...
Read more >module has no attribute mypy
https://github.com/Azure/azure-sdk-for-python/issues/20691, ... This returns the value unchanged. pre-release, 0.20.0rc1 However, when ``stride > 1``, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@RocketPuppy #755 got merged today. We will do a hotfix release. Closing the issue now. If you cannot wait for the hotfix release, there is a way to install the package from master branch directly:
@lzchen need your help to do a hotfix release. Thanks.
@RocketPuppy yes, but the main issue is that
status code
is being sent as astring
, but it should be antint
. This is fixed in #755 !