GithubHelp home page GithubHelp logo

nmix / gate-up Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 32 KB

Metrics translator from scaled services to pushgateway

Dockerfile 5.54% Python 93.74% Shell 0.72%
prometheus pushgateway metrics swarm

gate-up's Introduction

Gate UP

Metrics translator from services to pushgateway.

About

Let's say we have some scaled worker services in docker-compose (or in swarm) and each of them have own metrics. We need to take metrics from each service and transfer them to prometheus via pushgateway.

Quickstart

  1. add gateup service to compose file and mount docker.sock file

  2. add pushgateway service or use PUSHGATEWAY_URL environment variable

  3. set "com.github.nmix.gate-up.scrape" label and SCRAPE_PORT variable to target service

services:
  worker:
    scale: 2
    expose:
      - 9100
    labels:
      - "com.github.nmix.gate-up.scrape"
    environment:
      SCRAPE_PORT: 9100

  gateup:
    image: zoidenberg/gate-up:latest
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro

  pushgateway:
    image: prom/pushgateway
    container_name: pushgateway
    ports:
      - 9091:9091

gateup environment variables:

PUSHGATEWAY_URL - pushgateway url for post matrics, default http://pushgateway:9091

PUSHGATEWAY_BASIC_AUTH_USERNAME - basic auth username on pushgateway, default ""

PUSHGATEWAY_BASIC_AUTH_PASSWORD - basic auth password on pushgateway, default ""

SCRAPE_INTERVAL - scrape period in seconds, default 5s

target service environment variables:

SCRAPE_PORT - port for scrape metrics, default: 80

SCRAPE_PATH - path for scrape metrics, default: /metrics

Run from source

curl -sSL https://install.python-poetry.org | python3 -
git clone https://github.com/nmix/gate-up.git

cd gate-up
docker-compose up -d

Open pushgateway page on localhost:9091 with login admin and password admin.

Prometheus with Basic Auth

Use PUSHGATEWAY_* vars in app compose section for push metrics to pushgateway with enabled basic auth.

environment:
  PUSHGATEWAY_URL: http://pc-ip-address:19091
  PUSHGATEWAY_BASIC_AUTH_USERNAME: admin
  PUSHGATEWAY_BASIC_AUTH_PASSWORD: admin

Docker Swarm

Just add environment variable SWARM_MODE=1 into gateup service

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.