exporter

package
v0.0.0-...-c2add7f Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package exporter provides means to export collected metrics using one of supported transports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

type Exporter interface {
	Add(name string, value metrics.Metric) Exporter
	Send(ctx context.Context) Exporter
	Error() error
	Reset()
	Close() error
}

Exporter sends collected metrics to metrics collector in single batch request.

func New

func New(
	transport string,
	collectorAddress entity.NetAddress,
	secret security.Secret,
	publicKey security.PublicKey,
) Exporter

New create new instance of Exporter working over specified transport.

type GRPCExporter

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

GRPCExporter sends collected metrics to metrics collector in single batch request.

func NewGRPCExporter

func NewGRPCExporter(
	endpoint entity.NetAddress,
	secret security.Secret,
) *GRPCExporter

func (*GRPCExporter) Add

func (g *GRPCExporter) Add(name string, value metrics.Metric) Exporter

Add a metric to internal buffer.

func (*GRPCExporter) Close

func (g *GRPCExporter) Close() error

Close gracefully finishes gRPC client connection.

func (*GRPCExporter) Error

func (g *GRPCExporter) Error() error

func (*GRPCExporter) Reset

func (g *GRPCExporter) Reset()

Reset reset state of exporter to initial. This doesn't affected the underlying connection.

func (*GRPCExporter) Send

func (g *GRPCExporter) Send(ctx context.Context) Exporter

Send metrics stored in internal buffer to metrics collector in single batch request.

type HTTPExporter

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

HTTPExporter sends collected metrics to metrics collector in single batch request.

func NewHTTPExporter

func NewHTTPExporter(
	collectorAddress entity.NetAddress,
	secret security.Secret,
	publicKey security.PublicKey,
) *HTTPExporter

func (*HTTPExporter) Add

func (h *HTTPExporter) Add(name string, value metrics.Metric) Exporter

Add a metric to internal buffer.

func (*HTTPExporter) Close

func (h *HTTPExporter) Close() error

Close of HTTP exporter is no-op. Required by the Exporter interface.

func (*HTTPExporter) Error

func (h *HTTPExporter) Error() error

func (*HTTPExporter) Reset

func (h *HTTPExporter) Reset()

Reset reset state of exporter to initial. This doesn't affected the underlying connection.

func (*HTTPExporter) Send

func (h *HTTPExporter) Send(ctx context.Context) Exporter

Send metrics stored in internal buffer to metrics collector in single batch request.

Jump to

Keyboard shortcuts

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