File tree 1 file changed +71
-0
lines changed
1 file changed +71
-0
lines changed Original file line number Diff line number Diff line change
1
+ # JSON Exporter
2
+
3
+ This is a simple Prometheus exporter using:
4
+
5
+ * [ Prometheus exporter] ( https://github.com/desultory/prometheus_exporter )
6
+ * [ aiohttp] ( https://github.com/aio-libs/aiohttp )
7
+ * [ zenlib] ( https://github.com/desultory/zenlib )
8
+
9
+
10
+ ## Features
11
+
12
+ * Automatic query caching
13
+ * Full async
14
+ * Robust logging
15
+ * POST/GET
16
+ * Automatic label creation from JSON values
17
+
18
+ ## Installation
19
+
20
+ This project is on pypi and can be installed with:
21
+
22
+ ` pip install --user json_exporter `
23
+
24
+ ## Usage
25
+
26
+ Configuration is required and is specified in the following format:
27
+
28
+
29
+ ```
30
+ #listen_ip = '127.0.0.1'
31
+ #listen_port = 9809
32
+
33
+ cache_life = 900
34
+
35
+ # GET request example
36
+ [json.website]
37
+ endpoint = "https://api.example.com"
38
+
39
+ [json.website.headers]
40
+ auth_key = 'g5s9ZyklWpY/wRf6gai2DtC0GKUO9qsNYON+rkQzzbeD7Nmvn9UCg5hQMdtPN49x'
41
+
42
+ [json.website.metrics.test]
43
+ path = "result.path.test"
44
+ type = "counter"
45
+ help = "Test counter"
46
+
47
+ [json.website.metrics.example]
48
+ path = "result.another.path.example"
49
+ type = "gauge"
50
+ help = "Example gauge"
51
+
52
+ [json.website.json_labels]
53
+ api_user = "response.user"
54
+
55
+ # POST example
56
+
57
+ [json.website2]
58
+ endpoint = "https://api.example2.com"
59
+
60
+ [json.website2.post_data]
61
+ method = 'get_data'
62
+ api_key = 'aVDZvzwuT86KhFF33VkS95Ui/D1E37PDoShc6Wy9w1uTVMP776CP6AZHp5eyzcij'
63
+
64
+ [json.website2.metrics.example]
65
+ path = "results.path.example"
66
+ type = "gauge"
67
+ help = "Example gauge"
68
+
69
+ ```
70
+
71
+ > GET requests are used unless a ` post_data ` config section is specified.
You can’t perform that action at this time.
0 commit comments