metrics

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package metrics handles sending metrics about resource providers to CloudWatch

Index

Constants

View Source
const (
	// MetricNameSpaceRoot is the Metric name space root.
	MetricNameSpaceRoot = "AWS/CloudFormation"
	// MetricNameHanderException  is a metric type.
	MetricNameHanderException = "HandlerException"
	// MetricNameHanderDuration is a metric type.
	MetricNameHanderDuration = "HandlerInvocationDuration"
	// MetricNameHanderInvocationCount is a metric type.
	MetricNameHanderInvocationCount = "HandlerInvocationCount"
	// DimensionKeyAcionType  is the Action key in the dimension.
	DimensionKeyAcionType = "Action"
	// DimensionKeyExceptionType  is the ExceptionType in the dimension.
	DimensionKeyExceptionType = "ExceptionType"
	// DimensionKeyResourceType  is the ResourceType in the dimension.
	DimensionKeyResourceType = "ResourceType"
	// ServiceInternalError ...
	ServiceInternalError string = "ServiceInternal"
)

Variables

This section is empty.

Functions

func ResourceTypeName added in v0.1.3

func ResourceTypeName(t string) string

ResourceTypeName returns a type name by removing (::) and replaing with (/)

Example

r := metrics.ResourceTypeName("AWS::Service::Resource")

// Will return "AWS/Service/Resource"

Types

type Publisher

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

A Publisher represents an object that publishes metrics to AWS Cloudwatch.

func New

func New(client cloudwatchiface.CloudWatchAPI, resType string) *Publisher

New creates a new Publisher.

func (*Publisher) PublishDurationMetric

func (p *Publisher) PublishDurationMetric(date time.Time, action string, secs float64)

PublishDurationMetric publishes an duration metric.

A duration metric is the timing of something.

func (*Publisher) PublishExceptionMetric

func (p *Publisher) PublishExceptionMetric(date time.Time, action string, e error)

PublishExceptionMetric publishes an exception metric.

func (*Publisher) PublishInvocationMetric

func (p *Publisher) PublishInvocationMetric(date time.Time, action string)

PublishInvocationMetric publishes an invocation metric.

Jump to

Keyboard shortcuts

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