Giter VIP home page Giter VIP logo

graftool's Introduction

๐Ÿ“ˆ Streamlit Graftool

This project is a boilerplate for anyone who'd like to use Streamlit as a supervision tool.

Why ?

Because Streamlit is designed to ease data analytics with seamless integration with plotting and data process libs. Furthermore, Streamlit is easy to use and customize for people who know more about platforms than front-end code. This makes Streamlit a very good candidate for SRE/Devops/Plaform Engineers who want to customize their supervision experience.

What

Online demo

Currently includes:

  • a structured project
  • some functions to ease prometheus and charts render
  • a sample of prometheus dashboard you can reuse,
  • an example of kubernetes api integration you can adapt,
  • an example of OpenAI ChatGPT integration

This a very young project. Also most of the current functions names/signature may change in future. Do not use for production.

Config

Can be configured either with environment variables or in .streamlit/secrets.toml:

env var secrets.toml
PROM_CREDENTIALS_URL prom_credentials.url Set target prometheus url
OPENAI_API_KEY OPENAI_API_KEY Set OpenAI api key

Deploy

Docker

Customize source and build Docker image. Then run with a port-forward to 8051 and env vars. Here is demo with pre-built docker image:

docker run -p 8851:8501 -e PROM_CREDENTIALS_URL=https://prometheus.demo.do.prometheus.io -e OPENAI_API_KEY="sk-XXXX"  jseguillon/graftool:main

Kubernetes

Create secret:

kubectl create secret generic graftool-secrets \
  --from-literal=OPENAI_API_KEY=XXX-KEY \
  --from-literal=PROM_CREDENTIALS_URL=https://prometheus.demo.do.prometheus.io

Apply Deployment and Service

kubectl apply -f kubernetes/bundle.yaml

graftool's People

Contributors

jseguillon avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

graftool's Issues

Add explore page

Minimal needs :

  • enter prom query (with autocomplete ?)
  • show results as datafames
  • draw on line chart

Better resolution management for prometheus queries

Current compute expression is probably too naive

if end_time != None:
        # TODO: is 60s best value? should it be configurable
        return p.query_range(
            prometheus_query,
            start_time, end_time, (end_time-start_time)/20)

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.