Giter Club home page Giter Club logo

simple-grafonnet's Introduction

Simple-Grafonnet - generate simple Grafana dashboard based on app /metrics endpoint

Diagram

If an application exposes many metrics, it takes much time to create Grafana dashboard. In simple case, we just need graph for each exposed metric.

This tool:

  • Reads Prometheus-like metrics exposed by application endpoint.
  • Generates 2-column Dashboard.
  • Creates graph for each exposed metric.
  • Supports following metric types:
    • Gauge - exposed as is
    • Counter - exposed as rate()
    • Histogram - exposed as histogram_quantile()
    • Summary - exposed as rate(sum[5m]) / rate(count[5m])

Install

# go install github.com/nanorobocop/simple-grafonnet

Run

  1. Print out dashboard JSON on stdout:

    # simple-grafonnet -url http://localhost:8080/metrics

    Or copy generated dashboard to clipboard:

    # simple-grafonnet -url http://localhost:8080/metrics | pbcopy
    2021/11/25 21:40:17.239 INFO  {simple-grafonnet/main.go:30 main.main} Downloading metrics from endpoint: http://localhost:8080/metrics
    2021/11/25 21:40:17.253 INFO  {simple-grafonnet/main.go:37 main.main} Parsing metrics data
    2021/11/25 21:40:17.253 INFO  {simple-grafonnet/main.go:171 main.(*App).printMetricsStat} Found metrics of type counter: 7
    2021/11/25 21:40:17.253 INFO  {simple-grafonnet/main.go:171 main.(*App).printMetricsStat} Found metrics of type gauge: 31
    2021/11/25 21:40:17.253 INFO  {simple-grafonnet/main.go:171 main.(*App).printMetricsStat} Found metrics of type summary: 1
    2021/11/25 21:40:17.253 INFO  {simple-grafonnet/main.go:171 main.(*App).printMetricsStat} Found metrics of type untyped: 0
    2021/11/25 21:40:17.253 INFO  {simple-grafonnet/main.go:171 main.(*App).printMetricsStat} Found metrics of type histogram: 2
    2021/11/25 21:40:17.253 INFO  {simple-grafonnet/main.go:55 main.main} Generating dashboard
    2021/11/25 21:40:17.291 INFO  {simple-grafonnet/main.go:72 main.main} Dashboard generated and printed to stdout!
  2. Import generated dashboard to Grafana:

    Import dashboard

  3. Check result. Tune and save if needed.

    Grafana dashboard

simple-grafonnet's People

Contributors

nanorobocop avatar

Watchers

 avatar  avatar  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.