response

package
v0.0.0-...-4f1325e Latest Latest
Warning

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

Go to latest
Published: Jan 3, 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 // 告警项
	Status bool   // 是否告警 true: 告警 false: 未告警
}

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 {
	// 请求网络包时间戳,单位微秒
	StartTime int64 `json:"startTime"`
	// 响应网络包时间戳,单位微秒
	EndTime int64 `json:"endTime"`
	// 响应延时
	ResponseDuration uint64 `json:"responseDuration"`
}

type EntryInstanceData

type EntryInstanceData struct {
	ServiceName    string          `json:"serviceName"`
	Namespaces     []string        `json:"namespaces"` // 应用所属命名空间,可能为空
	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"`    // 错误类型
	Message string `json:"message"` // 错误消息
}

type ErrorInstance

type ErrorInstance struct {
	Name        string            `json:"name"`        // 错误实例名
	ContainerId string            `json:"containerId"` // 容器ID
	NodeName    string            `json:"nodeName"`    // 主机名
	Pid         int64             `json:"pid"`         // 进程号
	Propations  []*ErrorPropation `json:"propations"`  // 错误传播信息
	Logs        map[int64]float64 `json:"logs"`        // 日志告警
}

type ErrorPropation

type ErrorPropation struct {
	Timestamp  int64           `json:"timestamp"` // 时间戳
	TraceId    string          `json:"traceId"`   // TraceId
	ErrorInfos []*ErrorInfo    `json:"errors"`    // 错误信息
	Parents    []*InstanceNode `json:"parents"`   // 上游节点列表
	Current    *InstanceNode   `json:"current"`   // 当前节点
	Children   []*InstanceNode `json:"children"`  // 下游节点列表
}

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"`  // 服务名
	EndPoint         string  `json:"endpoint"`     // Endpoint
	Group            string  `json:"group"`        // 服务类型
	IsTraced         bool    `json:"isTraced"`     // 是否跟踪
	Distance         float64 `json:"distance"`     // 延时曲线差异
	DistanceType     string  `json:"distanceType"` // 延时曲线差异计算方式, 有euclidean/pearson/dtw/failed/net_failed四种
	DelaySource      string  `json:"delaySource"`  // 延时主要来源 unknown/self/dependency
	REDMetricsStatus string  `json:"REDStatus"`    // RED指标告警
	LastUpdateTime   *int64  `json:"timestamp"`    // 末次部署时间

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

type GetErrorInstanceResponse

type GetErrorInstanceResponse struct {
	Status    string           `json:"status"`    // 错误实例状态
	Instances []*ErrorInstance `json:"instances"` // 错误实例列表
}

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"`        // 实例名
	ContainerId string            `json:"containerId"` // 容器ID
	NodeName    string            `json:"nodeName"`    // 主机名
	Pid         int64             `json:"pid"`         // 进程号
	Logs        map[int64]float64 `json:"logs"`        // 日志告警
	Latency     map[int64]float64 `json:"latency"`     // 延时P90
	ErrorRate   map[int64]float64 `json:"errorRate"`   // 错误率
}

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"`        // 上游节点列表
	Current       *model.TopologyNode      `json:"current"`        // 当前服务
	ChildRelation []*model.ToplogyRelation `json:"childRelations"` // 下游节点调用关系列表
}

type GetServiceEndpointTopologyResponse

type GetServiceEndpointTopologyResponse struct {
	Parents  []*model.TopologyNode `json:"parents"`  // 上游节点列表
	Current  *model.TopologyNode   `json:"current"`  // 当前服务
	Children []*model.TopologyNode `json:"children"` // 下游节点列表
}

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"` //实例名
	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用于调用接口获取资源
	RefreshToken string `json:"refreshToken"` // refreshToken用于刷新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"` // 百分比总分
	Score        int       `json:"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 {
	// DayOverDay 日同比变化率
	DayOverDay *float64 `json:"dayOverDay"`
	// WeekOverDay 周同比变化率
	WeekOverDay *float64 `json:"weekOverDay"`
}

type RefreshTokenResponse

type RefreshTokenResponse struct {
	AccessToken string `json:"accessToken"` // accessToken用于调用接口获取资源
}

type SQLOperationDetail

type SQLOperationDetail struct {
	prometheus.SQLKey

	Latency   TempChartObject `json:"latency"`
	ErrorRate TempChartObject `json:"errorRate"`
	// FIXME Tps 名称为tps,实际为每分钟请求数
	Tps TempChartObject `json:"tps"`
}

type SegmentLatency

type SegmentLatency struct {
	// 在客户端进程处采集到的请求和响应时间
	ClientProcess Duration `json:"clientProcess"`
	// 在客户端网卡处采集到的请求和响应时间
	ClientNic Duration `json:"clientNic"`
	// 在客户端主机网卡处采集到的请求和响应时间
	ClientK8sNodeNic Duration `json:"clientK8SNodeNic"`
	// 在服务端主机网卡处采集到的请求和响应时间
	ServerK8sNodeNic Duration `json:"serverK8SNodeNic"`
	// 在服务端网卡处采集到的请求和响应时间
	ServerNic Duration `json:"serverNic"`
	// 在服务端进程处采集到的请求和响应时间
	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 名称为tps,实际为每分钟请求数
}

type ServiceEndPointsRes

type ServiceEndPointsRes struct {
	ServiceName    string          `json:"serviceName"`
	Namespaces     []string        `json:"namespaces"` // 应用所属命名空间,可能为空
	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 图表数据
	ChartData map[int64]float64 `json:"chartData"`
	// Value 指标平均值
	Value *float64 `json:"value"`
	// Ratio 指标同比变化率
	Ratio Ratio `json:"ratio"`
}

Jump to

Keyboard shortcuts

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