Skip to content

Commit d8fb4c2

Browse files
committed
docs: mention config vars
1 parent cf59944 commit d8fb4c2

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

traefik-mixin/README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ The Traefik mixin is a set of configurable, reusable, and extensible dashboards
55
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:
66

77
```shell
8-
$ go get github.com/monitoring-mixins/mixtool/cmd/mixtool
9-
$ go get github.com/google/go-jsonnet/cmd/jsonnetfmt
8+
go get github.com/monitoring-mixins/mixtool/cmd/mixtool
9+
go get github.com/google/go-jsonnet/cmd/jsonnetfmt
1010
```
1111

1212
You can then build the Prometheus rules files and dashboards for Grafana:
1313

1414
```shell
15-
$ make build
15+
make build
1616
```
1717

1818
This will generate:
@@ -26,6 +26,25 @@ This will generate:
2626
The following Prometheus alerts are included:
2727

2828
- **TraefikConfigReloadFailuresIncreasing**: Fires if Traefik is failing to reload its config.
29-
- **TraefikTLSCertificatesExpiring**: Fires if Traefik is serving certificates that will expire soon.
29+
- **TraefikTLSCertificatesExpiring**: Fires if Traefik is serving certificates that will expire very soon (critical, threshold configurable).
30+
- **TraefikTLSCertificatesExpiringSoon**: Fires if Traefik is serving certificates that will expire soon (warning, threshold configurable, only fires if the expiry is less than the warning threshold but greater than the critical threshold).
31+
32+
## Configuration
33+
34+
You can configure alert thresholds and labels in `config.libsonnet`:
35+
36+
```jsonnet
37+
{
38+
_config+:: {
39+
traefik_tls_expiry_days_critical: 7, // critical threshold (days)
40+
traefik_tls_expiry_days_warning: 14, // warning threshold (days)
41+
alertLabels: {}, // optional alert labels
42+
alertAnnotations: {}, // optional alert annotations
43+
timeSeriesLabels: "component=\"traefik\",environment=\"production\"", // optional time series labels
44+
sumByLabels: "instance", // optional sum by labels
45+
maxByLabels: "sans", // optional max by labels
46+
},
47+
}
48+
```
3049

3150
For more advanced uses of mixins, see https://github.com/monitoring-mixins/docs.

0 commit comments

Comments
 (0)