Documentation
¶
Overview ¶
Package emf helps with AWS Embedded Metric Format.
Index ¶
- func DefaultUnixMilli() int64
- type DimensionSet
- type Metadata
- type Metric
- func (m *Metric) CloudWatchLogEvents() []types.InputLogEvent
- func (m *Metric) CloudWatchString() string
- func (m *Metric) Fprintln(w io.Writer)
- func (m *Metric) Println()
- func (m *Metric) Record(namespace string, metric MetricDefinition, dimensions map[string]string, ...)
- func (m *Metric) Render() []string
- func (m *Metric) Reset()
- type MetricDefinition
- type MetricDirective
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultUnixMilli ¶
func DefaultUnixMilli() int64
DefaultUnixMilli is default function used when Options.UnixMilli is left undefined.
Types ¶
type Metadata ¶
type Metadata struct {
CloudWatchMetrics []*MetricDirective `json:"CloudWatchMetrics"`
Timestamp int64 `json:"Timestamp"`
}
Metadata defines EMF Metadata.
type Metric ¶
type Metric struct {
// contains filtered or unexported fields
}
Metric holds full EMF metric context.
func (*Metric) CloudWatchLogEvents ¶
func (m *Metric) CloudWatchLogEvents() []types.InputLogEvent
CloudWatchLogEvents yields EMF metric as input for cloudwatch log events.
func (*Metric) CloudWatchString ¶
CloudWatchString yields EMF metric as cloudwatch string for aws cli.
func (*Metric) Record ¶
func (m *Metric) Record(namespace string, metric MetricDefinition, dimensions map[string]string, value int)
Record records a metric.
func (*Metric) Reset ¶
func (m *Metric) Reset()
Reset clears all defined metrics and dimensions. If in the previsou cycle you sent any metric what you won't update with Record() in the next cycle, use Reset() to clear all metrics before the next cycle. Otherwise those stale metrics will be sent again.
type MetricDefinition ¶
type MetricDefinition struct {
Name string `json:"Name"`
Unit string `json:"Unit,omitempty"`
StorageResolution int `json:"StorageResolution,omitempty"`
}
MetricDefinition defines EMF MetricDefinition.
type MetricDirective ¶
type MetricDirective struct {
Namespace string `json:"Namespace"`
Dimensions []DimensionSet `json:"Dimensions"`
Metrics []MetricDefinition `json:"Metrics"`
}
MetricDirective defines EMF MetricDirective.