package metricexport
Import Path
go.opencensus.io/metric/metricexport (on go.dev)
Dependency Relation
imports 7 packages, and imported by 3 packages
Involved Source Files
Package metricexport contains support for exporting metric data.
This is an EXPERIMENTAL package, and may change in arbitrary ways without
notice.
export.go
reader.go
Package-Level Type Names (total 5, all are exported)
Exporter is an interface that exporters implement to export the metric data.
( T) ExportMetrics(ctx context.Context, data []*metricdata.Metric) error
*contrib.go.opencensus.io/exporter/stackdriver.Exporter
*contrib.go.opencensus.io/exporter/prometheus.descExporter
*contrib.go.opencensus.io/exporter/prometheus.metricExporter
*contrib.go.opencensus.io/exporter/stackdriver.statsExporter
func NewIntervalReader(reader *Reader, exporter Exporter) (*IntervalReader, error)
func (*Reader).ReadAndExport(exporter Exporter)
IntervalReader periodically reads metrics from all producers registered
with producer manager and exports those metrics using provided
exporter. Call Reader.Stop() to stop the reader.
ReportingInterval it the time duration between two consecutive
metrics reporting. defaultReportingDuration is used if it is not set.
It cannot be set lower than minimumReportingDuration.
done chan bool
exporter Exporter
mu sync.RWMutex
quit chan bool
reader *Reader
timer *time.Ticker
Start starts the IntervalReader which periodically reads metrics from all
producers registered with global producer manager. If the reporting interval
is not set prior to calling this function then default reporting interval
is used.
Stop stops the reader from reading and exporting metrics.
Additional call to Stop are no-ops.
(*T) startInternal()
func NewIntervalReader(reader *Reader, exporter Exporter) (*IntervalReader, error)
Reader reads metrics from all producers registered
with producer manager and exports those metrics using provided
exporter.
sampler trace.Sampler
spanName string
ReadAndExport reads metrics from all producer registered with
producer manager and then exports them using provided exporter.
func NewReader(o ...ReaderOption) *Reader
func NewIntervalReader(reader *Reader, exporter Exporter) (*IntervalReader, error)
var golang.org/x/pkgsite/cmd/prober.metricReader *metricexport.Reader
ReaderOption apply changes to ReaderOptions.
func WithSpanName(spanName string) ReaderOption
func NewReader(o ...ReaderOption) *Reader
ReaderOptions contains options pertaining to metrics reader.
SpanName is the name used for span created to export metrics.
Package-Level Functions (total 3, all are exported)
NewIntervalReader creates a reader. Once started it periodically
reads metrics from all producers and exports them using provided exporter.
NewReader returns a reader configured with specified options.
WithSpanName makes new reader to use given span name when exporting metrics.
Package-Level Variables (total 6, none are exported)
Package-Level Constants (total 3, none are exported)
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |