promutil

package
v2.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package promutil contains utilities for collecting Prometheus metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstrumentRoundTripper

func InstrumentRoundTripper(name string, rt http.RoundTripper) http.RoundTripper

InstrumentRoundTripper returns an http.RoundTripper that collects Prometheus metrics; delegating to the underlying RoundTripper to actually make requests.

Types

type Adder

type Adder interface {
	Add(float64) // Implemented by prometheus.Counter.
}

Adder is something that can be added to.

type CountingReader

type CountingReader struct {
	io.Reader
	Counter Adder
}

CountingReader exports a count of bytes read from an underlying io.Reader.

func (*CountingReader) Read

func (r *CountingReader) Read(p []byte) (n int, err error)

Read implements io.Reader.

type CountingWriter

type CountingWriter struct {
	io.Writer
	Counter Adder
}

CountingWriter exports a count of bytes written to an underlying io.Writer.

func (*CountingWriter) Write

func (w *CountingWriter) Write(p []byte) (n int, err error)

Write implements io.Writer.

Jump to

Keyboard shortcuts

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