Skip to content

Commit

Permalink
Add Node.js mixin (grafana#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
bfmatei authored Dec 31, 2020
1 parent 3f9c2fd commit ca37710
Show file tree
Hide file tree
Showing 6 changed files with 1,661 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ This repository contains various Jsonnet libraries we use at Grafana Labs:
* [`memcached-mixin`](memcached-mixin/): A set of reuseable and extensible dashboards
for Memcached.

* [`nodejs-mixin`](nodejs-mixin/): A set of reusable and extensible dashboards
for Node.js.

* [`oauth2-proxy`](oauth2-proxy/): A jsonnet configuration for deploying bitly's
OAuth proxy to Kubernetes.

Expand Down
3 changes: 3 additions & 0 deletions nodejs-mixin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/alerts.yaml
/rules.yaml
dashboards_out
18 changes: 18 additions & 0 deletions nodejs-mixin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Node.js Mixin

The Node.js Mixin is a set of configurable, reusable, and extensible alerts and dashboards based on the default metrics exported by the [prom-client](https://github.com/siimon/prom-client). The mixin creates alerting rules for Prometheus and suitable dashboard descriptions for Grafana.

To use them, you need to have `mixtool` and `jsonnetfmt` installed. If you have a working Go development environment, it's easiest to run the following:

```bash
$ go get github.com/monitoring-mixins/mixtool/cmd/mixtool
$ go get github.com/google/go-jsonnet/cmd/jsonnetfmt
```

You can then build the Prometheus rules file `alerts.yaml` and a directory `dashboard_out` with the JSON dashboard files for Grafana:

```bash
$ make build
```

For more advanced uses of mixins, see [Prometheus Monitoring Mixins docs](https://github.com/monitoring-mixins/docs).
11 changes: 11 additions & 0 deletions nodejs-mixin/alerts/alerts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
groups:
- name: NodejsAlerts
rules:
- alert: NodejsDown
expr: process_start_time_seconds != 1
for: 5m
labels:
severity: critical
annotations:
description: 'Node.js {{$labels.job}} on {{$labels.instance}} is not up.'
summary: Node.js not up
Loading

0 comments on commit ca37710

Please sign in to comment.