refactor monitoring (#1751)
Signed-off-by: huanggze <loganhuang@yunify.com>
This commit is contained in:
@@ -1,23 +1,10 @@
|
||||
package v1alpha2
|
||||
|
||||
// Prometheus query api response
|
||||
import "kubesphere.io/kubesphere/pkg/simple/client/monitoring"
|
||||
|
||||
type APIResponse struct {
|
||||
Status string `json:"status" description:"result status, one of error, success"`
|
||||
Data QueryResult `json:"data" description:"actual metric result"`
|
||||
ErrorType string `json:"errorType,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
Warnings []string `json:"warnings,omitempty"`
|
||||
}
|
||||
|
||||
// QueryResult includes result data from a query.
|
||||
type QueryResult struct {
|
||||
ResultType string `json:"resultType" description:"result type, one of matrix, vector"`
|
||||
Result []QueryValue `json:"result" description:"metric data including labels, time series and values"`
|
||||
}
|
||||
|
||||
// Time Series
|
||||
type QueryValue struct {
|
||||
Metric map[string]string `json:"metric,omitempty" description:"time series labels"`
|
||||
Value []interface{} `json:"value,omitempty" description:"time series, values of vector type"`
|
||||
Values [][]interface{} `json:"values,omitempty" description:"time series, values of matrix type"`
|
||||
Results []monitoring.Metric `json:"results" description:"actual array of results"`
|
||||
CurrentPage int `json:"page,omitempty" description:"current page returned"`
|
||||
TotalPage int `json:"total_page,omitempty" description:"total number of pages"`
|
||||
TotalItem int `json:"total_item,omitempty" description:"page size"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user