Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Commit 1da32f6

Browse files
authored
Stackdriver poll-based metrics (#593)
Move stackdriver stats exporter to metrics model, consume stats as metric producer and stop exporting on record.
1 parent 0aa5525 commit 1da32f6

File tree

16 files changed

+938
-655
lines changed

16 files changed

+938
-655
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Installation & basic usage
5454
5555
from opencensus.stats import stats as stats_module
5656
57-
stats = stats_module.Stats()
57+
stats = stats_module.stats
5858
view_manager = stats.view_manager
5959
stats_recorder = stats.stats_recorder
6060

contrib/opencensus-ext-prometheus/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Register the Prometheus exporter
4545

4646
.. code:: python
4747
48-
stats = stats_module.Stats()
48+
stats = stats_module.stats
4949
view_manager = stats.view_manager
5050
5151
exporter = prometheus.new_stats_exporter(prometheus.Options(namespace="<namespace>"))

contrib/opencensus-ext-prometheus/examples/prometheus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141

4242
def main():
43-
stats = stats_module.Stats()
43+
stats = stats_module.stats
4444
view_manager = stats.view_manager
4545
stats_recorder = stats.stats_recorder
4646

contrib/opencensus-ext-prometheus/tests/test_prometheus_stats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def test_exporter_constructor_no_namespace(self):
280280

281281
def test_emit(self):
282282
options = prometheus.Options(namespace="opencensus", port=9005)
283-
stats = stats_module.Stats()
283+
stats = stats_module.stats
284284
view_manager = stats.view_manager
285285
stats_recorder = stats.stats_recorder
286286
exporter = prometheus.new_stats_exporter(options)

contrib/opencensus-ext-stackdriver/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Register the Stackdriver exporter
8989

9090
.. code:: python
9191
92-
stats = stats_module.Stats()
92+
stats = stats_module.stats
9393
view_manager = stats.view_manager
9494
9595
exporter = stackdriver.new_stats_exporter(stackdriver.Options(project_id="<id_value>"))

contrib/opencensus-ext-stackdriver/examples/stackdriver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"task_latency", "The task latency in milliseconds", "ms")
3131

3232
# The stats recorder
33-
stats = stats_module.Stats()
33+
stats = stats_module.stats
3434
view_manager = stats.view_manager
3535
stats_recorder = stats.stats_recorder
3636

0 commit comments

Comments
 (0)