Documentation ¶
Overview ¶
Package backend defines an interface and RPC methods for communication with Graphite backends.
Example use:
var b Backend metrics, err := Render(ctx, b, from, until, targets)
The package will transparently handle concurrent requests to multiple backends:
var bs []Backend metrics, err := Renders(ctx, bs, from, until, targets)
Index ¶
- func Finds(ctx context.Context, backends []Backend, request types.FindRequest) (types.Matches, []error)
- func Infos(ctx context.Context, backends []Backend, request types.InfoRequest) ([]types.Info, []error)
- func Renders(ctx context.Context, backends []Backend, request types.RenderRequest, ...) ([]types.Metric, types.MetricRenderStats, []error)
- type Backend
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Finds ¶
func Finds(ctx context.Context, backends []Backend, request types.FindRequest) (types.Matches, []error)
Finds makes Find calls to multiple backends.
func Infos ¶
func Infos(ctx context.Context, backends []Backend, request types.InfoRequest) ([]types.Info, []error)
Infos makes Info calls to multiple backends.
func Renders ¶
func Renders( ctx context.Context, backends []Backend, request types.RenderRequest, replicaMismatchConfig cfg.RenderReplicaMismatchConfig, logger *zap.Logger) ([]types.Metric, types.MetricRenderStats, []error)
Renders makes Render calls to multiple backends. replicaMatchMode indicates how data points of the metrics fetched from replicas will be checked and applied on the final metrics. replicaMismatchReportLimit limits the number of mismatched metrics reported in log for each render request.
Types ¶
type Backend ¶
type Backend interface { Find(context.Context, types.FindRequest) (types.Matches, error) Info(context.Context, types.InfoRequest) ([]types.Info, error) Render(context.Context, types.RenderRequest) ([]types.Metric, error) Contains([]string) bool // Reports whether a backend contains any of the given targets. Logger() *zap.Logger // A logger used to communicate non-fatal warnings. GetServerAddress() string }
Backend codifies the RPC calls a Graphite backend responds to.
Click to show internal directories.
Click to hide internal directories.