#exporters

1 messages · Page 1 of 1 (latest)

bleak vessel
#

I am wondering if I can configure multipler exporters in harvest.yml. I tried, but it seems only one exporter is working.

ripe lantern
#

@bleak vessel Are you trying to set up multiple Prometheus exporters for a single poller? If so, could you please share the use case for it? Harvest currently only supports one unique exporter type per poller. For instance, if you configure two Prometheus exporters for a single poller, only the first one will be utilized, and the second will be ignored.

could you provide the output of the following command: bin/harvest doctor --print?

bleak vessel
#

Thanks for your support, your explaination is helpful. I had configured telegraf plugin to forward Harvest data to two InfluxDB instances.

#

I utilized telegraf plugin [[inputs.influxdb_v2_listener]] to do that

ripe lantern
ornate frost
#

Hi @ripe lantern we would be interested to have multiple Prometheus exporters. Use case is that we have a Prometheus setup for us as a infrastructure team but also need to send the data to a „public“ instance but only with a limited amount of metrics

ripe lantern
#

@ornate frost Prometheus supports pull model for gathering metrics. This means that Prometheus is responsible for "pulling" metrics from the targets it is configured to monitor, rather than the targets sending or "pushing" their metrics to Prometheus.

In your use case, you want to expose metrics to two different Prometheus servers. You don't need multiple Prometheus exporters for this. A single exporter can expose metrics to multiple Prometheus servers.

Here's how you can achieve this:

  1. Set up the Harvest poller with single prometheus exporter which exposes metrics to an endpoint.

  2. Configure the first Prometheus server: This is the server for your infrastructure team. You can configure it to scrape all metrics from this endpoint.

scrape_configs:
  - job_name: 'infra_harvest'
    static_configs:
      - targets: [''<your_exporter_endpoint>'']
  1. Configure the second Prometheus server: This is the "public" server that should only scrape a subset of metrics. You can use the metric_relabel_configs property in the Prometheus configuration to filter out the metrics you do/don't want to scrape. Here's an example:
scrape_configs:
  - job_name: 'public_harvest'
    static_configs:
      - targets: [''<your_exporter_endpoint>'']
    metric_relabel_configs:
      - source_labels: [__name__]
        regex: '(shelf_temperature_status|disk_new_status|disk_stats_sectors_read)'
        action: keep

In this example, shelf_temperature_status, disk_new_status, and disk_stats_sectors_read are the names of the metrics you want to scrape. The regex field is a regular expression that matches the names of the metrics you want to keep. The action: keep configuration tells Prometheus to only keep the metrics that match the regular expression.

This setup allows you to scrape all metrics with one Prometheus server and a subset of metrics with another server, all from a single exporter.