Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yoomoney/grafana-dashboard-dsl
DSL for generating Grafana dashboards
https://github.com/yoomoney/grafana-dashboard-dsl
backend dashboards-generation dsl grafana grafana-dashboards kotlin metrics
Last synced: about 2 months ago
JSON representation
DSL for generating Grafana dashboards
- Host: GitHub
- URL: https://github.com/yoomoney/grafana-dashboard-dsl
- Owner: yoomoney
- License: mit
- Archived: true
- Created: 2018-11-24T04:21:47.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-29T07:54:44.000Z (over 2 years ago)
- Last Synced: 2024-08-02T15:54:25.895Z (5 months ago)
- Topics: backend, dashboards-generation, dsl, grafana, grafana-dashboards, kotlin, metrics
- Language: Kotlin
- Homepage:
- Size: 1.83 MB
- Stars: 58
- Watchers: 25
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/yoomoney/grafana-dashboard-dsl.svg?branch=master)](https://travis-ci.org/yoomoney/grafana-dashboard-dsl)
[![codecov](https://codecov.io/gh/yoomoney/grafana-dashboard-dsl/branch/master/graph/badge.svg)](https://codecov.io/gh/yoomoney/grafana-dashboard-dsl)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Javadoc](https://img.shields.io/badge/javadoc-latest-blue.svg)](https://yoomoney.github.io/grafana-dashboard-dsl/)
[![Download](https://img.shields.io/badge/Download-latest-green.svg) ](https://search.maven.org/artifact/ru.yoomoney.tech/grafana-dashboard-dsl)# Grafana Dashboard DSL
Kotlin DSL for generating Grafana dashboards.
## Features
* Grafana Dashboards as a Code: review and vcs control over dashboards
* Reusable dashboards, panels, configs, etc
* Share visualization style across different metrics
* Easy to keep metrics up-to-date
* Easy to extend to most features of Grafana
* Easy to include in CI cycle: dashboard is a JSON-document
* Power of Kotlin language## Supported data sources
* Graphite (`./src/examples/kotlin/ru/yoomoney/tech/grafana/dsl/examples/GrafanaGraphiteDemoLayouts.kts`)
* Prometheus (`./src/examples/kotlin/ru/yoomoney/tech/grafana/dsl/examples/GrafanaPrometheusDemoLayouts.kts`)
* Zabbix## Usage with gradle plugin
See documentation at [Grafana Dashboard Plugin](https://github.com/yoomoney/grafana-dashboard-plugin)
## Manual usage
> build.gradle
```groovy
sourceSets {
grafana {
kotlin
}
}dependencies {
grafanaCompile 'ru.yoomoney.tech:grafana-dashboard-dsl:3.0.0'
}
```Code for dashboards generation must be placed in `${projectDir}/src/grafana/kotlin/`. Generation performed manually:
```kotlin
import ru.yoomoney.tech. grafana.dsl.dashboardfun main(args: Array) {
println(dashboard(title = "My custom dashboard") {
panels {
// ...
}
})
}
```## Examples
Examples are in `./src/examples/kotlin/ru/yoomoney/tech/grafana/dsl/examples`
## Development
To create new dashboards, panels, metrics, and others, create a class (usually with postfix `*Configuration` or`*Builder`),
mark it with annotation `ru.yoomoney.tech.grafana.dsl.DashboardElement`, and create data-class for it's contents,
that's implements `ru.yoomoney.tech.grafana.dsl.json.Json`For example see `DashboardBuilder` and `Dashboard` classes
# How to contribute?
Just fork the repo and send us a pull request.
Make sure your branch builds without any warnings/issues.