diff --git a/src/pages/kb/data-sources/newrelic.md b/src/pages/kb/data-sources/newrelic.md new file mode 100644 index 000000000..c0a7b97e2 --- /dev/null +++ b/src/pages/kb/data-sources/newrelic.md @@ -0,0 +1,38 @@ +--- +category: querying +parent_category: data-sources +title: NewRelic +slug: newrelic-ds +--- + +# Setup + +You need an **[Account ID](https://docs.newrelic.com/docs/accounts/accounts-billing/account-structure/account-id/)** provided by NewRelic, **[User API Token](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/)** and **[NewRelic GraphQL API URL](https://docs.newrelic.com/docs/apis/nerdgraph/get-started/introduction-new-relic-nerdgraph/)** to connect to NewRelic GraphQL API. The token behaves like a password. + +{% callout warning %} + +This query runner only support **count** and **comparison** queries + +{% endcallout %} + +![](/assets/images/docs/gitbook/newrelic-setup.png) + +# Querying + +For a simple count query, one that returns single result: + +``` +{ + "queryType": "count", + "nrql": "SELECT count(*) FROM Transactions" +} +``` + +For a comparison query, one that returns two results (current and previous) + +``` +{ + "queryType": "comparison", + "nrql": "SELECT count(*) FROM Transactions COMPARE WITH 1 day ago" +} +``` diff --git a/static/assets/images/docs/gitbook/newrelic-setup.png b/static/assets/images/docs/gitbook/newrelic-setup.png new file mode 100644 index 000000000..c6ad3d6e4 Binary files /dev/null and b/static/assets/images/docs/gitbook/newrelic-setup.png differ