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.