Giter Site home page Giter Site logo

docker-exporter's Introduction

docker-exporter

for this configurations you can collect all docker container metrics from docker host with cadvisor.

cadvisor insallation

you can run cadvisor on docker-compose file on docker host with host network. so prometheus directly collect metrics from host network and port.

version: "3.4"
services:
  cadvisor:
    container_name: cadvisor
    image: gcr.io/cadvisor/cadvisor:latest
    network_mode: "host"
    ports:
      - "8888:8080"
    volumes:
      - "/:/rootfs"
      - "/var/run:/var/run"
      - "/sys:/sys"
      - "/var/lib/docker/:/var/lib/docker"
      - "/dev/disk/:/dev/disk"
    privileged: true

prometheus

then you can install prometheus binary and run prometheus as a service with /etc/prometheus/prometheus.yml

mkdir -p /etc/prometheus
touch /etc/prometheus/prometheus.yml

add below configuration on yml file.

global:
  scrape_interval:     15s
  evaluation_interval: 15s

scrape_configs:
  - job_name: 'cadvisor'
    static_configs:
      - targets: ['dockerhostip:8080']

you can add systemd file as prometheus service.

touch /etc/systemd/system/prometheus.service

add below configuration on service file.

[Unit]
Description=Prometheus
After=network.target

[Service]
ExecStart=/usr/local/bin/prometheus --config.file=/etc/prometheus/prometheus.yml
Restart=always

[Install]
WantedBy=default.target

then reload deamon and start service.

systemctl daemon-reload
systemctl start prometheus

grafana

firstle need add data source for docker host

image

then you can import this dashboard to grafana. id=14282

and you can collect all docker containers metric.

docker-exporter's People

Contributors

alperen-selcuk avatar

Watchers

 avatar

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.