observability

package
v3.15.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAllGluonMetrics added in v3.15.0

func GenerateAllGluonMetrics() []map[string]interface{}

func GenerateAllHeartbeatMetricPermutations added in v3.14.0

func GenerateAllHeartbeatMetricPermutations() []proton.ObservabilityMetric

func GenerateAllUsedDistinctionMetricPermutations added in v3.14.0

func GenerateAllUsedDistinctionMetricPermutations() []proton.ObservabilityMetric

func ModifyThrottlePeriod

func ModifyThrottlePeriod(duration time.Duration)

ModifyThrottlePeriod - used for testing.

func ModifyUserMetricInterval added in v3.14.0

func ModifyUserMetricInterval(duration time.Duration)

func VerifyAndParseGenericMetrics added in v3.15.0

func VerifyAndParseGenericMetrics(metric map[string]interface{}) (bool, proton.ObservabilityMetric)

VerifyAndParseGenericMetrics parses a metric provided as an interface into a proton.ObservabilityMetric type. It's exported as it is also used in integration tests.

Types

type Adapter added in v3.15.0

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

func NewAdapter added in v3.15.0

func NewAdapter(sender Sender) *Adapter

func (*Adapter) AddDistinctMetrics added in v3.15.0

func (adapter *Adapter) AddDistinctMetrics(errType interface{}, metrics ...map[string]interface{})

func (*Adapter) AddMetrics added in v3.15.0

func (adapter *Adapter) AddMetrics(metrics ...map[string]interface{})

type DistinctionErrorTypeEnum added in v3.14.0

type DistinctionErrorTypeEnum int

DistinctionErrorTypeEnum - maps to the specific error schema for which we want to send a user update.

const (
	SyncError DistinctionErrorTypeEnum = iota
	GluonImapError
	GluonMessageError
	GluonOtherError
	SMTPError
	EventLoopError // EventLoopError - should always be kept last when inserting new keys.
)

type Sender added in v3.14.0

type Sender interface {
	AddMetrics(metrics ...proton.ObservabilityMetric)
	AddDistinctMetrics(errType DistinctionErrorTypeEnum, metrics ...proton.ObservabilityMetric)
}

Sender - interface maps to the observability service methods, so we can easily pass them down to relevant components.

type Service

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

func NewService

func NewService(ctx context.Context, panicHandler async.PanicHandler) *Service

func (*Service) AddDistinctMetrics added in v3.14.0

func (s *Service) AddDistinctMetrics(errType DistinctionErrorTypeEnum, metrics ...proton.ObservabilityMetric)

AddDistinctMetrics - sends an additional metric related to the user, so we can determine what number of events come from what number of users. As the binning interval is what allows us to do this we should not send these if there are no logged-in users at that moment.

func (*Service) AddMetrics added in v3.14.0

func (s *Service) AddMetrics(metrics ...proton.ObservabilityMetric)

func (*Service) DeregisterUserClient

func (s *Service) DeregisterUserClient(userID string)

func (*Service) ModifyHeartbeatInterval added in v3.14.0

func (s *Service) ModifyHeartbeatInterval(duration time.Duration)

ModifyHeartbeatInterval - should only be used for testing. Resets the heartbeat ticker.

func (*Service) RegisterUserClient

func (s *Service) RegisterUserClient(userID string, protonClient *proton.Client, telemetryService *telemetry.Service)

func (*Service) Run

func (s *Service) Run(settingsGetter settingsGetter)

Run starts the observability service goroutine. The function also sets some utility functions to a helper struct aimed at differentiating the amount of users sending metric updates.

func (*Service) Stop

func (s *Service) Stop()

Jump to

Keyboard shortcuts

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