Documentation
¶
Index ¶
Constants ¶
const ( KeyProjectID = "project_id" KeyLocation = "location" KeyCluster = "cluster" KeyNamespace = "namespace" KeyJob = "job" KeyInstance = "instance" )
The target label keys used for the Prometheus monitored resource.
const ( ClientName = "gpe-collector" Version = "" )
ClientName and Version are used to identify to User Agent. TODO(maxamin): automate versioning.
Variables ¶
This section is empty.
Functions ¶
func InitGlobal ¶
func InitGlobal(logger log.Logger, reg prometheus.Registerer, opts ExporterOpts) (err error)
InitGlobal initializes the global instance of the GCM exporter.
Types ¶
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter converts Prometheus samples into Cloud Monitoring samples and exports them.
func New ¶
func New(logger log.Logger, reg prometheus.Registerer, opts ExporterOpts) (*Exporter, error)
New returns a new Cloud Monitoring Exporter.
func (*Exporter) ApplyConfig ¶
ApplyConfig updates the exporter state to the given configuration. Must be called at least once before Export() can be used.
type ExporterOpts ¶
type ExporterOpts struct { // Whether to disable exporting of metrics. Disable bool // GCM API endpoint to send metric data to. Endpoint string // Credentials file for authentication with the GCM API. CredentialsFile string // Disable authentication (for debugging purposes). DisableAuth bool // Default monitored resource fields set on exported data. ProjectID string Location string Cluster string // Maximum batch size to use when sending data to the GCM API. The default // maximum will be used if set to 0. BatchSize uint // Prefix under which metrics are written to GCM. MetricTypePrefix string }
ExporterOpts holds options for an exporter.
func NewFlagOptions ¶
func NewFlagOptions(a *kingpin.Application) *ExporterOpts
NewFlagOptions returns new exporter options that are populated through flags registered in the given application.
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage provides a stateful wrapper around an Exporter that implements Prometheus's storage interface (Appendable).
For performance reasons Exporter is optimized to be tightly integrate with Prometheus's storage. This makes it rely on external state (series ID to label mapping). For use cases where a full Prometheus storage engine is not present (e.g. rule evaluation service), Storage acts as a simple drop-in replacement that directly manages the state required by Exporter.
func NewStorage ¶
func NewStorage(logger log.Logger, reg prometheus.Registerer, opts ExporterOpts) (*Storage, error)
NewStorage returns a new Prometheus storage that's exporting data via an Exporter.