Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTargetsServer ¶
func RegisterTargetsServer(targetsSrv targetspb.TargetsServer) func(*grpc.Server)
Types ¶
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
GRPCClient allows to retrieve targets from local gRPC streaming server implementation. TODO(bwplotka): Switch to native gRPC transparent client->server adapter once available.
func NewGRPCClient ¶
func NewGRPCClient(ts targetspb.TargetsServer) *GRPCClient
func NewGRPCClientWithDedup ¶
func NewGRPCClientWithDedup(ts targetspb.TargetsServer, replicaLabels []string) *GRPCClient
func (*GRPCClient) Targets ¶
func (rr *GRPCClient) Targets(ctx context.Context, req *targetspb.TargetsRequest) (*targetspb.TargetDiscovery, annotations.Annotations, error)
type Prometheus ¶
type Prometheus struct {
// contains filtered or unexported fields
}
Prometheus implements targetspb.Targets gRPC that allows to fetch targets from Prometheus HTTP api/v1/targets endpoint.
func NewPrometheus ¶
func NewPrometheus(base *url.URL, client *promclient.Client, extLabels func() labels.Labels) *Prometheus
NewPrometheus creates new targets.Prometheus.
func (*Prometheus) Targets ¶
func (p *Prometheus) Targets(r *targetspb.TargetsRequest, s targetspb.Targets_TargetsServer) error
Targets returns all specified targets from Prometheus.
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy implements targetspb.Targets gRPC that fans out requests to given targetspb.Targets.
func NewProxy ¶
func NewProxy(logger log.Logger, targets func() []targetspb.TargetsClient) *Proxy
NewProxy returns new targets.Proxy.
func (*Proxy) Targets ¶
func (s *Proxy) Targets(req *targetspb.TargetsRequest, srv targetspb.Targets_TargetsServer) error
type UnaryClient ¶
type UnaryClient interface {
Targets(ctx context.Context, req *targetspb.TargetsRequest) (*targetspb.TargetDiscovery, annotations.Annotations, error)
}
UnaryClient is gRPC targetspb.Targets client which expands streaming targets API. Useful for consumers that does not support streaming.