pyanodot.collectors.prometheus - Prometheus Collector¶
Overview¶
The prometheus collector uses the prometheus query API.
Configuration¶
Account-level properties¶
connection.endpoint(string, required)- an endpoint for the Prometheus server
Query-level properties¶
The queries in the prometheus collector specify the query to be sent, as well as the dimensions and metrics to be converted back from the result.
query- query to submit to Prometheus.dimension_defs- a list of dimension objects of the form { ‘dimension’: ‘$dimension_name’ } specifying which properties from the returned metrics should be converted to properties in Anodotmetric_defs- the metric names to convert to names of measures in Anodot.
Sample Configuration¶
anodot_api_endpoint: production
anodot_api_token: XXXXXXXXXXXXXXXXXXXXX
collectors:
pyanodot.collectors.prometheus:
accounts:
company: # an arbitrary name for the account
connection:
endpoint: http://localhost:9090/ # the endpoint for the Prometheus server
queries:
go_goroutines: # an arbitrary name for the query
dimension_defs:
- dimension: instance # take the property `instance` from the result as a dimension
- dimension: job # similar for `job`
metric_defs:
- metric: go_goroutines # use this name as the metric name
target_type: counter
query: go_goroutines # query to send into Prometheus
step: 1m # time step for the query from Prometheus
ver: '52'
up: # another query
dimension_defs:
- dimension: instance
- dimension: job
metric_defs:
- metric: up
target_type: counter
query: up
step: 1m
ver: '52'