Code Monkey home page Code Monkey logo

exporter_proxy's Introduction

exporter_proxy

A small pure-python Reverse HTTP proxy for Prometheus exporters with TLS support.

Installation

exporter_proxy can be downloaded and run as a standalone script. setup.py is provided for simplifying package builds.

Since it is pure-python, exporter_proxy should run on any OS with Python built with SSL support. It has been tested on Linux and Windows.

Use

exporter_proxy --help
usage: exporter_proxy [-h] [-c CONFIG]

Command-line options

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG, --config CONFIG
                        Path to config file. (Defaults to: /etc/prometheus/exporter_proxy.ini)

Configuration

The configuration is held in an ini-file. The section title must be [exporter_proxy]. See config.ini as an example.

The following configuration options are available:

  • proxy_address - The address to bind the proxy listener to.
  • proxy_port - The port to bind the proxy listener to.
  • server_url - The URL (optionally including port) of the server to proxy.
  • ssl_cert - Path to file containing the public certificate or chain for the proxy server (optional - if set enables SSL).
  • ssl_key - Path to file containing the certificate key for the proxy server. (optional, if key is in the certfile).
  • ssl_verify - Should client certificate verification be performed. (optional).
  • ssl_clients - A space-separated list of allowed clients. Matches entries in the client certificate subjectAltName field (optional - requires ssl_verify to be set).

Prometheus

The documentation on configuring Prometheus to scrape using TLS is here: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#tls_config

TLS is configured separately for each scrape job:

scrape_configs:
  - job_name: node
    scheme: https
    tls_config:
        cert_file: /etc/prometheus/exporter_proxy.crt
        key_file: /etc/prometheus/exporter_proxy.key
    file_sd_configs:
    - files:
      - /etc/prometheus/targets.d/node_targets.json

Multiple Exporters

[email protected] is an example systemd 'instance' service that will start an instance of exporter_proxy by loading a config file based on the instance name.

For example systemctl start exporter_proxy@node would run using the config in /etc/prometheus/exporter_proxy/node.ini

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.