domain

package
v1.1.0-beta.3 Latest Latest
Warning

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

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

Documentation

Overview

Groundtruth for available metrics and label names.

Index

Constants

View Source
const (
	PrimaryAdapterDuration         HistogramVecName = "primary_adapter_duration_ms"
	SecondaryAdapterCallDuration   HistogramVecName = "secondary_adapter_call_duration_ms"
	SecondaryAdapterTaskDuration   HistogramVecName = "secondary_adapter_task_duration_ms"
	PrimaryAdapterInProgress       GaugeVecName     = "primary_adapter_in_progress"
	AdaptiveTaskTimeoutDuration    GaugeVecName     = "adaptive_task_timeout_duration"
	AdaptiveCallTimeoutDuration    GaugeVecName     = "adaptive_call_timeout_duration"
	CallTimeout                    GaugeVecName     = "call_timeout_ms"
	TaskTimeout                    GaugeVecName     = "task_timeout_ms"
	CircuitBreakerDisabled         GaugeVecName     = "circuit_breaker_disabled"
	CircuitBreakerCountRetries     GaugeVecName     = "circuit_breaker_count_retries"
	CircuitBreakerIntervalSecs     GaugeVecName     = "circuit_breaker_interval_seconds"
	CircuitBreakerMaxRequests      GaugeVecName     = "circuit_breaker_max_requests"
	CircuitBreakerMinRequests      GaugeVecName     = "circuit_breaker_min_requests"
	CircuitBreakerTimeout          GaugeVecName     = "circuit_breaker_timeout_seconds"
	CircuitBreakerRatio            GaugeVecName     = "circuit_breaker_ratio"
	CircuitBreakerConsecutiveFails GaugeVecName     = "circuit_breaker_consecutive_fails"
	RetryDisabled                  GaugeVecName     = "retry_disabled"
	RetryMaxAttempt                GaugeVecName     = "retry_max_attempt"
	RetryInitialBackoff            GaugeVecName     = "retry_initial_backoff"
)

Variables

View Source
var DurationHistogramBuckets = slices.Concat(
	[]float64{0.1, 0.25, 0.5},
	[]float64{1, 2.5, 5},
	[]float64{10, 25, 50},
	[]float64{100, 250, 500},
	[]float64{1000, 2500, 5000},
	[]float64{10000, 25000, 50000, 100000},
)

Default Histogram bucket is []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10} and desinged as response time in seconds Adjust it so that it is in milliseconds

Functions

func GetGaugeVec

func GetGaugeVec(name GaugeVecName) *prometheus.GaugeVec

func GetHistogramVec

func GetHistogramVec(name HistogramVecName) *prometheus.HistogramVec

Types

type AdaptiveTimeoutGaugeLabels added in v1.0.18

type AdaptiveTimeoutGaugeLabels struct {
	Ctx TelemetryContext
}

func (AdaptiveTimeoutGaugeLabels) AsMap added in v1.0.18

func (atgl AdaptiveTimeoutGaugeLabels) AsMap() map[string]string

type CircuitBreakerGaugeLabels

type CircuitBreakerGaugeLabels struct {
	Ctx TelemetryContext
}

func (CircuitBreakerGaugeLabels) AsMap

func (cbgl CircuitBreakerGaugeLabels) AsMap() map[string]string

type GaugeOp added in v1.0.15

type GaugeOp int
const (
	INC GaugeOp = iota
	DEC
)

type GaugeVecName

type GaugeVecName = string

type HistogramVecName

type HistogramVecName = string

type PrimaryAdapterDurationLabels

type PrimaryAdapterDurationLabels struct {
	PrimaryLabels
	Status Status
}

func (PrimaryAdapterDurationLabels) AsMap

func (padl PrimaryAdapterDurationLabels) AsMap() map[string]string

type PrimaryAdapterHandler

type PrimaryAdapterHandler struct {
	ServiceName    string
	ServerConfig   *model.ServerConfig
	ConsumerConfig *model.ConsumerConfig
	TaskSet        []TaskHandler
}

either StatelessAdapterConfig or BrokerAdapterConfig must be defined

func (PrimaryAdapterHandler) GetId

func (iah PrimaryAdapterHandler) GetId() string

type PrimaryAdapterInProgressLabels added in v1.0.15

type PrimaryAdapterInProgressLabels struct {
	PrimaryLabels
}

func (PrimaryAdapterInProgressLabels) AsMap added in v1.0.15

type PrimaryLabels

type PrimaryLabels struct {
	ServiceName string
	Variant     string
	Action      string
	Route       string
	Topic       string
	Id          string
}

func (PrimaryLabels) GetPrimaryLabels

func (pl PrimaryLabels) GetPrimaryLabels() map[string]string

type RetryGaugeLabels

type RetryGaugeLabels struct {
	Ctx           TelemetryContext
	BackoffPolicy string
}

func (RetryGaugeLabels) AsMap

func (rgl RetryGaugeLabels) AsMap() map[string]string

type SecondaryAdapterCallDurationLabels

type SecondaryAdapterCallDurationLabels struct {
	Ctx                 TelemetryContext
	Status              Status
	NthAttmpt           uint32
	CircuitBreakerState string
	IsConcurrent        bool
}

func (SecondaryAdapterCallDurationLabels) AsMap

type SecondaryAdapterTaskDurationLabels

type SecondaryAdapterTaskDurationLabels struct {
	Ctx                 TelemetryContext
	Status              Status
	TotalAttempts       uint32
	CircuitBreakerState string
	IsConcurrent        bool
}

func (SecondaryAdapterTaskDurationLabels) AsMap

type SecondaryLabels

type SecondaryLabels struct {
	DstServiceName string
	DstVariant     string
	DstAction      string
	DstRoute       string
	DstTopic       string
	DstId          string
}

func (SecondaryLabels) GetSecondaryLabels

func (sl SecondaryLabels) GetSecondaryLabels() map[string]string

type Status

type Status float64
const (
	Ok Status = iota
	ErrGeneric
	ErrCtxDeadlineExceeded
	ErrCtxCanceled
	ErrCBOpen
)

func (Status) AsString

func (s Status) AsString() string

type TaskHandler

type TaskHandler func(context.Context, chan<- *secondary.SecondaryPortCallResult)

type TaskSetResult

type TaskSetResult struct {
	ShouldFail  bool
	TaskResults []*secondary.SecondaryPortCallResult
}

TaskSetResult is returned for collection of task results It may or may not fail the request based on error handling configuration.

type TelemetryContext

type TelemetryContext struct {
	PrimaryLabels
	SecondaryLabels
}

func NewTelemetryContext

func NewTelemetryContext(serviceName string, primaryConfig *model.PrimaryAdapterSpec, secondaryConfig *model.SecondaryAdapterConfig) TelemetryContext

func (TelemetryContext) AsMap

func (tx TelemetryContext) AsMap() map[string]string

type TimeoutGaugeLabels

type TimeoutGaugeLabels struct {
	Ctx TelemetryContext
}

func (TimeoutGaugeLabels) AsMap

func (tgl TimeoutGaugeLabels) AsMap() map[string]string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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