<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>The Ops Community ⚙️: Ben Greenberg</title>
    <description>The latest articles on The Ops Community ⚙️ by Ben Greenberg (@bencgreenberg).</description>
    <link>https://community.ops.io/bencgreenberg</link>
    <image>
      <url>https://community.ops.io/images/ICKIQw6XCdJfvlp5as_Q-sCIUC6aL_xcoxp34skPrT4/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL3Vz/ZXIvcHJvZmlsZV9p/bWFnZS8xMDYwLzU0/YzlhN2Q3LTFhNGMt/NGRhZC1iMTQ3LWFh/YWJkOTAxNDY5Yi5w/bmc</url>
      <title>The Ops Community ⚙️: Ben Greenberg</title>
      <link>https://community.ops.io/bencgreenberg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://community.ops.io/feed/bencgreenberg"/>
    <language>en</language>
    <item>
      <title>Navigating GraphQL with the New Relic Postman API collection</title>
      <dc:creator>Ben Greenberg</dc:creator>
      <pubDate>Tue, 05 Jul 2022 08:28:37 +0000</pubDate>
      <link>https://community.ops.io/bencgreenberg/navigating-graphql-with-the-new-relic-postman-api-collection-2d5p</link>
      <guid>https://community.ops.io/bencgreenberg/navigating-graphql-with-the-new-relic-postman-api-collection-2d5p</guid>
      <description>&lt;p&gt;Today we’re going to explore how to use Postman to navigate the New Relic GraphQL API, Nerdgraph, and use it to explore your telemetry data, update your account, and a lot more. Postman provides a lot of support for building with APIs and with the recently released New Relic public API collection, you can leverage that support to supercharge your usage of New Relic’s GraphQL API.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Nerdgraph? 
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://docs.newrelic.com/docs/apis/nerdgraph/get-started/introduction-new-relic-nerdgraph/"&gt;Nerdgraph&lt;/a&gt; is New Relic’s GraphQL API, and with it, you can get all the information you need with a single query. GraphQL is a query language for APIs that allows you to compose flexible requests to an API in a less structured manner than with the standard REST API. For example, you may wish to get summary data on your application performance monitoring (APM) entities. To do so, you can send the following GraphQL request to Nerdgraph:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  actor {
    entitySearch(query: "name like 'nerdgraph' and domainType = 'APM-APPLICATION'") {
      results {
        entities {
          name
          ... on ApmApplicationEntityOutline {
            apmSummary {
              errorRate
              apdexScore
              webResponseTimeAverage
              responseTimeAverage
            }
          }
        }
      }
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;You can even use NRQL, New Relic’s query language inside a Nerdgraph request for truly customized results. In this example, you are requesting all transaction data within the past hour:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
   actor {
      account(id: YOUR_ACCOUNT_ID) {
         nrql(query: "SELECT count(*) FROM Transaction SINCE 1 HOUR AGO") {
            results
         }
      }
   }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;While GraphQL can be a very powerful tool in working with your New Relic data, you may not know right away what to put in a query or how to structure one. The &lt;a href="https://docs.newrelic.com/docs/apis/nerdgraph/get-started/introduction-new-relic-nerdgraph/"&gt;New Relic Nerdgraph documentation&lt;/a&gt; and the &lt;a href="https://api.newrelic.com/graphiql"&gt;New Relic GraphQL explorer&lt;/a&gt; are excellent places to begin when learning how to use queries. &lt;/p&gt;
&lt;h2&gt;
  
  
  Use the new Nerdgraph API collection with Postman
&lt;/h2&gt;

&lt;p&gt;We’ve added a new resource for you to learn about queries with the new &lt;a href="https://www.postman.com/new-relic"&gt;Nerdgraph API collection on Postman&lt;/a&gt;. &lt;/p&gt;
&lt;h3&gt;
  
  
  What is Postman? 
&lt;/h3&gt;

&lt;p&gt;&lt;a href="http://postman.com/"&gt;Postman&lt;/a&gt; is a tool that helps you use and build with APIs. It enables seamless collaboration and experimentation in a graphical interface that is friendly for both the newcomer and the veteran to API development. An API collection in Postman is a group of saved requests and descriptions that are editable and customizable by the user. API collections in Postman come with benefits such as error detection in query formulation, auto-suggestions, the ability to define variables to use across requests, and more.&lt;/p&gt;

&lt;p&gt;Let’s take a look at how the new Postman API collection for Nerdgraph can help you in your work with New Relic.&lt;/p&gt;

&lt;p&gt;One of the major benefits of using the Postman Nerdgraph API collection is that you get auto-complete support for your queries right away. For example, if you are querying for your account data, as soon as you begin typing, Postman suggests next steps for you. &lt;/p&gt;

&lt;p&gt;The example video below demonstrates this, click on the link to see it in action!&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://giphy.com/embed/Rb066hH2EANc1DbwAx" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://community.ops.io/images/bUwc8RvLvUpCcIAM0Y4QMp1v7hwGAsUudIEzUtiP4yw/w:880/mb:500000/ar:1/aHR0cHM6Ly9tZWRp/YTQuZ2lwaHkuY29t/L21lZGlhL1JiMDY2/aEgyRUFOYzFEYndB/eC8yMDAuZ2lmP2Np/ZD1kZGEyNGQ1MDYz/ZTJhZTg2MjY5NGEz/MmNiZjM2ZjhiNTcy/ZTkxOGE5MjdiYmFi/ZWMmcmlkPTIwMC5n/aWYmY3Q9Zw" height="" class="m-0" width=""&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://giphy.com/embed/Rb066hH2EANc1DbwAx" rel="noopener noreferrer" class="c-link"&gt;
          Animated GIF - Find &amp;amp; Share on GIPHY
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Discover &amp;amp; share this Animated GIF with everyone you know. GIPHY is how you search, share, discover, and create GIFs.
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
        giphy.com
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;How does the auto-complete work so well? Postman refreshes the schema from New Relic’s Nerdgraph automatically for you, so that you always have access to the most up-to-date suggestions when using the New Relic API collection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get started with the Postman Nerdgraph API collection
&lt;/h2&gt;

&lt;p&gt;First, visit the API collection homepage at &lt;a href="https://www.postman.com/new-relic"&gt;https://www.postman.com/new-relic&lt;/a&gt;. From there, you can select to the API collection, which will open either in your browser or inside your Postman client.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/xpQaYCYwhOJuCuDu3Tt3bH5PQiAHK7T2fj5mRYd9IMA/w:880/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzLzlzdTZw/aXVwcGZza2dkcGF4/dXZ6LnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/xpQaYCYwhOJuCuDu3Tt3bH5PQiAHK7T2fj5mRYd9IMA/w:880/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzLzlzdTZw/aXVwcGZza2dkcGF4/dXZ6LnBuZw" alt="Screenshot of New Relic Postman collection" width="880" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, provide your API key to your copy of the collection. You can find your API key in New Relic One under the &lt;a href="https://one.newrelic.com/api-keys"&gt;API Keys section&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Then, create a Postman Environment and define it as a variable. We’ve already set up a recommended variable name for you to use inside the collection: &lt;code&gt;new_relic_api_key&lt;/code&gt;, so you need only to define its value inside your new Environment.&lt;/p&gt;

&lt;p&gt;To create a new Postman Environment, select the Environments button in the right-hand side navigation menu.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/5SBJ1DWJ74i4u3SjimgbDW3YJcEdYDoCMFbwMPH1g_E/w:880/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL3F3aDhm/eGh6ZmphYWQxajQz/eW1mLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/5SBJ1DWJ74i4u3SjimgbDW3YJcEdYDoCMFbwMPH1g_E/w:880/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL3F3aDhm/eGh6ZmphYWQxajQz/eW1mLnBuZw" alt="Postman UI where to click to create a new environment screenshot" width="880" height="923"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You’ll also need to define the API key as a variable inside your new environment. Enter the name as “new_relic_api_key”, select “secret” as the type in the dropdown, and provide your API key in the current value field.&lt;br&gt;
  &lt;br&gt;
There’s an important distinction between the current and initial value fields. The initial value is synced with members of your team who share the Postman workspace, so if you don’t want to share your API key across your team,  fill out only the current value field.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/GHTb098Zsk5IjeMigwdxzZwKLbPk3febna4JSVZXPHM/w:880/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL3AyNDFr/a3h4ajlqaWR4bHJm/ODRkLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/GHTb098Zsk5IjeMigwdxzZwKLbPk3febna4JSVZXPHM/w:880/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL3AyNDFr/a3h4ajlqaWR4bHJm/ODRkLnBuZw" alt="Postman initial setup of env vars" width="880" height="166"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, select the plus symbol to create a new environment. You will be prompted to name it. You can name it anything that makes sense for your work, for example, “Production” or “Staging.”&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/UW9puVDTPnESdqrqicLoUyCsYUycyfz9E0BeoWNcC_4/w:880/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL3hmamg3/aTN5b2pyNGcxc3k3/cG9vLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/UW9puVDTPnESdqrqicLoUyCsYUycyfz9E0BeoWNcC_4/w:880/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL3hmamg3/aTN5b2pyNGcxc3k3/cG9vLnBuZw" alt="Screenshot of Postman new environment creation" width="880" height="572"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Once you have finished and saved, you are ready to go! &lt;/p&gt;

&lt;p&gt;The collection is organized into two separate top-level folders: mutations and queries. Within the mutations folder, you will find sub-folders organized by topics for all the areas of your New Relic account you can modify. The queries folder contains top-level requests that will get you started in requesting data from your account.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next steps
&lt;/h2&gt;

&lt;p&gt;Want to try this out on your own free account? &lt;a href="https://newrelic.com/signup"&gt;Sign up today to try all of New Relic’s features with 100/GB of free data ingest.&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Have any questions about the processes described in this blog post? Connect with the New Relic Developer Relations team on our &lt;a href="https://newrelicusers-signup.herokuapp.com/"&gt;community Slack&lt;/a&gt; or send us an email at &lt;a href="//mailto:devrel@newrelic.com"&gt;devrel@newrelic.com&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;Did you know you can also monitor your API performance from Postman with New Relic? Learn how to get instant API observability with the &lt;a href="https://newrelic.com/blog/nerdlog/postman-integration"&gt;Postman integration and quickstart&lt;/a&gt;. &lt;/p&gt;

</description>
      <category>tutorials</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
