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.
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.
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.