metricx

package module
v0.0.0-...-763f2c4 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExporterProvider

type ExporterProvider interface {
	Exporter(ctx context.Context) (sdkmetric.Reader, error)
}

type GRPCOptions

type GRPCOptions struct {
	Endpoint               string
	Insecure               bool
	TLSConfig              *tls.Config
	Headers                map[string]string
	Compressor             string
	DialOptions            []grpc.DialOption
	GRPCConn               *grpc.ClientConn
	ReconnectionPeriod     time.Duration
	Retry                  *otlpmetricgrpc.RetryConfig
	Timeout                time.Duration
	ServiceConfig          string
	TemporalitySelector    sdkmetric.TemporalitySelector
	AggregationSelector    sdkmetric.AggregationSelector
	PeriodicReaderTimeout  time.Duration
	PeriodicReaderInterval time.Duration
}

func (*GRPCOptions) Exporter

func (o *GRPCOptions) Exporter(ctx context.Context) (sdkmetric.Reader, error)

type HTTPOptions

type HTTPOptions struct {
	Endpoint               string
	URLPath                string
	Compression            otlpmetrichttp.Compression
	TLSConfig              *tls.Config
	Insecure               bool
	Headers                map[string]string
	Timeout                time.Duration
	Retry                  *otlpmetrichttp.RetryConfig
	TemporalitySelector    sdkmetric.TemporalitySelector
	AggregationSelector    sdkmetric.AggregationSelector
	PeriodicReaderTimeout  time.Duration
	PeriodicReaderInterval time.Duration
}

func (*HTTPOptions) Exporter

func (o *HTTPOptions) Exporter(ctx context.Context) (sdkmetric.Reader, error)

type Metric

type Metric struct {
	// contains filtered or unexported fields
}

func NewMetric

func NewMetric(ctx context.Context, opts ...Option) (*Metric, error)

func (*Metric) MeterProvider

func (metric *Metric) MeterProvider() metric.MeterProvider

type Option

type Option func(o *options)

func Attributes

func Attributes(attrs ...attribute.KeyValue) Option

func GRPC

func GRPC(gRPCOptions *GRPCOptions) Option

func HTTP

func HTTP(httpOptions *HTTPOptions) Option

func Prometheus

func Prometheus(prometheusOptions *PrometheusOptions) Option

func Resources

func Resources(res resourcex.ResourceFlag) Option

func Service

func Service(svc *resourcex.Service) Option

func View

func View(views ...ViewOption) Option

func Writer

func Writer(writerOptions *WriterOptions) Option

type PrometheusOptions

type PrometheusOptions struct {
	Registerer        prome.Registerer
	Aggregation       metric.AggregationSelector
	WithoutUnits      bool
	WithoutTargetInfo bool
	WithoutScopeInfo  bool
}

func (*PrometheusOptions) Exporter

func (o *PrometheusOptions) Exporter(ctx context.Context) (metric.Reader, error)

type ViewOption

type ViewOption struct {
	Criteria sdkmetric.Instrument
	Mask     sdkmetric.Stream
}

type WriterOptions

type WriterOptions struct {
	// Writer 标准输入或者文件
	Writer                 io.Writer
	NewEncoder             func(writer io.Writer) stdoutmetric.Encoder
	TemporalitySelector    sdkmetric.TemporalitySelector
	AggregationSelector    sdkmetric.AggregationSelector
	PeriodicReaderTimeout  time.Duration
	PeriodicReaderInterval time.Duration
}

func (*WriterOptions) Exporter

func (o *WriterOptions) Exporter(ctx context.Context) (sdkmetric.Reader, error)

Jump to

Keyboard shortcuts

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