Skip to content

Proxy for feeding prometheus scraper from AMQP RPC source

License

Notifications You must be signed in to change notification settings

ArmisSecurity/prometheus_amqp_proxy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Proxy for feeding prometheus scraper from AMQP RPC source

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 53.0%
  • Starlark 24.5%
  • Python 19.1%
  • Dockerfile 3.4%