monitoring

package
v1.0.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package monitoring handles Grafana dashboard provisioning for nself monitoring plugin. On nself start, this copies the relevant dashboard JSON files based on installed plugins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDashboards

func CopyDashboards(sourceDir, destDir string, installedPlugins []string) ([]string, error)

CopyDashboards copies the nself-overview and any bundle dashboards whose trigger plugins are present in installedPlugins into destDir. destDir is the Grafana provisioning dashboards directory (e.g. /etc/grafana/provisioning/dashboards). sourceDir is the monitoring plugin's configs/grafana/dashboards/ directory. Returns the list of dashboard filenames copied and any error encountered.

func ReadProvisioningMeta

func ReadProvisioningMeta(dashboardPath string) (*nSelfProvisioningMeta, error)

ReadProvisioningMeta reads the __nself_provisioning block from a dashboard JSON file. Returns nil if the key is absent (overview dashboard and non-nself dashboards).

func SelectDashboards

func SelectDashboards(installedPlugins []string) []string

SelectDashboards returns the list of dashboard filenames that would be copied for the given installed plugins, without performing any file I/O. Useful for unit testing and dry-run output.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL