All Projects → K-Phoen → Grabana

K-Phoen / Grabana

Licence: mit
User-friendly Go library for building Grafana dashboards

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Grabana

Dark
(grafana) Dashboards As Resources in Kubernetes
Stars: ✭ 190 (-39.3%)
Mutual labels:  hacktoberfest, yaml, grafana, grafana-dashboard, dashboards
Sdk
Library for using Grafana' structures in Go programs and client for Grafana REST API.
Stars: ✭ 193 (-38.34%)
Mutual labels:  library, grafana, dashboards
website
Prometheus monitoring mixins
Stars: ✭ 91 (-70.93%)
Mutual labels:  yaml, dashboards, grafana-dashboard
nifi-prometheus-reporter
A reporting task in Nifi which is capable of sending monitoring statistics as prometheus metrics to a prometheus pushgateway.
Stars: ✭ 48 (-84.66%)
Mutual labels:  grafana, grafana-dashboard
victoriametrics-ru-links
Список постов и видеозаписей об VictoriaMetrics на русском языке
Stars: ✭ 1 (-99.68%)
Mutual labels:  grafana, grafana-dashboard
trovilo
trovilo collects and prepares files from Kubernetes ConfigMaps for Prometheus & friends
Stars: ✭ 16 (-94.89%)
Mutual labels:  grafana, dashboards
kafka-consumer-lag-monitoring
Client tool that exports the consumer lag of Kafka consumer groups to Prometheus or your terminal
Stars: ✭ 45 (-85.62%)
Mutual labels:  grafana, grafana-dashboard
nfCollector
Collects Netflow version 1, 5, 6, 7, 9 & IPFIX & stores them on InfluxData time-series DB (InfluxDB)
Stars: ✭ 30 (-90.42%)
Mutual labels:  grafana, grafana-dashboard
grafonnet-playground
Playground for grafanna with jsonnet
Stars: ✭ 25 (-92.01%)
Mutual labels:  grafana, grafana-dashboard
Gerador Validador Cpf
Biblioteca JS open-source para gerar e validar CPF.
Stars: ✭ 312 (-0.32%)
Mutual labels:  hacktoberfest, library
atop-graphite-grafana-monitoring
Tools to extract raw system counters from atop, aggregate them to generate high level performance metrics, whose are then injected into a Graphite database and visualize through Grafana dashboards.
Stars: ✭ 15 (-95.21%)
Mutual labels:  grafana, grafana-dashboard
Esphome
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Stars: ✭ 4,324 (+1281.47%)
Mutual labels:  hacktoberfest, yaml
Prometheus-grafana
Monitor your Kubernetes cluster resources and applications
Stars: ✭ 21 (-93.29%)
Mutual labels:  grafana, grafana-dashboard
tado-exporter
A Prometheus exporter for tado smart heating solution
Stars: ✭ 32 (-89.78%)
Mutual labels:  grafana, grafana-dashboard
grafana-aws-cost-explorer-backend
Grafana Backend for AWS Cost Explorer
Stars: ✭ 24 (-92.33%)
Mutual labels:  grafana, grafana-dashboard
fronius-to-influx
Collect Fronius inverter data and save in Influxdb for Grafana
Stars: ✭ 31 (-90.1%)
Mutual labels:  grafana, grafana-dashboard
ruuvitag-demo
Demo of reading Bluetooth Low Energy sensor measurements of RuuviTag environmental sensors and feeding them to MQTT, a database and dashboards
Stars: ✭ 14 (-95.53%)
Mutual labels:  grafana, grafana-dashboard
cv4pve-metrics
Metrics for Proxmox VE, Grafana with dasboard, InfluxDb
Stars: ✭ 38 (-87.86%)
Mutual labels:  grafana, dashboards
idrac snmp-grafana
SNMP Based Dashboard to Monitor Dell Hosts via iDRAC
Stars: ✭ 88 (-71.88%)
Mutual labels:  grafana, grafana-dashboard
burrow-kafka-dashboard
Kubernetes Kafka Overview, Burrow consumer lag stats, Kafka disk usage
Stars: ✭ 37 (-88.18%)
Mutual labels:  grafana, grafana-dashboard

Grabana

CI codecov GoDoc

Grabana provides a developer-friendly way of creating Grafana dashboards.

Whether you prefer writing code or YAML, if you are looking for a way to version your dashboards configuration or automate tedious and error-prone creation of dashboards, this library is meant for you.

Design goals

  • provide an understandable abstraction over dashboards configuration
  • expose a developer-friendly API
  • allow IDE assistance and auto-completion

Dashboard as code

Dashboard configuration:

builder := dashboard.New(
    "Awesome dashboard",
    dashboard.AutoRefresh("5s"),
    dashboard.Tags([]string{"generated"}),
    dashboard.VariableAsInterval(
        "interval",
        interval.Values([]string{"30s", "1m", "5m", "10m", "30m", "1h", "6h", "12h"}),
    ),
    dashboard.Row(
        "Prometheus",
        row.WithGraph(
            "HTTP Rate",
            graph.DataSource("prometheus-default"),
            graph.WithPrometheusTarget(
                "rate(prometheus_http_requests_total[30s])",
                prometheus.Legend("{{handler}} - {{ code }}"),
            ),
        ),
    ),
)

Dashboard creation:

ctx := context.Background()
client := grabana.NewClient(&http.Client{}, grafanaHost, grabana.WithAPIToken("such secret, much wow"))

// create the folder holding the dashboard for the service
folder, err := client.FindOrCreateFolder(ctx, "Test Folder")
if err != nil {
    fmt.Printf("Could not find or create folder: %s\n", err)
    os.Exit(1)
}

if _, err := client.UpsertDashboard(ctx, folder, builder); err != nil {
    fmt.Printf("Could not create dashboard: %s\n", err)
    os.Exit(1)
}

For a more complete example, see the example directory.

Dashboard as YAML

Dashboard configuration:

# dashboard.yaml
title: Awesome dashboard

editable: true
tags: [generated]
auto_refresh: 5s

variables:
  - interval:
      name: interval
      label: Interval
      values: ["30s", "1m", "5m", "10m", "30m", "1h", "6h", "12h"]

rows:
  - name: Prometheus
    panels:
      - graph:
          title: HTTP Rate
          height: 400px
          datasource: prometheus-default
          targets:
            - prometheus:
                query: "rate(promhttp_metric_handler_requests_total[$interval])"
                legend: "{{handler}} - {{ code }}"

Dashboard creation (or automatically as a Kubernetes Resource, using DARK):

content, err := ioutil.ReadFile("dashboard.yaml")
if err != nil {
    fmt.Fprintf(os.Stderr, "Could not read file: %s\n", err)
    os.Exit(1)
}

dashboard, err := decoder.UnmarshalYAML(bytes.NewBuffer(content))
if err != nil {
    fmt.Fprintf(os.Stderr, "Could not parse file: %s\n", err)
    os.Exit(1)
}

ctx := context.Background()
client := grabana.NewClient(&http.Client{}, grafanaHost, grabana.WithAPIToken("such secret, much wow"))

// create the folder holding the dashboard for the service
folder, err := client.FindOrCreateFolder(ctx, "Test Folder")
if err != nil {
    fmt.Printf("Could not find or create folder: %s\n", err)
    os.Exit(1)
}

if _, err := client.UpsertDashboard(ctx, folder, dashboard); err != nil {
    fmt.Printf("Could not create dashboard: %s\n", err)
    os.Exit(1)
}

Going further

Check out the documentation to discover what Grabana can do for you.

License

This library is under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].