Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultFunctions ¶ added in v0.49.0
func DefaultFunctions() map[string]interface{}
Types ¶
type Condition ¶
Condition represents an optional boolean condition on the RHS of a query. nolint:govet
type ExprFunc ¶ added in v0.49.0
type ExprFunc func(ctx TransformContext) interface{}
func NewFunctionCall ¶ added in v0.49.0
func NewFunctionCall(inv Invocation, functions map[string]interface{}, pathParser PathExpressionParser) (ExprFunc, error)
TODO(anuraaga): See if reflection can be avoided without complicating definition of transform functions. Visible for testing
type Getter ¶ added in v0.49.0
type Getter interface {
Get(ctx TransformContext) interface{}
}
type Invocation ¶
Invocation represents a function call. nolint:govet
type ParsedQuery ¶ added in v0.45.0
type ParsedQuery struct {
Invocation Invocation `@@`
Condition *Condition `( "where" @@ )?`
}
ParsedQuery represents a parsed query. It is the entry point into the query DSL. nolint:govet
type Path ¶
type Path struct {
Fields []Field `@@ ( "." @@ )*`
}
Path represents a telemetry path expression. nolint:govet
type PathExpressionParser ¶ added in v0.49.0
type Query ¶
type Query struct {
Function ExprFunc
Condition condFunc
}
Query holds a top level Query for processing telemetry data. A Query is a combination of a function invocation and the condition to match telemetry for invoking the function.
func ParseQueries ¶ added in v0.49.0
func ParseQueries(statements []string, functions map[string]interface{}, pathParser PathExpressionParser) ([]Query, error)
type Setter ¶ added in v0.49.0
type Setter interface {
Set(ctx TransformContext, val interface{})
}
type TransformContext ¶ added in v0.49.0
type TransformContext interface {
GetItem() interface{}
GetInstrumentationScope() pcommon.InstrumentationScope
GetResource() pcommon.Resource
}
type Value ¶
type Value struct {
Invocation *Invocation `( @@`
String *string `| @String`
Float *float64 `| @Float`
Int *int64 `| @Int`
Path *Path `| @@ )`
}
Value represents a part of a parsed query which is resolved to a value of some sort. This can be a telemetry path expression, function call, or literal. nolint:govet