You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
1.7 KiB
27 lines
1.7 KiB
# Example metric definition
|
|
metrics:
|
|
- name: 'mqtt_example' # Required(unique, if multiple, only last entry is kept)
|
|
help: 'MQTT example gauge' # Required
|
|
type: 'gauge' # Required ('gauge', 'counter', 'summary' or 'histogram')
|
|
#parameters: # Optional parameters for certain metrics
|
|
# buckets: # Optional (Passed as 'buckets' argument to Histogram)
|
|
# - .1
|
|
# - 1.0
|
|
# - 10.0
|
|
# states: # Optional (Passes as 'states' arguments to Enum)
|
|
# - on
|
|
# - off
|
|
topic: 'example/topic/+' # Required
|
|
|
|
# Inspired by 'https://prometheus.io/docs/operating/configuration/#<relabel_config>'
|
|
# "__msg_topic__" and "__value__" are populated with msg topic and value. And "__topic__" is 'topic' from config.
|
|
# Supported actions are: 'replace', 'keep' and 'drop'
|
|
# All labels starting with "__" will be removed, and "__topic__" and "__value__" is copied into "topic" anv "value"
|
|
# after all label configs have been applied.
|
|
label_configs: # Optional
|
|
- source_labels: ['__msg_topic__'] # Required (when label_configs is present)
|
|
separator: '/' # Optional default ';'
|
|
regex: '(.*)' # Optional default '(.*)'
|
|
target_label: '__topic__' # Required (when label_configs is present and 'action' = 'replace')
|
|
replacement: '\1' # Optional default '\1'
|
|
action: 'replace' # Optional default 'replace' |