monitoringlinter

package module
v0.0.0-...-d534621 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

monitoring-linter

Monitoring Linter is a Golang linter designed to ensure that in Kubernetes operator projects, monitoring-related practices are implemented within the pkg/monitoring directory using operator-observability methods. It verifies that all metrics, alerts and recording rules registrations are centralized in this directory. The use of Prometheus registration methods is restricted across the entire project.

Installation

go install github.com/kubevirt/monitoring/monitoringlinter/cmd/monitoringlinter@latest

Usage

Once installed, you can run the Monitoring Linter against your Kubernetes operator project by using the following command:

monitoringlinter  ./...

Linter Rules

  • The following Prometheus registration methods calls are restricted across all the project:

      prometheus.Register()
      prometheus.MustRegister()
    
  • The following operator-observability methods calls are allowed only within pkg/monitoring directory:

      operatormetrics.RegisterMetrics()
      operatorrules.RegisterAlerts()
      operatorrules.RegisterRecordingRules()
    
  • Examples for calls that are allowed across all the project, as they are not registering metrics, alerts or recording rules:

      prometheus.NewHistogram()
      operatormetrics.ListMetrics()
    

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAnalyzer

func NewAnalyzer() *analysis.Analyzer

NewAnalyzer returns an Analyzer.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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