package prometheus

Import Path
	contrib.go.opencensus.io/exporter/prometheus (on go.dev)

Dependency Relation
	imports 12 packages, and imported by one package

Involved Source Files Package prometheus contains a Prometheus exporter that supports exporting OpenCensus views as Prometheus metrics. sanitize.go
Code Examples package main import ( "contrib.go.opencensus.io/exporter/prometheus" "log" "net/http" ) func main() { exporter, err := prometheus.NewExporter(prometheus.Options{}) if err != nil { log.Fatal(err) } // Serve the scrape endpoint on port 9999. http.Handle("/metrics", exporter) log.Fatal(http.ListenAndServe(":9999", nil)) }
Package-Level Type Names (total 5, in which 2 are exported)
/* sort exporteds by: | */
Exporter exports stats to Prometheus, users need to register the exporter as an http.Handler to be able to export. 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 a Counter Metric, DistributionData will be a Histogram Metric. Deprecated in lieu of metricexport.Reader interface. ServeHTTP serves the Prometheus endpoint. *T : go.opencensus.io/stats/view.Exporter *T : net/http.Handler func NewExporter(o Options) (*Exporter, error)
Options contains options for configuring the exporter. // ConstLabels will be set as labels on all views. Namespace string OnError func(err error) Registry *prometheus.Registry func NewExporter(o Options) (*Exporter, error)
Package-Level Functions (total 10, in which 1 are exported)
NewExporter returns an exporter that exports stats to Prometheus.
Package-Level Constants (only one, which is unexported)