You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-9Lines changed: 23 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,18 @@
1
1
# Grafonnet example
2
2
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/)
3. Create an `example.jsonnet` file with a basic dashboard:
43
+
3. **Create an `example.jsonnet` file** with a basic dashboard:
32
44
33
45
```jsonnet
34
46
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:
37
49
+ g.dashboard.withDescription('Example dashboard built with Grafonnet')
38
50
```
39
51
40
-
4. Create a `dashboards.libsonnet` file with the main definition:
52
+
4. **Create a `dashboards.libsonnet` file** with the main definition:
41
53
42
54
```jsonnet
43
55
{
@@ -49,12 +61,12 @@ First of all, you need to have these tools up and running before starting:
49
61
50
62
*NOTE: It basically imports the example dashboard we defined in the previous step*
51
63
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):
53
65
54
66
- `GRAFANA_URL` with the root url of your instance
55
67
- `GRAFANA_TOKEN` with your service account token
56
68
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`:
58
70
59
71
```yaml
60
72
# .github/workflows/deploy.yml
@@ -81,8 +93,10 @@ First of all, you need to have these tools up and running before starting:
81
93
run: grr apply dashboards.libsonnet -l debug
82
94
```
83
95
84
-
7. Push new changes on `example.jsonnet` to `main` and enjoy!
96
+
7. **Push** new changes on `example.jsonnet` to `main` and **enjoy**!
85
97
86
98
## Contribute
87
99
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