Documentation ¶
Overview ¶
Package internal provides common utilities for all otlpmetric exporters.
Deprecated: package internal exists for historical compatibility, it should not be used.
Index ¶
- func GetUserAgentHeader() string
- type Client
- type Exporter
- func (e *Exporter) Aggregation(k metric.InstrumentKind) metric.Aggregation
- func (e *Exporter) Export(ctx context.Context, rm *metricdata.ResourceMetrics) error
- func (e *Exporter) ForceFlush(ctx context.Context) error
- func (e *Exporter) Shutdown(ctx context.Context) error
- func (e *Exporter) Temporality(k metric.InstrumentKind) metricdata.Temporality
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetUserAgentHeader ¶ added in v0.38.0
func GetUserAgentHeader() string
GetUserAgentHeader returns an OTLP header value form "OTel OTLP Exporter Go/{{ .Version }}" https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/protocol/exporter.md#user-agent
Types ¶
type Client ¶
type Client interface { // Temporality returns the Temporality to use for an instrument kind. Temporality(metric.InstrumentKind) metricdata.Temporality // Aggregation returns the Aggregation to use for an instrument kind. Aggregation(metric.InstrumentKind) metric.Aggregation // UploadMetrics transmits metric data to an OTLP receiver. // // All retry logic must be handled by UploadMetrics alone, the Exporter // does not implement any retry logic. All returned errors are considered // unrecoverable. UploadMetrics(context.Context, *mpb.ResourceMetrics) error // ForceFlush flushes any metric data held by an Client. // // The deadline or cancellation of the passed context must be honored. An // appropriate error should be returned in these situations. ForceFlush(context.Context) error // Shutdown flushes all metric data held by a Client and closes any // connections it holds open. // // The deadline or cancellation of the passed context must be honored. An // appropriate error should be returned in these situations. // // Shutdown will only be called once by the Exporter. Once a return value // is received by the Exporter from Shutdown the Client will not be used // anymore. Therefore all computational resources need to be released // after this is called so the Client can be garbage collected. Shutdown(context.Context) error }
Client handles the transmission of OTLP data to an OTLP receiving endpoint.
type Exporter ¶ added in v0.40.0
type Exporter struct {
// contains filtered or unexported fields
}
Exporter exports metrics data as OTLP.
func New ¶
New return an Exporter that uses client to transmits the OTLP data it produces. The client is assumed to be fully started and able to communicate with its OTLP receiving endpoint.
func (*Exporter) Aggregation ¶ added in v0.40.0
func (e *Exporter) Aggregation(k metric.InstrumentKind) metric.Aggregation
Aggregation returns the Aggregation to use for an instrument kind.
func (*Exporter) Export ¶ added in v0.40.0
func (e *Exporter) Export(ctx context.Context, rm *metricdata.ResourceMetrics) error
Export transforms and transmits metric data to an OTLP receiver.
func (*Exporter) ForceFlush ¶ added in v0.40.0
ForceFlush flushes any metric data held by an exporter.
func (*Exporter) Shutdown ¶ added in v0.40.0
Shutdown flushes all metric data held by an exporter and releases any held computational resources.
func (*Exporter) Temporality ¶ added in v0.40.0
func (e *Exporter) Temporality(k metric.InstrumentKind) metricdata.Temporality
Temporality returns the Temporality to use for an instrument kind.
Directories ¶
Path | Synopsis |
---|---|
Package oconf provides common metric configuration types and functionality for all otlpmetric exporters.
|
Package oconf provides common metric configuration types and functionality for all otlpmetric exporters. |
Package otest provides common testing utilities for all otlpmetric exporters.
|
Package otest provides common testing utilities for all otlpmetric exporters. |
Package transform provides transformation functionality from the sdk/metric/metricdata data-types into OTLP data-types.
|
Package transform provides transformation functionality from the sdk/metric/metricdata data-types into OTLP data-types. |