-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor stats exporters into ext packages (#556)
1. Extracted Prometheus Stats exporter into opencensus.ext.prometheus. 2. Extracted Stackdriver Stats exporter and reuse opencensus.ext.stackdriver. 3. Renamed opencensus.stats.exporters.base to opencensus.stats.base_exporter. 4. Moved Prometheus/Stackdriver specific document/samples to ext packages.
- Loading branch information
Showing
24 changed files
with
292 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Changelog | ||
|
||
## Unreleased | ||
|
||
- Initial version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
OpenCensus Prometheus Exporter | ||
============================================================================ | ||
|
||
Installation | ||
------------ | ||
|
||
:: | ||
|
||
pip install opencensus-ext-prometheus | ||
|
||
Usage | ||
----- | ||
|
||
The OpenCensus `Prometheus`_ Stats Exporter allows users | ||
to export metrics to Prometheus monitoring solution. | ||
The API of this project is still evolving. | ||
The use of vendoring or a dependency management tool is recommended. | ||
|
||
.. _Prometheus: https://prometheus.io/ | ||
|
||
Prometheus Exporter Usage | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Prometheus Import | ||
******************** | ||
|
||
.. code:: python | ||
from opencensus.ext.prometheus import stats_exporter as prometheus | ||
from opencensus.stats import stats as stats_module | ||
Prometheus Prerequisites | ||
*************************** | ||
|
||
- OpenCensus Python libraries require Python 2.7 or later. | ||
- Prometheus up and running. | ||
|
||
Register the Prometheus exporter | ||
*********************************** | ||
|
||
.. code:: python | ||
stats = stats_module.Stats() | ||
view_manager = stats.view_manager | ||
exporter = prometheus.new_stats_exporter(prometheus.Options(namespace="<namespace>")) | ||
view_manager.register_exporter(exporter) | ||
... | ||
Prometheus Code Reference | ||
*************************** | ||
|
||
In the *examples* folder, you can find all the necessary steps to get the exporter, register a view, put tags on the measure, and see the values against the Prometheus monitoring tool. | ||
|
||
For further details for the Prometheus implementation, see the folder *prometheus/stats_exporter*. | ||
|
||
|
||
+-------------------------------------------------------------------------------+-------------------------------------+ | ||
| Path & File | Short Description | | ||
+===============================================================================+=====================================+ | ||
| contrib/opencensus-ext-prometheus/examples/ | End to end example | | ||
+-------------------------------------------------------------------------------+-------------------------------------+ | ||
| contrib/opencensus-ext-prometheus/opencensus/ext/prometheus/stats_exporter/ | Stats implementation for Prometheus | | ||
+-------------------------------------------------------------------------------+-------------------------------------+ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
1 change: 1 addition & 0 deletions
1
contrib/opencensus-ext-prometheus/opencensus/ext/prometheus/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[bdist_wheel] | ||
universal = 1 |
Oops, something went wrong.