-
Notifications
You must be signed in to change notification settings - Fork 155
quickstart/python: use Prometheus exporter for metrics tutorials #388
Conversation
quickstart/python: use Prometheus exporter for metrics tutorials Replace Stackdriver Metrics exporter with Prometheus exporter in metrics quickstart since Prometheus is easy to setup, free, open sourced. Updates census-instrumentation#343 fixes census-instrumentation#353
@odeke-em please have a look ! |
Thank you for this PR @PikBot! As I had mentioned, the screenshot of this PR needs to be taken from the Prometheus UI itself and not from the scrape endpoint of the example code. Also the content of your current screenshot shows all zeroes for the value so perhaps please check your code. Please take a look at the OpenCensus-Go metrics quickstart as the rubric for which screenshots to take http://localhost:1313/quickstart/go/metrics/#viewing-your-metrics |
@odeke-em thank you, will refresh ASAP. |
@odeke-em kindly review, I have updated the screenshots and any erroneous code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you for working and updating this @PikBot!
We'll need a few more updates to use Count Aggregations instead of m_lines_in measure as per the Go stats quickstart https://opencensus.io/quickstart/go/metrics/#create-views
and also remove m_errors* measure and instead use tags -- or you can entirely remove error measurement for now.
@odeke-em thank you for the review! I have made the changes suggested by you. |
Hello @PikBot, the final issues with the Prometheus exporter not sanitizing it's metric names was just recently resolved by @songy23 with PR census-instrumentation/opencensus-python#468. @songy23 is there a new Python release on the horizon? Once that Python release is made, let's update this PR and then ensure that the view names are proper i.e. "foo/bar/rest" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, LGTM and thank you @PikBot! Minor nits and then waiting for the OpenCensus Python update to be published and then it is prime-time.
/cc @c24t for OC-Python release schedule. For now in the example please use '_' instead of '/' for all view names and tag keys. |
@songy23, sure. @PikBot please take heed of @songy23's advice but let's open up a follow-up issue to have the view names and tag keys updated. This initial PR is the bootstrap to complete the stats tutorial and then that follow-up issue will be to update them whenever the new release is made. |
@odeke-em , for some reason when I tried running the same code again (after updating the libraries), it produced an error :( . I have addressed the issue here for now census-instrumentation/opencensus-python#480 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you @PikBot!
However, it is quite odd that the latency screenshot doesn't seem to show the "status"="OK" tag in
@PikBot just one more round of running this code, please copy it from this tutorial and re-run, update the screenshots and then we'll be good to go -- this is because there were some views that were missing keys. Thank you. |
Just an FYI I found a few more bugs when working with the latest Prometheus Python client (we're testing against an outdated version in the unit tests). I'll send another PR to OC-Python. That shouldn't block this PR though. |
@odeke-em updated! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, LGTM and thank you @PikBot!
quickstart/python: use Prometheus exporter for metrics tutorials
Replace Stackdriver Metrics exporter with Prometheus exporter in metrics quickstart
since Prometheus is easy to setup, free, open sourced.
Updates #343
fixes #353
fixes #354