telemetry

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyTelemetryIfPresent

func ApplyTelemetryIfPresent(provider Provider, handler http.Handler) (http.Handler, error)

Types

type InMemResponseWriter

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

func NewInMemResponseWriter

func NewInMemResponseWriter() *InMemResponseWriter

func (*InMemResponseWriter) Body

func (w *InMemResponseWriter) Body() string

func (*InMemResponseWriter) Header

func (w *InMemResponseWriter) Header() http.Header

func (*InMemResponseWriter) StatusCode

func (w *InMemResponseWriter) StatusCode() int

func (*InMemResponseWriter) Write

func (w *InMemResponseWriter) Write(b []byte) (int, error)

func (*InMemResponseWriter) WriteHeader

func (w *InMemResponseWriter) WriteHeader(statusCode int)

type PassThroughResponseWriter

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

func NewPassThroughResponseWriter

func NewPassThroughResponseWriter(w http.ResponseWriter) *PassThroughResponseWriter

func (*PassThroughResponseWriter) Body

func (*PassThroughResponseWriter) Header

func (*PassThroughResponseWriter) StatusCode

func (w *PassThroughResponseWriter) StatusCode() int

func (*PassThroughResponseWriter) Write

func (w *PassThroughResponseWriter) Write(b []byte) (int, error)

func (*PassThroughResponseWriter) WriteHeader

func (w *PassThroughResponseWriter) WriteHeader(statusCode int)

type Prometheus

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

func (*Prometheus) CheckError

func (p *Prometheus) CheckError(err error)

func (*Prometheus) Configure

func (p *Prometheus) Configure() error

func (*Prometheus) GetHTTPMetricsHandler

func (p *Prometheus) GetHTTPMetricsHandler() (http.Handler, error)

func (*Prometheus) GetHTTPMiddleware

func (p *Prometheus) GetHTTPMiddleware() (func(handler http.Handler) http.Handler, error)

func (*Prometheus) Shutdown

func (p *Prometheus) Shutdown()

type Provider

type Provider interface {
	// Configure telemetry provider
	Configure() error
	// Get a func which wraps a http Handler as Middleware
	GetHTTPMiddleware() (func(handler http.Handler) http.Handler, error)
	// Get a handler which can be exposed as "/metrics" endpoint
	GetHTTPMetricsHandler() (http.Handler, error)
	// Gracefully shutdown
	Shutdown()
}

Jump to

Keyboard shortcuts

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