Documentation
¶
Index ¶
- Constants
- Variables
- func EscapeForLog(s string) string
- func GetAlertType(g string) string
- func NewQueryCondition(st, et int64, timeField, query string) string
- type AlertEventSample
- type AlertGroup
- type AlertService
- type BucketRedMetric
- type ByLimitBuilder
- func (builder *ByLimitBuilder) GroupBy(keys ...string) *ByLimitBuilder
- func (builder *ByLimitBuilder) Limit(limit int) *ByLimitBuilder
- func (builder *ByLimitBuilder) Offset(offset int) *ByLimitBuilder
- func (builder *ByLimitBuilder) OrderBy(key string, asc bool) *ByLimitBuilder
- func (builder *ByLimitBuilder) String() string
- type ChildNode
- type ChildRelation
- type Endpoint
- type EntryNode
- type EntryRelationship
- type ErrorInstancePropagation
- type FaultLogQuery
- type FaultLogResult
- type FieldBuilder
- type FlameGraphData
- type GroupRedMetric
- type GroupService
- type K8sEvents
- type K8sEventsCount
- type LogContent
- type Logs
- type NetSegments
- type ParentNode
- type ProfilingEvent
- type QueryBuilder
- func (builder *QueryBuilder) And(where *whereSQL) *QueryBuilder
- func (builder *QueryBuilder) Between(key string, from interface{}, to interface{}) *QueryBuilder
- func (builder *QueryBuilder) Contains(key string, value any) *QueryBuilder
- func (builder *QueryBuilder) Equals(key string, value interface{}) *QueryBuilder
- func (builder *QueryBuilder) EqualsNotEmpty(key string, value string) *QueryBuilder
- func (builder *QueryBuilder) Exists(key string) *QueryBuilder
- func (builder *QueryBuilder) GreaterThan(key string, value any) *QueryBuilder
- func (builder *QueryBuilder) In(key string, values any) *QueryBuilder
- func (builder *QueryBuilder) InStrings(key string, values []string) *QueryBuilder
- func (builder *QueryBuilder) LessThan(key string, value any) *QueryBuilder
- func (builder *QueryBuilder) Like(key string, values any) *QueryBuilder
- func (builder *QueryBuilder) NotContains(key string, value any) *QueryBuilder
- func (builder *QueryBuilder) NotEquals(key string, value interface{}) *QueryBuilder
- func (builder *QueryBuilder) NotExists(key string) *QueryBuilder
- func (builder *QueryBuilder) NotGreaterThan(key string, value any) *QueryBuilder
- func (builder *QueryBuilder) NotIn(key string, values any) *QueryBuilder
- func (builder *QueryBuilder) NotLessThan(key string, value any) *QueryBuilder
- func (builder *QueryBuilder) NotLike(key string, values any) *QueryBuilder
- func (builder *QueryBuilder) Statement(where string) *QueryBuilder
- func (builder *QueryBuilder) String() string
- type QueryTraceResult
- type Repo
- type ServiceNode
- type ServiceNodeWithDepth
- type ServiceRedMetric
- type ServiceRelation
- type Source
- type SpanTraceOptions
- type ValueInGroups
- type WrappedConn
- func (c *WrappedConn) Exec(ctx context.Context, query string, args ...any) error
- func (c *WrappedConn) Ping(ctx context.Context) error
- func (c *WrappedConn) Query(ctx context.Context, query string, args ...any) (driver.Rows, error)
- func (c *WrappedConn) QueryRow(ctx context.Context, query string, args ...any) driver.Row
- func (c *WrappedConn) Select(ctx context.Context, dest any, query string, args ...any) error
Constants ¶
View Source
const ( // The SQL _GET_SAMPLE_ALERT_EVENT are grouped by the alarm_event name. Each group takes the record with the latest event and records the number of alarms with the same name in the returned result. SQL_GET_SAMPLE_ALERT_EVENT = `` /* 517-byte string literal not displayed */ SQL_GET_ALERT_EVENT_DATA_SCOPE = `` /* 140-byte string literal not displayed */ SQL_GET_GROUP_COUNTS_ALERT_EVENT = `` /* 216-byte string literal not displayed */ GET_ALERT_EVENTS_COUNT = `SELECT count(1) as count FROM alert_event %s` SQL_GET_PAGED_ALERT_EVENT = `` /* 147-byte string literal not displayed */ )
View Source
const ( SQL_LIST_APP_INFO_LABEL_KEYS = `SELECT DISTINCT arrayJoin(mapKeys(labels)) AS key FROM originx_app_info %s` SQL_LIST_APP_INFO_LABEL_VALUES = `SELECT DISTINCT %s FROM originx_app_info %s` )
View Source
const ( SQL_GET_APP_LOG_SOURCE = `SELECT LogAttributes['_source_'] as LogSource FROM ilogtail_logs %s %s` SQL_GET_APP_LOG = `SELECT toUnixTimestamp64Micro(Timestamp) as ts,Body FROM ilogtail_logs %s %s` )
View Source
const ( TEMPLATE_QUERY_GROUP_RED_METRIC = "" /* 201-byte string literal not displayed */ TEMPLATE_QUERY_RED_METRIC_VALUE = "SELECT sum(count) as total_count, sum(error_count) as total_error, sum(duration) as total_duration FROM service_red_metric %s" TEMPLATE_QUERY_SERVICES = "" /* 132-byte string literal not displayed */ TEMPLATE_QUERY_ENDPOINTS = "SELECT endpoint FROM service_red_metric %s GROUP BY endpoint" )
View Source
const ( SQL_GET_PARENT_NODES = `` /* 409-byte string literal not displayed */ SQL_GET_CHILD_NODES = `` /* 343-byte string literal not displayed */ SQL_GET_DESCENDANT_TOPOLOGY = `` /* 924-byte string literal not displayed */ SQL_GET_ENTRY_NODES = ` SELECT entry_service, entry_url FROM service_relationship %s GROUP BY entry_service, entry_url ` SQL_GET_SERVICE_TOPOLOGY = `` /* 470-byte string literal not displayed */ SQL_GET_ANCESTOR_NODES = `` /* 436-byte string literal not displayed */ )
View Source
const ( TEMPLATE_COUNT_SPAN_TRACE = "SELECT count(1) as total FROM span_trace %s" TEMPLATE_QUERY_SPAN_TRACE = "SELECT %s FROM span_trace %s %s" SQL_GET_LABEL_FILTER_KEYS = `` /* 135-byte string literal not displayed */ SQL_GET_FLAGS_FILTER_KEYS = `` /* 131-byte string literal not displayed */ SQL_GET_FILTER_VALUES = `SELECT DISTINCT %s as label_value FROM span_trace st %s %s` )
View Source
const ( AndSep mergeSep = " AND " OrSep mergeSep = " OR " )
View Source
const GET_ALERTS_WITH_EVENT_COUNT = `` /* 418-byte string literal not displayed */
View Source
const SQL_GET_ALERTEVENT_COUNTS = `` /* 867-byte string literal not displayed */
View Source
const SQL_GET_ALERTEVENT_WITH_WORKFLOW_RECORD = `` /* 1283-byte string literal not displayed */
View Source
const SQL_GET_ALERTEVENT_WITH_WORKFLOW_RECORD_COUNT = `` /* 863-byte string literal not displayed */
View Source
const SQL_GET_ALERT_DETAIL = `` /* 1646-byte string literal not displayed */
View Source
const ( // 查询指定节点的入口信息,如果链路上存在异步请求,则返回异步入口的信息 SQL_GET_ENTRY_RELATIONSHIP = `` /* 725-byte string literal not displayed */ )
View Source
const (
SQL_GET_INSTANCE_ERROR_PROPAGATION = `` /* 1983-byte string literal not displayed */
)
View Source
const ( // SQL _GET_K8S_EVENTS get K8s event alarm SQL_GET_K8S_EVENTS = `` /* 339-byte string literal not displayed */ )
View Source
const SQL_GET_LATEST_ALERT_EVENT_BY_ALERTID = `SELECT * FROM alert_event ae
%s ORDER BY received_time DESC LIMIT 1`
View Source
const SQL_GET_RELEATED_ALERT_EVENT = `` /* 1621-byte string literal not displayed */
View Source
const SQL_GET_RELEATED_ALERT_EVENT_COUNT = `SELECT count(1) AS count
FROM alert_event ae
%s`
View Source
const SQL_GET_RELEATED_ALERT_EVENT_LOCATE = `` /* 218-byte string literal not displayed */
View Source
const SQL_SEARCH_ALERT_FILTER_KEYS = `` /* 890-byte string literal not displayed */
View Source
const SQL_SEARCH_ALERT_FILTER_VALUES = `` /* 898-byte string literal not displayed */
View Source
const SQL_SEARCH_ALERT_FILTER_VALUES_FROM_WORKFLOW = `` /* 898-byte string literal not displayed */
View Source
const (
TEMPLATE_QUERY_APP_INFO = "SELECT host_pid, container_id, labels FROM originx_app_info %s"
)
View Source
const (
TEMPLATE_QUERY_REALTIME_TOPOLOGY = "" /* 150-byte string literal not displayed */
)
Variables ¶
View Source
var ( ALWAYS_TRUE = &whereSQL{Wheres: "TRUE"} ALWAYS_FALSE = &whereSQL{Wheres: "FALSE"} )
Functions ¶
func EscapeForLog ¶
func GetAlertType ¶
func NewQueryCondition ¶
Types ¶
type AlertEventSample ¶
type AlertEventSample struct {
model.AlertEvent
// Record line number
Rn uint64 `ch:"rn" json:"-"`
AlarmCount uint64 `ch:"alarm_count" json:"alarmCount"`
AlertKey string `ch:"alert_key" json:"alertKey"`
}
type AlertGroup ¶
type AlertGroup string
const ( APP_GROUP AlertGroup = "app" NETWORK_GROUP AlertGroup = "network" CONTAINER_GROUP AlertGroup = "container" INFRA_GROUP AlertGroup = "infra" MIDDLEWARE_GROUP AlertGroup = "middleware" )
func (AlertGroup) GetAlertType ¶
func (g AlertGroup) GetAlertType() string
type AlertService ¶
type AlertService struct {
Service string `json:"serviceName"`
Endpoint string `json:"endpoint"`
DatabaseURL string `json:"dbURL"`
DatabaseIP string `json:"dbIP"`
DatabasePort string `json:"dbPort"`
}
和ServiceNode结构完全相同 作为查询条件时,允许Endpoint为空 表示对应Service下的所有Endpoint
type BucketRedMetric ¶
type ByLimitBuilder ¶
type ByLimitBuilder struct {
// contains filtered or unexported fields
}
func NewByLimitBuilder ¶
func NewByLimitBuilder() *ByLimitBuilder
func (*ByLimitBuilder) GroupBy ¶
func (builder *ByLimitBuilder) GroupBy(keys ...string) *ByLimitBuilder
func (*ByLimitBuilder) Limit ¶
func (builder *ByLimitBuilder) Limit(limit int) *ByLimitBuilder
func (*ByLimitBuilder) Offset ¶
func (builder *ByLimitBuilder) Offset(offset int) *ByLimitBuilder
func (*ByLimitBuilder) OrderBy ¶
func (builder *ByLimitBuilder) OrderBy(key string, asc bool) *ByLimitBuilder
func (*ByLimitBuilder) String ¶
func (builder *ByLimitBuilder) String() string
Return GroupBy, OrderBy, and Limit
type ChildRelation ¶
type ChildRelation struct {
ParentService string `ch:"parentService"`
ParentUrl string `ch:"parentUrl"`
Service string `ch:"service"`
Url string `ch:"url"`
IsTraced bool `ch:"traced"`
ClientGroup string `ch:"clientGroup"`
ClientType string `ch:"clientType"`
ClientPeer string `ch:"clientPeer"`
ClientKey string `ch:"clientKey"`
}
type EntryRelationship ¶
type EntryRelationship struct {
Service string `ch:"service"`
Endpoint string `ch:"url"`
EntryService string `ch:"entry_service"`
EntryEndpoint string `ch:"entry_url"`
AsyncEntryService string `ch:"async_entry_service"`
AsyncEntryEndpoint string `ch:"async_entry_endpoint"`
}
EntryRelationship 表示下游节点和其入口的直接对应关系
func (*EntryRelationship) GetEntryEndpoint ¶
func (r *EntryRelationship) GetEntryEndpoint() string
func (*EntryRelationship) GetEntryService ¶
func (r *EntryRelationship) GetEntryService() string
type ErrorInstancePropagation ¶
type ErrorInstancePropagation struct {
Timestamp time.Time `ch:"timestamp"`
Service string `ch:"service"`
InstanceId string `ch:"instance_id"`
TraceId string `ch:"trace_id"`
ErrorTypes []string `ch:"error_types"`
ErrorMsgs []string `ch:"error_msgs"`
ParentServices []string `ch:"parent_services"`
ParentInstances []string `ch:"parent_instances"`
ParentTraced []bool `ch:"parent_traced"`
ChildServices []string `ch:"child_services"`
ChildInstances []string `ch:"child_instances"`
ChildTraced []bool `ch:"child_traced"`
}
type FaultLogQuery ¶
type FaultLogQuery struct {
StartTime int64
EndTime int64
Service string
Instance string
NodeName string
ContainerId string
Pid uint32
EndPoint string
TraceId string
PageNum int
PageSize int
Type int // 0 - slow & error, 1 - error
MultiServices []string // Match multiple service
MultiNamespace []string // Match multiple namespace
Pod string // Pod name
ClusterIDs []string
}
type FaultLogResult ¶
type FaultLogResult struct {
ServiceName string `ch:"service_name" json:"serviceName"`
InstanceId string `ch:"instance_id" json:"instanceId"`
TraceId string `ch:"trace_id" json:"traceId"`
StartTime uint64 `ch:"start_time_us" json:"startTime"`
EndTime uint64 `ch:"end_time_us" json:"endTime"`
EndPoint string `ch:"endpoint" json:"endpoint"`
PodName string `ch:"pod_name" json:"podName"`
ContainerId string `ch:"container_id" json:"containerId"`
NodeName string `ch:"node_name" json:"nodeName"`
Pid uint32 `ch:"pid" json:"pid"`
}
type FieldBuilder ¶
type FieldBuilder struct {
// contains filtered or unexported fields
}
func NewFieldBuilder ¶
func NewFieldBuilder() *FieldBuilder
func (*FieldBuilder) Alias ¶
func (builder *FieldBuilder) Alias(key string, alias string) *FieldBuilder
func (*FieldBuilder) Fields ¶
func (builder *FieldBuilder) Fields(keys ...string) *FieldBuilder
type FlameGraphData ¶
type FlameGraphData struct {
StartTime int64 `ch:"start_time" json:"startTime"`
EndTime int64 `ch:"end_time" json:"endTime"`
PID uint32 `ch:"pid" json:"pid"`
TID uint32 `ch:"tid" json:"tid"`
SampleType string `ch:"sample_type" json:"sampleType"`
SampleRate uint32 `ch:"sample_rate" json:"sampleRate"`
Labels map[string]string `ch:"labels" json:"labels"`
FlameBearer string `ch:"flamebearer" json:"flameBearer"`
}
type GroupRedMetric ¶
type GroupRedMetric struct {
Duration int64
TotalCount uint64 `ch:"total_count"`
TotalError uint64 `ch:"total_error"`
TotalDuration uint64 `ch:"total_duration"`
}
func (*GroupRedMetric) GetAvgLatency ¶
func (metric *GroupRedMetric) GetAvgLatency() float64
func (*GroupRedMetric) GetErrorRate ¶
func (metric *GroupRedMetric) GetErrorRate() float64
func (*GroupRedMetric) GetTpm ¶
func (metric *GroupRedMetric) GetTpm() float64
type GroupService ¶
type K8sEvents ¶
type K8sEvents struct {
Timestamp time.Time `ch:"Timestamp" json:"timestamp"`
SeverityText string `ch:"SeverityText" json:"SeverityText"`
Body string `ch:"Body" json:"body"`
ResourceAttributes map[string]string `ch:"ResourceAttributes" json:"resourceAttributes"`
LogAttributes map[string]string `ch:"LogAttributes" json:"logAttributes"`
}
func (*K8sEvents) GetObjKind ¶
func (*K8sEvents) GetObjName ¶
type K8sEventsCount ¶
type LogContent ¶
type Logs ¶
type Logs struct {
Source string `json:"source"`
Contents []LogContent `json:"contents"`
}
type NetSegments ¶
type ParentNode ¶
type ProfilingEvent ¶
type ProfilingEvent struct {
Timestamp time.Time `json:"timestamp" ch:"timestamp"`
StartTime uint64 `json:"startTime" ch:"startTime"`
EndTime uint64 `json:"endTime" ch:"endTime"`
Offset int64 `json:"offset" ch:"offset"`
PID uint32 `json:"pid" ch:"pid"`
TID uint32 `json:"tid" ch:"tid"`
TransactionIDs string `json:"transactionIds" ch:"transactionIds"`
CPUEvents string `json:"cpuEvents" ch:"cpuEvents"`
InnerCalls string `json:"innerCalls" ch:"innerCalls"`
JavaFutexEvents string `json:"javaFutexEvents" ch:"javaFutexEvents"`
Spans string `json:"spans" ch:"spans"`
ThreadName string `json:"threadName" ch:"threadName"` // thread name table in labels
Labels map[string]string `json:"labels" ch:"labels"`
}
type QueryBuilder ¶
type QueryBuilder struct {
// contains filtered or unexported fields
}
func NewQueryBuilder ¶
func NewQueryBuilder() *QueryBuilder
func (*QueryBuilder) And ¶
func (builder *QueryBuilder) And(where *whereSQL) *QueryBuilder
And Add a series of conditional whereSQL to the QueryBuilder as And Nil is treated as ALWAYS_FALSE
func (*QueryBuilder) Between ¶
func (builder *QueryBuilder) Between(key string, from interface{}, to interface{}) *QueryBuilder
func (*QueryBuilder) Contains ¶
func (builder *QueryBuilder) Contains(key string, value any) *QueryBuilder
func (*QueryBuilder) Equals ¶
func (builder *QueryBuilder) Equals(key string, value interface{}) *QueryBuilder
func (*QueryBuilder) EqualsNotEmpty ¶
func (builder *QueryBuilder) EqualsNotEmpty(key string, value string) *QueryBuilder
func (*QueryBuilder) Exists ¶
func (builder *QueryBuilder) Exists(key string) *QueryBuilder
func (*QueryBuilder) GreaterThan ¶
func (builder *QueryBuilder) GreaterThan(key string, value any) *QueryBuilder
func (*QueryBuilder) In ¶
func (builder *QueryBuilder) In(key string, values any) *QueryBuilder
The key in (values) statement in the SQL statement is generated by combination. The value array is inside the value array.
func (*QueryBuilder) InStrings ¶
func (builder *QueryBuilder) InStrings(key string, values []string) *QueryBuilder
func (*QueryBuilder) LessThan ¶
func (builder *QueryBuilder) LessThan(key string, value any) *QueryBuilder
func (*QueryBuilder) Like ¶
func (builder *QueryBuilder) Like(key string, values any) *QueryBuilder
func (*QueryBuilder) NotContains ¶
func (builder *QueryBuilder) NotContains(key string, value any) *QueryBuilder
func (*QueryBuilder) NotEquals ¶
func (builder *QueryBuilder) NotEquals(key string, value interface{}) *QueryBuilder
func (*QueryBuilder) NotExists ¶
func (builder *QueryBuilder) NotExists(key string) *QueryBuilder
func (*QueryBuilder) NotGreaterThan ¶
func (builder *QueryBuilder) NotGreaterThan(key string, value any) *QueryBuilder
func (*QueryBuilder) NotIn ¶
func (builder *QueryBuilder) NotIn(key string, values any) *QueryBuilder
func (*QueryBuilder) NotLessThan ¶
func (builder *QueryBuilder) NotLessThan(key string, value any) *QueryBuilder
func (*QueryBuilder) NotLike ¶
func (builder *QueryBuilder) NotLike(key string, values any) *QueryBuilder
func (*QueryBuilder) Statement ¶
func (builder *QueryBuilder) Statement(where string) *QueryBuilder
func (*QueryBuilder) String ¶
func (builder *QueryBuilder) String() string
Return the query condition
type QueryTraceResult ¶
type QueryTraceResult struct {
Timestamp int64 `ch:"ts" json:"timestamp"`
Duration uint64 `ch:"duration_us" json:"duration"`
ServiceName string `ch:"service_name" json:"serviceName"`
Pid uint32 `ch:"pid" json:"pid"`
Tid uint32 `ch:"tid" json:"tid"`
TraceId string `ch:"trace_id" json:"traceId"`
EndPoint string `ch:"endpoint" json:"endpoint"`
InstanceId string `ch:"instance_id" json:"instanceId"`
SpanId string `ch:"span_id" json:"spanId"`
ApmType string `ch:"apm_type" json:"apmType"`
Reason string `ch:"reason" json:"reason"`
IsError bool `ch:"is_error" json:"isError"`
IsSlow bool `ch:"is_slow" json:"isSlow"`
ThresholdValue float64 `ch:"threshold_value" json:"thresholdValue"`
ThresholdMultiple float64 `ch:"threshold_multiple" json:"thresholdMultiple"`
Labels map[string]string `ch:"labels" json:"labels"`
Flags map[string]bool `ch:"flags" json:"flags"`
Metrics map[string]uint64 `ch:"metrics" json:"metrics"`
MutatedValue uint64 `ch:"mutated_value" json:"mutatedValue"`
IsMutated uint8 `ch:"is_mutated" json:"isMutated"` // whether the delay changes abruptly
}
type Repo ¶
type Repo interface {
// ========== service_relationship ==========
// Query the list of upstream nodes
ListParentNodes(ctx core.Context, req *request.GetServiceEndpointTopologyRequest) (*model.TopologyNodes, error)
// Query the list of downstream nodes
ListChildNodes(ctx core.Context, req *request.GetServiceEndpointTopologyRequest) (*model.TopologyNodes, error)
// Query the list of all descendant service nodes
ListDescendantNodes(ctx core.Context, req *request.GetDescendantMetricsRequest) (*model.TopologyNodes, error)
// Query the calling relationship of all descendant nodes
ListDescendantRelations(ctx core.Context, req *request.GetServiceEndpointTopologyRequest) ([]*model.TopologyRelation, error)
// Query the entry node list
ListEntryEndpoints(ctx core.Context, req *request.GetServiceEntryEndpointsRequest) ([]EntryNode, error)
SearchEntryEndpointsByAlertService(ctx core.Context, endpoints []AlertService, startTime, endTime int64) ([]EntryRelationship, error)
// Query Service Topology
ListServiceTopologys(ctx core.Context, req *request.QueryTopologyRequest) (*model.ServiceTopologyNodes, error)
ListAncestorEndpoints(ctx core.Context, req *request.GetServiceEntryEndpointsRequest) ([]ServiceNodeWithDepth, error)
// ========== error_propagation ==========
// Query instance-related error propagation chain
ListErrorPropagation(ctx core.Context, req *request.GetErrorInstanceRequest) ([]ErrorInstancePropagation, error)
// ========== span_trace ==========
GetAvailableFilterKey(ctx core.Context, startTime, endTime time.Time, needUpdate bool) ([]request.SpanTraceFilter, error)
UpdateFilterKey(ctx core.Context, startTime, endTime time.Time) ([]request.SpanTraceFilter, error)
GetFieldValues(ctx core.Context, searchText string, filter *request.SpanTraceFilter, startTime, endTime time.Time) (*SpanTraceOptions, error)
// Paging query the fault site log list
GetFaultLogPageList(ctx core.Context, query *FaultLogQuery) ([]FaultLogResult, int64, error)
// Paged Trace List
GetTracePageList(ctx core.Context, req *request.GetTracePageListRequest) ([]QueryTraceResult, int64, error)
CountK8sEvents(ctx core.Context, startTime int64, endTim int64, pods []string, clusterIDs []string) ([]K8sEventsCount, error)
// ========== application_logs ==========
// Query the log content of the fault site. The sourceFrom can be blank. The log in the first source that can be found will be returned.
QueryApplicationLogs(ctx core.Context, req *request.GetFaultLogContentRequest) (logContents *Logs, availableSource []string, err error)
// Query the available source of the fault field log content
QueryApplicationLogsAvailableSource(ctx core.Context, faultLog FaultLogResult) ([]string, error)
CreateLogTable(ctx core.Context, req *request.LogTableRequest) ([]string, error)
DropLogTable(ctx core.Context, req *request.LogTableRequest) ([]string, error)
UpdateLogTable(ctx core.Context, req *request.LogTableRequest, old []request.Field) ([]string, error)
QueryAllLogs(ctx core.Context, req *request.LogQueryRequest) ([]map[string]any, string, error)
QueryAllLogsInOrder(ctx core.Context, req *request.LogQueryRequest) ([]map[string]any, string, error)
QueryLogContext(ctx core.Context, req *request.LogQueryContextRequest) ([]map[string]any, []map[string]any, error)
GetLogChart(ctx core.Context, req *request.LogQueryRequest) ([]map[string]any, int64, error)
GetLogIndex(ctx core.Context, req *request.LogIndexRequest) (map[string]uint64, uint64, error)
OtherLogTable(ctx core.Context) ([]map[string]any, error)
OtherLogTableInfo(ctx core.Context, req *request.OtherTableInfoRequest) ([]map[string]any, error)
InsertBatchAlertEvents(ctx core.Context, events []*model.AlertEvent) error
ReadAlertEvent(ctx core.Context, id uuid.UUID) (*model.AlertEvent, error)
GetConn(ctx core.Context) driver.Conn
//config
ModifyTableTTL(ctx core.Context, mapResult []model.ModifyTableTTLMap) error
GetTables(ctx core.Context, tables []model.Table) ([]model.TablesQuery, error)
// ========== alert =================
GetAlertsWithEventCount(ctx core.Context, startTime, endTime time.Time, filter *alert.AlertEventFilter, maxSize int) ([]alert.AlertWithEventCount, uint64, error)
// ========== alert events ==========
// Query the alarm events sampled by group and level, and sampleCount the number of samples for each group and level.
GetAlertEventCountGroupByInstance(ctx core.Context, startTime time.Time, endTime time.Time, filter request.AlertFilter, instances *model.RelatedInstances) ([]model.AlertEventCount, error)
// Query alarm events sampled by labels, sampleCount the number of samples for each label.
GetAlertEventsSample(ctx core.Context, sampleCount int, startTime time.Time, endTime time.Time, filter request.AlertFilter, instances *model.RelatedInstances) ([]AlertEventSample, error)
// Query alarm events by pageParam
GetAlertEvents(ctx core.Context, startTime time.Time, endTime time.Time, filter request.AlertFilter, instances *model.RelatedInstances, pageParam *request.PageParam) ([]alert.AlertEvent, uint64, error)
GetAlertDataScope(ctx core.Context, startTime time.Time, endTime time.Time) ([]datagroup.DataScope, error)
// ========== k8s events ============
// SeverityNumber > 9 (warning)
GetK8sAlertEventsSample(ctx core.Context, startTime time.Time, endTime time.Time, instances []*model.ServiceInstance) ([]K8sEvents, error)
// profiling_event
// GetOnOffCPU get span execution consumption
GetOnOffCPU(ctx core.Context, pid uint32, nodeName string, startTime, endTime int64) (*[]ProfilingEvent, error)
// ========== network (deepflow) ==========
GetNetworkSpanSegments(ctx core.Context, traceId string, spanId string) ([]NetSegments, error)
// ========== flame graph ===========
GetFlameGraphData(ctx core.Context, startTime, endTime int64, nodeName string, pid, tid int64, sampleType, spanId, traceId string) (*[]FlameGraphData, error)
AddWorkflowRecord(ctx core.Context, record *model.WorkflowRecord) error
AddWorkflowRecords(ctx core.Context, records []model.WorkflowRecord) error
GetAlertEventWithWorkflowRecord(ctx core.Context, req *request.AlertEventSearchRequest, cacheMinutes int) ([]alert.AEventWithWRecord, int64, error)
GetAlertEventCounts(ctx core.Context, req *request.AlertEventSearchRequest, cacheMinutes int) (map[string]int64, error)
GetAlertDetail(ctx core.Context, req *request.GetAlertDetailRequest, cacheMinutes int) (*alert.AEventWithWRecord, error)
GetRelatedAlertEvents(ctx core.Context, req *request.GetAlertDetailRequest, cacheMinutes int) ([]alert.AEventWithWRecord, int64, error)
CreateAlertNotifyRecord(ctx core.Context, record model.AlertNotifyRecord) error
GetLatestAlertEventByAlertID(ctx core.Context, alertID string) (*alert.AlertEvent, error)
ManualResolveLatestAlertEventByAlertID(ctx core.Context, alertID string) error
GetStaticFilterKeys(ctx core.Context) []request.AlertEventFilter
GetAlertEventFilterLabelKeys(ctx core.Context, req *request.SearchAlertEventFilterValuesRequest) ([]string, error)
GetAlertEventFilterValues(ctx core.Context, req *request.SearchAlertEventFilterValuesRequest) (*request.AlertEventFilter, error)
// Dataplane
QueryServices(ctx core.Context, startTime int64, endTime int64, clusterId string) ([]*model.Service, error)
QueryServiceEndpoints(ctx core.Context, startTime int64, endTime int64, clusterId string, serviceName string) ([]string, error)
QueryGroupServiceRedMetrics(ctx core.Context, startTime int64, endTime int64, clusterId string, serviceName string, endpoint string, step int64) ([]BucketRedMetric, error)
QueryGroupServiceRedMetricValue(ctx core.Context, startTime int64, endTime int64, clusterId string, serviceName string, endpoint string) (*GroupRedMetric, error)
QueryRealtimeServiceTopology(ctx core.Context, startTime int64, endTime int64, clusterId string) ([]model.ServiceToplogy, error)
GetToResolveApps(ctx core.Context) ([]model.AppInfo, error)
ListAppInfoLabelKeys(ctx core.Context, startTime, endTime int64) ([]string, error)
ListAppInfoLabelValues(ctx core.Context, startTime, endTime int64, key string) ([]string, error)
GetResolvedApps(ctx core.Context, ruleIds []string, startTime int64, endTime int64) ([]model.AppInfo, error)
GetDataplaneServiceList(ctx core.Context, req *request.QueryServiceNameRequest) ([]*model.Service, error)
GetDataplaneServiceInstances(ctx core.Context, startTime int64, endTime int64, cluster string, serviceNames []string) ([]*model.ServiceInstance, error)
integration.Input
// contains filtered or unexported methods
}
type ServiceNode ¶
type ServiceNodeWithDepth ¶
type ServiceRedMetric ¶
type ServiceRelation ¶
type SpanTraceOptions ¶
type SpanTraceOptions struct {
request.SpanTraceFilter
Options any `json:"options"`
}
type ValueInGroups ¶
type ValueInGroups struct {
Keys []string
ValueGroups []clickhouse.GroupSet
}
ValueInGroups is used to pass in multiple sets of InGroups parameters in the OrInGroups and make OR connections. Each ValueInGroups generates the following SQL, where x is each value in the EqualIfNotEmpty (keys) IN (ValueGroups)
Source Files
¶
- dao.go
- dao_alert_analyze_relation.go
- dao_alert_event_detail.go
- dao_alert_event_filter.go
- dao_alert_event_with_workflow.go
- dao_alert_events.go
- dao_alert_notify.go
- dao_alerts_with_event_count.go
- dao_app_info.go
- dao_config.go
- dao_error_propagation.go
- dao_flame_graph.go
- dao_k8s_event.go
- dao_list_app_info_label_keys.go
- dao_log_chart.go
- dao_log_index.go
- dao_log_table.go
- dao_network_span_segments.go
- dao_other_log_table.go
- dao_profilling_event.go
- dao_query_all_log.go
- dao_query_app_logs.go
- dao_query_log_context.go
- dao_query_rows.go
- dao_service_k8s_events.go
- dao_service_red_metric.go
- dao_service_relationship.go
- dao_service_topology.go
- dao_span_trace.go
- dao_workflow_records.go
- sql_builder.go
- sub_sql_builder.go
- wrapped_driver.go
Click to show internal directories.
Click to hide internal directories.