Importing a dbt Metric

Import a metric already defined in a dbt semantic layer into PowerMetrics.

  1. GET /direct_connections — find a connection to import from. dbt connections and data-warehouse/Cube connections are listed together; a dbt connection is the one whose dataBaseType is "dbt" (as opposed to its siblings cube and the various warehouse types).
  2. GET /direct_connections/:connectionId/metrics — list the metrics the dbt project defines. Each entry is a candidate metric spec, not yet created.
  3. POST /metrics — post one of those specs back unchanged. The read-only properties.sl*/supportedPeriodicities entries it carries are ignored rather than rejected, so there is nothing to strip first (see the Metrics guide for the field-by-field detail).
{
  "name": "Total Revenue",
  "description": "Sum of order revenue",
  "sourceType": "DBT",
  "sourceId": "conn_dbt_1",
  "fieldId": "total_revenue",
  "timeRefId": "metric_time",
  "properties": { "numberFormat": "NUMERIC", "dataShape": "TRANSACTIONAL" },
  "dimensions": [{ "name": "Region", "fieldId": "customer__region" }]
}

Did this page help you?