Documentation ¶
Overview ¶
Package cloudwatch scopes CloudWatch-specific utiltities for Sparta
Index ¶
- func RegisterLambdaUtilizationMetricPublisher(customDimensionMap map[string]string)
- type EmbeddedMetric
- func (em *EmbeddedMetric) MarshalJSON() ([]byte, error)
- func (em *EmbeddedMetric) NewMetricDirective(namespace string, dimensions map[string]string) *MetricDirective
- func (em *EmbeddedMetric) Publish(additionalProperties map[string]interface{})
- func (em *EmbeddedMetric) PublishToSink(additionalProperties map[string]interface{}, sink io.Writer)
- func (em *EmbeddedMetric) WithProperty(key string, value interface{}) *EmbeddedMetric
- type MetricDirective
- type MetricUnit
- type MetricValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterLambdaUtilizationMetricPublisher ¶
RegisterLambdaUtilizationMetricPublisher installs a periodic task to publish the current system metrics to CloudWatch Metrics.
Types ¶
type EmbeddedMetric ¶ added in v1.13.0
type EmbeddedMetric struct {
// contains filtered or unexported fields
}
EmbeddedMetric represents an embedded metric that should be published
func NewEmbeddedMetric ¶ added in v1.13.0
func NewEmbeddedMetric() (*EmbeddedMetric, error)
NewEmbeddedMetric returns a new fully initialized embedded metric. Callers should populate the Fields
func NewEmbeddedMetricWithProperties ¶ added in v1.13.0
func NewEmbeddedMetricWithProperties(props map[string]interface{}) (*EmbeddedMetric, error)
NewEmbeddedMetricWithProperties returns an EmbeddedMetric with the user supplied properties
func (*EmbeddedMetric) MarshalJSON ¶ added in v1.13.0
func (em *EmbeddedMetric) MarshalJSON() ([]byte, error)
MarshalJSON is a custom marshaller to ensure that the marshalled headers are always lowercase
func (*EmbeddedMetric) NewMetricDirective ¶ added in v1.13.0
func (em *EmbeddedMetric) NewMetricDirective(namespace string, dimensions map[string]string) *MetricDirective
NewMetricDirective returns an initialized MetricDirective that's included in the EmbeddedMetric instance
func (*EmbeddedMetric) Publish ¶ added in v1.13.0
func (em *EmbeddedMetric) Publish(additionalProperties map[string]interface{})
Publish the metric to the logfile
func (*EmbeddedMetric) PublishToSink ¶ added in v1.13.0
func (em *EmbeddedMetric) PublishToSink(additionalProperties map[string]interface{}, sink io.Writer)
PublishToSink writes the EmbeddedMetric info to the provided writer
func (*EmbeddedMetric) WithProperty ¶ added in v1.13.0
func (em *EmbeddedMetric) WithProperty(key string, value interface{}) *EmbeddedMetric
WithProperty is a fluent builder to add property to the EmbeddedMetric state. Properties should be used for high cardintality values that need to be searchable, but not treated as independent metrics
type MetricDirective ¶ added in v1.13.0
type MetricDirective struct { // Dimensions corresponds to the JSON schema field "Dimensions". Dimensions map[string]string // Metrics corresponds to the JSON schema field "Metrics". Metrics map[string]MetricValue // contains filtered or unexported fields }
MetricDirective is the directive that encapsulates a metric
type MetricUnit ¶ added in v1.13.0
type MetricUnit string
MetricUnit Represents a MetricUnit type
const ( // UnitSeconds Seconds UnitSeconds MetricUnit = "Seconds" // UnitMicroseconds Microseconds UnitMicroseconds MetricUnit = "Microseconds" // UnitMilliseconds Milliseconds UnitMilliseconds MetricUnit = "Milliseconds" // UnitBytes Bytes UnitBytes MetricUnit = "Bytes" //UnitKilobytes Kilobytes UnitKilobytes MetricUnit = "Kilobytes" //UnitMegabytes Megabytes UnitMegabytes MetricUnit = "Megabytes" //UnitGigabytes Gigabytes UnitGigabytes MetricUnit = "Gigabytes" //UnitTerabytes Terabytes UnitTerabytes MetricUnit = "Terabytes" //UnitBits Bits UnitBits MetricUnit = "Bits" //UnitKilobits Kilobits UnitKilobits MetricUnit = "Kilobits" //UnitMegabits Megabits UnitMegabits MetricUnit = "Megabits" //UnitGigabits Gigabits UnitGigabits MetricUnit = "Gigabits" //UnitTerabits Terabits UnitTerabits MetricUnit = "Terabits" //UnitPercent Percent UnitPercent MetricUnit = "Percent" //UnitCount Count UnitCount MetricUnit = "Count" //UnitBytesPerSecond BytesPerSecond UnitBytesPerSecond MetricUnit = "Bytes/Second" //UnitKilobytesPerSecond KilobytesPerSecond UnitKilobytesPerSecond MetricUnit = "Kilobytes/Second" //UnitMegabytesPerSecond MegabytesPerSecond UnitMegabytesPerSecond MetricUnit = "Megabytes/Second" //UnitGigabytesPerSecond GigabytesPerSecond UnitGigabytesPerSecond MetricUnit = "Gigabytes/Second" //UnitTerabytesPerSecond TerabytesPerSecond UnitTerabytesPerSecond MetricUnit = "Terabytes/Second" //UnitBitsPerSecond BitsPerSecond UnitBitsPerSecond MetricUnit = "Bits/Second" //UnitKilobitsPerSecond KilobitsPerSecond UnitKilobitsPerSecond MetricUnit = "Kilobits/Second" //UnitMegabitsPerSecond MegabitsPerSecond UnitMegabitsPerSecond MetricUnit = "Megabits/Second" //UnitGigabitsPerSecond GigabitsPerSecond UnitGigabitsPerSecond MetricUnit = "Gigabits/Second" //UnitTerabitsPerSecond TerabitsPerSecond UnitTerabitsPerSecond MetricUnit = "Terabits/Second" //UnitCountPerSecond CountPerSecond UnitCountPerSecond MetricUnit = "Count/Second" // UnitNone No units UnitNone MetricUnit = "None" )
type MetricValue ¶ added in v1.13.0
type MetricValue struct { Value interface{} Unit MetricUnit }
MetricValue represents a metric value