Package proxysrv proxies metrics over gRPC to global veneurs using consistent hashing
The Server provided accepts a hash ring of destinations, and then listens for metrics over gRPC. It hashes each metric to a specific destination, and forwards each metric to its appropriate destination Veneur.
type Option func(*options)
Option modifies an internal options type.
WithForwardTimeout sets the time after which an individual RPC to a downstream Veneur times out
WithLog sets the logger entry used in the object.
WithStatsInterval sets the time interval at which diagnostic metrics about the server will be emitted.
WithTraceClient sets the trace client used by the server.
Server is a gRPC server that implements the forwardrpc.Forward service. It receives metrics and forwards them consistently to a destination, based on the metric name, type and tags.
New creates a new Server with the provided destinations. The server returned is unstarted.
func (s *Server) SendMetrics(ctx context.Context, mlist *forwardrpc.MetricList) (*empty.Empty, error)
SendMetrics spawns a new goroutine that forwards metrics to the destinations and exist immediately.
Serve starts a gRPC listener on the specified address and blocks while listening for requests. If listening is interrupted by some means other than Stop or GracefulStop being called, it returns a non-nil error.
SetDestinations updates the ring of hosts that are forwarded to by the server. If new hosts are being added, a gRPC connection is initialized for each.
This also prunes the list of open connections. If a connection exists to a host that wasn't in either the current list or the last one, the connection is closed.
Stop stops the gRPC server (if it was started) and closes all gRPC client connections.