• Stars
    star
    715
  • Rank 62,893 (Top 2 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 7 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Proxy to allow Prometheus to scrape through NAT etc.

PushProx CircleCI

PushProx is a client and proxy that allows transversing of NAT and other similar network topologies by Prometheus, while still following the pull model.

While this is reasonably robust in practice, this is a work in progress.

Running

First build the proxy and client:

git clone https://github.com/prometheus-community/pushprox.git
cd pushprox
make build

Run the proxy somewhere both Prometheus and the clients can get to:

./pushprox-proxy

On every target machine run the client, pointing it at the proxy:

./pushprox-client --proxy-url=http://proxy:8080/

In Prometheus, use the proxy as a proxy_url:

scrape_configs:
- job_name: node
  proxy_url: http://proxy:8080/
  static_configs:
    - targets: ['client:9100']  # Presuming the FQDN of the client is "client".

If the target must be scraped over SSL/TLS, add:

  params:
    _scheme: [https]

rather than the usual scheme: https. Only the default scheme: http works with the proxy, so this workaround is required.

Service Discovery

The /clients endpoint will return a list of all registered clients in the format used by file_sd_configs. You could use wget in a cronjob to put it somewhere file_sd_configs can read and then then relabel as needed.

How It Works

Sequence diagram

Clients perform scrapes in a network environment that's not directly accessible by Prometheus. The Proxy is accessible by both the Clients and Prometheus. Each client is identified by its fqdn.

For example, the following sequence is performed when Prometheus scrapes target fqdn-x via PushProx. First, a Client polls the Proxy for scrape requests, and includes its fqdn in the poll (1). The Proxy does not respond yet. Next, Prometheus tries to scrape the target with hostname fqdn-x via the Proxy (2). Using the fqdn received in (1), the Proxy now routes the scrape to the correct Client: the scrape request is in the response body of the poll (3). This scrape request is executed by the client (4), the response containing metrics (5) is posted to the Proxy (6). On its turn, the Proxy returns this to Prometheus (7) as a reponse to the initial scrape of (2).

PushProx passes all HTTP headers transparently, features like compression and accept encoding are up to the scraping Prometheus server.

Security

There is no authentication or authorisation included, a reverse proxy can be put in front though to add these.

Running the client allows those with access to the proxy or the client to access all network services on the machine hosting the client.

More Repositories

1

helm-charts

Prometheus community Helm charts
Mustache
4,981
star
2

windows_exporter

Prometheus exporter for Windows machines
Go
2,858
star
3

postgres_exporter

A PostgreSQL metric exporter for Prometheus
Go
2,720
star
4

elasticsearch_exporter

Elasticsearch stats exporter for Prometheus
Go
1,910
star
5

json_exporter

A prometheus exporter which scrapes remote JSON by JSONPath
Go
631
star
6

node-exporter-textfile-collector-scripts

Scripts for node-exporter's textfile collector
Python
490
star
7

ipmi_exporter

Remote IPMI exporter for Prometheus
Go
459
star
8

avalanche

Prometheus/OpenMetrics endpoint series generator for load testing.
Go
393
star
9

ansible

Ansible Collection for Prometheus
Python
357
star
10

jiralert

JIRA integration for Prometheus Alertmanager
Go
333
star
11

pro-bing

A library for creating continuous probers
Go
317
star
12

bind_exporter

Prometheus exporter for BIND
Go
299
star
13

smartctl_exporter

Export smartctl statistics to prometheus
Go
289
star
14

systemd_exporter

Exporter for systemd unit metrics
Go
283
star
15

prom-label-proxy

A proxy that enforces a given label in a given PromQL query.
Go
262
star
16

stackdriver_exporter

Google Stackdriver Prometheus exporter
Go
254
star
17

promql-langserver

PromQL language server
Go
176
star
18

prometheus-playground

Turnkey sandbox projects demonstrating a wide variety of Prometheus use cases
Go
164
star
19

pgbouncer_exporter

Prometheus exporter for PgBouncer
Go
138
star
20

ecs_exporter

Prometheus exporter for Amazon Elastic Container Service (ECS)
Go
78
star
21

vscode-promql

This is supposed to become a PromQL extension for vs code.
TypeScript
52
star
22

monaco-promql

PromQL support for the Monaco code editor
TypeScript
31
star
23

community

Prometheus & The Ecosystem Community Meeting Information
20
star
24

prometheus-community

13
star
25

snmp

Tools and configurations for translating SNMP into Prometheus
11
star
26

kitefactory

Makefile
3
star
27

sublimelsp-promql

PromQL support for Sublime LSP plugin, using promql-langserver
Python
2
star