Giter Club home page Giter Club logo

exporter-merger's Introduction

exporter-merger

โš ๏ธ We archived this project because we don't use it anymore and in the meantime some other solutions for the problem described in prometheus/prometheus#3756 became available.

license GitHub release

Merges Prometheus metrics from multiple sources.

Development Status exporter-merger is in an early development phase. Expect incompatible changes and abandoment at any time.

But Why?!

prometheus/prometheus#3756

Usage

exporter-merger needs a configuration file. Currently, nothing but URLs are accepted:

exporters:
- url: http://localhost:9100/metrics
- url: http://localhost:9101/metrics

To start the exporter:

exporter-merger --config-path merger.yaml --listen-port 8080

Environment variables

Alternatively configuration can be passed via environment variables, here is relevant part of exporter-merger -h output:

      --listen-port int      Listen port for the HTTP server. (ENV:MERGER_PORT) (default 8080)
      --url stringSlice      URL to scrape. Can be speficied multiple times. (ENV:MERGER_URLS,space-seperated)

Kubernetes

The exporter-merger is supposed to run as a sidecar. Here is an example config with nginx-exporter:

apiVersion: apps/v1
kind: Deployment

metadata:
  name: my-nginx
  labels:
    app: my-nginx

spec:
  selector:
    matchLabels:
      app: my-nginx

  template:
    metadata:
      name: my-nginx
      labels:
        app: my-nginx
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "8080"

    spec:
      containers:
      - name: "nginx"
        image: "my-nginx" # nginx image with modified config file

        volumeMounts:
        - name: mtail
          mountPath: /var/log/nginx/mtail

      - name: nginx-exporter
        image: quay.io/rebuy/nginx-exporter:v1.1.0
        ports:
        - containerPort: 9397
        env:
        - name: NGINX_ACCESS_LOGS
          value: /var/log/nginx/mtail/access.log
        - name: NGINX_STATUS_URI
          value: http://localhost:8888/nginx_status
        volumeMounts:
        - name: mtail
          mountPath: /var/log/nginx/mtail

      - name: exporter-merger
        image: quay.io/rebuy/exporter-merger:v0.2.0
        ports:
        - containerPort: 8080
        env:
        # space-separated list of URLs
        - name: MERGER_URLS
          value: http://localhost:9000/prometheus/metrics http://localhost:9397/metrics
        # default exposed port, change only if need other than default 8080
        # - name: MERGER_PORT
        #   value: 8080

Planned Features

  • Allow transforming of metrics from backend exporters.
    • eg add a prefix to the metric names
    • eg add labels to the metrics
  • Allow dynamic adding of exporters.

exporter-merger's People

Contributors

bjoernhaeuser avatar der-eismann avatar lcasassa avatar paskal avatar phsm avatar spea avatar svenwltr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

exporter-merger's Issues

exporter-merger absence of k8s example

Hello, team!

Thank you for your work. https://github.com/rebuy-de/exporter-merger repo doesn't have issues, so I'd have to create one here: could you please include k8s usage example into exporter-merger and teach it to use ENV variables and not only CLI arguments?
Also it would be really cool of you to publish docker image at quay.io, now it seems to be private.

Thanks!

Errors when at least one service is unreachable

The /metrics endpoint returns a 500 error if at least one of the URLs can't be reached (eg if the service has crashed). It would be helpful if the rest of the metrics were returned anyway when this happens.

It could even expose an ok: 1|0 metric labelled with each URL, so we can track when services go down.

duplicate metrics in separate containers

We publish identical metrics across two containers. The merge puts them both together into a single payload. Can we instead do a left or right join of these metrics to ensure one container becomes the authoritative source for a specific metric?

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.