Skip to content

Commit

Permalink
Add sep file example
Browse files Browse the repository at this point in the history
  • Loading branch information
v-zhuravlev committed Nov 14, 2023
1 parent 0e78ebf commit 21c8272
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions docs/node-observ-lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ local linux =

### Example 2: Fill in monitoring-mixin with default config values and enable loki logs:

You can use observ-lib to fill in monitoring-mixin structure:

```jsonnet
// mixin.libsonnet file
Expand All @@ -62,7 +61,42 @@ local linux =
```

### Example 3: Modify specific panel before rendering dashboards
### Example 3: Override some of default config values from file:


```jsonnet
// overrides.libsonnet
{
// Memory utilzation (%) level on which to trigger the
// 'NodeMemoryHighUtilization' alert.
memoryHighUtilizationThreshold: 80,
// Threshold for the rate of memory major page faults to trigger
// 'NodeMemoryMajorPagesFaults' alert.
memoryMajorPagesFaultsThreshold: 1000,
// Disk IO queue level above which to trigger
// 'NodeDiskIOSaturation' alert.
diskIOSaturationThreshold: 20,
}
// mixin.libsonnet file
local configOverride = import './overrides.libsonnet';
local nodelib = import 'node-observ-lib/main.libsonnet';
local linux =
nodelib.new()
+ nodelib.withConfigMixin(configOverride);
{
grafanaDashboards+:: linux.grafana.dashboards,
prometheusAlerts+:: linux.prometheus.alerts,
prometheusRules+:: linux.prometheus.recordingRules,
}
```

### Example 4: Modify specific panel before rendering dashboards

```jsonnet
local g = import './g.libsonnet';
Expand Down

0 comments on commit 21c8272

Please sign in to comment.