Skip to content

Commit

Permalink
Stackdriver poll-based metrics (#593)
Browse files Browse the repository at this point in the history
Move stackdriver stats exporter to metrics model, consume stats as metric
producer and stop exporting on record.
  • Loading branch information
c24t authored Apr 2, 2019
1 parent 0aa5525 commit 1da32f6
Show file tree
Hide file tree
Showing 16 changed files with 938 additions and 655 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Installation & basic usage
from opencensus.stats import stats as stats_module
stats = stats_module.Stats()
stats = stats_module.stats
view_manager = stats.view_manager
stats_recorder = stats.stats_recorder
Expand Down
2 changes: 1 addition & 1 deletion contrib/opencensus-ext-prometheus/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Register the Prometheus exporter

.. code:: python
stats = stats_module.Stats()
stats = stats_module.stats
view_manager = stats.view_manager
exporter = prometheus.new_stats_exporter(prometheus.Options(namespace="<namespace>"))
Expand Down
2 changes: 1 addition & 1 deletion contrib/opencensus-ext-prometheus/examples/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@


def main():
stats = stats_module.Stats()
stats = stats_module.stats
view_manager = stats.view_manager
stats_recorder = stats.stats_recorder

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def test_exporter_constructor_no_namespace(self):

def test_emit(self):
options = prometheus.Options(namespace="opencensus", port=9005)
stats = stats_module.Stats()
stats = stats_module.stats
view_manager = stats.view_manager
stats_recorder = stats.stats_recorder
exporter = prometheus.new_stats_exporter(options)
Expand Down
2 changes: 1 addition & 1 deletion contrib/opencensus-ext-stackdriver/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Register the Stackdriver exporter

.. code:: python
stats = stats_module.Stats()
stats = stats_module.stats
view_manager = stats.view_manager
exporter = stackdriver.new_stats_exporter(stackdriver.Options(project_id="<id_value>"))
Expand Down
2 changes: 1 addition & 1 deletion contrib/opencensus-ext-stackdriver/examples/stackdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"task_latency", "The task latency in milliseconds", "ms")

# The stats recorder
stats = stats_module.Stats()
stats = stats_module.stats
view_manager = stats.view_manager
stats_recorder = stats.stats_recorder

Expand Down
Loading

0 comments on commit 1da32f6

Please sign in to comment.