veneur: github.com/stripe/veneur/importsrv Index | Files

package importsrv

import "github.com/stripe/veneur/importsrv"

Package importsrv receives metrics over gRPC and sends them to workers.

The Server wraps a grpc.Server, and implements the forwardrpc.Forward service. It receives batches of metrics, then hashes them to a specific "MetricIngester" and forwards them on.

Index

Package Files

options.go server.go

type MetricIngester Uses

type MetricIngester interface {
    IngestMetrics([]*metricpb.Metric)
}

MetricIngester reads metrics from protobufs

type Option Uses

type Option func(*options)

Option is returned by functions that serve as options to New, like "With..."

func WithTraceClient Uses

func WithTraceClient(c *trace.Client) Option

WithTraceClient sets the trace client for the server. Otherwise it uses trace.DefaultClient.

type Server Uses

type Server struct {
    *grpc.Server
    // contains filtered or unexported fields
}

Server wraps a gRPC server and implements the forwardrpc.Forward service. It reads a list of metrics, and based on the provided key chooses a MetricIngester to send it to. A unique metric (name, tags, and type) should always be routed to the same MetricIngester.

func New Uses

func New(metricOuts []MetricIngester, opts ...Option) *Server

New creates an unstarted Server with the input MetricIngester's to send output to.

func (*Server) SendMetrics Uses

func (s *Server) SendMetrics(ctx context.Context, mlist *forwardrpc.MetricList) (*empty.Empty, error)

SendMetrics takes a list of metrics and hashes each one (based on the metric key) to a specific metric ingester.

func (*Server) Serve Uses

func (s *Server) Serve(addr string) error

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.

Package importsrv imports 11 packages (graph) and is imported by 1 packages. Updated 2020-03-18. Refresh now. Tools for package owners.