monitoring

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmitRequest

type EmitRequest struct {
	ActionIdentifier string // used for metrics
	Message          string // used for logs
	EntityIdentifier string
	Layer            ServiceLayer
	LayerSubtype     string
	Type             EmitType
	Data             interface{}
	ExtraData        map[string]string
	Error            error
}

type EmitType

type EmitType string
const (
	EmitTypeError   EmitType = "error"
	EmitTypeWarn    EmitType = "warn"
	EmitTypeInfo    EmitType = "info"
	EmitTypeSuccess EmitType = "success"
)

type Implementation

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

func New

func New(params Params) (*Implementation, error)

func (*Implementation) Emit

func (i *Implementation) Emit(req EmitRequest)

type MetricsProvider

type MetricsProvider string
const (
	DATADOG_METRICS_PROVIDER MetricsProvider = "datadog"
)

type MonitoringConfig

type MonitoringConfig struct {
	LoggingEnabled  bool            `yaml:"logging-enabled"`
	LoggingLevel    EmitType        `yaml:"logging-level"`
	MetricsEnabled  bool            `yaml:"metrics-enabled"`
	MetricsLevel    EmitType        `yaml:"metrics-level"`
	MetricsProvider MetricsProvider `yaml:"metrics-provider"`
	DatadogAddr     string          `yaml:"datadog-addr"`
}

type Params

type Params struct {
	fx.In
	Logger    *zap.Logger
	Provider  config.Provider
	Lifecycle fx.Lifecycle
}

type ServiceLayer

type ServiceLayer string
const (
	ModuleServiceLayer     ServiceLayer = "module"
	RepositoryServiceLayer ServiceLayer = "repository"
	ProtocolServiceLayer   ServiceLayer = "protocol"
	EventServiceLayer      ServiceLayer = "event"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳