Documentation ¶
Overview ¶
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.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*options)
Option modifies an internal options type.
func WithForwardTimeout ¶
WithForwardTimeout sets the time after which an individual RPC to a downstream Veneur times out
func WithStatsInterval ¶
WithStatsInterval sets the time interval at which diagnostic metrics about the server will be emitted.
func WithTraceClient ¶
WithTraceClient sets the trace client used by the server.
type 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.
func New ¶
func New(destinations *consistent.Consistent, opts ...Option) (*Server, error)
New creates a new Server with the provided destinations. The server returned is unstarted.
func (*Server) SendMetrics ¶
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.
func (*Server) Serve ¶
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.
func (*Server) SetDestinations ¶
func (s *Server) SetDestinations(dests *consistent.Consistent) 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.