Movatterモバイル変換


[0]ホーム

URL:


promlint

package
v1.23.2Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License:Apache-2.0Imports:6Imported by:44

Details

Repository

github.com/prometheus/client_golang

Links

Documentation

Overview

Package promlint provides a linter for Prometheus metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeLinter

type Linter struct {// contains filtered or unexported fields}

A Linter is a Prometheus metrics linter. It identifies issues with metricnames, types, and metadata, and reports them to the caller.

funcNew

func New(rio.Reader) *Linter

New creates a new Linter that reads an input stream of Prometheus metrics inthe Prometheus text exposition format.

funcNewWithMetricFamilies

func NewWithMetricFamilies(mfs []*dto.MetricFamily) *Linter

NewWithMetricFamilies creates a new Linter that reads from a slice ofMetricFamily protobuf messages.

func (*Linter)AddCustomValidationsadded inv1.18.0

func (l *Linter) AddCustomValidations(vs ...Validation)

AddCustomValidations adds custom validations to the linter.

func (*Linter)Lint

func (l *Linter) Lint() ([]Problem,error)

Lint performs a linting pass, returning a slice of Problems indicating anyissues found in the metrics stream. The slice is sorted by metric nameand issue description.

typeProblem

type Problem struct {// The name of the metric indicated by this Problem.Metricstring// A description of the issue for this Problem.Textstring}

A Problem is an issue detected by a linter.

typeValidationadded inv1.18.0

type Validation = func(mf *dto.MetricFamily) []error

Source Files

View all Source files

Directories

PathSynopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp