Skip to content

Instantly share code, notes, and snippets.

@shairyar
Created July 25, 2022 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shairyar/a0e31a4b2fcedacf011d9cad89247c1e to your computer and use it in GitHub Desktop.
Save shairyar/a0e31a4b2fcedacf011d9cad89247c1e to your computer and use it in GitHub Desktop.
Query to help fetch object count for each action
query PaginatedMetricsListQuery(
$appId: String!,
$start: DateTime,
$end: DateTime,
$timeframe: TimeframeEnum,
$query: [MetricAggregation!]!
$limit: Int,
$offset: Int
){
app(id: $appId) {
id
metrics {
list(start: $start, end: $end, query: $query, timeframe: $timeframe, limit: $limit, offset: $offset, ) {
start
end
total
rows {
id
name
tags {
key
value
}
fields {
key
value
}
}
}
}
}
}
@shairyar
Copy link
Author

query params

{
  "appId": "YOUR-APP-ID",
  "timeframe": "R30D",
  "query": [
    {
      "name": "transaction_allocation_count",
      "tags": [{ "key": "action", "value": "*" }, { "key": "namespace", "value": "web" }],
      "fields": [{ "field": "COUNTER", "aggregate": "SUM" }]
    }
  ]
}


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment