POST
https://logs.betterstack.com/api/v2/sources/{source_id}/metrics
URL parameters
source_id
required
integer
Source for which to create a metric
Headers
Authorization
required
string
Bearer $TOKEN
Body parameters
team_name
string
Required if using global API token to specify the team which should own the resource
name
required
string
Metric name
sql_expression
required
string
SQL expression to use for the metric
aggregations
array
Aggregations to apply to the metric.
Valid aggregations are avg, count, uniq, max, min, anyLast, sum, p50, p90, p95, p99
type
required
string
Metric type.
Valid types are string_low_cardinality
, int64_delta
, float64_delta
, datetime64_delta
, and boolean