otel: go.opentelemetry.io/otel/exporter/metric/prometheus Index | Files

package prometheus

import "go.opentelemetry.io/otel/exporter/metric/prometheus"

Index

Package Files

prometheus.go sanitize.go

func InstallNewPipeline Uses

func InstallNewPipeline(config Config) (*push.Controller, http.HandlerFunc, error)

InstallNewPipeline instantiates a NewExportPipeline and registers it globally. Typically called as:

pipeline, hf, err := prometheus.InstallNewPipeline(prometheus.Config{...})

if err != nil {
	...
}
http.HandleFunc("/metrics", hf)
defer pipeline.Stop()
... Done

func NewExportPipeline Uses

func NewExportPipeline(config Config) (*push.Controller, http.HandlerFunc, error)

NewExportPipeline sets up a complete export pipeline with the recommended setup, chaining a NewRawExporter into the recommended selectors and batchers.

type Config Uses

type Config 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

    // DefaultSummaryQuantiles is the default summary quantiles
    // to use. Use nil to specify the system-default summary quantiles.
    DefaultSummaryQuantiles []float64

    // OnError is a function that handle errors that may occur while exporting metrics.
    // TODO: This should be refactored or even removed once we have a better error handling mechanism.
    OnError func(error)
}

Config is a set of configs for the tally reporter.

type Exporter Uses

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

Exporter is an implementation of metric.Exporter that sends metrics to Prometheus.

func NewRawExporter Uses

func NewRawExporter(config Config) (*Exporter, error)

NewRawExporter returns a new prometheus exporter for prometheus metrics for use in a pipeline.

func (*Exporter) Export Uses

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

Export exports the provide metric record to prometheus.

func (*Exporter) ServeHTTP Uses

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

Package prometheus imports 16 packages (graph) and is imported by 1 packages. Updated 2020-02-19. Refresh now. Tools for package owners.