API metrics with rate limit info

Aug 4th, 2021view comments

There is new data in the extensions field that shows you aggregate information about the API requests OneGraph made to fulfill your GraphQL query.

We surface information about API rate limits for the services that provide it. If you've worked with the Salesforce API and Salesforce admins who are constantly fighting to keep under their API quota, then you know how valuable this is.

{
  "data": "...",
  "extensions": {
    "metrics": {
      "api": {
        "avoidedRequestCount": 0,
        "requestCount": 1,
        "totalRequestMs": 457,
        "byHost": [
          {
            "host": "na173.salesforce.com",
            "requestCount": 1,
            "totalRequestMs": 457,
            "rateLimit": {
              "limit": 15000,
              "remaining": null,
              "used": 1,
              "resetAt": null
            }
          }
        ]
      }
    }
  }
}

You can turn it off by adding show_metrics=false as a query param to your URL.

Much of this information is also available with our Honeycomb integration.