otlpmetric

package module
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package otlpmetric provides an OpenTelemetry metric Exporter that can be used with PeriodicReader. It transforms metricdata into OTLP and transmits the transformed data to OTLP receivers. The Exporter is configurable to use different Clients, each using a distinct transport protocol to communicate to an OTLP receiving endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(client Client) metric.Exporter

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.

Types

type Client

type Client interface {
	// 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.

Directories

Path Synopsis
internal
transform
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.

Jump to

Keyboard shortcuts

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