response

package
v0.0.0-...-712da53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// latency/error_rate/log_error_count/alert/replica
	MAX_RYG_SCORE = 3 * 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddOtherTableResponse

type AddOtherTableResponse struct {
	Err string `json:"error"`
}

type AlarmStatus

type AlarmStatus struct {
	Name   string // Alarm entry
	Status bool   // alarm true: alarm false: no alarm
}

type CheckAlertRuleResponse

type CheckAlertRuleResponse struct {
	Available bool `json:"available"`
}

type Column

type Column struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

type DBInfo

type DBInfo struct {
	DataBase string         `json:"dataBase"`
	Tables   []LogTableInfo `json:"tables"`
}

type DeleteOtherTableResponse

type DeleteOtherTableResponse struct {
	Err string `json:"error"`
}

type Duration

type Duration struct {
	// The timestamp of the request network packet, in microseconds.
	StartTime int64 `json:"startTime"`
	// Timestamp of the response network packet, in microseconds
	EndTime int64 `json:"endTime"`
	// Response delay
	ResponseDuration uint64 `json:"responseDuration"`
}

type EntryInstanceData

type EntryInstanceData struct {
	ServiceName    string          `json:"serviceName"`
	Namespaces     []string        `json:"namespaces"` // The namespace of the application. It may be empty
	EndpointCount  int             `json:"endpointCount"`
	ServiceDetails []ServiceDetail `json:"serviceDetails"`

	Logs      TempChartObject `json:"logs"`
	Timestamp *int64          `json:"timestamp"`
	model.AlertStatus
	AlertReason model.AlertReason `json:"alertReason"`
}

func (*EntryInstanceData) AddNamespaces

func (entryInstanceData *EntryInstanceData) AddNamespaces(namespaces []string)

type ErrorInfo

type ErrorInfo struct {
	Type    string `json:"type"`    // error type
	Message string `json:"message"` // error message
}

type ErrorInstance

type ErrorInstance struct {
	Name        string            `json:"name"`        // Bad instance name
	ContainerId string            `json:"containerId"` // container ID
	NodeName    string            `json:"nodeName"`    // hostname
	Pid         int64             `json:"pid"`         // process number
	Propations  []*ErrorPropation `json:"propations"`  // error propagation info
	Logs        map[int64]float64 `json:"logs"`        // log alarm
}

type ErrorPropation

type ErrorPropation struct {
	Timestamp  int64           `json:"timestamp"` // timestamp
	TraceId    string          `json:"traceId"`   // TraceId
	ErrorInfos []*ErrorInfo    `json:"errors"`    // error message
	Parents    []*InstanceNode `json:"parents"`   // upstream node list
	Current    *InstanceNode   `json:"current"`   // current node
	Children   []*InstanceNode `json:"children"`  // downstream node list
}

type GetAlertEventsResponse

type GetAlertEventsResponse struct {
	TotalCount int `json:"totalCount"`

	EventList []clickhouse.PagedAlertEvent `json:"events"`
}

type GetAlertEventsSampleResponse

type GetAlertEventsSampleResponse struct {
	EventMap map[string]map[string][]clickhouse.AlertEventSample `json:"events"`
	Status   string                                              `json:"status"`
}

type GetAlertManagerConfigReceiverResponse

type GetAlertManagerConfigReceiverResponse struct {
	AMConfigReceivers []amconfig.Receiver `json:"amConfigReceivers"`

	Pagination *model.Pagination `json:"pagination"`
}

type GetAlertRuleFileResponse

type GetAlertRuleFileResponse struct {
	AlertRules map[string]string `json:"alertRules"`
}

type GetAlertRulesResponse

type GetAlertRulesResponse struct {
	AlertRules []*request.AlertRule `json:"alertRules"`

	Pagination *model.Pagination `json:"pagination"`
}

type GetDescendantMetricsResponse

type GetDescendantMetricsResponse = prometheus.DescendantMetrics

type GetDescendantRelevanceResponse

type GetDescendantRelevanceResponse struct {
	ServiceName      string  `json:"serviceName"`   // service name
	EndPoint         string  `json:"endpoint"`      // Endpoint
	Group            string  `json:"group"`         // service type
	IsTraced         bool    `json:"isTraced"`      // whether to trace
	Distance         float64 `json:"distance"`      // delay curve difference
	DistanceType     string  `json: "distanceType"` // delay curve difference calculation method, there are four types of euclidean/pearson/dtw/failed/net_failed
	DelaySource      string  `json: "delaySource"`  // main source of delay unknown/self/dependency
	REDMetricsStatus string  `json:"REDStatus"`     // RED metric alarm
	LastUpdateTime   *int64  `json:"timestamp"`     // Last deployment time

	model.AlertStatus
	AlertReason model.AlertReason `json:"alertReason"`
}

type GetErrorInstanceResponse

type GetErrorInstanceResponse struct {
	Status    string           `json:"status"`    // Bad instance status
	Instances []*ErrorInstance `json:"instances"` // error instance list
}

type GetFaultLogContentResponse

type GetFaultLogContentResponse struct {
	Sources     []string         `json:"sources"`
	LogContents *clickhouse.Logs `json:"logContents"`
}

type GetFaultLogPageListResponse

type GetFaultLogPageListResponse struct {
	List       []clickhouse.FaultLogResult `json:"list"`
	Pagination *model.Pagination           `json:"pagination"`
}

type GetFeatureResponse

type GetFeatureResponse []*database.Feature

type GetFlameDataResponse

type GetFlameDataResponse clickhouse.FlameGraphData

type GetGroupListResponse

type GetGroupListResponse struct {
	GroupsLabel map[string]string `json:"groupsLabel"`
}

type GetK8sEventsResponse

type GetK8sEventsResponse struct {
	Status  string                         `json:"status"`
	Reasons []string                       `json:"reasons"`
	Data    map[string]*K8sEventStatistics `json:"data"`
}

type GetLogMetricsResponse

type GetLogMetricsResponse struct {
	Name        string            `json:"name"`        // Instance name
	ContainerId string            `json:"containerId"` // container ID
	NodeName    string            `json:"nodeName"`    // hostname
	Pid         int64             `json:"pid"`         // process number
	Logs        map[int64]float64 `json:"logs"`        // log alarm
	Latency     map[int64]float64 `json:"latency"`     // delay P90
	ErrorRate   map[int64]float64 `json:"errorRate"`   // error rate
}

type GetMetricPQLResponse

type GetMetricPQLResponse struct {
	AlertMetricsData []database.AlertMetricsData `json:"alertMetricsData"`
}

type GetMonitorStatusResponse

type GetMonitorStatusResponse struct {
	MonitorList []MonitorStatus `json:"monitorList"`
}

type GetNamespaceInfoResponse

type GetNamespaceInfoResponse struct {
	*v1.Namespace
}

type GetNamespaceListResponse

type GetNamespaceListResponse struct {
	*v1.NamespaceList
}

type GetOnOffCPUResponse

type GetOnOffCPUResponse struct {
	ProfilingEvent *[]clickhouse.ProfilingEvent `json:"profilingEvent"`
}

type GetPodInfoResponse

type GetPodInfoResponse struct {
	*v1.Pod
}

type GetPodListResponse

type GetPodListResponse struct {
	*v1.PodList
}

type GetPolarisInferResponse

type GetPolarisInferResponse = polarisanalyzer.PolarisInferRes

type GetProcessFlameGraphResponse

type GetProcessFlameGraphResponse clickhouse.FlameGraphData

type GetRoleResponse

type GetRoleResponse []database.Role

type GetSQLMetricsResponse

type GetSQLMetricsResponse struct {
	Pagination          model.Pagination     `json:"pagination"`
	SQLOperationDetails []SQLOperationDetail `json:"sqlOperationDetails"`
}

type GetServiceEndpointRelationResponse

type GetServiceEndpointRelationResponse struct {
	Parents       []*model.TopologyNode    `json:"parents"`        // upstream node list
	Current       *model.TopologyNode      `json:"current"`        // current service
	ChildRelation []*model.ToplogyRelation `json:"childRelations"` // downstream node call relationship list
}

type GetServiceEndpointTopologyResponse

type GetServiceEndpointTopologyResponse struct {
	Parents  []*model.TopologyNode `json:"parents"`  // upstream node list
	Current  *model.TopologyNode   `json:"current"`  // current service
	Children []*model.TopologyNode `json:"children"` // downstream node list
}

type GetServiceEntryEndpointsResponse

type GetServiceEntryEndpointsResponse struct {
	Status string               `json:"status"`
	Data   []*EntryInstanceData `json:"data"`
}

type GetServiceNamespaceListResponse

type GetServiceNamespaceListResponse struct {
	NamespaceList []string `json:"namespaceList"`
}

type GetServiceRouteResponse

type GetServiceRouteResponse struct {
	RouteRule map[string]string `json:"routeRule"`
}

type GetSingleTraceInfoResponse

type GetSingleTraceInfoResponse string

type GetSubjectFeatureResponse

type GetSubjectFeatureResponse []database.Feature

type GetTTLResponse

type GetTTLResponse struct {
	Logs     []model.ModifyTableTTLMap `json:"logs"`
	Trace    []model.ModifyTableTTLMap `json:"trace"`
	K8s      []model.ModifyTableTTLMap `json:"k8s"`
	Topology []model.ModifyTableTTLMap `json:"topology"`
	Other    []model.ModifyTableTTLMap `json:"other"`
}

type GetThresholdResponse

type GetThresholdResponse struct {
	Latency   float64 `json:"latency"`
	ErrorRate float64 `json:"errorRate"`
	Tps       float64 `json:"tps"`
	Log       float64 `json:"log"`
}

type GetTraceFilterValueResponse

type GetTraceFilterValueResponse struct {
	TraceFilterOptions clickhouse.SpanTraceOptions `json:"traceFilterOptions"`
}

type GetTraceFiltersResponse

type GetTraceFiltersResponse struct {
	TraceFilters []request.SpanTraceFilter `json:"traceFilters"`
}

type GetTraceMetricsResponse

type GetTraceMetricsResponse = GetLogMetricsResponse

type GetTracePageListResponse

type GetTracePageListResponse struct {
	List       []clickhouse.QueryTraceResult `json:"list"`
	Pagination *model.Pagination             `json:"pagination"`
}

type GetUserConfigResponse

type GetUserConfigResponse struct {
	MenuItem []*database.MenuItem `json:"menuItem"`
	Routes   []string             `json:"routes"`
}

type GetUserInfoResponse

type GetUserInfoResponse struct {
	database.User
}

type GetUserListResponse

type GetUserListResponse struct {
	Users []database.User `json:"users"`
	model.Pagination
}

type GetUserRoleResponse

type GetUserRoleResponse []database.Role

type IndexItem

type IndexItem struct {
	IndexName string  `json:"indexName"`
	Count     uint64  `json:"count"`
	Percent   float64 `json:"percent"`
}

type Instance

type Instance struct {
	InstanceName string   `json:"instanceName"`
	DataBases    []DBInfo `json:"dataBases"`
}

type InstanceData

type InstanceData struct {
	Name      string          `json:"name"` // Instance name
	Namespace string          `json:"namespace"`
	NodeName  string          `json:"nodeName"`
	NodeIP    string          `json:"nodeIP"`
	Timestamp *int64          `json:"timestamp"`
	Latency   TempChartObject `json:"latency"`
	ErrorRate TempChartObject `json:"errorRate"`
	Tps       TempChartObject `json:"tps"`
	Logs      TempChartObject `json:"logs"`

	model.AlertStatus
	AlertReason model.AlertReason `json:"alertReason"`
}

type InstanceNode

type InstanceNode struct {
	Service  string `json:"service"`
	Instance string `json:"instance"`
	IsTraced bool   `json:"isTraced"`
}

type InstancesRes

type InstancesRes struct {
	Status string         `json:"status"`
	Data   []InstanceData `json:"data"`
}

type K8sEventCountValues

type K8sEventCountValues struct {
	Current   uint64 `json:"current"`
	LastWeek  uint64 `json:"lastWeek"`
	LastMonth uint64 `json:"lastMonth"`
}

func (*K8sEventCountValues) AddCount

type K8sEventStatistics

type K8sEventStatistics struct {
	EventName   string `json:"eventName"`
	DisplayName string `json:"displayName"`
	// Normal or Warning
	Severity string              `json:"severity"`
	Counts   K8sEventCountValues `json:"counts"`
}

type LogChartResponse

type LogChartResponse struct {
	Histograms []*LogHistogram `json:"histograms"`
	Count      uint64          `json:"count"`
	Progress   string          `json:"progress"`
	Err        string          `json:"error"`
}

type LogHistogram

type LogHistogram struct {
	Count    uint64 `json:"count"`
	Progress string `json:"progress"`
	From     int64  `json:"from"`
	To       int64  `json:"to"`
}

type LogIndexResponse

type LogIndexResponse struct {
	Indexs []IndexItem `json:"indexs"`
}

type LogItem

type LogItem struct {
	Content   interface{}            `json:"content"`
	Tags      map[string]interface{} `json:"tags"`
	LogFields map[string]interface{} `json:"logFields"`
	Time      int64                  `json:"timestamp"`
}

type LogParseResponse

type LogParseResponse struct {
	ParseInfo    string            `json:"parseInfo"`
	Service      []string          `json:"serviceName"`
	ParseName    string            `json:"parseName"`
	RouteRule    map[string]string `json:"routeRule"`
	ParseRule    string            `json:"parseRule"`
	LogFields    []request.Field   `json:"tableFields"`
	IsStructured bool              `json:"isStructured"`
}

type LogQueryContextResponse

type LogQueryContextResponse struct {
	Front []LogItem `json:"front"`
	Back  []LogItem `json:"back"`
}

type LogQueryResponse

type LogQueryResponse struct {
	Limited int `json:"limited"`
	// log field
	HiddenFields []string `json:"hiddenFields"`
	// tag field
	DefaultFields []string  `json:"defaultFields"`
	Logs          []LogItem `json:"logs"`
	Query         string    `json:"query"`
	Cost          int64     `json:"cost"`
	Err           string    `json:"error"`
}

type LogTableInfo

type LogTableInfo struct {
	Cluster   string `json:"cluster"`
	TableName string `json:"tableName"`
	TimeField string `json:"timeField"`
	LogField  string `json:"logField"`
}

type LogTableInfoResponse

type LogTableInfoResponse struct {
	Parses    []Parse    `json:"parses"`
	Instances []Instance `json:"instances"`
}

type LogTableResponse

type LogTableResponse struct {
	Sqls []string `json:"sqls"`
	Err  string   `json:"error"`
}

type LoginResponse

type LoginResponse struct {
	AccessToken  string `json:"accessToken"`  // accessToken is used to call the interface get resources
	RefreshToken string `json:"refreshToken"` // refreshToken for refreshing accessToken
	database.User
}

type MonitorStatus

type MonitorStatus struct {
	MonitorName string `json:"monitorName"`
	IsAlive     bool   `json:"isAlive"`
}

type OtherDB

type OtherDB struct {
	DataBase string       `json:"dataBase"`
	Tables   []OtherTable `json:"tables"`
}

type OtherTable

type OtherTable struct {
	TableName string `json:"tableName"`
}

type OtherTableInfoResponse

type OtherTableInfoResponse struct {
	Columns []Column `json:"columns"`
	Err     string   `json:"error"`
}

type OtherTableResponse

type OtherTableResponse struct {
	OtherTables []OtherDB `json:"otherTables"`
}

type Parse

type Parse struct {
	DataBase  string `json:"dataBase"`
	TableName string `json:"tableName"`
	ParseName string `json:"parseName"`
	ParseInfo string `json:"parseInfo"`
}

type PodMapResponse

type PodMapResponse struct {
	Columns []string `json:"columns"`
	Schemas []struct {
		LabelType string `json:"label_type"`
		PreAs     string `json:"pre_as"`
		Type      int    `json:"type"`
		Unit      string `json:"unit"`
		ValueType string `json:"value_type"`
	} `json:"schemas"`
	Values [][]interface{} `json:"values"`
}

type RYGResult

type RYGResult struct {
	PercentScore int       `json:"percentScore"` // percentage total score
	Score        int       `json:"score"`        // total score
	Status       RYGStatus `json:"status"`

	ScoreDetail []RYGScoreDetail `json:"scoreDetail"`
}

type RYGScoreDetail

type RYGScoreDetail struct {
	Key    string `json:"key"`
	Score  int    `json:"score"`
	Detail string `json:"detail"`
}

type RYGStatus

type RYGStatus string
const (
	RED    RYGStatus = "red"
	YELLOW RYGStatus = "yellow"
	GREEN  RYGStatus = "green"
)

type Ratio

type Ratio struct {
	// Day-over-Day Growth Rate
	DayOverDay *float64 `json:"dayOverDay"`
	// Week-over-Week Growth Rate
	WeekOverDay *float64 `json:"weekOverDay"`
}

type RefreshTokenResponse

type RefreshTokenResponse struct {
	AccessToken string `json:"accessToken"` // accessToken is used to call the interface get resources
}

type SQLOperationDetail

type SQLOperationDetail struct {
	prometheus.SQLKey

	Latency   TempChartObject `json:"latency"`
	ErrorRate TempChartObject `json:"errorRate"`
	// FIXME Tps name is tps, actual requests per minute
	Tps TempChartObject `json:"tps"`
}

type SegmentLatency

type SegmentLatency struct {
	// Request and response times collected at the client process
	ClientProcess Duration `json:"clientProcess"`
	// Request and response time collected at the client NIC
	ClientNic Duration `json:"clientNic"`
	// Request and response time collected at the client host NIC
	ClientK8sNodeNic Duration `json:"clientK8SNodeNic"`
	// Request and response time collected at the server host NIC
	ServerK8sNodeNic Duration `json:"serverK8SNodeNic"`
	// Request and response time collected at the server NIC
	ServerNic Duration `json:"serverNic"`
	// Request and response time collected at the server process
	ServerProcess Duration `json:"serverProcess"`
}

type ServiceAlertRes

type ServiceAlertRes struct {
	ServiceName string          `json:"serviceName"`
	Logs        TempChartObject `json:"logs"`

	Timestamp *int64 `json:"timestamp"`

	model.AlertStatus
	AlertReason model.AlertReason `json:"alertReason"`
}

type ServiceDetail

type ServiceDetail struct {
	Endpoint    string          `json:"endpoint"`
	DelaySource string          `json:"delaySource"`
	Latency     TempChartObject `json:"latency"`
	ErrorRate   TempChartObject `json:"errorRate"`
	Tps         TempChartObject `json:"tps"` // FIXME name is tps, actual requests per minute
}

type ServiceEndPointsRes

type ServiceEndPointsRes struct {
	ServiceName    string          `json:"serviceName"`
	Namespaces     []string        `json:"namespaces"` // The namespace of the application. It may be empty
	EndpointCount  int             `json:"endpointCount"`
	ServiceDetails []ServiceDetail `json:"serviceDetails"`
}

type ServiceRYGLightRes

type ServiceRYGLightRes struct {
	ServiceList []*ServiceRYGResult `json:"serviceList"`
}

type ServiceRYGResult

type ServiceRYGResult struct {
	ServiceName string `json:"serviceName"`

	RYGResult
}

type ServiceRes

type ServiceRes struct {
	ServiceName          string          `json:"serviceName"`
	EndpointCount        int             `json:"endpointCount"`
	ServiceDetails       []ServiceDetail `json:"serviceDetails"`
	Logs                 TempChartObject `json:"logs"`
	InfrastructureStatus string          `json:"infrastructureStatus"`
	NetStatus            string          `json:"netStatus"`
	K8sStatus            string          `json:"k8sStatus"`
	Timestamp            *int64          `json:"timestamp"`
}

type SetThresholdResponse

type SetThresholdResponse struct {
}

type SpanSegmentMetricsResponse

type SpanSegmentMetricsResponse map[string]*SegmentLatency

type TempChartObject

type TempChartObject struct {
	// ChartData chart data
	ChartData map[int64]float64 `json:"chartData"`
	// Value metric average
	Value *float64 `json:"value"`
	// Ratio metric Day-over-Day Growth Rate rate
	Ratio Ratio `json:"ratio"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL