1
- OpenTelemetry Python SDK Prometheus Remote Write Exporter
1
+ OpenTelemetry Prometheus Remote Write Exporter
2
2
=========================================================
3
3
4
4
This package contains an exporter to send `OTLP `_ metrics from the
5
- Python SDK directly to a Prometheus Remote Write integrated backend
5
+ ` OpenTelemetry Python SDK`_ directly to a ` Prometheus Remote Write integrated backend `_
6
6
(such as Cortex or Thanos) without having to run an instance of the
7
- Prometheus server. The image below shows the two Prometheus exporters in
8
- the OpenTelemetry Python SDK.
7
+ Prometheus server. The latest `types.proto `_ and `remote.proto `_
8
+ protocol buffers are used to create the WriteRequest. The image below shows the
9
+ two Prometheus exporters in the OpenTelemetry Python SDK.
9
10
10
- Pipeline 1 illustrates the setup required for a Prometheus "pull"
11
- exporter.
11
+ Pipeline 1 illustrates the setup required for a `Prometheus "pull" exporter `_.
12
12
13
13
Pipeline 2 illustrates the setup required for the Prometheus Remote
14
14
Write exporter.
@@ -24,7 +24,7 @@ collection datapath is shown below:
24
24
25
25
|controller_datapath_final |
26
26
27
- See the ``example `` folder for a demo usage of this exporter
27
+ See the ``examples `` folder for a demo usage of this exporter
28
28
29
29
Table of Contents
30
30
=================
@@ -55,6 +55,7 @@ Prerequisite
55
55
**DEB **: `sudo apt-get install libsnappy-dev `
56
56
**RPM **: `sudo yum install libsnappy-devel `
57
57
**OSX/Brew **: `brew install snappy `
58
+ **Windows **: `pip install python_snappy-0.5-cp36-cp36m-win_amd64.whl `
58
59
2. Install python-snappy
59
60
`pip install python-snappy `
60
61
@@ -63,9 +64,7 @@ Exporter
63
64
64
65
- To install from the latest PyPi release, run
65
66
``pip install opentelemetry-exporter-prometheus-remote-write ``
66
- - To install from the local repository, run
67
- ``pip install -e exporter/opentelemetry-exporter-prometheus-remote-write/ ``
68
- in the project root
67
+
69
68
70
69
Quickstart
71
70
----------
@@ -186,8 +185,8 @@ for failed requests where any error status code is logged as a warning
186
185
instead.
187
186
188
187
This is because the exporter does not implement any retry logic as it
189
- sends cumulative metrics data. This means that data will be preserved
190
- even if some exports fail .
188
+ sends cumulative metrics data. This means that in the long-term data will be preserved
189
+ even if failed exports are dropped in the interim .
191
190
192
191
For example, consider a situation where a user increments a Counter
193
192
instrument 5 times and an export happens between each increment. If the
@@ -198,21 +197,17 @@ exports happen like so:
198
197
SUCCESS FAIL FAIL SUCCESS SUCCESS
199
198
1 2 3 4 5
200
199
201
- Then the recieved data will be:
200
+ Then the received data will be:
202
201
203
202
::
204
203
205
204
1 4 5
206
205
207
- The end result is the same since the aggregations are cumulative
206
+ The end result (metric value 5) is the same since the aggregations are cumulative
207
+
208
208
Contributing
209
209
------------
210
210
211
- This exporter's datapath is as follows:
212
-
213
- |Exporter datapath | *Entites with ``*`` after their name are not actual
214
- classes but rather logical groupings of functions within the exporter. *
215
-
216
211
If you would like to learn more about the exporter's structure and
217
212
design decisions please view the design document below
218
213
@@ -224,10 +219,14 @@ Design Doc
224
219
This document is stored elsewhere as it contains large images which will
225
220
significantly increase the size of this repo.
226
221
227
- .. _Design Document : https://github.com/open-o11y/docs/tree/master/python-prometheus-remote-write
228
- .. |Exporter datapath | image :: https://user-images.githubusercontent.com/20804975/100285717-604c7280-2f3f-11eb-9b73-bdf70afce9dd.png
222
+ .. _Design Document : https://github.com/open-o11y/docs/blob/master/python-prometheus-remote-write/design-doc.md
229
223
.. _OTLP : https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/protocol/otlp.md
230
- .. _push controller : https://github.com/open-telemetry/opentelemetry-python/blob/master/opentelemetry-sdk/src/opentelemetry/sdk/metrics/export/controller.py
224
+ .. _OpenTelemetry Python SDK : https://github.com/open-telemetry/opentelemetry-python
225
+ .. _Prometheus "pull" exporter : https://github.com/open-telemetry/opentelemetry-python/tree/master/exporter/opentelemetry-exporter-prometheus
226
+ .. _Prometheus Remote Write integrated backend : https://prometheus.io/docs/operating/integrations/
227
+ .. _types.proto : https://github.com/prometheus/prometheus/blob/master/prompb/types.proto
228
+ .. _remote.proto : https://github.com/prometheus/prometheus/blob/master/prompb/remote.proto
229
+ .. _push controller : https://github.com/open-telemetry/opentelemetry-python/blob/master/opentelemetry-sdk/src/opentelemetry/sdk/metrics/export/controller.py#L22
231
230
.. _`timeseries` : https://prometheus.io/docs/concepts/data_model/
232
231
.. _Summary : #opentelemetry-python-sdk-prometheus-remote-write-exporter
233
232
.. _Table of Contents : #table-of-contents
0 commit comments