Skip to main content

Get Multiple Metrics

get-multiple-metrics runs several metrics at once and joins them on the date bucket and group_by columns. It is what the dashboard uses for every table view, and it is the only way to request the metrics marked Multi only on the overview. Endpoint: POST https://api.bilanc.co/metrics/get-multiple-metrics

Request format

Parameters

The per-request parameters (filters, group_by, date_level, include_previous_period, order_direction) behave as on the overview. Three parameters become per-metric maps:
string[]
required
Metric names to compute. Any metric from any table.
object
required
Map of metric → date column. Required for every metric except users-count and salary. Each column must exist on that metric’s table (e.g. pr_merged_at for PR metrics, completed_at for issues, date for posthook and copilot metrics). Metrics sharing a table and a date field are computed in one pass.
object
Map of metric → SUM / AVG / MIN / MAX. Required for every metric marked Agg on the overview. Omit count and rate metrics.
object
Map of metric → minimum value. Rows below the threshold for that metric are dropped. Default 0 for every metric.
order_by and limit are not honoured here. Rows come back sorted by date bucket, and there is no row cap, which makes this endpoint the right one for bulk exports. See Exporting Row-Level Data.

Response format

A flat array of rows, one per date bucket × group_by combination that has data in any requested metric (tables are full-outer-joined). Columns:
  • {date_level}_date, or date_level_not_set: true when date_level is omitted
  • one column per group_by field
  • one or more columns per metric, named as listed on the overview
  • with include_previous_period, a previous_ twin of every metric column
Metrics from different tables are joined on the date bucket and the group_by values. A group that exists in one table but not another (say a team that merged PRs but closed no issues that month) still appears, with null for the missing metric.

Example: team performance table

pr_states applies to the PR-table metrics and is ignored by posthook-committed-lines, whose table has no PR state. The second engineer has no posthook sessions, so that metric is null rather than 0.

Example: copilot acceptance over time

suggested-lines and accepted-lines are Multi-only metrics.

Best practices

  1. Share date fields where you can. Metrics on the same table with the same date_field are computed in a single pass.
  2. Pick the date field that matches the question. pr_merged_at for throughput, pr_created_at for demand, completed_at for delivery.
  3. Remember filters are global. A PR-only filter such as pr_states silently does nothing for issue or posthook metrics in the same request.
  4. Use metric_min_values to trim sparse groups. {"pull-requests-count": 1} drops people with no merged PRs in the window.
  5. Use it for bulk exports. There is no row cap; combine one count metric with a primary key in group_by.