metric

package
v0.0.0-...-3bd2c62 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidCompression = errors.New("not a valid Compression")
View Source
var ErrInvalidExporter = errors.New("not a valid Exporter")
View Source
var ErrInvalidProtocol = errors.New("not a valid Protocol")

Functions

func NewMeterProvider

func NewMeterProvider(ctx context.Context, options MeterProviderOptions) (*metric.MeterProvider, func())

func NewReaders

func NewReaders(ctx context.Context, options ReadersOptions) ([]metric.Reader, error)

Types

type Compression

type Compression string

Compression defines the compression type to use on OTLP. ENUM(none, gzip)

const (
	// CompressionNone is a Compression of type none.
	CompressionNone Compression = "none"
	// CompressionGzip is a Compression of type gzip.
	CompressionGzip Compression = "gzip"
)

func ParseCompression

func ParseCompression(name string) (Compression, error)

ParseCompression attempts to convert a string to a Compression.

func (Compression) IsValid

func (x Compression) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (Compression) String

func (x Compression) String() string

String implements the Stringer interface.

type Endpoint

type Endpoint url.URL

Endpoint represents a URL endpoint for metric data export.

type ExportInterval

type ExportInterval time.Duration

ExportInterval represents the interval between metric exports.

type Exporter

type Exporter string

Exporter defines a metric exporter type responsible for delivering metric data to external receivers. ENUM(otlp, none, prometheus, logging)

const (
	// ExporterOtlp is a Exporter of type otlp.
	ExporterOtlp Exporter = "otlp"
	// ExporterNone is a Exporter of type none.
	ExporterNone Exporter = "none"
	// ExporterPrometheus is a Exporter of type prometheus.
	ExporterPrometheus Exporter = "prometheus"
	// ExporterLogging is a Exporter of type logging.
	ExporterLogging Exporter = "logging"
)

func ParseExporter

func ParseExporter(name string) (Exporter, error)

ParseExporter attempts to convert a string to a Exporter.

func (Exporter) IsValid

func (x Exporter) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (Exporter) String

func (x Exporter) String() string

String implements the Stringer interface.

type Exporters

type Exporters []Exporter

Exporters is a slice of Exporter, representing a collection of metric exporters.

type MeterProviderOptions

type MeterProviderOptions struct {
	Resource       *resource.Resource
	Readers        []metric.Reader
	ExportInterval ExportInterval
	Logger         logr.Logger
}

type Protocol

type Protocol string

Protocol defines the encoding of telemetry data and the protocol used to exchange metric data between the client and the server. ENUM(grpc, http/protobuf)

const (
	// ProtocolGrpc is a Protocol of type grpc.
	ProtocolGrpc Protocol = "grpc"
	// ProtocolHttpProtobuf is a Protocol of type http/protobuf.
	ProtocolHttpProtobuf Protocol = "http/protobuf"
)

func ParseProtocol

func ParseProtocol(name string) (Protocol, error)

ParseProtocol attempts to convert a string to a Protocol.

func (Protocol) IsValid

func (x Protocol) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (Protocol) String

func (x Protocol) String() string

String implements the Stringer interface.

type ReadersOptions

type ReadersOptions struct {
	Exporters      Exporters
	Endpoint       Endpoint
	Compression    Compression
	ExportInterval ExportInterval
	Protocol       Protocol
}

Jump to

Keyboard shortcuts

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