Architecture
Execution flows down the hierarchy, and result rows flow back up to become samples on /metrics.
Exporter → (Jobs) → Targets:
Exporter is the top-level struct. It contains global settings, and either a list of Jobs or a single Target. Each entry in a Job target list resolves into a dedicated Target.
Target and jobs modes are mutually exclusive and cannot work together.
Targets → Collectors:
Each Target has its own connection string, and an attached list of Collector references.
Collector → Metrics:
Collector might hold multiple Metrics. The cache parameter applies at the collector level.
Metrics → Queries:
Metric defines a Query to be executed on the target database, and the mapping rules to convert the query result into Prometheus metrics.
Queries
Query is the minimal unit of execution. It is executed once per scrape, and the result is mapped to one or more metrics.
The query can be defined as a part of the Metric using the
queryfield, or may be referenced by name at thequery_reffield.For better clarity, please inspect the configuration page and available examples.
