Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InstrumentationServer ¶
type InstrumentationServer struct {
// contains filtered or unexported fields
}
func NewInstrumentationServer ¶
func NewInstrumentationServer(port int, registry *prometheus.Registry) *InstrumentationServer
NewInstrumentationServer returns a server exposing Prometheus metrics.
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
type ProxyBackend ¶
type ProxyBackend struct {
// contains filtered or unexported fields
}
ProxyBackend holds the information of a single backend.
func NewProxyBackend ¶
func NewProxyBackend(name string, endpoint *url.URL, timeout time.Duration, preferred bool) *ProxyBackend
NewProxyBackend makes a new ProxyBackend
func (*ProxyBackend) ForwardRequest ¶
func (b *ProxyBackend) ForwardRequest(orig *http.Request) (int, []byte, error)
type ProxyConfig ¶
type ProxyConfig struct {
ServerServicePort int
BackendEndpoints string
PreferredBackend string
BackendReadTimeout time.Duration
CompareResponses bool
ValueComparisonTolerance float64
PassThroughNonRegisteredRoutes bool
}
func (*ProxyConfig) RegisterFlags ¶
func (cfg *ProxyConfig) RegisterFlags(f *flag.FlagSet)
type ProxyEndpoint ¶
type ProxyEndpoint struct {
// contains filtered or unexported fields
}
func NewProxyEndpoint ¶
func NewProxyEndpoint(backends []*ProxyBackend, routeName string, metrics *ProxyMetrics, logger log.Logger, comparator ResponsesComparator) *ProxyEndpoint
type ProxyMetrics ¶
type ProxyMetrics struct {
// contains filtered or unexported fields
}
func NewProxyMetrics ¶
func NewProxyMetrics(registerer prometheus.Registerer) *ProxyMetrics
type ResponsesComparator ¶
type ResponsesComparator interface {
Compare(expected, actual []byte) error
}
type Route ¶
type Route struct {
Path string
RouteName string
Methods []string
ResponseComparator ResponsesComparator
}
type SamplesComparator ¶
type SamplesComparator struct {
// contains filtered or unexported fields
}
func NewSamplesComparator ¶
func NewSamplesComparator(tolerance float64) *SamplesComparator
func (*SamplesComparator) Compare ¶
func (s *SamplesComparator) Compare(expectedResponse, actualResponse []byte) error
func (*SamplesComparator) RegisterSamplesType ¶
func (s *SamplesComparator) RegisterSamplesType(samplesType string, comparator SamplesComparatorFunc)
RegisterSamplesComparator helps with registering custom sample types
type SamplesComparatorFunc ¶
type SamplesComparatorFunc func(expected, actual json.RawMessage, tolerance float64) error
SamplesComparatorFunc helps with comparing different types of samples coming from /api/v1/query and /api/v1/query_range routes.
type SamplesResponse ¶
type SamplesResponse struct {
Status string
Data struct {
ResultType string
Result json.RawMessage
}
}
Click to show internal directories.
Click to hide internal directories.