beamtrace/aql

Types

pub type AgentComparator {
  AgentEqual
  AgentNotEqual
}

Constructors

  • AgentEqual
  • AgentNotEqual
pub type AgentPlan {
  AgentPlan(
    match_spec_fields: List(String),
    residual_fields: List(String),
  )
}

Constructors

  • AgentPlan(
      match_spec_fields: List(String),
      residual_fields: List(String),
    )

A finite predicate that the dependency-free target agent can safely turn into an OTP trace match-spec. It intentionally cannot inspect scalar values, binaries, process state, or any field that would weaken privacy.

pub type AgentPredicate {
  AgentAlways
  AgentNever
  AgentArgTag(
    index: Int,
    comparator: AgentComparator,
    tag: String,
  )
  AgentArgType(
    index: Int,
    comparator: AgentComparator,
    kind: String,
  )
  AgentAnd(left: AgentPredicate, right: AgentPredicate)
  AgentOr(left: AgentPredicate, right: AgentPredicate)
  AgentNot(predicate: AgentPredicate)
}

Constructors

pub type AqlError {
  AqlError(offset: Int, message: String)
}

Constructors

  • AqlError(offset: Int, message: String)
pub type Comparator {
  Equal
  NotEqual
  GreaterThan
  GreaterThanOrEqual
  LessThan
  LessThanOrEqual
}

Constructors

  • Equal
  • NotEqual
  • GreaterThan
  • GreaterThanOrEqual
  • LessThan
  • LessThanOrEqual
pub type Query {
  Compare(field: String, comparator: Comparator, value: Value)
  And(left: Query, right: Query)
  Or(left: Query, right: Query)
  Not(query: Query)
}

Constructors

pub type TriggerPlan {
  TriggerPlan(
    predicate: AgentPredicate,
    residual: option.Option(Query),
  )
}

Constructors

pub type Value {
  StringValue(String)
  IntValue(Int)
  FloatValue(Float)
  BoolValue(Bool)
  DurationValue(milliseconds: Int)
}

Constructors

  • StringValue(String)
  • IntValue(Int)
  • FloatValue(Float)
  • BoolValue(Bool)
  • DurationValue(milliseconds: Int)

Values

pub fn compile_agent(query: Query) -> AgentPlan
pub fn compile_trigger(
  query: Query,
  trigger: types.Mfa,
) -> TriggerPlan

Split an AQL query into a target-safe root predicate and a relay-side residual. Mixed safe/unsafe OR and NOT expressions stay wholly residual; pushing only one branch would incorrectly discard valid roots.

pub fn evaluate(
  query: Query,
  context: dict.Dict(String, Value),
) -> Bool
pub fn parse(source: String) -> Result(Query, AqlError)
Search Document