From 0e78ebfcd1e10dcd6220d866efbe4c9abe450d38 Mon Sep 17 00:00:00 2001 From: Vitaly Zhuravlev Date: Tue, 14 Nov 2023 13:56:04 +0000 Subject: [PATCH] Add separate loki example --- docs/node-observ-lib/README.md | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/docs/node-observ-lib/README.md b/docs/node-observ-lib/README.md index a483dee2db..46e9d53fcf 100644 --- a/docs/node-observ-lib/README.md +++ b/docs/node-observ-lib/README.md @@ -28,13 +28,31 @@ local linux = dashboardNamePrefix: 'Node exporter / ', dashboardTags: ['node-exporter-mixin'], uid: 'node', - }) - + nodelib.withConfigMixin( - { - // enable loki logs - enableLokiLogs: true, - } - ); + // enable loki logs + enableLokiLogs: true, + }); + +{ + grafanaDashboards+:: linux.grafana.dashboards, + prometheusAlerts+:: linux.prometheus.alerts, + prometheusRules+:: linux.prometheus.recordingRules, +} + +``` + +### 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 +local nodelib = import 'node-observ-lib/main.libsonnet'; + +local linux = + nodelib.new() + + nodelib.withConfigMixin({ + enableLokiLogs: true, + }); { grafanaDashboards+:: linux.grafana.dashboards, @@ -44,7 +62,7 @@ local linux = ``` -### Example 2: Modify specific panel before rendering dashboards +### Example 3: Modify specific panel before rendering dashboards ```jsonnet local g = import './g.libsonnet';