Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spoved/crafana.cr
Crystal library to help autogenerate Grafana dashboards
https://github.com/spoved/crafana.cr
Last synced: about 2 months ago
JSON representation
Crystal library to help autogenerate Grafana dashboards
- Host: GitHub
- URL: https://github.com/spoved/crafana.cr
- Owner: spoved
- License: mit
- Created: 2019-07-10T16:33:00.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-26T20:42:53.000Z (8 months ago)
- Last Synced: 2024-06-21T18:11:26.903Z (3 months ago)
- Language: Crystal
- Size: 69.3 KB
- Stars: 21
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-crystal - crafana - A [Grafana](https://grafana.com/) library to help autogenerate dashboards (Logging and monitoring)
- awesome-crystal - crafana - A [Grafana](https://grafana.com/) library to help autogenerate dashboards (Logging and monitoring)
README
# Crafana [![Build Status](https://travis-ci.org/spoved/crafana.cr.svg?branch=master)](https://travis-ci.org/spoved/crafana.cr)
This library is intended to help autogenerate Grafana dashboards
## Installation
Add the dependency to your project's `shard.yml`:
```yaml
dependencies:
crafana:
github: spoved/crafana.cr
```## Usage
### Builder
The `Crafana::Builder` can be used to generate dashboards and sub panels.
```crystal
builder = Crafana::Builder.new
builder.add_dashboard("My new dash") do |dash|
# Add sub panels to the dashboard heredash.add_row("row 1") do |row|
# Configure row here
enddash.add_graph("graph 1") do |graph|
# Configure graph here
end
end
```The dashboard json can be exported via the `to_json` method.
```crystal
builder.dashboards.first.to_json
```## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## Contributors
- [Holden Omans](https://github.com/kalinon) - creator and maintainer
- [Christian Nicolai](https://github.com/cmur2) - Superuser!