Prometheus collector metricsetedit

The Prometheus collector metricset scrapes data from prometheus exporters.

Scraping from a Prometheus exporteredit

To scrape metrics from a Prometheus exporter, configure the hosts field to it. The path to retrieve the metrics from (/metrics by default) can be configured with metrics_path.

- module: prometheus
  period: 10s
  hosts: ["node:9100"]
  metrics_path: /metrics

  #username: "user"
  #password: "secret"

  # This can be used for service account based authorization:
  #bearer_token_file: /var/run/secrets/
  #  - /var/run/secrets/

Scraping all metrics from a Prometheus serveredit

This module can scrape all metrics stored in a Prometheus server, by using the federation API. By pointing this config to the Prometheus server:

- module: prometheus
  period: 10s
  hosts: ["localhost:9090"]
  metrics_path: '/federate'
    'match[]': '{__name__!=""}'


For a description of each field in the metricset, see the exported fields section.

Here is an example document generated by this metricset:

    "@timestamp": "2019-03-01T08:05:34.853Z",
    "event": {
        "dataset": "prometheus.collector",
        "duration": 115000,
        "module": "prometheus"
    "metricset": {
        "name": "collector"
    "prometheus": {
        "labels": {
            "listener_name": "http"
        "metrics": {
            "net_conntrack_listener_conn_accepted_total": 3,
            "net_conntrack_listener_conn_closed_total": 0
    "service": {
        "address": "",
        "type": "prometheus"