Skip to main content

Metric

The metric object allows you to query information about metrics.

Arguments

When querying for a metric, the following arguments are available. Note that if you do not include a runId, it will default to the most recent run of the specified job:

Fetching data...

Below we show some illustrative example queries and outline the schema (all possible fields you can query) of this metric object.

Example Queries

Metric information

The example query below outputs information about a metric. Note that you can also add any field from the Model endpoint -- here we are simply selecting name. This includes schema, database, uniqueId, columns and more -- find documentation here.

{
metric(jobId: 123, uniqueId: "metric.jaffle_shop.new_customers") {
uniqueId
name
packageName
tags
label
runId
description
type
sql
timestamp
timeGrains
dimensions
meta
resourceType
filters {
field
operator
value
}
model {
name
}
}
}

Fields

When querying for a metric, the following fields are available:

Fetching data...

0