You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A [prometheus](https://prometheus.io/) exporter which scrapes remote JSON by JSONPath.
5
+
A [prometheus](https://prometheus.io/) exporter which scrapes remote JSON by JSONPath or [CEL (Common Expression Language)](https://github.com/google/cel-spec).
help: Example of a timestamped value scrape in the json
39
+
labels:
40
+
environment: "\"beta\""# static label
41
+
values:
42
+
count: '.count'# dynamic value
43
+
22
44
- name: example_value
23
45
type: object
24
46
help: Example of sub-level value scrapes from a json
25
-
path: '{.values[?(@.state == "ACTIVE")]}'
47
+
path: '{.values[?(@.state == "ACTIVE")]}'
26
48
labels:
27
49
environment: beta # static label
28
-
id: '{.id}'# dynamic label
50
+
id: '{.id}'# dynamic label
29
51
values:
30
52
active: 1# static value
31
-
count: '{.count}'# dynamic value
32
-
boolean: '{.some_boolean}'
53
+
count: '{ .count }'# dynamic value
54
+
boolean: '{ .some_boolean }'
55
+
56
+
- name: example_cel_value
57
+
type: object
58
+
engine: cel
59
+
help: Example of sub-level value scrapes from a json
60
+
path: ".values.filter(i, i.state == \"ACTIVE\")"
61
+
labels:
62
+
environment: "\"beta\""# static label
63
+
id: '.id'# dynamic label
64
+
values:
65
+
active: 1# static value
66
+
count: '.count'# dynamic value
67
+
boolean: '.some_boolean'
68
+
33
69
34
70
animals:
35
71
metrics:
@@ -43,6 +79,17 @@ modules:
43
79
values:
44
80
population: '{ .population }'
45
81
82
+
- name: animal_cel
83
+
type: object
84
+
engine: cel
85
+
help: Example of top-level lists in a separate module
86
+
path: '[*]'
87
+
labels:
88
+
name: '.noun'
89
+
predator: '.predator'
90
+
values:
91
+
population: '.population'
92
+
46
93
## HTTP connection configurations can be set in 'modules.<module_name>.http_client_config' field. For full http client config parameters, ref: https://pkg.go.dev/github.com/prometheus/common/config?tab=doc#HTTPClientConfig
47
94
#
48
95
# http_client_config:
@@ -59,11 +106,11 @@ modules:
59
106
## If 'modueles.<module_name>.body' field is set, it will be sent by the exporter as the body content in the scrape request. The HTTP method will also be set as 'POST' in this case.
## The body content can also be a Go Template (https://golang.org/pkg/text/template), with all the functions from the Sprig library (https://masterminds.github.io/sprig/) available. All the query parameters sent by prometheus in the scrape query to the exporter, are available in the template.
0 commit comments