Documentation ¶
Index ¶
- Constants
- Variables
- func GetTopologyPermission(db *db.DB) httpserver.Interceptor
- type AggregationCondition
- type ExceptionDescription
- func ExceptionOrderByCountStrategy(exceptions ExceptionDescriptionsCountSort) []ExceptionDescription
- func ExceptionOrderByStrategyExecute(exceptionType string, exceptions []ExceptionDescription) []ExceptionDescription
- func ExceptionOrderByTimeStrategy(exceptions ExceptionDescriptionsTimeSort) []ExceptionDescription
- type ExceptionDescriptionsCountSort
- type ExceptionDescriptionsTimeSort
- type Field
- type GlobalParams
- type GroupByField
- type InstanceInfo
- type Metric
- type Node
- type NodeRelation
- type NodeType
- type ProcessParams
- type ReadWriteBytes
- type ReadWriteBytesSpeed
- type RequestTransaction
- type Response
- type SearchTag
- type ServiceDashboard
- type ServiceInstance
- type ServiceParams
- type ServicesVo
- type Tag
- type TopologyNodeRelation
- type Vo
Constants ¶
View Source
const ( JavaProcessType = "jvm_memory" NodeJsProcessType = "nodejs_memory" )
View Source
const ( TypeService = "Service" TypeMysql = "Mysql" TypeRedis = "Redis" TypeRocketMQ = "RocketMQ" TypeExternal = "ExternalService" TypeInternal = "InternalService" TypeDubbo = "Dubbo" TypeSidecar = "SideCar" TypeGateway = "APIGateway" TypeRegisterCenter = "RegisterCenter" TypeConfigCenter = "ConfigCenter" TypeNoticeCenter = "NoticeCenter" TypeElasticsearch = "Elasticsearch" )
View Source
const ( Application = "application" Service = "service" HttpIndex = apm.Spot + apm.Sep1 + Application + apm.Sep3 + "http" + apm.Sep3 + Service RpcIndex = apm.Spot + apm.Sep1 + Application + apm.Sep3 + "rpc" + apm.Sep3 + Service MicroIndex = apm.Spot + apm.Sep1 + Application + apm.Sep3 + "micro" + apm.Sep3 + Service MqIndex = apm.Spot + apm.Sep1 + Application + apm.Sep3 + "mq" + apm.Sep3 + Service DbIndex = apm.Spot + apm.Sep1 + Application + apm.Sep3 + "db" + apm.Sep3 + Service CacheIndex = apm.Spot + apm.Sep1 + Application + apm.Sep3 + "cache" + apm.Sep3 + Service ServiceNodeIndex = apm.Spot + apm.Sep1 + "service_node" )
View Source
const ( TargetServiceNode = "TargetServiceNode" SourceServiceNode = "SourceServiceNode" TargetAddonNode = "TargetAddonNode" SourceAddonNode = "SourceAddonNode" TargetComponentNode = "TargetComponentNode" TargetOtherNode = "TargetOtherNode" SourceMQNode = "SourceMQNode" TargetMQNode = "TargetMQNode" TargetMQServiceNode = "TargetMQServiceNode" OtherNode = "OtherNode" )
View Source
const ( HttpRecMircoIndexType = "http-rpc-mirco" MQDBCacheIndexType = "mq-db-cache" ServiceNodeIndexType = "service-node" )
View Source
const ( ExceptionTimeSortStrategy = "time" ExceptionCountSortStrategy = "count" )
View Source
const TimeLayout = "2006-01-02 15:04:05"
Variables ¶
View Source
var ( ApplicationSearchTag = SearchTag{ Tag: "application", Label: "应用名称", Type: "select", } ServiceSearchTag = SearchTag{ Tag: "service", Label: "服务名称", Type: "select", } )
View Source
var ( ReServiceNode = regexp.MustCompile("^" + ServiceNodeIndex + "(.*)$") ReHttpRpcMicro = regexp.MustCompile("^(" + HttpIndex + "|" + RpcIndex + "|" + MicroIndex + ")(.*)$") ReMqDbCache = regexp.MustCompile("^(" + MqIndex + "|" + DbIndex + "|" + CacheIndex + ")(.*)$") )
View Source
var Aggregations map[string]*AggregationCondition
View Source
var ErrorReqMetricNames = []string{
"application_http_error",
"application_rpc_error",
"application_cache_error",
"application_db_error",
"application_mq_error",
}
View Source
var IndexPrefix = []string{ HttpIndex, RpcIndex, MicroIndex, MqIndex, DbIndex, CacheIndex, ServiceNodeIndex, }
View Source
var NodeRelations map[string][]*NodeRelation
View Source
var NodeTypes = []string{ TypeService, TypeMysql, TypeRedis, TypeExternal, TypeDubbo, TypeSidecar, TypeGateway, TypeRegisterCenter, TypeConfigCenter, TypeNoticeCenter, TypeElasticsearch, }
View Source
var ProcessTypes = []string{ JavaProcessType, NodeJsProcessType, }
View Source
var ReqMetricNames = []string{
"application_http_service",
"application_rpc_service",
"application_cache_service",
"application_db_service",
"application_mq_service",
}
View Source
var ReqMetricNamesDesc = map[string]string{
"application_http_service": "HTTP 请求",
"application_rpc_service": "RPC 请求",
"application_cache_service": "缓存请求",
"application_db_service": "数据库请求",
"application_mq_service": "MQ 请求",
}
Functions ¶
func GetTopologyPermission ¶
func GetTopologyPermission(db *db.DB) httpserver.Interceptor
Types ¶
type AggregationCondition ¶
type AggregationCondition struct {
Aggregation map[string]*elastic.FilterAggregation
}
type ExceptionDescription ¶
type ExceptionDescription struct { InstanceId string `json:"instance_id"` ExceptionType string `json:"exception_type"` Class string `json:"class"` Method string `json:"method"` Message string `json:"message"` Time string `json:"time"` Count int64 `json:"count"` }
func ExceptionOrderByCountStrategy ¶
func ExceptionOrderByCountStrategy(exceptions ExceptionDescriptionsCountSort) []ExceptionDescription
func ExceptionOrderByStrategyExecute ¶
func ExceptionOrderByStrategyExecute(exceptionType string, exceptions []ExceptionDescription) []ExceptionDescription
func ExceptionOrderByTimeStrategy ¶
func ExceptionOrderByTimeStrategy(exceptions ExceptionDescriptionsTimeSort) []ExceptionDescription
type ExceptionDescriptionsCountSort ¶
type ExceptionDescriptionsCountSort []ExceptionDescription
func (ExceptionDescriptionsCountSort) Len ¶
func (e ExceptionDescriptionsCountSort) Len() int
func (ExceptionDescriptionsCountSort) Less ¶
func (e ExceptionDescriptionsCountSort) Less(i, j int) bool
Less() by count
func (ExceptionDescriptionsCountSort) Swap ¶
func (e ExceptionDescriptionsCountSort) Swap(i, j int)
Swap()
type ExceptionDescriptionsTimeSort ¶
type ExceptionDescriptionsTimeSort []ExceptionDescription
func (ExceptionDescriptionsTimeSort) Len ¶
func (e ExceptionDescriptionsTimeSort) Len() int
func (ExceptionDescriptionsTimeSort) Less ¶
func (e ExceptionDescriptionsTimeSort) Less(i, j int) bool
Less() by time
func (ExceptionDescriptionsTimeSort) Swap ¶
func (e ExceptionDescriptionsTimeSort) Swap(i, j int)
Swap()
type Field ¶
type Field struct { ELapsedCount float64 `json:"elapsed_count,omitempty"` ELapsedMax float64 `json:"elapsed_max,omitempty"` ELapsedMean float64 `json:"elapsed_mean,omitempty"` ELapsedMin float64 `json:"elapsed_min,omitempty"` ELapsedSum float64 `json:"elapsed_sum,omitempty"` CountSum float64 `json:"count_sum,omitempty"` ErrorsSum float64 `json:"errors_sum,omitempty"` }
type GlobalParams ¶
type GroupByField ¶
type GroupByField struct { Name string SubField *GroupByField }
type InstanceInfo ¶
type Metric ¶
type Metric struct { Count int64 `json:"count"` HttpError int64 `json:"http_error"` RT float64 `json:"rt"` ErrorRate float64 `json:"error_rate"` Replicas float64 `json:"replicas,omitempty"` Running float64 `json:"running"` Stopped float64 `json:"stopped"` RPS float64 `json:"rps"` Duration float64 `json:"duration"` }
type Node ¶
type Node struct { Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` TypeDisplay string `json:"typeDisplay,omitempty"` AddonId string `json:"addonId,omitempty"` AddonType string `json:"addonType,omitempty"` ApplicationId string `json:"applicationId,omitempty"` ApplicationName string `json:"applicationName,omitempty"` RuntimeId string `json:"runtimeId,omitempty"` RuntimeName string `json:"runtimeName,omitempty"` ServiceId string `json:"serviceId,omitempty"` ServiceName string `json:"serviceName,omitempty"` DashboardId string `json:"dashboardId"` Metric *Metric `json:"metric"` Parents []*Node `json:"parents"` }
type NodeRelation ¶
type NodeType ¶
type NodeType struct { Type string GroupByField *GroupByField SourceFields []string Filter *elastic.BoolQuery Aggregation map[string]*elastic.SumAggregation }
var ( TargetServiceNodeType *NodeType SourceServiceNodeType *NodeType TargetAddonNodeType *NodeType SourceAddonNodeType *NodeType TargetComponentNodeType *NodeType TargetOtherNodeType *NodeType SourceMQNodeType *NodeType TargetMQNodeType *NodeType TargetMQServiceNodeType *NodeType OtherNodeType *NodeType ServiceNodeAggregation map[string]*elastic.SumAggregation NodeAggregation map[string]*elastic.SumAggregation )
type ProcessParams ¶
type ReadWriteBytes ¶
type ReadWriteBytesSpeed ¶
type RequestTransaction ¶
type ServiceDashboard ¶
type ServiceDashboard struct { Id string `json:"service_id"` Name string `json:"service_name"` ReqCount int64 `json:"req_count"` ReqErrorCount int64 `json:"req_error_count"` ART float64 `json:"avg_req_time"` // avg response time RSInstanceCount string `json:"running_instance_count"` // running / stopped RuntimeId string `json:"runtime_id"` RuntimeName string `json:"runtime_name"` ApplicationId string `json:"application_id"` ApplicationName string `json:"application_name"` }
type ServiceInstance ¶
type ServiceInstance struct { ApplicationName string `json:"applicationName,omitempty"` ServiceId string `json:"serviceId,omitempty"` ServiceName string `json:"serviceName,omitempty"` ServiceInstanceName string `json:"serviceInstanceName,omitempty"` ServiceInstanceId string `json:"serviceInstanceId,omitempty"` InstanceState string `json:"instanceState,omitempty"` PlatformVersion string `json:"platformVersion,omitempty"` StartTime string `json:"startTime,omitempty"` LastHeartbeatTime string `json:"lastHeartbeatTime,omitempty"` }
type ServiceParams ¶
type ServiceParams struct { Scope string `query:"scope" default:"micro_service"` ScopeId string `query:"terminusKey" validate:"required"` StartTime int64 `query:"start" validate:"required"` EndTime int64 `query:"end" validate:"required"` ServiceName string `query:"serviceName" validate:"required"` ServiceId string `query:"serviceId" validate:"required"` InstanceId string `query:"instanceId"` }
type ServicesVo ¶
type Tag ¶
type Tag struct { Component string `json:"component,omitempty"` DBType string `json:"db_type,omitempty"` DBSystem string `json:"db_system,omitempty"` Host string `json:"host,omitempty"` HttpUrl string `json:"http_url,omitempty"` PeerServiceScope string `json:"peer_service_scope,omitempty"` PeerAddress string `json:"peer_address,omitempty"` PeerService string `json:"peer_service,omitempty"` DBHost string `json:"db_host,omitempty"` SourceProjectId string `json:"source_project_id,omitempty"` SourceProjectName string `json:"source_project_name,omitempty"` SourceWorkspace string `json:"source_workspace,omitempty"` SourceTerminusKey string `json:"source_terminus_key,omitempty"` SourceApplicationId string `json:"source_application_id,omitempty"` SourceApplicationName string `json:"source_application_name,omitempty"` SourceRuntimeId string `json:"source_runtime_id,omitempty"` SourceRuntimeName string `json:"source_runtime_name,omitempty"` SourceServiceName string `json:"source_service_name,omitempty"` SourceServiceId string `json:"source_service_id,omitempty"` SourceAddonID string `json:"source_addon_id,omitempty"` SourceAddonType string `json:"source_addon_type,omitempty"` TargetInstanceId string `json:"target_instance_id,omitempty"` TargetProjectId string `json:"target_project_id,omitempty"` TargetProjectName string `json:"target_project_name,omitempty"` TargetWorkspace string `json:"target_workspace,omitempty"` TargetTerminusKey string `json:"target_terminus_key,omitempty"` TargetApplicationId string `json:"target_application_id,omitempty"` TargetApplicationName string `json:"target_application_name,omitempty"` TargetRuntimeId string `json:"target_runtime_id,omitempty"` TargetRuntimeName string `json:"target_runtime_name,omitempty"` TargetServiceName string `json:"target_service_name,omitempty"` TargetServiceId string `json:"target_service_id,omitempty"` TargetAddonID string `json:"target_addon_id,omitempty"` TargetAddonType string `json:"target_addon_type,omitempty"` TerminusKey string `json:"terminus_key,omitempty"` ProjectId string `json:"project_id,omitempty"` ProjectName string `json:"project_name,omitempty"` Workspace string `json:"workspace,omitempty"` ApplicationId string `json:"application_id,omitempty"` ApplicationName string `json:"application_name,omitempty"` RuntimeId string `json:"runtime_id,omitempty"` RuntimeName string `json:"runtime_name,omitempty"` ServiceName string `json:"service_name,omitempty"` ServiceId string `json:"service_id,omitempty"` ServiceInstanceId string `json:"service_instance_id,omitempty"` ServiceIp string `json:"service_ip,omitempty"` Type string `json:"type,omitempty"` }
type TopologyNodeRelation ¶
Click to show internal directories.
Click to hide internal directories.