metrics

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VerifyOutcomeTypeBody verifyOutcomeType = "body"
	VerifyOutcomeTypeUrl  verifyOutcomeType = "url"
)

Variables

View Source
var (
	DNSLookupCounter = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace: namespace,
		Name:      "dns_lookup_count",
		Help:      "The total number of requests verified",
	}, []string{dnsLookupErrorLabel})
	DNSLookupTimeHistogram = prometheus.NewHistogram(prometheus.HistogramOpts{
		Namespace: namespace,
		Name:      "dns_lookup_ms",
		Help:      "Milliseconds to lookup DNS.",
		Buckets:   standardMillisecondBuckets,
	})
	SignCounter = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace: namespace,
		Name:      "sign_count",
		Help:      "The total number of requests signed.",
	}, []string{signErrorLabel})
	SignTimeHistogram = prometheus.NewHistogram(prometheus.HistogramOpts{
		Namespace: namespace,
		Name:      "sign_time_us",
		Help:      "Microseconds to sign a request.",
		Buckets:   standardMicrosecondBuckets,
	})
	VerifyCounter = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace: namespace,
		Name:      "verify_count",
		Help:      "The total number of requests verified.",
	}, []string{verifyErrorLabel})
	VerifyOutcomeCounter = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace: namespace,
		Name:      "verify_outcome_count",
		Help:      "The total number of valid signed requests.",
	}, []string{verifyOutcomeTypeLabel, verifyOutcomeValidLabel})
	VerifyTimeHistogram = prometheus.NewHistogram(prometheus.HistogramOpts{
		Namespace: namespace,
		Name:      "verify_time_us",
		Help:      "Microseconds to verify a request.",
		Buckets:   standardMicrosecondBuckets,
	})
)

Creates all metrics

Functions

func GetAdscertMetricsRegistry

func GetAdscertMetricsRegistry() *prometheus.Registry

func RecordDNSLookup

func RecordDNSLookup(err adscerterrors.DNSLookupErrorCode)

func RecordDNSLookupTime

func RecordDNSLookupTime(observeTime time.Duration)

func RecordSigning

func RecordSigning(err adscerterrors.SigningErrorCode)

func RecordSigningTime

func RecordSigningTime(observeTime time.Duration)

func RecordVerify

func RecordVerify(err adscerterrors.VerifyErrorCode)

func RecordVerifyOutcome

func RecordVerifyOutcome(t verifyOutcomeType, valid bool)

func RecordVerifyTime

func RecordVerifyTime(observeTime time.Duration)

Types

This section is empty.

Jump to

Keyboard shortcuts

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