Giter Site home page Giter Site logo

binaryomen / druid-prometheus Goto Github PK

View Code? Open in Web Editor NEW
16.0 3.0 3.0 28 KB

This repo contains Druid Prometheus exporter, docs ways to scale druid on custom metrics

License: Apache License 2.0

Dockerfile 4.14% Go 95.86%
druid prometheus-exporter custom-metrics kubernetes golang druid-io

druid-prometheus's Introduction

druid-prometheus exporter

MOTIVATION
  • Scale druid middlemanagers on the basis of custom metrics such as pending, waiting tasks.

  • These are the metrics which currently this exporter emits count for

    1. Running Tasks
    2. Pending Tasks
    3. Waiting Tasks
    4. Completed Tasks
    5. Count of All DataSources
    6. Druid Health
GETTING STARTED
  • To deploy a druid cluster on kuberentes, refer to this awesome operator https://github.com/druid-io/druid-operator.
  • This exporter can be ran as a simple deployment in kubernetes.
  • The deployment files expects a env for the druid endpoint DRUID_EP, this can be an overlord or a router endpoint.
  • Build your own docker image.
- docker build -t your_repo/image_name:tag .
- docker push image_name

## Deploy exporter
- kubectl create -f deploy/exporter.yaml 
## Deploy prometheus
- kubectl create -f cm.yaml 
- kubectl create -f prometheus.yaml
  • Run tasks on druid and check the metrics. Expose prometheus UI kubectl port-forward prometheus_pod 9090:9090

Custom Scaling Of Middle Managers

  • Deploy prometheus custom metrics adapter. Refer to this https://github.com/stefanprodan/k8s-prom-hpa to get started.
  • Deploy the HPA yaml to scale on the basis of the following metrics
druid_tasks{instance="metrics.druid.svc.cluster.local:8080",job="druid-metrics",tasks="completed"}	
druid_tasks{instance="metrics.druid.svc.cluster.local:8080",job="druid-metrics",tasks="pending"}
druid_tasks{instance="metrics.druid.svc.cluster.local:8080",job="druid-metrics",tasks="running"}
druid_tasks{instance="metrics.druid.svc.cluster.local:8080",job="druid-metrics",tasks="waiting"}

##  Deploy HPA 
- kubectl create -f deploy/hpa.yaml
- kubectl get hpa
NOTE: This is tested for HPA apiVersion autoscaling/v2beta1. Exporter is still under development.
You will need to add a custom post stop container script which does not kill the process of running tasks in MM

druid-prometheus's People

Contributors

adheipsingh avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

druid-prometheus's Issues

Handle Crash Gracefully

On not finding the url just log an error, currently the exporter is crashing and causing unnecessary error when running as a pod

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.