Giter Club home page Giter Club logo

seldon-prometheus-exporter's Introduction

Seldon Prometheus Exporter

ARCHIVING THIS PROJECT AS USING SeldonIO/seldon-core#2484 INSTEAD

This exporter should lookup kube-state-metrics for models and downsample relevant metrics to be exported at collected again.

How it Works

The aim is to get SeldonDeployment metrics with a low enough res to query on.

We do this by querying metrics from kube-state-metrics and averaging them. So we query over, say 1hr, and put in a new metric that represents the average over that hour.

This is necessary as prometheus has a max limit on querying. See https://docs.google.com/document/d/1w8rU9gYGQ3fmm6FBI9WuXKic-wZp2Q8OUsJdnHBXwa4/edit?usp=sharing

Metrics Format

model_containers_average{namespace="seldon",type="seldon",name="iris"} 1.21
model_cpu_usage_seconds_total{namespace="seldon",type="seldon",name="iris"} 0.019797927555476498
model_memory_usage_bytes{namespace="seldon",type="seldon",name="iris"} 138986.313
model_containers_average{namespace="seldon",type="seldon",name="income"} 1.15
model_cpu_usage_seconds_total{namespace="seldon",type="seldon",name="income"} 0.028586977665586328
model_memory_usage_bytes{namespace="seldon",type="seldon",name="income"} 235434.334
model_cpu_requests{name="income",namespace="seldon",type="SeldonDeployment"} 1.1
model_cpu_limits{name="income",namespace="seldon",type="SeldonDeployment"} 1
model_memory_requests_bytes{name="income-default",namespace="seldon",type="SeldonDeployment"} 1.073741824e+09
model_memory_limits_bytes{name="income-default",namespace="seldon",type="SeldonDeployment"} 1.073741824e+09

These are based on kube-state-metrics that provide the data as a basis.

Configuration

The query frequency needs to be configured. This needs to be configured both on the internal querying frequency and with the same frequency on scraping of the exporter.

The exporter is both scraped by prometheus and reads from prometheus. It needs configuration for both.

Data refresh frequency is set with TIME_PERIOD. Format is a prom time period.

The prometheus to gather data from is set with PROMETHEUS_URL.

If a token is needed then set in PROMETHEUS_SELDON_TOKEN.

These are also exposed in the helm chart values file.

The chart exposes a metrics port and adds annotations for scraping by seldon core analytics.

How to Run

First port-forward to a prometheus in a cluster running Seldon.

kubectl port-forward -n seldon-system svc/seldon-core-analytics-prometheus-seldon 8080:80

Then go run ./.

Go to http://localhost:8000/metrics to see metrics.

Or use helm chart with make helm-install

Notes

Project initially based on https://rsmitty.github.io/Prometheus-Exporters-Revamp/

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.