metrics

package
v0.0.0-...-45a9bcf Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// OutOfMemoryMetric is the name of the out of memory enhanced Lambda metric
	OutOfMemoryMetric = "aws.lambda.enhanced.out_of_memory"

	// ErrorsMetric is the name of the errors enhanced Lambda metric
	ErrorsMetric = "aws.lambda.enhanced.errors"
)

Variables

This section is empty.

Functions

func ContainsOutOfMemoryLog

func ContainsOutOfMemoryLog(logString string) bool

ContainsOutOfMemoryLog determines whether a runtime specific out of memory string is found in the log line

func GenerateCPUUtilizationEnhancedMetrics

func GenerateCPUUtilizationEnhancedMetrics(args GenerateCPUUtilizationEnhancedMetricArgs)

func GenerateEnhancedMetricsFromReportLog

func GenerateEnhancedMetricsFromReportLog(args GenerateEnhancedMetricsFromReportLogArgs)

GenerateEnhancedMetricsFromReportLog generates enhanced metrics from a LogTypePlatformReport log message

func GenerateEnhancedMetricsFromRuntimeDoneLog

func GenerateEnhancedMetricsFromRuntimeDoneLog(args GenerateEnhancedMetricsFromRuntimeDoneLogArgs)

GenerateEnhancedMetricsFromRuntimeDoneLog generates the runtime duration metric

func GenerateOutOfMemoryEnhancedMetrics

func GenerateOutOfMemoryEnhancedMetrics(time time.Time, tags []string, demux aggregator.Demultiplexer)

GenerateOutOfMemoryEnhancedMetrics generates enhanced metrics specific to an out of memory error

func SendASMInvocationEnhancedMetric

func SendASMInvocationEnhancedMetric(tags []string, demux aggregator.Demultiplexer)

SendASMInvocationEnhancedMetric sends an enhanced metric representing an appsec supported invocation at the current time Metric is sent even if enhanced metrics are disabled

func SendCPUEnhancedMetrics

func SendCPUEnhancedMetrics(cpuOffsetData *proc.CPUData, uptimeOffset float64, tags []string, demux aggregator.Demultiplexer)

SendCPUEnhancedMetrics sends CPU enhanced metrics for the invocation

func SendErrorsEnhancedMetric

func SendErrorsEnhancedMetric(tags []string, t time.Time, demux aggregator.Demultiplexer)

SendErrorsEnhancedMetric sends an enhanced metric representing an error at a given time

func SendFailoverReasonMetric

func SendFailoverReasonMetric(tags []string, demux aggregator.Demultiplexer)

func SendInvocationEnhancedMetric

func SendInvocationEnhancedMetric(tags []string, demux aggregator.Demultiplexer)

SendInvocationEnhancedMetric sends an enhanced metric representing an invocation at the current time

func SendNetworkEnhancedMetrics

func SendNetworkEnhancedMetrics(networkOffsetData *proc.NetworkData, tags []string, demux aggregator.Demultiplexer)

func SendOutOfMemoryEnhancedMetric

func SendOutOfMemoryEnhancedMetric(tags []string, t time.Time, demux aggregator.Demultiplexer)

SendOutOfMemoryEnhancedMetric sends an enhanced metric representing a function running out of memory at a given time

func SendProcessEnhancedMetrics

func SendProcessEnhancedMetrics(sendMetrics chan bool, tags []string, metricAgent *ServerlessMetricAgent)

func SendTimeoutEnhancedMetric

func SendTimeoutEnhancedMetric(tags []string, demux aggregator.Demultiplexer)

SendTimeoutEnhancedMetric sends an enhanced metric representing a timeout at the current time

func SendTmpEnhancedMetrics

func SendTmpEnhancedMetrics(sendMetrics chan bool, tags []string, metricAgent *ServerlessMetricAgent)

Types

type DogStatsDFactory

type DogStatsDFactory interface {
	NewServer(aggregator.Demultiplexer) (dogstatsdServer.ServerlessDogstatsd, error)
}

DogStatsDFactory allows create a new DogStatsD server

type GenerateCPUUtilizationEnhancedMetricArgs

type GenerateCPUUtilizationEnhancedMetricArgs struct {
	IndividualCPUIdleTimes       map[string]float64
	IndividualCPUIdleOffsetTimes map[string]float64
	IdleTimeMs                   float64
	IdleTimeOffsetMs             float64
	UptimeMs                     float64
	UptimeOffsetMs               float64
	Tags                         []string
	Demux                        aggregator.Demultiplexer
	Time                         float64
}

type GenerateEnhancedMetricsFromReportLogArgs

type GenerateEnhancedMetricsFromReportLogArgs struct {
	InitDurationMs   float64
	DurationMs       float64
	BilledDurationMs int
	MemorySizeMb     int
	MaxMemoryUsedMb  int
	RuntimeStart     time.Time
	RuntimeEnd       time.Time
	T                time.Time
	Tags             []string
	Demux            aggregator.Demultiplexer
}

GenerateEnhancedMetricsFromReportLogArgs provides the arguments required for the GenerateEnhancedMetricsFromReportLog func

type GenerateEnhancedMetricsFromRuntimeDoneLogArgs

type GenerateEnhancedMetricsFromRuntimeDoneLogArgs struct {
	Start            time.Time
	End              time.Time
	ResponseLatency  float64
	ResponseDuration float64
	ProducedBytes    float64
	Tags             []string
	Demux            aggregator.Demultiplexer
}

GenerateEnhancedMetricsFromRuntimeDoneLogArgs are the arguments required for the GenerateEnhancedMetricsFromRuntimeDoneLog func

type MetricConfig

type MetricConfig struct {
}

MetricConfig abstacts the config package

func (*MetricConfig) GetMultipleEndpoints

func (m *MetricConfig) GetMultipleEndpoints() (map[string][]string, error)

GetMultipleEndpoints returns the api keys per domain specified in the main agent config

type MetricDogStatsD

type MetricDogStatsD struct {
}

MetricDogStatsD abstracts the DogStatsD package

func (*MetricDogStatsD) NewServer

NewServer returns a running DogStatsD server

type MultipleEndpointConfig

type MultipleEndpointConfig interface {
	GetMultipleEndpoints() (map[string][]string, error)
}

MultipleEndpointConfig abstracts the config package

type ServerlessMetricAgent

type ServerlessMetricAgent struct {
	Tagger tagger.Component
	Demux  aggregator.Demultiplexer

	SketchesBucketOffset time.Duration
	// contains filtered or unexported fields
}

ServerlessMetricAgent represents the DogStatsD server and the aggregator

func (*ServerlessMetricAgent) Flush

func (c *ServerlessMetricAgent) Flush()

Flush triggers a DogStatsD flush

func (*ServerlessMetricAgent) GetExtraTags

func (c *ServerlessMetricAgent) GetExtraTags() []string

GetExtraTags gets extra tags

func (*ServerlessMetricAgent) IsReady

func (c *ServerlessMetricAgent) IsReady() bool

IsReady indicates whether or not the DogStatsD server is ready

func (*ServerlessMetricAgent) SetExtraTags

func (c *ServerlessMetricAgent) SetExtraTags(tagArray []string)

SetExtraTags sets extra tags on the DogStatsD server

func (*ServerlessMetricAgent) Start

func (c *ServerlessMetricAgent) Start(forwarderTimeout time.Duration, multipleEndpointConfig MultipleEndpointConfig, dogstatFactory DogStatsDFactory)

Start starts the DogStatsD agent

func (*ServerlessMetricAgent) Stop

func (c *ServerlessMetricAgent) Stop()

Stop stops the DogStatsD server

Jump to

Keyboard shortcuts

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