datadog_query/query

Types

pub type Aggregator {
  Sum
  Avg
  Max
  Min
  Count
  Percentile(Int)
}

Constructors

  • Sum
  • Avg
  • Max
  • Min
  • Count
  • Percentile(Int)
pub type Query {
  Query(
    aggregator: Aggregator,
    metric: String,
    scope: String,
    grouping: List(String),
    functions: List(String),
  )
}

Constructors

  • Query(
      aggregator: Aggregator,
      metric: String,
      scope: String,
      grouping: List(String),
      functions: List(String),
    )

Values

pub fn aggregator_to_string(aggregator: Aggregator) -> String
pub fn by(query: Query, grouping: List(String)) -> Query

Returns a copy of query with grouping set.

pub fn new(
  aggregator: Aggregator,
  metric: String,
  scope: String,
) -> Query

Convenience constructor with sensible defaults: empty grouping and no postfix functions. scope may be "" to emit the empty {} scope or filter.wildcard_all to emit {*}.

pub fn to_string(query: Query) -> String
pub fn with_function(query: Query, function: String) -> Query

Appends a postfix function (already-rendered) to the chain.

Search Document