prometheus

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: Apache-2.0 Imports: 9 Imported by: 2

README

OpenTelemetry-Go Prometheus Exporter

OpenTelemetry Prometheus exporter

Installation

go get -u go.opentelemetry.io/exporter/metric/prometheus

Documentation

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 is an implementation of metric.Exporter that sends metrics to Prometheus.

func NewExporter

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

NewExporter returns a new prometheus exporter for prometheus metrics.

func (*Exporter) Export

func (e *Exporter) Export(_ context.Context, checkpointSet export.CheckpointSet) error

Export exports the provide metric record to prometheus.

func (*Exporter) ServeHTTP

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

type MeasureAggregation

type MeasureAggregation int
const (
	Histogram MeasureAggregation = iota
	Summary
)

type Options

type Options struct {
	// Registry is the prometheus registry that will be used as the default Registerer and
	// Gatherer if these are not specified.
	//
	// If not set a new empty Registry is created.
	Registry *prometheus.Registry

	// Registerer is the prometheus registerer to register
	// metrics with.
	//
	// If not specified the Registry will be used as default.
	Registerer prometheus.Registerer

	// Gatherer is the prometheus gatherer to gather
	// metrics with.
	//
	// If not specified the Registry will be used as default.
	Gatherer prometheus.Gatherer

	// DefaultHistogramBuckets is the default histogram buckets
	// to use. Use nil to specify the system-default histogram buckets.
	DefaultHistogramBuckets []float64

	// DefaultSummaryObjectives is the default summary objectives
	// to use. Use nil to specify the system-default summary objectives.
	DefaultSummaryObjectives map[float64]float64

	// MeasureAggregation defines how metric.Measure are exported.
	// Possible values are 'Histogram' or 'Summary'.
	// The default export representation for measures is Histograms.
	MeasureAggregation MeasureAggregation
}

Options is a set of options for the tally reporter.

Jump to

Keyboard shortcuts

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