Metrics are data aggregations that add business context to your data.

You can define metrics inline or as pre-defined to ensure consistent usage across your application.

Querying Metrics

You can query metrics using the GraphQL API. Metrics can be queried either by defining them inline or by referencing pre-defined metrics.

In-line Metrics

You can define Metrics in line in your query.

Query
query TimeSeriesExample {
  timeSeries(input: {
    metric: {
      count: {
        dataPool: {
          name: "TacoSoft Demo Data"
        }
      }
    }
    ...
  }) {
    ...
  }
}

Pre-defined Metrics

You can predefine Metrics to ensure consistent usage across your application. Learn more about Defining Metrics.

Query using a pre-defined Metric ID:

Query
query TimeSeriesExample {
  timeSeries(input: {
    metric: {
      id: "METXXXXXXXXXXXXXXXXXXXXXXXXXX"
    }
    ...
  }) {
    ...
  }
}

Query using a pre-defined Metric name:

Query
query TimeSeriesExample {
  timeSeries(input: {
    metric: {
      name: "sales"
    }
    ...
  }) {
    ...
  }
}