text

package
v0.72.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package text writes Prometheus metrics in the text exposition format.

frp uses it for frpc, which only exposes Go runtime metrics. Implementing that subset here keeps client_golang and its protobuf dependency out of the frpc binary; frps keeps using client_golang, which also gives it the business metrics and the HTTP handler instrumentation.

Index

Constants

View Source
const ContentType = "text/plain; version=0.0.4; charset=utf-8"

ContentType is the content type of the text exposition format.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

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

Registry holds the collectors exposed on one listener.

func NewRegistry

func NewRegistry() *Registry

NewRegistry returns a registry with no collectors.

func (*Registry) Handler

func (r *Registry) Handler() http.Handler

Handler returns an http.Handler serving the registry.

func (*Registry) RegisterRuntime

func (r *Registry) RegisterRuntime()

RegisterRuntime registers the Go runtime collector.

func (*Registry) WritePrometheus

func (r *Registry) WritePrometheus(w io.Writer) error

WritePrometheus writes every collected family in the text exposition format.

Jump to

Keyboard shortcuts

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