Skip to main content
POST /v1/scores/aggregate sums the scores with one name, per group. Right: read.

Body

object
required
A score filter. name is required. from and to are on the score’s own time at.
object
A trace filter. Only the scores of the traces that meet it count (scores on such a trace and on its spans). A score with no trace in the store does not count then.
string | object
default:"all"
object
A second key (a trace field or a root attribute), for a series per value. groupBy must be a time bucket: else an error. key is the bucket, key2 the value.
number[]
default:"[]"
Percentiles of the value, for example [50, 95]. Each from 0 to 100, at most 4 decimals. Exact, by the nearest-rank rule.
object
{"by": "count" | "avg", "order": "desc" | "asc"}. order defaults to "desc". Ties by key; rows with no average last. Left out: rows by key.
integer
Keep this many rows, after the sort. Left out: every row.
With thenBy, sort and limit choose whole series, as in /v1/aggregate.

Answer

object[]

How the trace side works

  • The server joins the trace when the query runs. It copies nothing onto a score when the score is written. So a group comes from the trace as it is now.
  • A trace with two models is in both groups.
  • A score with no trace in the store (on a session, or before its trace came) has the key null, and does not count with traces.
  • The query reads the columns of the matching scores, one trace summary per trace of those scores, and for rootAttribute one span per trace.
  • To compare two groups (two experiments), run the same query twice: with "traces": {"root": {"attributes": {"experiment": "A"}}}, then with "B".

Scores

Write and read scores.

Sessions and scores

A guide with real sums of scores.