Back to godoc.org
bosun.org / cloudwatch

Package cloudwatch

v0.0.0-...-8a7cd2d
Latest Go to latest

The latest major version is .

Published: Jun 18, 2020 | License: MIT | Module: bosun.org

Overview

Package cloudwatch defines structures for interacting with Cloudwatch Metrics.

Index

Constants

const DefaultConcurrency = 4
const DefaultExpansionLimit = 500
const DefaultPageLimit = 10

Variables

var ErrExpansionLimit = errors.New("Hit dimension expansion limit")
var ErrInvalidPeriod = errors.New("Period must be greater than 0")
var ErrPagingLimit = errors.New("Hit the page limit when retrieving metrics")

type Context

type Context interface {
	Query(*Request) (Response, error)
	LookupDimensions(request *LookupRequest) ([][]Dimension, error)
	GetExpansionLimit() int
	GetPagesLimit() int
	GetConcurrency() int
}

Context is the interface for querying CloudWatch.

func GetContext

func GetContext() Context

func GetContextWithProvider

func GetContextWithProvider(p ProfileProvider) Context

type DataPoint

type DataPoint struct {
	Aggregator string
	Timestamp  string
	Unit       string
}

type Dimension

type Dimension struct {
	Name  string
	Value string
}

func (Dimension) String

func (d Dimension) String() string

type DimensionList

type DimensionList struct {
	Groups [][]Dimension
}

type DimensionSet

type DimensionSet map[string]bool

type LookupRequest

type LookupRequest struct {
	Region     string
	Namespace  string
	Metric     string
	Dimensions [][]Dimension
	Profile    string
}

type ProfileProvider

type ProfileProvider interface {
	NewProfile(name, region string) cwi.CloudWatchAPI
}

type Request

type Request struct {
	Start           *time.Time
	End             *time.Time
	Region          string
	Namespace       string
	Metric          string
	Period          int64
	Statistic       string
	DimensionString string
	Dimensions      [][]Dimension
	Profile         string
}

Request holds query objects. Currently only absolute times are supported.

func (*Request) CacheKey

func (r *Request) CacheKey() string

type Response

type Response struct {
	Raw    cw.GetMetricDataOutput
	TagSet map[string]opentsdb.TagSet
}

type Series

type Series struct {
	Datapoints []DataPoint
	Label      string
}

type Wildcards

type Wildcards map[string]string

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier