metrics

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	VerifyResultTypeBody verifyResultType = "body"
	VerifyResultTypeUrl  verifyResultType = "url"
)

Variables

View Source
var (
	SignCounter = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "adscert_sign_count",
		Help: "The total number of requests signed",
	}, []string{signErrorLabel})
	VerifyCounter = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "adscert_verify_count",
		Help: "The total number of requests verified",
	}, []string{verifyErrorLabel})
	VerifyResultCounter = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "adscert_verify_result_count",
		Help: "The total number of valid signed requests",
	}, []string{verifyResultTypeLabel, verifyResultValidLabel})
)

Creates all metrics

Functions

func GetAdscertMetricsRegistry

func GetAdscertMetricsRegistry() *prometheus.Registry

func RecordSigningMetrics

func RecordSigningMetrics(err SignErrorCode)

func RecordVerifyMetrics

func RecordVerifyMetrics(err VerifyErrorCode)

func RecordVerifyResultMetrics

func RecordVerifyResultMetrics(t verifyResultType, valid bool)

Types

type SignErrorCode

type SignErrorCode string

Signing Errors

const (
	SignErrorNone          SignErrorCode = "no_error"
	SignErrorParseUrl      SignErrorCode = "parsing_url_error"
	SignErrorGenerateNonce SignErrorCode = "generate_nonce_error"
	SignErrorEmboss        SignErrorCode = "emboss_error"
)

type VerifyErrorCode

type VerifyErrorCode string

Verification Errors

const (
	VerifyErrorNone               VerifyErrorCode = "no_error"
	VerifyErrorParseUrl           VerifyErrorCode = "url_parse"
	VerifyErrorSignatureDecode    VerifyErrorCode = "signature_decode"
	VerifyErrorUnrelatedSignature VerifyErrorCode = "unrelated_signature"
	VerifyErrorNoSharedSecret     VerifyErrorCode = "no_shared_secret"
	VerifyErrorCounterPartyLookUp VerifyErrorCode = "counter_party_lookup"
)

Jump to

Keyboard shortcuts

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