Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1.13 KB

README.md

File metadata and controls

39 lines (30 loc) · 1.13 KB

Prometheus AMQP proxy

Proxy for feeding prometheus scraper from AMQP RPC sources.

Building and running

Build and run using bazel

bazel run //proxy:proxy -- -amqp_url=amqp://my_rabbitmq_url/ -amqp_exchange=my_prometheus_exchange

Visiting http://localhost:8200/proxy?target=prometheus will send an AMQP RPC request to the "prometheus" queue in my_prometheus_exchange exchange, and return the returned data.

Prometheus Configuration

The AMQP proxy needs to be passed the AMQP queue as a parameter, this can be done with relabelling.

Example config:

scrape_configs:
  - job_name: 'amqp_proxy'
    metrics_path: '/proxy'
    target_groups:
      - targets: ['queue1', 'queue2']
    relabel_configs:
      - source_labels: [__address__]
        regex: (.*)
        target_label: __param_target
        replacement: ${1}
      - source_labels: [__param_target]
        regex: (.*)
        target_label: instance
        replacement: ${1}
      - source_labels: []
        regex: .*
        target_label: __address__
        replacement: localhost:8200  # AMQP proxy