package module
v0.21.0 Latest Latest

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 15 Imported by: 36


OpenTelemetry-Go Prometheus Exporter

OpenTelemetry Prometheus exporter


go get -u



Package prometheus provices an OpenTelemetry metrics exporter for Prometheus.

Deprecated: Use Prometheus exporter in package

This package is frozen and no new functionality will be added.



This section is empty.


View Source
var ErrUnsupportedAggregator = fmt.Errorf("unsupported aggregator type")

ErrUnsupportedAggregator is returned for unrepresentable aggregator types (e.g., exact).


This section is empty.


type Config

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

	// DefaultHistogramBoundaries defines the default histogram bucket
	// boundaries.
	DefaultHistogramBoundaries []float64

Config is a set of configs for the tally reporter.

type Exporter

type Exporter struct {
	// contains filtered or unexported fields

Exporter supports Prometheus pulls. It does not implement the sdk/export/metric.Exporter interface--instead it creates a pull controller and reads the latest checkpointed data on-scrape.

func New added in v0.21.0

func New(config Config, controller *controller.Controller) (*Exporter, error)

New returns a new Prometheus exporter using the configured metric controller. See controller.New().

func (*Exporter) Controller added in v0.6.0

func (e *Exporter) Controller() *controller.Controller

Controller returns the controller object that coordinates collection for the SDK.

func (*Exporter) ExportKindFor added in v0.7.0

func (e *Exporter) ExportKindFor(desc *metric.Descriptor, kind aggregation.Kind) export.ExportKind

ExportKindFor implements ExportKindSelector.

func (*Exporter) MeterProvider added in v0.12.0

func (e *Exporter) MeterProvider() metric.MeterProvider

MeterProvider returns the MeterProvider of this exporter.

func (*Exporter) ServeHTTP

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

ServeHTTP implements http.Handler.

Jump to

Keyboard shortcuts

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