metrics

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertCheckToTimeSeries

func ConvertCheckToTimeSeries(target config.Target, result net.WebsiteCheckResult, region string, timestamp time.Time) []*prompb.TimeSeries

func ConvertSSLExpiryToTimeSeries

func ConvertSSLExpiryToTimeSeries(target config.Target, daysUntilExpiry int, timestamp time.Time) *prompb.TimeSeries

func InitRemoteWrite

func InitRemoteWrite(cfg Config)

func MapSeries

func MapSeries(name string, labels map[string]string) []*prompb.Label

func MapTargetLabels

func MapTargetLabels(target config.Target, result net.WebsiteCheckResult, region string) map[string]string

func RecordCheck

func RecordCheck(target config.Target, result net.WebsiteCheckResult, region string)

func RecordSSLExpiry

func RecordSSLExpiry(target config.Target, daysUntilExpiry int)

func StopRemoteWrite

func StopRemoteWrite()

Types

type Config

type Config struct {
	ServerURL    string
	Headers      map[string]string
	PushInterval time.Duration
	Username     string
	Password     string // #nosec G117 -- credentials for metrics push auth, never serialized
}

func NewConfig

func NewConfig() Config

type TimeSeries

type TimeSeries struct {
	Name   string
	Labels map[string]string
}

type WriteClient

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

func NewWriteClient

func NewWriteClient(cfg Config) *WriteClient

func (*WriteClient) AddCheck

func (c *WriteClient) AddCheck(target config.Target, result net.WebsiteCheckResult, region string)

func (*WriteClient) AddSSLExpiry

func (c *WriteClient) AddSSLExpiry(target config.Target, daysUntilExpiry int)

func (*WriteClient) Start

func (c *WriteClient) Start()

func (*WriteClient) Stop

func (c *WriteClient) Stop()

Jump to

Keyboard shortcuts

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