metrics

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Namespace = "eigenda_proxy"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host              string
	Port              int
	Enabled           bool
	ReadHeaderTimeout int
}

Config ... Metrics server configuration

type Metricer

type Metricer interface {
	RecordInfo(version string)
	RecordUp()
	RecordRPCServerRequest(method string) func()
	RecordRPCClientResponse(method string, err error)

	Document() []metrics.DocumentedMetric
}

Metricer ... Interface for metrics

var NoopMetrics Metricer = new(noopMetricer)

type Metrics

type Metrics struct {
	Info *prometheus.GaugeVec
	Up   prometheus.Gauge

	metrics.RPCMetrics
	// contains filtered or unexported fields
}

Metrics ... Metrics struct

func NewMetrics

func NewMetrics(procName string) *Metrics

func (*Metrics) Document

func (m *Metrics) Document() []metrics.DocumentedMetric

func (*Metrics) RecordInfo

func (m *Metrics) RecordInfo(version string)

RecordInfo sets a pseudo-metric that contains versioning and config info for the proxy DA node.

func (*Metrics) RecordUp

func (m *Metrics) RecordUp()

RecordUp sets the up metric to 1.

func (*Metrics) StartServer

func (m *Metrics) StartServer(hostname string, port int) (*ophttp.HTTPServer, error)

StartServer starts the metrics server on the given hostname and port.

Jump to

Keyboard shortcuts

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