Documentation ¶
Index ¶
- Constants
- Variables
- func ColumnNameSwap(args []interface{}) func(result *common.Result) error
- func ExtractFromWhereAndvisibilityFilter(s string) (table string, whereClause string, visibilityFilter string)
- func FormatInnerTime(m *view.Model)
- func FormatLimit(m *view.Model)
- func FormatModel(m *view.Model)
- func GetDatabases() *common.Result
- func GetDefaultAlias(name string, args []string) string
- func GetMetricIDFilter(e *CHEngine) (view.Node, error)
- func GetNotNullFilter(name string, e *CHEngine) (view.Node, bool)
- func GetPrometheusAllTagTranslator(e *CHEngine) (string, string, error)
- func GetPrometheusFilter(promTag, table, op, value string, e *CHEngine) (string, error)
- func GetPrometheusGroup(name string, e *CHEngine) string
- func GetPrometheusNotNullFilter(name string, e *CHEngine) (view.Node, bool)
- func GetPrometheusSingleTagTranslator(tag string, e *CHEngine) (string, string, error)
- func GetRemoteReadFilter(promTag, table, op, value, originFilter string, e *CHEngine) (string, error)
- func GetTables(db, where, queryCacheTTL, orgID string, useQueryCache bool, ...) *common.Result
- func GetVirtualTableFilter(db, table string) (view.Node, bool)
- func LoadDbDescriptions(dbDescriptions map[string]interface{}) error
- func MacTranslate(args []interface{}) func(result *common.Result) error
- func MatchPattern(s string) (int, bool)
- func ShowTagTypeMetrics(tagDescriptions, result *common.Result, db, table string)
- func SimpleExecute(args *common.QuerierParams) (result *common.Result, debug map[string]interface{}, err error)
- func TimeFill(args []interface{}) func(result *common.Result) error
- func TransAlertEventNoSuffixFilter(translator, regexpTranslator, op, value string) (filter string)
- func TransChostFilter(translator, regexpTranslator, op, value string) (filter string)
- func TransEnvFilter(translator, regexpTranslator, key, op, value string) (filter string)
- func TransIngressFilter(translator, regexpTranslator, op, value string) (filter string)
- func TransLabelFilter(translator, regexpTranslator, key, op, value string) (filter string)
- func TransTagFilter(whereTag, postAsTag, value, op, db, table, originFilter string, ...) (filter string, err error)
- func TransWhereTagFunction(db, table string, name string, args []string) (filter string)
- type AggFunction
- type BinaryFunction
- type CHEngine
- func (e *CHEngine) AddGroup(group string) error
- func (e *CHEngine) AddTable(table string)
- func (e *CHEngine) AddTag(tag string, alias string) (string, error)
- func (e *CHEngine) ExecuteQuery(args *common.QuerierParams) (*common.Result, map[string]interface{}, error)
- func (e *CHEngine) Init()
- func (e *CHEngine) ParseShowSql(sql string, args *common.QuerierParams, DebugInfo *client.DebugInfo) (*common.Result, []string, bool, error)
- func (e *CHEngine) ParseSlimitSql(sql string, args *common.QuerierParams) (string, map[string]func(*common.Result) error, map[string]*common.ColumnSchema, ...)
- func (e *CHEngine) ParseWithSql(sql string) (string, map[string]func(*common.Result) error, map[string]*common.ColumnSchema, ...)
- func (e *CHEngine) QuerySlimitSql(sql string, args *common.QuerierParams) (*common.Result, *client.Debug, error)
- func (e *CHEngine) QueryWithSql(sql string, args *common.QuerierParams) (*common.Result, *client.Debug, error)
- func (e *CHEngine) SetLevelFlag(flag int)
- func (e *CHEngine) ToSQLString() string
- func (e *CHEngine) TransDerivativeGroupBy(groups sqlparser.GroupBy) error
- func (e *CHEngine) TransFrom(froms sqlparser.TableExprs) error
- func (e *CHEngine) TransGroupBy(groups sqlparser.GroupBy) error
- func (e *CHEngine) TransHaving(node *sqlparser.Where) error
- func (e *CHEngine) TransLimit(limit *sqlparser.Limit) error
- func (e *CHEngine) TransOrderBy(orders sqlparser.OrderBy) error
- func (e *CHEngine) TransPrometheusTargetIDFilter(expr view.Node) (view.Node, error)
- func (e *CHEngine) TransSelect(tags sqlparser.SelectExprs) error
- func (e *CHEngine) TransWhere(node *sqlparser.Where) error
- type Callback
- type Field
- type FieldFunction
- type Function
- type GroupTag
- type Having
- type PrometheusSubqueryCache
- type SelectTag
- type Statement
- func GetAggFunc(name string, args []string, alias string, derivativeArgs []string, e *CHEngine) (Statement, int, string, error)
- func GetDefaultTag(name string, alias string) Statement
- func GetGroup(name string, e *CHEngine) ([]Statement, error)
- func GetMetricsTag(name string, alias string, e *CHEngine) (Statement, error)
- func GetTagFunction(name string, args []string, alias string, e *CHEngine) (Statement, error)
- func GetTagTranslator(name, alias string, e *CHEngine) ([]Statement, string, error)
- func GetTopKTrans(name string, args []string, alias string, e *CHEngine) (Statement, int, string, error)
- type Table
- type TagFunction
- type TargetLabelFilter
- type Time
- type TimeIntervalField
- type TimeTag
- type Where
- type WhereFunction
- type WhereStatement
- type WhereTag
Constants ¶
View Source
const ( TAG_FUNCTION_NODE_TYPE = "node_type" TAG_FUNCTION_ICON_ID = "icon_id" TAG_FUNCTION_MASK = "mask" TAG_FUNCTION_TIME = "time" TAG_FUNCTION_TO_UNIX_TIMESTAMP_64_MICRO = "toUnixTimestamp64Micro" TAG_FUNCTION_TO_UNIX_TIMESTAMP = "toUnixTimestamp" TAG_FUNCTION_TO_STRING = "toString" TAG_FUNCTION_IF = "if" TAG_FUNCTION_UNIQ = "uniq" TAG_FUNCTION_ANY = "any" TAG_FUNCTION_TOPK = "topK" TAG_FUNCTION_NEW_TAG = "newTag" TAG_FUNCTION_ENUM = "enum" TAG_FUNCTION_FAST_FILTER = "FastFilter" TAG_FUNCTION_FAST_TRANS = "FastTrans" TAG_FUNCTION_COUNT_DISTINCT = "countDistinct" )
View Source
const INTERVAL_1D = 86400
Variables ¶
View Source
var DEFAULT_LIMIT = "10000"
View Source
var INVALID_PROMETHEUS_SUBQUERY_CACHE_ENTRY = "-1"
View Source
var Lock sync.Mutex
View Source
var TAG_FUNCTIONS = []string{ TAG_FUNCTION_NODE_TYPE, TAG_FUNCTION_ICON_ID, TAG_FUNCTION_MASK, TAG_FUNCTION_TIME, TAG_FUNCTION_TO_UNIX_TIMESTAMP_64_MICRO, TAG_FUNCTION_TO_STRING, TAG_FUNCTION_IF, TAG_FUNCTION_UNIQ, TAG_FUNCTION_ANY, TAG_FUNCTION_TOPK, TAG_FUNCTION_TO_UNIX_TIMESTAMP, TAG_FUNCTION_NEW_TAG, TAG_FUNCTION_ENUM, TAG_FUNCTION_FAST_FILTER, TAG_FUNCTION_FAST_TRANS, TAG_FUNCTION_COUNT_DISTINCT, }
View Source
var TIME_FILL_LIMIT_DEFAULT = 20
Functions ¶
func ColumnNameSwap ¶
func ExtractFromWhereAndvisibilityFilter ¶ added in v1.6.65
func ExtractFromWhereAndvisibilityFilter(s string) (table string, whereClause string, visibilityFilter string)
extractFromWhere extracts the first string after 'from' and all strings after 'where'.
func FormatInnerTime ¶
func FormatLimit ¶
func FormatModel ¶
func GetDatabases ¶
func GetDefaultAlias ¶
func GetPrometheusFilter ¶
func GetPrometheusGroup ¶
func GetRemoteReadFilter ¶
func LoadDbDescriptions ¶
func MacTranslate ¶
func MatchPattern ¶
func ShowTagTypeMetrics ¶
func SimpleExecute ¶
func TransChostFilter ¶
service, chost, chost_hostname, chost_ip, router, dhcpgw, redis, rds, lb_listener, natgw, lb, host, host_hostname, host_ip, pod_node, pod_node_hostname, pod_node_ip, pod_group_type
func TransEnvFilter ¶
k8s.env, os.app
func TransIngressFilter ¶
pod_ingress, pod_service, x_request_id, syscall_thread, syscall_coroutine, syscall_cap_seq, syscall_trace_id, tcp_seq
func TransLabelFilter ¶
k8s.label, k8s.annotation, cloud.tag
Types ¶
type AggFunction ¶
type AggFunction struct { // 指标量内容 Metrics *metrics.Metrics // 解析获得的参数 Name string Args []string Alias string IsDerivative bool DerivativeArgs []string DerivativeGroupBy []string }
func (*AggFunction) Format ¶
func (f *AggFunction) Format(m *view.Model)
func (*AggFunction) FormatInnerTag ¶
func (f *AggFunction) FormatInnerTag(m *view.Model) (innerAlias string)
func (*AggFunction) SetAlias ¶
func (f *AggFunction) SetAlias(alias string)
type BinaryFunction ¶
func GetBinaryFunc ¶
func GetBinaryFunc(name string, args []Function) (*BinaryFunction, error)
func (*BinaryFunction) Format ¶
func (f *BinaryFunction) Format(m *view.Model)
func (*BinaryFunction) SetAlias ¶
func (f *BinaryFunction) SetAlias(alias string)
type CHEngine ¶
type CHEngine struct { Model *view.Model Statements []Statement DB string Table string DataSource string AsTagMap map[string]string ColumnSchemas []*common.ColumnSchema View *view.View Context context.Context TargetLabelFilters []TargetLabelFilter NoPreWhere bool IsDerivative bool DerivativeGroupBy []string ORGID string }
func (*CHEngine) ExecuteQuery ¶
func (*CHEngine) ParseShowSql ¶
func (*CHEngine) ParseSlimitSql ¶
func (*CHEngine) ParseWithSql ¶
func (*CHEngine) QuerySlimitSql ¶
func (*CHEngine) QueryWithSql ¶
func (*CHEngine) SetLevelFlag ¶
func (*CHEngine) TransDerivativeGroupBy ¶
func (*CHEngine) TransPrometheusTargetIDFilter ¶
func (*CHEngine) TransSelect ¶
func (e *CHEngine) TransSelect(tags sqlparser.SelectExprs) error
type Callback ¶
type FieldFunction ¶
type FieldFunction interface { Function }
func GetFieldFunc ¶
func GetFieldFunc(name string) (FieldFunction, error)
type PrometheusSubqueryCache ¶
type PrometheusSubqueryCache struct { PrometheusSubqueryCache *lru.Cache[common.EntryKey, common.EntryValue] Lock sync.Mutex }
func GetPrometheusSubqueryCache ¶
func GetPrometheusSubqueryCache() *PrometheusSubqueryCache
func (*PrometheusSubqueryCache) Add ¶
func (c *PrometheusSubqueryCache) Add(key common.EntryKey, value common.EntryValue)
func (*PrometheusSubqueryCache) Get ¶
func (c *PrometheusSubqueryCache) Get(key common.EntryKey) (value common.EntryValue, ok bool)
type Statement ¶
翻译单元,翻译结果写入view.Model
func GetAggFunc ¶
func GetDefaultTag ¶
func GetTagFunction ¶
func GetTagTranslator ¶
type TagFunction ¶
type TagFunction struct { Name string Args []string Alias string Withs []view.Node Value string DB string Table string Engine *CHEngine }
func (*TagFunction) Check ¶
func (f *TagFunction) Check() error
func (*TagFunction) Format ¶
func (f *TagFunction) Format(m *view.Model)
func (*TagFunction) SetAlias ¶
func (f *TagFunction) SetAlias(alias string)
type TargetLabelFilter ¶
type Time ¶
type TimeIntervalField ¶
type TimeIntervalField struct {
FieldFunction
}
func (*TimeIntervalField) Format ¶
func (f *TimeIntervalField) Format(m *view.Model)
func (*TimeIntervalField) SetAlias ¶
func (f *TimeIntervalField) SetAlias(alias string)
type WhereFunction ¶
type WhereStatement ¶
func GetWhere ¶
func GetWhere(name, value string) WhereStatement
Source Files ¶
Click to show internal directories.
Click to hide internal directories.