Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

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 here

dash.add_row("row 1") do |row|
# Configure row here
end

dash.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!