exporter

package
v0.0.0-...-df27b73 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2018 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudMonitoringExporter

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

CloudMonitoringExporter exports metrics collected from nginx access logs to custom Stackdriver metrics. Only HTTP response code counts are currently supported.

func NewCloudMonitoringExporter

func NewCloudMonitoringExporter(project string, resourceLabels map[string]string, service *monitoring.Service) *CloudMonitoringExporter

NewCloudMonitoringExporter creates a new CloudMonitoringExporter configured to export metrics for the provided project / resource.

func (*CloudMonitoringExporter) CreateMetrics

func (e *CloudMonitoringExporter) CreateMetrics() error

CreateMetrics creates the custom Stackdriver metrics written by CloudMonitoringExporter. It is assumed that this will have been called at least once before the exporter is actually used (e.g. by calling IncrementStatusCounts).

func (*CloudMonitoringExporter) IncrementStatusCounter

func (e *CloudMonitoringExporter) IncrementStatusCounter(counts map[string]int64) error

IncrementStatusCounter increments internal HTTP response status counters by the provided map of deltas and writes the updated cumulative values to Stackdriver.

func (*CloudMonitoringExporter) ReplaceStatusCounter

func (e *CloudMonitoringExporter) ReplaceStatusCounter(c counter.CounterMetricT)

ReplaceStatusCounter replaces the existing CounterMetricT for the status counter metric with a different one. For use in tests.

func (*CloudMonitoringExporter) StatusCounterResetTime

func (e *CloudMonitoringExporter) StatusCounterResetTime() time.Time

StatusCounterResetTime returnes the reset time of the response status counter metric.

type ExporterT

type ExporterT interface {
	IncrementStatusCounter(map[string]int64) error
	StatusCounterResetTime() time.Time
}

ExporterT defines the interface implemented by CloudMonitoringExporter. For use in mocks.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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