question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 4 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
reyangcommented, Aug 21, 2019

@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:

pip install "git+https://github.com/census-instrumentation/opencensus-python.git@master#subdirectory=context/opencensus-context"
pip install "git+https://github.com/census-instrumentation/opencensus-python.git@master"
# add your packages (e.g. opencensus-ext-azure) based on what's needed
...

@lzchen need your help to do a hotfix release. Thanks.

2reactions
victoraugustollscommented, Aug 16, 2019

@RocketPuppy yes, but the main issue is that status code is being sent as a string, but it should be ant int. This is fixed in #755 !

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found