prometheus

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package prometheus contains the Prometheus exporters for Stackdriver Monitoring.

Please note that this exporter is currently work in progress and not complete.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

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

Exporter exports stats to Prometheus, users need to register the exporter as an http.Handler to be able to export.

func NewExporter

func NewExporter(o Options) (*Exporter, error)

NewExporter returns an exporter that exports stats to Prometheus. Only one exporter should exist per instance

func (*Exporter) ExportView

func (e *Exporter) ExportView(vd *stats.ViewData)

ExportView exports to the Prometheus if view data has one or more rows. Each OpenCensus AggregationData will be converted to corresponding Prometheus Metric: SumData will be converted to Untyped Metric, CountData will be Counter Metric, DistributionData will be Histogram Metric, and MeanData will be Summary Metric. Please note the Summary Metric from MeanData does not have any quantiles.

func (*Exporter) ServeHTTP

func (e *Exporter) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves the Prometheus endpoint.

type Options

type Options struct {
	Namespace string
	OnError   func(err error)
}

Options contains options for configuring the exporter.

Jump to

Keyboard shortcuts

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