Skip to content

Commit 5c24b1f

Browse files
committed
Refine main documentation
1 parent d4c295c commit 5c24b1f

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

README.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# Grafonnet example
22

3-
This repository contains an example of a Grafana dashboard as code, defined with [Grafonnet](https://github.com/grafana/grafonnet), continuously deployed to a [Grafana Cloud](https://grafana.com/products/cloud/) instance, thanks to [Grizzly](https://github.com/grafana/grizzly) and [GitHub Actions](https://docs.github.com/en/actions).
3+
This repository contains an example of a [Grafana dashboard](https://grafana.com/docs/grafana/latest/dashboards/)
4+
[as code](https://grafana.com/blog/2022/12/06/a-complete-guide-to-managing-grafana-as-code-tools-tips-and-tricks/),
5+
defined with [Grafonnet](https://github.com/grafana/grafonnet), continuously deployed to
6+
a [Grafana Cloud](https://grafana.com/products/cloud/) instance,
7+
thanks to [Grizzly](https://github.com/grafana/grizzly) and [GitHub Actions](https://docs.github.com/en/actions).
8+
9+
## What's here?
10+
11+
- **An [example dashboard](./example.jsonnet)** written in [Jsonnet](https://jsonnet.org/) with [Grafonnet](https://github.com/grafana/grafonnet).
12+
- **Are you willing to extend it?** Find [here](https://grafana.github.io/grafonnet/API/dashboard/index.html) the Grafonnet API for dashboards.
13+
- An example of **[how to use Grizzle to push dashboards to a Grafana instance](./.github/workflows/deploy.yml#L20)**.
14+
- **Would you like to learn more about Grizzly** Find [here](https://grafana.github.io/grizzly/) the docs.
15+
- An example of **[how to continuously deploy Grafonnet code to a Grafana instance](./.github/workflows/deploy.yml)**.
416

517
## Looking for building your own example?
618

@@ -16,19 +28,19 @@ First of all, you need to have these tools up and running before starting:
1628

1729
### Step by step
1830

19-
1. Initialize a new project:
31+
1. **Initialize** a new project:
2032

2133
```sh
2234
jb init
2335
```
2436

25-
2. Add Grafonnet as dependency:
37+
2. **Add Grafonnet** as dependency:
2638

2739
```sh
2840
jb install github.com/grafana/grafonnet/gen/grafonnet-latest@main
2941
```
3042

31-
3. Create an `example.jsonnet` file with a basic dashboard:
43+
3. **Create an `example.jsonnet` file** with a basic dashboard:
3244

3345
```jsonnet
3446
local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet';
@@ -37,7 +49,7 @@ First of all, you need to have these tools up and running before starting:
3749
+ g.dashboard.withDescription('Example dashboard built with Grafonnet')
3850
```
3951

40-
4. Create a `dashboards.libsonnet` file with the main definition:
52+
4. **Create a `dashboards.libsonnet` file** with the main definition:
4153

4254
```jsonnet
4355
{
@@ -49,12 +61,12 @@ First of all, you need to have these tools up and running before starting:
4961

5062
*NOTE: It basically imports the example dashboard we defined in the previous step*
5163

52-
5. Set up [Grafana auth for Grizzly](https://grafana.github.io/grizzly/authentication/#grafana-itself) as [Actions secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets):
64+
5. **Set up [Grafana auth for Grizzly](https://grafana.github.io/grizzly/authentication/#grafana-itself)** as [Actions secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets):
5365

5466
- `GRAFANA_URL` with the root url of your instance
5567
- `GRAFANA_TOKEN` with your service account token
5668

57-
6. Set up GitHub Actions to automatically `grr apply` your changes on every push to `main`:
69+
6. **Set up GitHub Actions** to automatically `grr apply` your changes on every push to `main`:
5870

5971
```yaml
6072
# .github/workflows/deploy.yml
@@ -81,8 +93,10 @@ First of all, you need to have these tools up and running before starting:
8193
run: grr apply dashboards.libsonnet -l debug
8294
```
8395

84-
7. Push new changes on `example.jsonnet` to `main` and enjoy!
96+
7. **Push** new changes on `example.jsonnet` to `main` and **enjoy**!
8597

8698
## Contribute
8799

88-
**Have you detected a typo or something incorrect and you are willing to contribute?** Please, [open a pull request](https://github.com/joanlopez/grafonnet-example/compare) and I'll be happy to review it.
100+
**Have you detected a typo or something incorrect and you are willing to contribute?**
101+
102+
Please, [open a pull request](https://github.com/joanlopez/grafonnet-example/compare), and I'll be happy to review it.

0 commit comments

Comments
 (0)