Skip to content

Commit 8957ee7

Browse files
authored
add monitoring mixin for the rendering service (#255)
Signed-off-by: bergquist <[email protected]>
1 parent 035e3d0 commit 8957ee7

File tree

11 files changed

+1118
-0
lines changed

11 files changed

+1118
-0
lines changed

mixin/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/alerts.yaml
2+
/rules.yaml
3+
dashboards_out

mixin/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
all: fmt lint build clean
2+
3+
fmt:
4+
./scripts/format.sh
5+
6+
lint:
7+
./scripts/lint.sh
8+
9+
build:
10+
./scripts/build.sh
11+
12+
clean:
13+
rm -rf dashboards_out alerts.yaml rules.yaml

mixin/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Grafana Render service Mixin
2+
3+
To build, you need to have `mixtool` and `jsonnetfmt` installed. If you
4+
have a working Go development environment, it's easiest to run the following:
5+
6+
```bash
7+
$ go get github.com/monitoring-mixins/mixtool/cmd/mixtool
8+
$ go get github.com/google/go-jsonnet/cmd/jsonnetfmt
9+
```
10+
11+
You can then build the Prometheus rules files `alerts.yaml` and
12+
`rules.yaml` and a directory `dashboard_out` with the JSON dashboard files
13+
for Grafana render service:
14+
15+
```bash
16+
$ make build
17+
```
18+
19+
For more advanced uses of mixins, see
20+
https://github.com/monitoring-mixins/docs.

mixin/alerts/alerts.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
groups:
2+
- name: GrafanaImageRendererAlerts
3+
rules:
4+
- alert: GrafanaImageRendererAlertsRequestsFailing
5+
for: 5m
6+
expr: |
7+
(100 * namespace_job_statuscode:grafana_image_renderer_service_http_request_duration_seconds_count:rate5m{status_code=~"5.."}
8+
/
9+
namespace_job_statuscode:grafana_image_renderer_service_http_request_duration_seconds_count:rate5m) > 5
10+
labels:
11+
severity: 'warning'
12+
annotations:
13+
message: "'{{ $labels.namespace }}' / '{{ $labels.job }}' is experiencing {{ $value | humanize }}% errors"

0 commit comments

Comments
 (0)