POST
https://telemetry.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. Keep empty to create a label instead.
Valid aggregations are avg, count, uniq, max, min, sum, and histogram.