Documentation ¶
Overview ¶
Package prom2cloudwatch provides a bridge to push Prometheus metrics to AWS CloudWatch
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bridge ¶
type Bridge struct {
// contains filtered or unexported fields
}
Bridge pushes metrics to AWS Cloudwatch
func NewBridge ¶
NewBridge initializes and returns a pointer to a Bridge using the supplied configuration, or an error if there is a problem with the configuration
type Config ¶
type Config struct { // Required. The Prometheus namespace/prefix to scrape. Each Bridge only supports 1 prefix. // If multiple prefixes are required, multiple Bridges must be used. PrometheusNamespace string // Required. The CloudWatch namespace under which metrics should be published CloudWatchNamespace string // Required. The AWS Region to use CloudWatchRegion string // The frequency with which metrics should be published to Cloudwatch. Default: 15s Interval time.Duration // Timeout for sending metrics to Cloudwatch. Default: 1s Timeout time.Duration // Custom HTTP Client to use with the Cloudwatch API. Default: http.Client{} // If Config.Timeout is supplied, it will override any timeout defined on // the supplied http.Client Client *http.Client // Logger that messages are written to. Default: nil Logger Logger // The Gatherer to use for metrics. Default: prometheus.DefaultGatherer Gatherer prometheus.Gatherer // Only publish whitelisted metrics WhitelistOnly bool // List of metrics that should be published, causing all others to be ignored. // Config.WhitelistOnly must be set to true for this to take effect. Whitelist []string // List of metrics that should never be published. This setting overrides entries in Config.Whitelist Blacklist []string }
Config defines configuration options for Bridge
type Logger ¶
type Logger interface {
Println(v ...interface{})
}
Logger is the minimal interface Bridge needs for logging. Note that log.Logger from the standard library implements this interface, and it is easy to implement by custom loggers, if they don't do so already anyway. Taken from https://github.com/prometheus/client_golang/blob/master/prometheus/graphite/bridge.go