Giter Site home page Giter Site logo

hairyhenderson / dockerhub_ratelimit_exporter Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 1.0 130 KB

A Prometheus-format exporter to report on DockerHub per-image rate limits

License: MIT License

Go 48.15% Makefile 34.62% Dockerfile 17.23%
dockerhub docker prometheus-exporter prometheus hacktoberfest

dockerhub_ratelimit_exporter's Introduction

Build Docker Build Total Downloads hairyhenderson/dockerhub_ratelimit_exporter on DockerHub

dockerhub_ratelimit_exporter

A Prometheus-format exporter to report on DockerHub per-image rate limits.

Recently, DockerHub has introduced rate limiting for anonymous and free-tier users. This exporter can help Prometheus users track the remaining pulls for certain images.

Status/Roadmap

This is brand-new, hacked-together over the course of a couple hours. It works, but I'm certain there are bugs.

This is currently very thin on features. Some things that are missing:

  • support for authenticating to DockerHub
  • support for caching auth tokens on a per-repo basis
  • exposing a few more general-purpose metrics

Usage

The image name is provided as a query parameter when querying the exporter, and Prometheus-format metrics are returned, like this:

$ curl http://localhost:9766/limits?image=hairyhenderson/gomplate:v3.8.0
# HELP dockerhub_ratelimits_limit total number of pulls that can be performed during the window
# TYPE dockerhub_ratelimits_limit gauge
dockerhub_ratelimits_limit{image="hairyhenderson/gomplate:v3.8.0"} 100
# HELP dockerhub_ratelimits_remaining number of pulls remaining for the window
# TYPE dockerhub_ratelimits_remaining gauge
dockerhub_ratelimits_remaining{image="hairyhenderson/gomplate:v3.8.0"} 100
# HELP dockerhub_ratelimits_window_seconds the length of the time window
# TYPE dockerhub_ratelimits_window_seconds gauge
dockerhub_ratelimits_window_seconds{image="hairyhenderson/gomplate:v3.8.0"} 21600

Prometheus Configuration

When using Prometheus to scrape the exporter, the image parameter can be provided like this:

scrape_configs:
  - job_name: hub-limits
    scrape_interval: 15s
    metrics_path: /limits
    params:
      image:
        - busybox
        - hairyhenderson/gomplate:v3.8.0
        - prom/prometheus:v2.22.1
    static_configs:
      - targets:
        - localhost:9766

License

The MIT License

Copyright (c) 2020 Dave Henderson

dockerhub_ratelimit_exporter's People

Contributors

dependabot[bot] avatar hairyhenderson avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

Forkers

isgasho

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.