Documentation
¶
Index ¶
- Constants
- Variables
- func Respond(w http.ResponseWriter, data any, warnings []error, logger log.Logger)
- func RespondError(w http.ResponseWriter, apiErr *ApiError, data any, logger log.Logger)
- func SetCORS(w http.ResponseWriter)
- type ApiError
- type ApiFunc
- type BaseAPI
- type ErrorType
- type InstrFunc
- type RuntimeInfo
- type RuntimeInfoFn
- type TSDBStatus
- type TenantStats
- type ThanosVersion
Constants ¶
View Source
const ( StatusSuccess status = "success" StatusError status = "error" )
Variables ¶
Functions ¶
func RespondError ¶
Types ¶
type BaseAPI ¶
func NewBaseAPI ¶
NewBaseAPI returns a new initialized BaseAPI type.
func (*BaseAPI) Register ¶
func (api *BaseAPI) Register(r *route.Router, tracer opentracing.Tracer, logger log.Logger, ins extpromhttp.InstrumentationMiddleware, logMiddleware *logging.HTTPServerMiddleware)
Register registers the common API endpoints.
type InstrFunc ¶
type InstrFunc func(name string, f ApiFunc) http.HandlerFunc
func GetInstr ¶
func GetInstr( tracer opentracing.Tracer, logger log.Logger, ins extpromhttp.InstrumentationMiddleware, logMiddleware *logging.HTTPServerMiddleware, disableCORS bool, ) InstrFunc
GetInstr returns a http HandlerFunc with the instrumentation middleware.
type RuntimeInfo ¶
type RuntimeInfo struct {
StartTime time.Time `json:"startTime"`
CWD string `json:"CWD"`
GoroutineCount int `json:"goroutineCount"`
GOMAXPROCS int `json:"GOMAXPROCS"`
GOGC string `json:"GOGC"`
GODEBUG string `json:"GODEBUG"`
GOMEMLIMIT int64 `json:"GOMEMLIMIT"`
}
RuntimeInfo contains runtime information about Thanos.
type RuntimeInfoFn ¶
type RuntimeInfoFn func() RuntimeInfo
RuntimeInfoFn returns updated runtime information about Thanos.
func GetRuntimeInfoFunc ¶
func GetRuntimeInfoFunc(logger log.Logger) RuntimeInfoFn
type TSDBStatus ¶ added in v0.40.0
type TSDBStatus struct {
Tenant string `json:"tenant"`
v1.TSDBStatus `json:","`
}
TSDBStatus has information of cardinality statistics from postings.
type TenantStats ¶ added in v0.40.0
type ThanosVersion ¶
type ThanosVersion struct {
Version string `json:"version"`
Revision string `json:"revision"`
Branch string `json:"branch"`
BuildUser string `json:"buildUser"`
BuildDate string `json:"buildDate"`
GoVersion string `json:"goVersion"`
}
ThanosVersion contains build information about Thanos.
Click to show internal directories.
Click to hide internal directories.