mirror of
https://github.com/prometheus-community/json_exporter
synced 2024-12-24 15:33:59 +00:00
75ae2b065e
* support modules configuration Signed-off-by: Ben Ye <ben.ye@bytedance.com> * fallback default module if the param is missing Signed-off-by: Ben Ye <ben.ye@bytedance.com> * update readme and example config file Signed-off-by: Ben Ye <ben.ye@bytedance.com> * fix lint Signed-off-by: Ben Ye <ben.ye@bytedance.com>
23 lines
665 B
YAML
23 lines
665 B
YAML
---
|
|
modules:
|
|
default:
|
|
metrics:
|
|
- name: example_global_value
|
|
path: "{ .counter }"
|
|
help: Example of a top-level global value scrape in the json
|
|
labels:
|
|
environment: beta # static label
|
|
location: "planet-{.location}" # dynamic label
|
|
|
|
- name: example_value
|
|
type: object
|
|
help: Example of sub-level value scrapes from a json
|
|
path: '{.values[?(@.state == "ACTIVE")]}'
|
|
labels:
|
|
environment: beta # static label
|
|
id: '{.id}' # dynamic label
|
|
values:
|
|
active: 1 # static value
|
|
count: '{.count}' # dynamic value
|
|
boolean: '{.some_boolean}'
|