From d1423412542713514ffd94bbf87cc353086d0405 Mon Sep 17 00:00:00 2001 From: nr-opensource-bot Date: Wed, 19 Aug 2020 00:45:45 +0000 Subject: [PATCH] chore(related-content): updated related content data --- src/data/related-pages.json | 7173 ++++++++++++++++++----------------- 1 file changed, 3598 insertions(+), 3575 deletions(-) diff --git a/src/data/related-pages.json b/src/data/related-pages.json index 69b25a8e5..70350c814 100644 --- a/src/data/related-pages.json +++ b/src/data/related-pages.json @@ -1,292 +1,262 @@ { - "/collect-data/custom-attributes": [ + "/automate-workflows/5-mins-tag-resources": [ { - "body": "New Relic allows you to collect custom attributes. For example, you can create a custom attribute to track the user name associated with a slow or failing request. This document contains links to docs on how to do this for APM, infrastructure monitoring, browser monitoring, and mobile monitoring. APM: Record custom attributes Review the list of reserved terms used by NRQL. Using reserved terms can cause issues. To enable and use custom attributes for APM, follow the procedure for your APM agent: C SDK To add custom attributes to applications monitored by the C SDK, call one of the attribute functions; for example, newrelic_add_attribute_double(). The key name for your custom attribute depends on what you specify when you call the function. Go Custom attribute collection is enabled by default in the Go agent. However, you can disable custom attribute collection. Java Custom attribute collection is enabled by default in Java. You can collect custom attributes using XML and the Java agent APIs. These two methods can be used in conjunction with each other. Method How to do it Specify attributes in XML XML allows you to specify custom attributes without changing any of your source code. You can have multiple XML files for custom attributes that are grouped by some logical facet. To set custom attributes for your Java app via XML: Review the New Relic Java agent's documentation about XML file format, methods and classes, and examples. From your Extensions directory within the New Relic Java agent, create a single XML file. Define the methods you want New Relic to monitor by editing your XML file directly. Define an XML instrumentation file using the New Relic UI. This may require additional config in the common: block of your newrelic.yml. See Report custom attributes under Instrumentation options for more detail. Call the agent's API Example 1: Adding custom attributes to transactions To collect custom attributes using the agent's API, call the relevant methods: For each method you want to record an attribute for, call NewRelic.addCustomParameter(...). Optional: Include or exclude certain attributes with attributes.include and attributes.exclude. For example, to record a variable named userId, include this code in the parent method: NewRelic.addCustomParameter(\"userId\", userId); Example 2: Adding custom attributes to spans in distributed traces To collect custom attributes using the agent's API, call the relevant methods: For each span (currently executing method) that you want to record an attribute for, call NewRelic.getAgent().getTracedMethod().addCustomAttribute(...). Optional: Include or exclude certain attributes with span_events.attributes.include and span_events.attributes.exclude. For example, to record a variable named userId on the current span, include this code in the associated method: NewRelic.getAgent().getTracedMethod().addCustomAttribute(\"userId\", userId); Collect user attributes The Java agent also includes a built-in mechanism to enable user attributes and collect user information from HttpServletRequest.getUserPrincipal() as custom attributes. .NET Custom attribute collection is enabled by default in .NET. To collect custom attributes, call the relevant API methods: For each method for which you want to record an attribute, call AddCustomAttribute. Optional: Include or exclude attributes with the include and exclude configuration options. For example, to record attributes for a coupon code (string) and an item ID code (number), you could include this code in the parent method: IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); ITransaction transaction = agent.CurrentTransaction; transaction .AddCustomAttribute(\"Discount Code\", \"Summer Super Sale\") .AddCustomAttribute(\"Item Code\", 31456); Node.js Custom attribute collection is enabled by default in Node.js. To collect custom attributes, call the relevant API method: For each attribute you want to record, call newrelic.addCustomAttribute. To record multiple attributes using a single call, use newrelic.addCustomAttributes. For example, to record attributes for a coupon code and an item ID code, you could include this in the parent method: newrelic.addCustomAttributes({ \"Discount Code\": \"Summer Super Sale\", \"Item Code\": 31456 }); PHP Custom attribute collection is enabled by default in PHP. To collect custom attributes, call the relevant API method for each method that you want to record an attribute; newrelic_add_custom_parameter for transaction events and spans newrelic_add_custom_span_parameter for only spans For example, to record a variable named $userId, include this code in the parent method: newrelic_add_custom_parameter ('userID', $userId) Python Custom attribute collection is enabled by default in Python. To collect custom attributes, call add_custom_parameter for each method that you want to record an attribute. For example, to record a variable named user_id, include this code in the parent method: newrelic.agent.add_custom_parameter('user_id', user_id) Ruby Custom attribute collection is enabled by default in Ruby. To collect custom attributes, call the relevant API methods: For Ruby agent version 3.12.0 or higher, use the add_custom_attributes method. For example, to record a variable named @user_id, include this code in the parent method: ::NewRelic::Agent.add_custom_attributes({ user_id: @user.id }) For Ruby agent version 3.11.2 or lower, use the add_custom_parameters method. For example, to record a variable named @user_id, include this code in the parent method: ::NewRelic::Agent.add_custom_parameters({ user_id: @user.id }) Browser monitoring: Record custom attributes The browser agent provides an API to specify extra details associated with a page view or browser interaction, either by forwarding attributes from APM to browser monitoring or by specifying custom attributes through JavaScript. Values forwarded from the APM agent are encoded and injected into browser attributes by our browser agent. Infrastructure monitoring: Record custom attributes Our Infrastructure monitoring lets you create custom attributes that are used to annotate the data from the infrastructure agent. You can use this metadata to build filter sets, group your results, and annotate your data. Mobile monitoring: Record custom attributes Mobile agents include API calls to record custom attributes: For an overview of mobile monitoring custom data, see Insert custom events and attributes Android method: setAttribute iOS method: setAttribute For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag⁠ (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / Using New Relic / Cross-product functions / Install and configure", - "info": "How to add custom attributes to data reported from some New Relic products. ", - "nodeid": 2726, + "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", "sections": [ - "Cross-product functions", - "Install and configure", - "Troubleshooting", - "Collect custom attributes", - "APM: Record custom attributes", - "Browser monitoring: Record custom attributes", - "Infrastructure monitoring: Record custom attributes", - "Mobile monitoring: Record custom attributes", - "For more help" + "Get started with the New Relic CLI", + "Before you begin", + "Install the New Relic CLI", + "Linux", + "macOS", + "Windows", + "Create your New Relic CLI profile", + "Get your application details", + "Add a simple tag to your application", + "Bonus step: Create a deployment marker", + "Next steps" ], - "title": "Collect custom attributes", + "title": "Get started with the New Relic CLI", "popularity": 1, - "external_id": "5a43638e8ef969ce9f0b16fedf433317e67bb4a6", - "category_1": "Cross-product functions", - "category_2": "Install and configure", + "tags": [ + "api key", + "New Relic CLI", + "Tags", + "Entity", + "Deployment markers" + ], + "external_id": "531f2f3985bf64bb0dc92a642445887095048882", "image": "", - "url": "https://docs.newrelic.com/docs/using-new-relic/data/customize-data/collect-custom-attributes", - "published_at": "2020-08-15T04:02:20Z", - "updated_at": "2020-08-11T00:28:22Z", - "category_0": "Using New Relic", + "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/", + "published_at": "2020-08-18T02:06:05Z", + "updated_at": "2020-08-08T01:41:47Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.81196296, + "_score": 19.977236, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Collect custom attributes", - "sections": "Collect custom attributes", - "info": "How to add custom attributes to data reported from some New Relic products. ", - "body": ". APM: Record custom attributes Review the list of reserved terms used by NRQL. Using reserved terms can cause issues. To enable and use custom attributes for APM, follow the procedure for your APM agent: C SDK To add custom attributes to applications monitored by the C SDK, call one of the attribute" + "title": "Get started with the New Relic CLI", + "sections": "Get started with the New Relic CLI", + "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", + "tags": "New Relic CLI", + "body": " Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead" }, - "id": "5e9a9d9728ccbc90cdd949ca" + "id": "5efa999c196a67c4e1766461" }, { - "body": "In New Relic, attributes are key-value pairs containing information that determines the properties of an event or transaction. These key-value pairs can help you gain greater insight into your application and query your data. View and use attributes Both default APM attributes and custom attributes for your C application appear in: APM transaction traces and error analytics APM events C-specific attributes Before creating custom attributes, review New Relic's list of reserved terms used by NRQL. Otherwise unexpected results may occur. To add custom attributes to your C application, call one of the attribute functions in the C SDK API; for example, newrelic_add_attribute_double(). The key name for your custom attribute depends on what you specify when you call the function. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / APM agents / C SDK / Instrumentation", - "info": "You can create custom attributes for your C app to supplement the New Relic event data that automatically includes default APM attributes.", - "nodeid": 15891, + "info": "The command line tools for performing tasks against New Relic APIs", "sections": [ - "C SDK", - "Get started", - "Install and configure", - "Instrumentation", - "Troubleshooting", - "Use default or custom attributes (C SDK)", - "View and use attributes", - "C-specific attributes", - "For more help" + "New Relic CLI Reference", + "New Relic CLI commands", + "Options", + "Commands" ], - "title": "Use default or custom attributes (C SDK)", + "title": "New Relic CLI Reference", "popularity": 1, - "external_id": "45876c14a1d258566a824f7c49a50bb8c8fb709d", - "category_1": "C SDK", - "category_2": "Instrumentation", + "tags": "new relic cli", + "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", "image": "", - "url": "https://docs.newrelic.com/docs/agents/c-sdk/instrumentation/use-default-or-custom-attributes-c-sdk", - "published_at": "2020-08-15T02:11:23Z", - "updated_at": "2020-08-15T02:11:23Z", - "category_0": "APM agents", + "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", + "published_at": "2020-08-18T02:11:50Z", + "updated_at": "2020-08-14T01:47:12Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.75732994, + "_score": 16.580233, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Use default or custom attributes (C SDK)", - "sections": "Use default or custom attributes (C SDK)", - "info": "You can create custom attributes for your C app to supplement the New Relic event data that automatically includes default APM attributes.", - "body": " for your C application appear in: APM transaction traces and error analytics APM events C-specific attributes Before creating custom attributes, review New Relic's list of reserved terms used by NRQL. Otherwise unexpected results may occur. To add custom attributes to your C application, call one" + "title": "New Relic CLI Reference", + "sections": "New Relic CLI Reference", + "info": "The command line tools for performing tasks against New Relic APIs", + "tags": "new relic cli", + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" }, - "id": "5cd8abf7e621f45d85a089a9" + "id": "5efa989ee7b9d2024b7bab97" }, { - "body": "Collect data Through our opensource agents or APIs, New Relic makes it easy to collect data from any source. The guides in this section provide strategies for collecting and querying data for use in your existing implementation, or in apps you build. The opportunities are endless. Guides to collect data 15 min Collect data - any source APIs, agents, OS emitters - get any data 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 10 min Query data with NRQL Query default event data, custom events, and attributes   Add custom attributes Use custom attributes for deeper analysis", + "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform", "type": "developer", "document_type": "page", "info": "", "sections": [ - "Collect data", - "Guides to collect data", - "Collect data - any source", - "Create custom events", - "Build queries with NerdGraph", - "Query data with NRQL", - "Add custom attributes" + "Automate workflows", + "Guides to automate workflows", + "Quickly tag resources", + "Automate common tasks", + "Set up New Relic using the Kubernetes operator", + "Set up New Relic using Terraform" ], - "title": "Collect data", + "title": "Automate workflows", "popularity": 1, - "external_id": "fb5d6f75b61858b09e3e8c63f3b2af97813f47b6", + "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871", "image": "", - "url": "https://developer.newrelic.com/collect-data/", - "published_at": "2020-08-17T01:55:15Z", + "url": "https://developer.newrelic.com/automate-workflows/", + "published_at": "2020-08-18T02:04:53Z", "updated_at": "2020-08-17T01:55:15Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.5022758, + "_score": 0.37249726, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Add custom attributes", - "body": " data 15 min Collect data - any source APIs, agents, OS emitters - get any data 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 10 min Query data with NRQL Query default event data, custom events, and attributes   Add custom attributes Use custom attributes for deeper analysis" + "sections": "Set up New Relic using the Kubernetes operator", + "body": " solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform" }, - "id": "5efa997328ccbc768c307de2" + "id": "5efa999c196a67dfb4766445" }, { - "body": "newrelic.agent.add_custom_parameters(items) Adds one or more custom attributes to a transaction. Description This call records one or more custom attributes (a key/value tuple attached to your transaction). The call name is add_custom_parameters because \"custom attributes\" were previously called \"custom parameters\". Attributes may be found in New Relic APM if the transaction is associated with an error or if a transaction trace is generated for that transaction. Attributes can also be found and queried in Insights or New Relic One. Before you create custom attributes, review New Relic's list of reserved terms used by NRQL and Insights. Parameters Parameter Description items list Required. Each item in the list must be a tuple, with the first element being a key, and the second its value. Each key is a string representing the name of an attribute, and each corresponding value is the value to add to the current transaction for this attribute. Values can be int, float, string, or boolean. Only the first 255 characters are retained for both keys and values. Return value(s) Returns True if all attributes were added successfully. Example(s) Adding custom parameters to background task An example of adding custom parameters to a background task: @newrelic.agent.background_task() def send_request(): response = requests.get(\"http://example.com\") newrelic.agent.add_custom_parameters( [(\"url_path_status_code\", response.status_code)] ) Using custom parameters to troubleshoot You can also use custom parameters to troubleshoot performance issues. For example, you might see occasional slow response times from a pool of memcache instances, but you don't know what instance is causing the problem. You might add an attribute to the transaction indicating the server, like so: # Set server_ip to be the current server processing the transaction newrelic.agent.add_custom_parameters([ (\"memcache_query_frontend_lookup\", \"server_ip\") ])", - "type": "docs", - "document_type": "api_doc", - "breadcrumb": "Contents » APM agents / Python agent / Python agent API", - "info": "New Relic Python API: This call adds a custom attribute (key/value tuple) to a transaction.", - "nodeid": 27406, + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", + "type": "developer", + "document_type": "page", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "sections": [ - "Python agent", - "Getting started", - "Installation", - "Configuration", - "Supported features", - "Back-end services", - "Custom instrumentation", - "API guides", - "Python agent API", - "Web frameworks and servers", - "Hosting services", - "Attributes", - "Troubleshooting", - "add_custom_parameters", - "Description", - "Parameters", - "Return value(s)", - "Example(s)", - "Adding custom parameters to background task", - "Using custom parameters to troubleshoot", - "For more help" + "New Relic One CLI reference", + "Installing the New Relic One CLI", + "Tip", + "New Relic One CLI Commands", + "Get started", + "Configure your CLI preferences", + "Set up your Nerdpacks", + "Manage your Nerdpack subscriptions", + "Install and manage plugins", + "Manage catalog information" ], - "title": "add_custom_parameters (Python agent API)", + "title": "New Relic One CLI reference", "popularity": 1, - "external_id": "4a0759cb3bd46dfabe6d34a678cc7c644ff79773", - "category_1": "Python agent", - "category_2": "Python agent API", - "image": "", - "url": "https://docs.newrelic.com/docs/agents/python-agent/python-agent-api/addcustomparameters-python-agent-api", - "published_at": "2020-08-15T10:25:58Z", - "updated_at": "2020-08-15T10:25:58Z", - "category_0": "APM agents", + "tags": [ + "New Relic One app", + "nerdpack commands" + ], + "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", + "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", + "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-18T01:50:36Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.4139715, + "_score": 0.25086987, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Attributes", - "info": "New Relic Python API: This call adds a custom attribute (key/value tuple) to a transaction.", - "body": "newrelic.agent.add_custom_parameters(items) Adds one or more custom attributes to a transaction. Description This call records one or more custom attributes (a key/value tuple attached to your transaction). The call name is add_custom_parameters because "custom attributes" were previously called" + "title": "New Relic One CLI reference", + "sections": "New Relic One CLI reference", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use" }, - "id": "5c4055440cc37f4ab32ef6be" + "id": "5efa989e28ccbc535a307dd0" }, { - "body": "You can use the New Relic NerdGraph GraphiQL explorer to make New Relic Query Language (NRQL) queries. To learn how to construct these queries and see responses, go to the NerdGraph GraphiQL explorer at https://api.newrelic.com/graphiql. This document explains some of the available functions for NRQL queries. Basic NRQL queries with NerdGraph To make NRQL queries using NerdGraph: Go to the NerdGraph GraphiQL explorer at https://api.newrelic.com/graphiql. Pass the NRQL query as a string argument to the NRQL object, and include the results field in your NerdGraph query. For example, to get a count of all transaction events in the last hour, use the following query: { actor { account(id: YOUR_ACCOUNT_ID) { nrql(query: \"SELECT count(*) FROM Transaction SINCE 1 HOUR AGO\") { results } } } } This NerdGraph query example returns the following results: { \"data\": { \"actor\": { \"account\": { \"nrql\": { \"results\": [ { \"count\": 1000 } ] } } } } } The actual value of the count varies depending on your transaction data. Use the NerdGraph GraphiQL explorer to experiment with queries. Create embeddable charts In addition to returning raw data, you can fetch embeddable chart links for the data to use in an application. For example, instead of a single count of transaction, you can create a chart that illustrates a timeseries of bucketed counts over time. Add TIMESERIES to your query with embeddedChartUrl: { actor { account(id: YOUR_ACCOUNT_ID) { nrql(query: \"SELECT count(*) from Transaction TIMESERIES\") { embeddedChartUrl } } } } This NerdGraph query example returns the URL for the chart in the following response: { \"data\": { \"actor\": { \"account\": { \"nrql\": { \" embeddedChartUrl \": \"https://chart-embed.service.newrelic.com/charts/EMBEDDABLE-CHART-ID\" } } } } } If you view the embedded chart URL using any standard HTTP client, it returns an image showing a visualization of the response to the query you submitted. These charts follow the same embedded chart rules as embedded charts that are created elsewhere. To change the style of the data visualization, pass a chartType argument to embeddedChartUrl. Suggested facets When using NerdGraph to explore your data, you can use the suggestedFacets field to return suggested attributes for use in faceted NRQL queries. Rules governing suggested facets Here are some of the rules that govern what attributes are suggested: Built-in suggestions. Each event type comes with its own set of recommended attributes. These are attributes chosen by New Relic for their importance and popularity. Usage-based suggestions. Some attribute suggestions are based on the queries that have been frequently used by your account. These suggestions can include custom attributes. Role restriction. Restricted users do not have access to account-related facet suggestions. To disable the use of account data for determining suggested queries, contact Support. Example of returning suggested attributes Here's an example of returning suggested attributes for faceting transaction counts. The response suggests the host attribute. Faceting by host can reveal that one host is servicing more requests than other hosts. { actor { account(id: YOUR_ACCOUNT_ID) { nrql(query: \"SELECT count(*) from Transaction TIMESERIES\") { suggestedFacets { attributes } } } } } This NerdGraph query example returns a response similar to this: { \"data\": { \"actor\": { \"account\": { \"nrql\": { \" suggestedFacets \": [ \"attributes\": [\"host\"] ] } } } } } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "Contain the complexity - Observability made simple New Relic’s Kubernetes cluster explorer empowers Kubernetes nerds to move beyond infrastructure metrics and investigate deeper into applications, traces, logs, and events—with a single click—while staying grounded in a centralized UI. Join us at KubeCon and CloudNativeCon Europe August 17-20 to learn more. Check out the complete schedule of New Relic talks to make the most of your KubeCon experience. Learn more. Get coding Create a free account 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events Start the guide 7 min Add tags to apps Add tags to applications you instrument for easier filtering and organization Start the guide 12 min Build a Hello, World! app Build a Hello, World! app and publish it to your local New Relic One Catalog Start the guide Get inspired 30 min Add a table to your app Add a table to your New Relic One app 15 min Collect data - any source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add a time picker to your app Add a time picker to a sample application   Add custom attributes Use custom attributes for deeper analysis Show 18 more guides Looking for more inspiration? Check out the open source projects built by the New Relic community. New Relic developer champions New Relic Champions are solving big problems using New Relic as their linchpin and are recognized as experts and leaders in the New Relic technical community. Nominate a developer champion Learn more about developer champions New Relic Podcasts We like to talk, especially to developers about developer things. Join us for conversations on open source, observability, software design and industry news. Listen", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / APIs / NerdGraph / Examples", - "info": "Use New Relic NerdGraph to query data using New Relic Query Language (NRQL). ", - "nodeid": 19116, + "info": "", "sections": [ - "NerdGraph", - "Get started", - "Examples", - "NerdGraph NRQL tutorial", - "Basic NRQL queries with NerdGraph", - "Create embeddable charts", - "Suggested facets", - "For more help" + "Contain the complexity - Observability made simple", + "Get coding", + "Create custom events", + "Add tags to apps", + "Build a Hello, World! app", + "Get inspired", + "Add a table to your app", + "Collect data - any source", + "Automate common tasks", + "Create a custom map view", + "Add a time picker to your app", + "Add custom attributes", + "New Relic developer champions", + "New Relic Podcasts" ], - "title": "NerdGraph NRQL tutorial", + "title": "New Relic Developers", "popularity": 1, - "external_id": "617cc66328b47f455da27ea9b08a4e0209567713", - "category_1": "NerdGraph", - "category_2": "Examples", - "image": "", - "url": "https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-nrql-tutorial", - "published_at": "2020-08-15T09:20:38Z", - "updated_at": "2020-08-15T09:20:38Z", - "category_0": "APIs", + "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab", + "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png", + "url": "https://developer.newrelic.com/", + "published_at": "2020-08-18T02:03:42Z", + "updated_at": "2020-08-15T01:36:10Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.3984331, + "_score": 0.24943998, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "NerdGraph NRQL tutorial", - "sections": "NerdGraph NRQL tutorial", - "info": "Use New Relic NerdGraph to query data using New Relic Query Language (NRQL). ", - "body": " to embeddedChartUrl. Suggested facets When using NerdGraph to explore your data, you can use the suggestedFacets field to return suggested attributes for use in faceted NRQL queries. Rules governing suggested facets Here are some of the rules that govern what attributes are suggested: Built" + "title": "New Relic Developers", + "sections": "New Relic developer champions", + "body": " to your app Add a table to your New Relic One app 15 min Collect data - any source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add" }, - "id": "5b983126c75d077ad734386c" + "id": "5d6fe49a64441f8d6100a50f" } ], - "/automate-workflows/get-started-new-relic-cli": [ + "/automate-workflows/get-started-kubernetes": [ { - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", - "type": "developer", + "body": "You can create alert conditions using NRQL queries. Create NRQL alert condition To create a NRQL condition: When you start to create a condition, where it prompts you to Select a product, click NRQL. Tips on creating a NRQL condition: NRQL conditions Tips Condition types NRQL condition types include static, baseline, and outlier. Create a description For some condition types, you can create a Description. Query results Queries must return a number. The condition works by evaluating that returned number against the thresholds you set. Time period As with all alert conditions, NRQL conditions evaluate one single minute at a time. The implicit SINCE ... UNTIL clause specifying which minute to evaluate is controlled by your Evaluation offset setting. Since very recent data may be incomplete, you may want to query data from 3 minutes ago or longer, especially for: Applications that run on multiple hosts. SyntheticCheck data: Timeouts can take 3 minutes, so 5 minutes or more is recommended. Also, if a query will generate intermittent data, consider using the sum of query results option. Condition settings Use the Condition settings to: Configure whether and how open violations are force-closed. Adjust the evaluation offset. Create a concise and descriptive condition name. (NerdGraph API Only) Provide a text description for the condition that will be included in violations and notifications. Troubleshooting procedures Optional: To include your organization's procedures for handling the incident, add the runbook URL to the condition. Limits on conditions See the maximum values. Examples For more information, see: Expected NRQL syntax Examples of NRQL condition queries Alert threshold types When you create a NRQL alert, you can choose from different types of thresholds: NRQL alert threshold types Description Static This is the simplest type of NRQL threshold. It allows you to create a condition based on a NRQL query that returns a numeric value. Optional: Include a FACET clause. Baseline Uses a self-adjusting condition based on the past behavior of the monitored values. Uses the same NRQL query form as the static type, except you cannot use a FACET clause. Outlier Looks for group behavior and values that are outliers from those groups. Uses the same NRQL query form as the static type, but requires a FACET clause. NRQL alert syntax Here is the basic syntax for creating all NRQL alert conditions. Depending on the threshold type, also include a FACET clause as applicable. SELECT function(attribute) FROM Event WHERE attribute [comparison] [AND|OR ...] Clause Notes SELECT function(attribute) Required Supported functions that return numbers include: apdex average count latest max min percentage percentile sum uniqueCount If you use the percentile aggregator in a faceted alert condition with many facets, this may cause the following error to appear: An error occurred while fetching chart data. If you see this error, use average instead. FROM data type Required Only one data type can be targeted. Supported data types: Event Metric (RAW data points will be returned) WHERE attribute [comparison] [AND|OR ...] Optional Use the WHERE clause to specify a series of one or more conditions. All the operators are supported. FACET attribute Static: Optional Baseline: Not allowed Outlier: Required Including a FACET clause in your NRQL syntax depends on the threshold type: static, baseline, or outlier. Use the FACET clause to separate your results by attribute and alert on each attribute independently. Faceted queries can return a maximum of 5000 values for static conditions and a maximum of 500 values for outlier conditions. If the query returns more than this number of values, the alert condition cannot be created. If you create the condition and the query returns more than this number later, the alert will fail. Sum of query results (limited or intermittent data) Available only for static (basic) threshold types. If a query returns intermittent or limited data, it may be difficult to set a meaningful threshold. Missing or limited data will sometimes generate false positives or false negatives. To avoid this problem when using the static threshold type, you can set the selector to sum of query results. This lets you set the alert on an aggregated sum instead of a value from a single harvest cycle. Up to two hours of the one-minute data checks can be aggregated. The duration you select determines the width of the rolling sum, and the preview chart will update accordingly. Offset the query time window Every minute, we evaluate the NRQL query in one-minute time windows. The start time depends on the value you select in the NRQL condition's Advanced settings > Evaluation offset. Example: Using the default time window to evaluate violations With the Evaluation offset at the default setting of three minutes, the NRQL time window applied to your query will be: SINCE 3 minutes ago UNTIL 2 minutes ago If the event type is sourced from an APM language agent and aggregated from many app instances (for example, Transactions, TransactionErrors, etc.), we recommend evaluating data from three minutes ago or longer. An offset of less than 3 minutes will trigger violations sooner, but you might see more false positives and negatives due to data latency. For cloud data, such as AWS integrations, you may need an offset longer than 3 minutes. Check our AWS polling intervals documentation to determine your best setting. NRQL alert threshold examples Here are some common use cases for NRQL alert conditions. These queries will work for static and baseline threshold types. The outlier threshold type will require additional FACET clauses. Alert on specific segments of your data Create constrained alerts that target a specific segment of your data, such as a few key customers or a range of data. Use the WHERE clause to define those conditions. SELECT average(duration) FROM Transaction WHERE account_id in (91290, 102021, 20230) SELECT percentile(duration, 95) FROM Transaction WHERE name LIKE 'Controller/checkout/%' Alert on Nth percentile of your data Create alerts when an Nth percentile of your data hits a specified threshold; for example, maintaining SLA service levels. Since we evaluate the NRQL query in one-minute time windows, percentiles will be calculated for each minute separately. SELECT percentile(duration, 95) FROM Transaction SELECT percentile(databaseDuration, 75) FROM Transaction Alert on max, min, avg of your data Create alerts when your data hits a certain maximum, minimum, or average; for example, ensuring that a duration or response time does not pass a certain threshold. SELECT max(duration) FROM Transaction SELECT average(duration) FROM Transaction Alert on a percentage of your data Create alerts when a proportion of your data goes above or below a certain threshold. SELECT percentage(count(*), WHERE duration > 2) FROM Transaction SELECT percentage(count(*), WHERE httpResponseCode = '500') FROM Transaction Alert on Apdex with any T-value Create alerts on Apdex, applying your own T-value for certain transactions. For example, get an alert notification when your Apdex for a T-value of 500ms on transactions for production apps goes below 0.8. SELECT apdex(duration, t:0.5) FROM Transaction WHERE appName like '%prod%' Create a description You can define a description that passes useful information downstream for better violation responses or for use by downstream systems. For details, see Description. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "The command line tools for performing tasks against New Relic APIs", + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert conditions", + "info": "How to define thresholds that trigger alert notifications based on your NRQL queries.", + "nodeid": 9231, "sections": [ - "New Relic CLI Reference", - "New Relic CLI commands", - "Options", - "Commands" + "New Relic Alerts", + "Get started", + "Alert policies", + "Alert conditions", + "Alert violations", + "Alert Incidents", + "Alert notifications", + "Troubleshooting", + "Rules, limits, and glossary", + "Alerts and Nerdgraph", + "REST API alerts", + "Create NRQL alert conditions", + "Create NRQL alert condition", + "Alert threshold types", + "NRQL alert syntax", + "Sum of query results (limited or intermittent data)", + "Offset the query time window", + "NRQL alert threshold examples", + "Create a description", + "For more help" ], - "title": "New Relic CLI Reference", + "title": "Create NRQL alert conditions", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions", "popularity": 1, - "tags": "new relic cli", - "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", + "external_id": "956a7a0b84d2afac5e6236df3143085ebc4f7459", + "category_1": "New Relic Alerts", + "category_2": "Alert conditions", "image": "", - "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-08-17T01:54:02Z", - "updated_at": "2020-08-14T01:47:12Z", + "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions", + "published_at": "2020-08-18T21:58:59Z", + "updated_at": "2020-08-15T23:05:02Z", + "category_0": "Alerts and Applied intelligence", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 9.066783, + "_score": 0.38054845, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic CLI Reference", - "sections": "New Relic CLI Reference", - "info": "The command line tools for performing tasks against New Relic APIs", - "tags": "new relic cli", - "body": " the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql" - }, - "id": "5efa989ee7b9d2024b7bab97" - }, - { - "body": "Quickly tag a set of resources 5 min Tags help you group, search, filter, and focus the data about your entities, which can be anything from applications to hosts to services. Tagging entities using the New Relic CLI is a good candidate for automation. In this 5-minute guide, you use the New Relic CLI to add multiple tags to one of your entities. Before you begin For this guide you need your New Relic personal API Key: Create it at the Account settings screen for your account. Step 1 of 6 Install the New Relic CLI You can download the New Relic CLI via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 6 Create your New Relic CLI profile New Relic CLI profiles contain credentials and settings that you can apply to any CLI command. To create your first CLI profile, run the profiles add command. Don't forget to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey API_KEY -r us # Set the profile as default newrelic profiles default -n tutorial Copy Step 3 of 6 Search for an entity Your New Relic account might have hundreds of entities: Have a quick look by opening the Entity explorer. In the terminal, run entity search to retrieve a list of entities from your account as JSON. In the example, you're searching for all entities with \"test\" in their name. # Change the `name` to match any of your existing entities newrelic entity search --name \"test\" Copy Step 4 of 6 If there are matching entities in your account, the query yields data in JSON format, similar to this workload example. Select an entity from the results and look for its guid value; the guid is the unique identifier of the entity. Write it down. { \"accountId\": 123456789, \"domain\": \"NR1\", \"entityType\": \"WORKLOAD_ENTITY\", \"guid\": \"F7B7AE59FDED4204B846FB08423DB18E\", \"name\": \"Test workload\", \"reporting\": true, \"type\": \"WORKLOAD\" }, Copy Step 5 of 6 Add tags and tag lists to your entity With your entity guid, you can add tags right away. You can do so by invoking the entities tags create command. What if you want to add multiple tags? You can use tag sets for that: While tags are key-value pairs separated by colons, tag sets are comma-separated lists of tags. For example: tag1:value1,tag2:value2 Note Adding tags is an asynchronous operation: it could take a little while for the tags to get created. # Adding a single tag newrelic entity tags create --guid GUID --tag key:value # Adding multiple tags newrelic entity tags create --guid GUID --tag tag1:test,tag2:test Copy Step 6 of 6 Check that the tags are there To make sure that the tags have been added to your entities, retrieve them using the entity tags get command. All tags associated with your entity are retrieved as a JSON array. newrelic entity tags get --guid GUID Tip Tags can be deleted at any time by invoking the entity tags delete command followed by the same arguments you used to create them. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Next steps Have a look at all the New Relic CLI commands. For example, you could create a New Relic workflow using workload create. If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.", - "type": "developer", - "document_type": "page", - "info": "Add tags to applications you instrument for easier filtering and organization.", - "sections": [ - "Quickly tag a set of resources", - "Before you begin", - "Install the New Relic CLI", - "Linux", - "macOS", - "Windows", - "Create your New Relic CLI profile", - "Search for an entity", - "Add tags and tag lists to your entity", - "Note", - "Check that the tags are there", - "Tip", - "Next steps" - ], - "title": "Quickly tag a set of resources", - "popularity": 1, - "external_id": "c7c374812f8295e409a9b06d552de51ceefc666b", - "image": "", - "url": "https://developer.newrelic.com/automate-workflows/5-mins-tag-resources/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-14T01:45:08Z", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.47255388, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "Quickly tag a set of resources", - "sections": "Install the New Relic CLI", - "info": "Add tags to applications you instrument for easier filtering and organization.", - "body": " by invoking the entity tags delete command followed by the same arguments you used to create them. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Next steps Have a look at all the New Relic CLI commands. For example" + "title": "Create NRQL alert conditions", + "sections": "Create NRQL alert conditions", + "info": "How to define thresholds that trigger alert notifications based on your NRQL queries.", + "category_0": "Alerts and Applied intelligence", + "category_1": "New Relic Alerts", + "category_2": "Alert conditions", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions", + "body": "You can create alert conditions using NRQL queries. Create NRQL alert condition To create a NRQL condition: When you start to create a condition, where it prompts you to Select a product, click NRQL. Tips on creating a NRQL condition: NRQL conditions Tips Condition types NRQL condition types", + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert conditions" }, - "id": "5efa999d64441fa74a5f7e2d" + "id": "5f2d992528ccbc489d88dfc1" }, { "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform", @@ -306,848 +276,1185 @@ "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871", "image": "", "url": "https://developer.newrelic.com/automate-workflows/", - "published_at": "2020-08-17T01:55:15Z", + "published_at": "2020-08-18T02:04:53Z", "updated_at": "2020-08-17T01:55:15Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.3754982, + "_score": 0.19427466, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Set up New Relic using the Kubernetes operator", - "body": " solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform" + "sections": "Set up New Relic using the Kubernetes operator", + "body": " solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform" }, "id": "5efa999c196a67dfb4766445" }, { - "body": "Contain the complexity - Observability made simple New Relic’s Kubernetes cluster explorer empowers Kubernetes nerds to move beyond infrastructure metrics and investigate deeper into applications, traces, logs, and events—with a single click—while staying grounded in a centralized UI. Join us at KubeCon and CloudNativeCon Europe August 17-20 to learn more. Check out the complete schedule of New Relic talks to make the most of your KubeCon experience. Learn more. Get coding Create a free account 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events Start the guide 7 min Add tags to apps Add tags to applications you instrument for easier filtering and organization Start the guide 12 min Build a Hello, World! app Build a Hello, World! app and publish it to your local New Relic One Catalog Start the guide Get inspired 30 min Add a table to your app Add a table to your New Relic One app 15 min Collect data - any source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add a time picker to your app Add a time picker to a sample application   Add custom attributes Use custom attributes for deeper analysis Show 18 more guides Looking for more inspiration? Check out the open source projects built by the New Relic community. New Relic developer champions New Relic Champions are solving big problems using New Relic as their linchpin and are recognized as experts and leaders in the New Relic technical community. Nominate a developer champion Learn more about developer champions New Relic Podcasts We like to talk, especially to developers about developer things. Join us for conversations on open source, observability, software design and industry news. Listen", - "type": "developer", + "body": "You can manage alerts conditions using our GraphQL NerdGraph API. Here are some conditions queries and mutations you can develop in our NerdGraph API explorer. See the NerdGraph introduction for help getting started with NerdGraph API explorer. This document covers the following: Steps to create a NRQL condition NRQL static condition NRQL baseline condition NRQL outlier condition Update a condition Update mutations List and filter NRQL conditions Singular NRQL condition queries Create a description Delete conditions Steps to create a NRQL condition Follow these steps: Decide which condition type you want to create (see NRQL Condition threshold types). Find your relevant policyID by doing one of the following: Use the NerdGraph policies API. Go to one.newrelic.com, in the top nav click Alerts & AI, then click Policies. Choose a policy. Find the ID under the policy name. Provide the appropriate mutation for your NRQL condition type and the relevant values. The NerdGraph GraphiQL explorer is the best place to find up-to-date documentation about the per-field specifics of the NerdGraph NRQL Conditions API. For example, questions like \"What does the valueFunction field accept?\" are best answered with the inline NerdGraph documentation. NRQL static condition Here's an example of creating a static condition: mutation { alertsNrqlConditionStaticCreate(accountId: YOUR_ACCOUNT_ID, policyId: YOUR_POLICY_ID, condition: { name: \"Low Host Count - Catastrophic\" enabled: true nrql: { query: \"SELECT uniqueCount(host) from Transaction where appName='my-app-name'\" evaluationOffset: 3 } terms: { threshold: 2 thresholdOccurrences: AT_LEAST_ONCE thresholdDuration: 600 operator: BELOW priority: CRITICAL } valueFunction: SINGLE_VALUE violationTimeLimit: TWENTY_FOUR_HOURS }) { id name } } NRQL baseline condition Here's an example of creating a baseline condition: mutation { alertsNrqlConditionBaselineCreate(accountId: YOUR_ACCOUNT_ID, policyId: YOUR_POLICY_ID, condition: { name: \"Baseline Condition\" enabled: true baselineDirection: UPPER_ONLY nrql: { query: \"SELECT average(duration) FROM Transaction\" evaluationOffset: 3 } terms: { threshold: 13 thresholdDuration: 180 thresholdOccurrences: ALL operator: ABOVE priority: CRITICAL } violationTimeLimit: TWENTY_FOUR_HOURS }) { id name baselineDirection } } NRQL outlier condition Here's an example of creating an outlier condition: mutation { alertsNrqlConditionOutlierCreate(accountId: YOUR_ACCOUNT_ID, policyId: YOUR_POLICY_ID, condition: { name: \"Outlier Condition\" enabled: true expectedGroups: 4 openViolationOnGroupOverlap: false nrql: { query: \"SELECT average(duration) FROM Transaction FACET httpResponseCode\" evaluationOffset: 3 } terms: { threshold: 1 thresholdDuration: 300 thresholdOccurrences: ALL operator: ABOVE priority: CRITICAL } violationTimeLimit: TWENTY_FOUR_HOURS }) { id name expectedGroups openViolationOnGroupOverlap } } Update a condition Complete the following: Determine the type of your existing condition by requesting the type field in a nrqlConditionsSearch query like this: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch { nrqlConditions { id type } } } } } } The type returned is what you use for your update mutation. For example, if the type returned is STATIC, use alertsNrqlConditionStaticUpdate. If the type returned is BASELINE, use alertsNrqlConditionBaselineUpdate. If the type returned is OUTLIER, use alertsNrqlConditionOutlierUpdate. Provide the id of your condition to your relevant condition type mutation. Note that you can only update conditions of the relevant type. Only provide update mutations for the fields you want to update. Fields you don't provide in the update are not touched. Update mutations Only fields that you provide in the update are changed. In the following example, baselineDirection returns unchanged, but name is updated. mutation { alertsNrqlConditionBaselineUpdate(id: YOUR_CONDITION_ID, accountId: YOUR_ACCOUNT_ID, condition: { name: \"Your updated name\" }) { id name baselineDirection } } List and filter NRQL conditions To list or filter your NRQL conditions, use the nrqlConditionsSearch query in NerdGraph. Use cursor pagination The basic of list functionality for NRQL conditions allows you to paginate through your NRQL conditions as well as request the total count of conditions per account. The nrqlConditionsSearch query utilizes cursor pagination to paginate through resources. The idea behind cursor pagination is that the client will request a cursor in a programmatic loop until the cursor comes back empty. An initial list response will look something like this: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch { nextCursor nrqlConditions { id name type } totalCount } } } } } This example returns a JSON response like this: { \"data\": { \"actor\": { \"account\": { \"alerts\": { \"nrqlConditionsSearch\": { \"nextCursor\": \"WOwfJ4+TWm9QTFeKMGyg+w==:QqkI8S4+Wwnpno6z+uk8kQ==\", \"nrqlConditions\": [ { \"id\": \"4432\", \"name\": \"Baseline Condition\", \"type\": \"BASELINE\" }, { \"id\": \"443\", \"name\": \"A static condition\", \"type\": \"STATIC\" }, // more conditions here in reality ], \"totalCount\": 435 } } } } }, } In order to paginate through conditions in the response, have the client request the cursor to be returned until the nextCursor returns from the response as null: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch(cursor: \"WOwfJ4+TWm9QTFeKMGyg+w==:QqkI8S4+Wwnpno6z+uk8kQ==\", ) { nextCursor nrqlConditions { id name type } totalCount } } } } } Request type-specific fields Certain fields are only available on specific NRQL condition types. The main reason that mutations are split between the different condition types is because they have minor differences between the fields they accept. For example, valueFunction is only relevant for static NRQL conditions and baselineDirection is only relevant on baseline NRQL conditions. But if these fields are only available on these certain condition types, how do we return them in a list of all of our condition types? The answer is a GraphQL convention known as inline fragments. Inline fragments allow you to access the data on a specific type of NRQL condition: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch { nrqlConditions { id name type ...on AlertsNrqlStaticCondition { valueFunction } ...on AlertsNrqlBaselineCondition { baselineDirection } ...on AlertsNrqlOutlierCondition { expectedGroups } } } } } } } In the previous example query, we are asking GraphQL to do the hard work for us to determine which NRQL conditions are the correct type. So, when the returned type is a static condition, it will return the valueFunction in the object. When the returned type is a baseline condition, it will return baselineDirection instead, and when the type is an outlier condition, it will return expectedGroups. Here is an example response: { \"data\": { \"actor\": { \"account\": { \"alerts\": { \"nrqlConditionsSearch\": { \"nrqlConditions\": [ { \"baselineDirection\": \"UPPER_ONLY\", \"id\": \"342\", \"name\": \"My baseline condition\", \"type\": \"BASELINE\" }, { \"id\": \"553\", \"name\": \"My static condition\", \"type\": \"STATIC\", \"valueFunction\": \"SINGLE_VALUE\" }, { \"expectedGroups\": 4, \"id\": \"802\", \"name\": \"My outlier condition\", \"type\": \"OUTLIER\" } ] } } } } } } Filter NRQL conditions You can filter NRQL conditions with the searchCriteria argument of the nrqlConditionsSearch query: Here's an example of filtering NRQL conditions with matching by name. This query returns NRQL conditions that match the provided name. Note that this match is case insensitive. { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch(searchCriteria: { name: \"Baseline Condition\" }) { nrqlConditions { id name type } } } } } } Singular NRQL condition queries You can use the NRQL condition API to query for a singular condition. Run the nrqlCondition query in the alerts namespace. Similar to type specific fields on the nrqlConditionSearch query, you can also use these inline fragmentsto request fields that are restricted to a NRQL condition type. { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlCondition(id: YOUR_CONDITION_ID) { id name ...on AlertsNrqlStaticCondition { valueFunction } } } } } } Update the description This will walk you through the procedure to create a description for a NRQL alert condition. 1. Get all the conditions for a policy: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditions(policyId: YOUR_POLICY_ID) { nextCursor results { id name description enabled nrql { query sinceValue } policyId runbookUrl terms { duration operator priority timeFunction threshold } type violationTimeLimit } } } } } } 2. Get the details for a single condition: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlCondition(id: \"YOUR_CONDITION_ID\") { description id enabled name nrql { query evaluationOffset } policyId runbookUrl terms { operator priority threshold thresholdDuration thresholdOccurrences } type violationTimeLimit } } } } } 3. Create a mutation with the description. Here's an empty mutation template: mutation { alertsNrqlConditionStaticUpdate(accountId: YOUR_ACCOUNT_ID, id: \"YOUR_CONDITION_ID\", condition: {description: \"\"}) { description } } Here'a an example mutation with an included example description: mutation { alertsNrqlConditionStaticUpdate(accountId: 123456, id: \"123456\", condition: {description: \"timestamp : {{timestamp}} \\n accountId : {{accountId}} \\n type : {{type}} \\n event : {{event}} \\n description : {{description}} \\n policyId : {{policyId}} \\n policyName: {{policyName}} \\n conditionName : {{conditionName}} \\n conditionId : {{conditionId}} \\n product : {{product}} \\n conditionType : {{conditionType}} \\n RunbookUrl : {{runbookUrl}} \\n nrqlQuery : {{nrqlQuery}} \\n nrqlEventType : {{nrqlEventType}} \\n targetID : {{targetId}} \\n targetName : {{targetName}} \\n commandLine : {{tag.commandLine}} \\n entityGuid : {{tag.entityGuid}} \\n entityName : {{tag.entityName}} \\n fullHostname : {{tag.fullHostname}} \\n instanceType : {{tag.instanceType}} \\n processDisplayName : {{tag.processDisplayName}}\"}) { description } } Delete conditions You can use the alertsConditionDelete mutation to delete any type of condition. You can only request the id field on a delete mutation; for example: mutation { alertsConditionDelete(accountId: YOUR_ACCOUNT_ID, id: YOUR_CONDITION_ID) { id } } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "", + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph", + "info": "Examples of how to use the NerdGraph API explorer to create alert conditions, queries, and mutations.", + "nodeid": 37711, "sections": [ - "Contain the complexity - Observability made simple", - "Get coding", - "Create custom events", - "Add tags to apps", - "Build a Hello, World! app", - "Get inspired", - "Add a table to your app", - "Collect data - any source", - "Automate common tasks", - "Create a custom map view", - "Add a time picker to your app", - "Add custom attributes", - "New Relic developer champions", - "New Relic Podcasts" + "New Relic Alerts", + "Get started", + "Alert policies", + "Alert conditions", + "Alert violations", + "Alert Incidents", + "Alert notifications", + "Troubleshooting", + "Rules, limits, and glossary", + "Alerts and Nerdgraph", + "REST API alerts", + "NerdGraph API: NRQL condition alerts", + "Steps to create a NRQL condition", + "NRQL static condition", + "NRQL baseline condition", + "NRQL outlier condition", + "Update a condition", + "Update mutations", + "List and filter NRQL conditions", + "Singular NRQL condition queries", + "Update the description", + "Delete conditions", + "For more help" ], - "title": "New Relic Developers", + "title": "NerdGraph API: NRQL condition alerts ", "popularity": 1, - "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab", - "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png", - "url": "https://developer.newrelic.com/", - "published_at": "2020-08-17T01:47:47Z", - "updated_at": "2020-08-15T01:36:10Z", + "external_id": "86591bd20017930f1e4eef1b1a76e3806298dbb9", + "category_1": "New Relic Alerts", + "image": "", + "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alerts-nerdgraph/nerdgraph-api-nrql-condition-alerts", + "published_at": "2020-08-18T18:15:13Z", + "updated_at": "2020-08-11T04:56:49Z", + "category_0": "Alerts and Applied intelligence", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.24213192, + "_score": 0.15523642, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic Developers", - "sections": "New Relic developer champions", - "body": " to your app Add a table to your New Relic One app 15 min Collect data - any source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add" + "title": "NerdGraph API: NRQL condition alerts ", + "sections": "NerdGraph API: NRQL condition alerts", + "info": "Examples of how to use the NerdGraph API explorer to create alert conditions, queries, and mutations.", + "category_0": "Alerts and Applied intelligence", + "category_1": "New Relic Alerts", + "body": " the conditions for a policy: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditions(policyId: YOUR_POLICY_ID) { nextCursor results { id name description enabled nrql { query sinceValue } policyId runbookUrl terms { duration operator priority timeFunction threshold } type violationTimeLimit" }, - "id": "5d6fe49a64441f8d6100a50f" + "id": "5f2dee1128ccbc562e88dfc1" }, { - "body": "Explore NerdGraph using the API Explorer 25 min NerdGraph is New Relic's GraphQL API. It allows you to get all the information you need in a single request. With NerdGraph API Explorer you don't need to know the query format: using the Query Builder you can browse our entire graph and compose queries just by selecting the items you want and filling out their required values. Before you begin Go to api.newrelic.com/graphiql and log in using your New Relic user ID and password: the NerdGraph API Explorer loads up. Make sure you have a valid New Relic API key. You can create one directly from the NerdGraph API Explorer. Step 1 of 5 Build a query to retrieve your name Time for your first NerdGraph query. Search for your name in the New Relic database: Erase everything in the query editor. Select the following fields in the query explorer in this order: actor, user, name. This GraphQL snippet appears in the editor. { actor { user { name } } } Copy Step 2 of 5 Click the play button to see the result With this query, you're telling NerdGraph to retrieve your name. You're asking for the name field, which is nested within the user field. This refers to the user who owns the API key, which in turn is nested within actor. Click the play button to see the result: It has almost the same shape as the request. All the fields in the Query Builder make up what's called the GraphQL schema, which describes all the available data types and their attributes. To learn more about each field, click the Docs button, or hover over a field in the editor. Step 3 of 5 Add more fields to your query Now you can try adding more fields to your query. The simplest way is clicking the fields in the Query Builder: The API Explorer knows where the attributes should go in the query. In the example, you add the account id and email fields. Once again, running the GraphQL query results in just the data you need, without over or under-fetching data. Notice that the id field has an argument: passing arguments is a powerful way of customizing your NerdGraph queries. Every field and object can contain arguments, so instead of running multiple queries, you just compose the one that you need. { actor { user { name email } account(id: 12345678) } } Copy Step 4 of 5 Experiment with mutations In GraphQL, mutations are a way to execute queries with side effects that can alter the data by creating, updating, or deleting objects (Commonly referred to as CRUD operations in REST APIs). Ready for your first mutation? Erase what's in the editor. Scroll down the Query Builder and expand mutation. Select the fields in the following screenshot: In this case, you're trying to add a custom tag to an entity. Notice that the editor complains if you don't select errors: mutations must have a way of telling you how the operation performed in the backend (failed requests result in null responses). Tip Unlike REST, GraphQL APIs like NerdGraph can return partial responses. For example, if you try adding tags to multiple entities, some mutations can fail and others succeed; all is logged in the GraphQL response you get. Step 5 of 5 Try your NerdGraph query in the terminal Let's say that you've built a NerdGraph query you're happy with and you want to test it elsewhere. To capture code-ready queries and mutations: Select the Tools menu. Copy the query as a curl call or as a New Relic CLI command. # cURL version curl https://api.newrelic.com/graphql \\ -H 'Content-Type: application/json' \\ -H 'API-Key: API_KEY_REDACTED' \\ --data-binary '{\"query\":\"{\\n actor {\\n user {\\n name\\n email\\n }\\n account(id: 12345678)\\n }\\n}\\n\", \"variables\":\"\"}' # New Relic CLI version newrelic nerdgraph query '{ actor { user { name email } account(id: 12345678) } } ' Copy Next steps Now you know the basics of composing and testing NerdGraph queries, but how do you turn them into client or server code? Solutions such as GraphQL Code Generator can help you turn the NerdGraph queries into code for your implementation. Try creating more complex queries by clicking fields and expanding objects in the Query Builder (be careful with mutations though, since they could write data to your account). For more information on NerdGraph and explore other projects from the developer community, check out the threads on the Explorer’s Hub.", - "type": "developer", + "body": "Use the entity explorer to access the performance data from all your monitored applications, services, and hosts. For more about entities, see What is an entity? View entities To use the entity explorer: Go to one.newrelic.com and select Entity explorer. Your monitored entities are on the left. You may need to scroll your list of entities to see them all. one.newrelic.com > Entity explorer: Use the entity explorer to locate and examine the entities you monitor. The entity explorer brings together data reported from across all of New Relic. Entity categories include: Services: APM-monitored applications and services monitored. Hosts: your monitored infrastructure (your servers and hosts). Mobile applications: your mobile apps. Browser applications: your front-end browser apps. Integration-reported data: data from services monitored by our integrations, including our on-host integrations (like Kubernetes, StatsD, and NGINX), and cloud platform integrations, like Amazon, Microsoft Azure, and Google Cloud Platform (GCP). Health (alert) status The entity explorer shows a color-coded alert status for entities. For example, you may see a red alert status indicating a critical violation in progress. To see what an alert status means, mouse over it. To see details about an entity's alerting status, select the entity. NRQL alert conditions aren't used to determine alert status because they aren't associated with specific entities. Starting June 8, 2020, New Relic One will not continue to display any APM application that hasn't reported data for 93 days. To match our published APM data retention guidelines, applications that have not reported data will be available within the New Relic UI for 90 days. After 90 days, those applications will be removed from the UI; however, key metrics will continue to be available via the New Relic REST API based on subscription level. For more information, see New Relic's Explorers Hub post. Filter by tag or entity name There are a couple ways to filter down to specific types of entities: Filter entities by tags: Use Filter with tags at the top of the page. For example, you may want to filter down to only entities tagged with production, or only entities with a specific AWS region tag. For more about tags, see Tagging. Filter by entity name: Use Search services by name at the top of the page. Entity data retention Availability of data depends on these factors: Scope Data retention Entity explorer and search In the UI, data is available for eight days after an entity no longer exists, with one exception: data reported by integrations, such as Amazon AWS, is only available for one day after an entity ceases to exist. Our database (accessible via NRQL query) For querying our database (for example, via the query builder or data explorer), availability is dependent on the data retention for that data type. As a result of these factors, a short-lived entity (like a cloud host) may not be available in the entity explorer list or via search, but its data may still be available via NRQL query. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "Learn to explore NerdGraph, our GraphQL API, and build the queries you need.", + "breadcrumb": "Contents / New Relic One / Use New Relic One / UI and data", + "info": "Use New Relic's entity explorer to see all your monitored entities in one place and explore the reported data. ", + "nodeid": 34316, "sections": [ - "Explore NerdGraph using the API Explorer", - "Before you begin", - "Build a query to retrieve your name", - "Click the play button to see the result", - "Add more fields to your query", - "Experiment with mutations", - "Tip", - "Try your NerdGraph query in the terminal", - "Next steps" + "Use New Relic One", + "Get started", + "Core concepts", + "UI and data", + "Workloads", + "Build on New Relic One", + "Entity explorer: View performance across apps, services, hosts", + "View entities", + "Health (alert) status", + "Filter by tag or entity name", + "Entity data retention", + "For more help" ], - "title": "Explore NerdGraph using the API Explorer", + "title": "Entity explorer: View performance across apps, services, hosts", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/new-relic-one/use-new-relic-one/ui-data/new-relic-one-entity-explorer-view-performance-across-apps-services-hosts", "popularity": 1, - "external_id": "df1f04edc2336c69769d946edbaf263a5339bc92", - "image": "https://developer.newrelic.com/static/0ce8c387a290d7fbd6be155322be9bce/bc8d6/create-account.png", - "url": "https://developer.newrelic.com/collect-data/get-started-nerdgraph-api-explorer/", - "published_at": "2020-08-17T01:48:54Z", - "updated_at": "2020-08-14T01:45:09Z", + "external_id": "4a6bab9713737af90dbcc516f3c61501354f15d2", + "category_1": "Use New Relic One", + "category_2": "UI and data", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-one-entity-explorer.png", + "url": "https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/ui-data/new-relic-one-entity-explorer-view-performance-across-apps-services-hosts", + "published_at": "2020-08-18T14:54:15Z", + "updated_at": "2020-08-10T23:54:20Z", + "category_0": "New Relic One", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.20797253, + "_score": 0.089622304, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Explore NerdGraph using the API Explorer", - "sections": "Explore NerdGraph using the API Explorer", - "info": "Learn to explore NerdGraph, our GraphQL API, and build the queries you need.", - "body": " and mutations: Select the Tools menu. Copy the query as a curl call or as a New Relic CLI command. # cURL version curl https://api.newrelic.com/graphql \\ -H 'Content-Type: application/json' \\ -H 'API-Key: API_KEY_REDACTED' \\ --data-binary '{"query":"{\\n actor {\\n user {\\n name\\n email\\n }\\n account(id" + "sections": "Health (alert) status", + "body": " in progress. To see what an alert status means, mouse over it. To see details about an entity's alerting status, select the entity. NRQL alert conditions aren't used to determine alert status because they aren't associated with specific entities. Starting June 8, 2020, New Relic One will not continue" }, - "id": "5efa9973196a6791f4766402" - } - ], - "/automate-workflows/get-started-terraform": [ + "id": "5d244a5864441fe577a72a1b" + }, { - "body": "In order to provide a unified experience, we're deprecating Synthetics monitor alert notifications and alert conditions violations, and replacing these pages with a new synthetic monitor overview experience in New Relic One. This new experience provides visibility into a monitor's open violations and alert conditions with the monitor results in a single view, removing the need to open multiple tabs to view violations or alert conditions. For more information, check the EoL Announcements page. If you want to receive alert notifications when a synthetic monitor fails, you can configure the alert notification either while creating a monitor or after you have created one. You can configure your monitor's alert policy directly from the Synthetics UI or via the Alerts UI for existing monitors. To identify which monitors do not have policies assigned to them, review their color-coded health status. Add a synthetic monitor to alert policies A monitor can be included in multiple alert policies. You can view the alert policies and conditions for the selected monitor from the Synthetics UI or from the Alerts UI. To add an existing monitor to an alert policy: Go to one.newrelic.com > Alerts & AI > Policies. From the list of existing alert policies, use the search box or scroll the list to locate one or more alert policies where the monitor has not already been added. Open the policy, then click Add a condition. Click Synthetics and then select the monitor. Fill out the remaining settings and click Create condition. Existing monitor: Remove from alert policy To remove an existing monitor from an existing alert policy: Go to one.newrelic.com > Alerts & AI > Policies. From the list of existing alert policies, use the search box or scroll the list to locate one or more alert policies where the monitor has not already been added. Select the trash can (delete) icon on the monitor's row. Receive alert notifications on a three-strike basis Synthetic alert notifications operate on a three-strike basis, sending an alert after three monitor attempts from a single location return an error. Your alert policy configuration and notification channel settings will determine when you receive alerts for specific monitors and locations. If you monitor a non-public app and add your selected public minion IPs to your allow list, you may very infrequently receive a false downtime alert. When a synthetic monitoring data center goes down, New Relic may decide to temporarily use an alternate host, which results in the temporary server's IP being blocked by your app. Mute (disable) monitor's alert notifications To temporarily disable alerting for a monitor, mute it: Go to one.newrelic.com > Synthetics > Monitors > (select a monitor). Click General under the Settings menu in the left menu sidebar. Click the Notifications button to Off. Muting a monitor's alert notifications will not mute multi-location alerts or NRQL alerts. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "body": "New Relic's Kubernetes integration can be installed directly on a server or VM, or through several cloud platforms, such as GKE, EKS, AKS, or OpenShift. Each has a different compatibility with our integration. Compatibility Our Kubernetes integration is compatible with the following versions, depending on the installation mode: Install mode or feature Kubernetes versions Kubernetes cluster Currently tested with versions 1.10 to 1.18 Kubernetes cluster GKE Currently tested with versions 1.10 and 1.17 Kubernetes cluster EKS Currently tested with version 1.11 Kubernetes cluster AKS Currently tested with version 1.11 Kubernetes cluster OpenShift Currently tested with versions 3.7, 3.9, 4.2, 4.3, 4.4 and 4.5 Control plane monitoring Compatible with version 1.11 or higher Service monitoring Compatible with version 1.13 or higher Requirements The New Relic Kubernetes integration has the following requirements: Linux distribution compatible with New Relic infrastructure agent. kube-state-metrics version 1.9.5 running on the cluster. Install using Helm For compatibility and requirements when installing the Kubernetes integration using Helm, see Alternative install using Helm. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "type": "docs", "document_type": "page", - "breadcrumb": "Contents / Synthetic monitoring / Synthetic monitoring / Using monitors", - "info": "New Relic can use alerts to notify you about synthetic monitors's failures.", - "nodeid": 6371, + "breadcrumb": "Contents / Integrations / Kubernetes integration / Get started", + "info": "Compatibility and requirements of the New Relic Kubernetes integration.", + "nodeid": 38331, "sections": [ - "Synthetic monitoring", - "Getting started", - "Guides", - "Using monitors", - "Monitor scripting", - "Administration", - "Private locations", - "UI pages", - "Synthetics API", + "Kubernetes integration", + "Get started", + "Installation", + "Understand and use data", + "Link apps and services", + "Kubernetes events", + "Logs", "Troubleshooting", - "Alerts for synthetic monitoring", - "Add a synthetic monitor to alert policies", - "Existing monitor: Remove from alert policy", - "Receive alert notifications on a three-strike basis", - "Mute (disable) monitor's alert notifications", + "Kubernetes integration: compatibility and requirements", + "Compatibility", + "Requirements", + "Install using Helm", "For more help" ], - "title": "Alerts for synthetic monitoring", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/synthetics/synthetic-monitoring/using-monitors/alerts-synthetic-monitoring", + "title": "Kubernetes integration: compatibility and requirements", "popularity": 1, - "external_id": "b69353439d3cc180ca46c64bef5e8470cdda1636", - "category_1": "Synthetic monitoring", - "category_2": "Using monitors", + "external_id": "dd40c3bef40e68d873d909dbff75708e20a1141e", + "category_1": "Kubernetes integration", + "category_2": "Get started", "image": "", - "url": "https://docs.newrelic.com/docs/synthetics/synthetic-monitoring/using-monitors/alerts-synthetic-monitoring", - "published_at": "2020-08-15T08:07:46Z", - "updated_at": "2020-08-14T00:47:54Z", - "category_0": "Synthetic monitoring", + "url": "https://docs.newrelic.com/docs/integrations/kubernetes-integration/get-started/kubernetes-integration-compatibility-requirements", + "published_at": "2020-08-18T17:13:01Z", + "updated_at": "2020-08-18T17:13:00Z", + "category_0": "Integrations", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.6482735, + "_score": 0.08006527, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Alerts for synthetic monitoring", - "sections": "Mute (disable) monitor's alert notifications", - "info": "New Relic can use alerts to notify you about synthetic monitors's failures.", - "category_0": "Synthetic monitoring", - "category_1": "Synthetic monitoring", - "category_2": "Using monitors", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/synthetics/synthetic-monitoring/using-monitors/alerts-synthetic-monitoring", - "body": " the alert notification either while creating a monitor or after you have created one. You can configure your monitor's alert policy directly from the Synthetics UI or via the Alerts UI for existing monitors. To identify which monitors do not have policies assigned to them, review their color-coded health", - "breadcrumb": "Contents / Synthetic monitoring / Synthetic monitoring / Using monitors" + "title": "Kubernetes integration: compatibility and requirements", + "sections": "Kubernetes integration", + "info": "Compatibility and requirements of the New Relic Kubernetes integration.", + "category_1": "Kubernetes integration", + "body": "New Relic's Kubernetes integration can be installed directly on a server or VM, or through several cloud platforms, such as GKE, EKS, AKS, or OpenShift. Each has a different compatibility with our integration. Compatibility Our Kubernetes integration is compatible with the following versions", + "breadcrumb": "Contents / Integrations / Kubernetes integration / Get started" }, - "id": "5f31b60e196a6742d2fbd6c8" - }, + "id": "5ea87c3be7b9d2c533748090" + } + ], + "/build-apps/map-pageviews-by-region": [ { - "body": "If you delete a channel, you cannot restore it. If you want to keep the notification channel, you can remove it from any associated policy. Delete a channel To delete a channel permanently: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Optional: To find the notification channel easily, search the Notification channels index. From the Notification channels index, select the channel's delete icon, and then select the confirmation prompt to cancel or continue. When you delete (or remove) a channel, any policies associated with it will still remain. You must delete policies separately. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "Set up your development environment 20 min If you've decided to build a custom app or modify one of our open source apps, you need a few essential tools: The New Relic One command line interface (CLI) An API key, which you get when you download the CLI Depending on what you want to do with your app, you might have some additional setup and configuration. This guide covers: Downloading the New Relic One CLI to build or modify apps Contribute content to this website Before you begin You must have: A github account account - While not strictly necessary for building apps, a GitHub account enables you to download and customize our open source apps, and contribute an open source project. A New Relic developer account - if you don't already have one, you can get a free trial account for developing New Relic applications. npm - If you've installed Node.js, then you already have npm, which is used to share, reuse, and update JavaScript code, and is necessary for working with React components that are the framework for New Relic apps and this website. Tip Use the NR1 VS Code extension to build your apps. Prepare to build or modify apps Step 1 of 2 Download the CLI and API key On the Build New Relic One applications page, complete the Quick start steps. These six Quick start steps get you an API key for use with developing apps, and the New Relic One CLI, for building and deploying apps. At the end of the Quick start, you have a project consisting of the following: A Nerdpack - The package containing all the files required by your application. It contains two types of files that you customize to build your app: Nerdlets, and the launcher. One or more Nerdlet files - A specific UI view or window. A Nerdlet is a React JavaScript package that includes an index.js file, a stylesheet, and a JSON-format config file. It can contain any JS functionality (charts, interactive fields, tooltips, etc.). A launcher file: This is the basis for the launcher, which is used to open your application from New Relic One after you publish your app. Step 2 of 2 Start building If you're ready to code, cd to your Nerdpack and get started. If you want to learn more about building applications, try these step-by-step guides: Build a \"Hello, World!\" application shows how to create a little application, publish it to New Relic One, and share it with others by subscribing accounts to it. Map pageviews by region takes you through the steps to create one of our popular open source apps. You learn to add a custom query to an app and view it in a table, then add that data to a map. Contributing to developer.newrelic.com This site is open source, and we want your input. Create a pull request if you see a mistake you know how to fix. Drop us a GitHub issue if you see some content gaps you want us to work on. Or write up a whole new guide if you have one you'd like to share. Read on to learn how. Step 1 of 3 Fork the developer-website GithHub repo Forking the repo enables you to work on your own copy of the developer.newrelic.com files, and build the site locally. It also enables us to more easily manage incomimg pull requests. On the developer-website page in GitHub, select the Fork button on the top right of the page, choose the account you want to fork to, and wait a few seconds while the fork is created. Sync regularly to keep your fork up to date with changes and additions to the main branch upstream. Step 2 of 3 Make a feature or documentation request On any page, select the GitHub button at the top of the page, and then select the kind of change you want, and fill out the GitHub form. Step 3 of 3 Contribute a new guide Check out our contributors guidelines, which will walk you through the process.", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert notifications", - "info": "You can delete alerts notification channels permanently or you can keep channels but remove them from associated policies.", - "nodeid": 6471, + "info": "Prepare to build apps and contribute to this site", "sections": [ - "New Relic Alerts", - "Get started", - "Alert policies", - "Alert conditions", - "Alert violations", - "Alert Incidents", - "Alert notifications", - "Troubleshooting", - "Rules, limits, and glossary", - "Alerts and Nerdgraph", - "REST API alerts", - "Delete alert notification channels", - "Delete a channel", - "For more help" + "Set up your development environment", + "Before you begin", + "Tip", + "Prepare to build or modify apps", + "Download the CLI and API key", + "Start building", + "Contributing to developer.newrelic.com", + "Fork the developer-website GithHub repo", + "Make a feature or documentation request", + "Contribute a new guide" ], - "title": "Delete alert notification channels", + "title": "Set up your development environment", "popularity": 1, - "external_id": "dcea3b60f23ddeb74a7a0a0f44a5130cd9e2885d", - "category_1": "New Relic Alerts", - "category_2": "Alert notifications", + "external_id": "c45638a9cd548d1ffffc9f1c7708f115a92ae04a", "image": "", - "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/delete-alert-notification-channels", - "published_at": "2020-08-15T07:46:53Z", - "updated_at": "2020-08-15T07:46:52Z", - "category_0": "Alerts and Applied intelligence", + "url": "https://developer.newrelic.com/build-apps/set-up-dev-env/", + "published_at": "2020-08-18T02:08:12Z", + "updated_at": "2020-08-18T01:45:02Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.64575, + "_score": 0.20750418, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Delete alert notification channels", - "sections": "Delete alert notification channels", - "info": "You can delete alerts notification channels permanently or you can keep channels but remove them from associated policies.", - "category_2": "Alert notifications", - "body": "If you delete a channel, you cannot restore it. If you want to keep the notification channel, you can remove it from any associated policy. Delete a channel To delete a channel permanently: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Optional: To find" + "sections": "Prepare to build or modify apps", + "info": "Prepare to build apps and contribute to this site", + "body": " pageviews by region takes you through the steps to create one of our popular open source apps. You learn to add a custom query to an app and view it in a table, then add that data to a map. Contributing to developer.newrelic.com This site is open source, and we want your input. Create a pull request" }, - "id": "5f2dbb3628ccbc65c788dfcb" + "id": "5efa9973e7b9d242237bab39" }, { - "body": "Depending on the selected channel type, different values appear. Reference for updating channels Here's a quick reference for updating channels which also includes links to more detailed information and procedures. Add or remove policies assigned to a channel To add or remove policies assigned to a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. Choose a channel, and then click Alert policies. From the selected policy, use the windows to select, remove, or clear all notification channels. Assign a channel to policies To add a notification channel to one or more policies: Go to one.newrelic.com, in the top nav click Alerts & AI, click Policies. Choose a policy, click Notification channels, and then click Add notification channels. Choose a channel, and then click Update policy. Change a channel's name To rename an existing notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels, then choose a channel. From the Channel details, change the name (maximum 64 characters) based on the channel type if applicable, and then save. Check for policies assigned to a user To check whether an account user has any policies assigned: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. Optional: Search by \"user\" to browse users or a specific username or email. Choose the user, then click Alert policies. Check how many policies are assigned to a channel To check whether a notification channel has any policies assigned: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. The Policy subscriptions column lists how many policies are assigned to the channel. Create more channels To create a new notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. Click New notification channel. Delete a channel To delete a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. In the list, click the Delete icon. Test a saved channelView assigned alert policies To view the policies assigned to a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels, choose a channel, and then click Alert policies. OR To view the notification channels assigned to a policy: Go to one.newrelic.com, in the top nav click Alerts & AI, click Policies, choose a policy, then click Notification channels. Basic process Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels, then choose a channel. From the Channel details page, make any necessary changes, and then save. The user interface shows a Last modified time stamp for any changes to policies, including their conditions and notification channels. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "body": "New Relic APM's Summary page provides general information about the selected app, including web transactions and non-web transactions, Apdex score, CPU usage, throughput (requests per minute or rpm), transaction times, error rate, application activity, and hosts. To get a high-level overview of all your applications and services, use the entity explorer. View your app's summary page Here are two ways to reach the Summary page: Entity explorer: Go to one.newrelic.com > Entity explorer > (select an app). APM: Go to one.newrelic.com > APM > (select an app). For more information, see the documentation about navigating core UI components in New Relic One. View app performance Use the Summary page for a quick summary of your website's performance. Overview charts Some charts include links to APM pages where you can drill down into additional details. APM Summary chart Comments Transactions response time This stacked chart represents the response time of web transactions or non-web transactions in your app. Segments in the chart vary depending on which agent you are using. Some charts may have an independent line for response time that represents the relationship between response time and total time. Also, for your external or background services, you may see data labeled as Web external. For more information about these out-of-process services, use the Externals page. Apdex score This chart measures the performance of your app based on its Apdex T value during the selected time window. To view additional details, hover over the question question circle icon or the chart's End user and App server lines. The End user line charts the Apdex for your Browser apps, and the App server line charts the Apdex for your APM apps. Throughput This chart illustrates the requests per minute for either web transactions or non-web transactions. To change the type of transaction, select the Transaction response time chart's dropdown arrow, then select Web or Non-web. Error rate This chart shows the number of errors that have occurred in the current time window. The tooltip that appears when you hover over the Error rate chart shows the combined throughput for both web and non-web transactions. To understand how error rate is calculated, see Application error rate example. Event markers Markers on the main Summary chart indicate events and changes to the app: Black vertical bar: Apdex settings have changed. Blue vertical bar: A deployment marker has been created or another event has occurred, such as a settings change for the app. Yellow or red area: This indicates alert thresholds have been violated. To view additional information, mouse over the marker. Drill-down details Use any of New Relic's standard page functions to drill down into detailed information. Here is a summary of additional options with the APM Summary page. If you want to... Do this... Change how data appears on the main chart Select the chart title's drop-down arrow, and then select your choice of view options, including histograms or percentiles if available. View threshold levels for your app's Apdex score Mouse over the Apdex score ? icon. For non-web transactions, the Apdex chart is blank because Apdex is not applicable to this class of apps. View trends in transaction time, Apdex, and throughput Select the Compare with yesterday and last week checkbox. The checkbox is only available when viewing the Web transaction response time chart with the time picker window Ending now. The checkbox is unavailable if you are viewing histograms, percentiles, or custom dates. View app performance since the last deployment From the time picker, select Performance since the last deployment. For detailed information about all deployments, select the Deployments page. View the Transactions page Select the Transactions table's heading on the APM Summary page. Or, to view details about a specific transaction (including operations, transaction traces, and key transactions), select its name. View the Databases or External services pages Click on a related time band in the Web transactions response time chart. View the Errors page Select the Error rate chart's title on the APM Summary page. You can also view the Errors page from one.newrelic.com > (select an app) > Events > Errors. Browser details In order to view Browser details, you must enable this feature from Browser settings. However, if your app has never reported any browser monitoring data, you must first enable it from the application's settings: Go to one.newrelic.com > (select an app) > Settings > Application. From the New Relic Browser section, select the Enable browser monitoring? checkbox. Select Apdex values for browser monitoring and app server requests, or leave the defaults. Optional: Select up to five countries or regions for browser monitoring to highlight on the Geography page. Select Save application settings. To enable additional features, follow standard procedures from Browser > (selected app) > Settings. After New Relic Browser instrumentation is set up, the APM Summary page provides summary information and direct links to detailed information on the app's corresponding Browser Summary page. To view chart details with browser page load time, select the main chart's Browser link. To view the Apdex score for browsers, select the Apdex chart's Browser link. Link app performance to resources The APM Summary page shows a table with averages about your app's instances on their hosts, including: Apdex Response time Throughput Error rate CPU usage Memory CPU usage percentage is calculated as though the application is running on one CPU core. For more information about this calculation, see CPU usage is over 100%. Examine app performance within system context Use any of these options to examine your app's performance within the context of your system's architecture and resources, such as individual hosts: Select your choice from the table at the bottom of the APM Summary page for infrastructure. Toggle between a table view or breakout metric details. If applicable, select your choice from the drop-down at the top of the APM Summary page for servers or JVMs. Examine details within infrastructure To help you understand the full context of your app's performance within your environment, New Relic APM includes options to view performance from inside the application, as well as from outside the application with the infrastructure agent. To view detailed information from your resources' point of view, click any host link. The link takes you directly to the infrastructure Compute page. When you click, the Compute data may not immediately appear. If that happens, follow the prompt to validate your account and complete the conversion process for the infrastructure agent. If you need additional help, get support at support.newrelic.com. Troubleshoot host link To troubleshoot the host link from the APM Summary page, use these tips: Host link from APM Summary Troubleshooting tips Your infrastructure agent is not installed on the host. Follow standard procedures to install our infrastructure agent. The application is operating within a container, and your infrastructure agent is installed on the container’s host. Set the hostname for the container to be the hostname of the underlying server. Docker containers: Run your Docker container with the argument: --uts=\"host\" This will cause the container to share the UTS Linux Namespace with the underlying host. However, by using this set, a privileged container could change the host's hostname. The application is running on a Windows container, and your infrastructure agent is installed on the Windows host. To get a direct link to infrastructure metric data for your application, enable process metrics in the infrastructure agent's configuration. Your infrastructure agent is installed, but it only reports the short hostname, not the long hostname. Configure your server's hostname settings so that the infrastructure agent and the APM agent return the exact same name string. If possible, do so by editing your server's fully qualified domain name (FQDN) settings. The APM and infrastructure agents both read their hostname from the operating system's FQDN settings, so setting the hostname there ensures both agents share a single hostname. For more information, see the Java agent troubleshooting example. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "type": "docs", "document_type": "page", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert notifications", - "info": "Read about how to update alerts notification channels. ", - "nodeid": 6481, + "breadcrumb": "Contents / APM / APM UI pages / Monitoring", + "info": "New Relic APM's Summary page provides charts and tables that you can drill down into details about your selected app’s performance.", + "nodeid": 3106, "sections": [ - "New Relic Alerts", - "Get started", - "Alert policies", - "Alert conditions", - "Alert violations", - "Alert Incidents", - "Alert notifications", - "Troubleshooting", - "Rules, limits, and glossary", - "Alerts and Nerdgraph", - "REST API alerts", - "Update alert notification channels", - "Reference for updating channels", - "Basic process", + "APM UI pages", + "Monitoring", + "Error analytics", + "Features", + "Events", + "APM Summary page: View transaction, Apdex, usage data", + "View your app's summary page", + "View app performance", + "Link app performance to resources", "For more help" ], - "title": "Update alert notification channels", + "title": "APM Summary page: View transaction, Apdex, usage data", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/apm/apm-ui-pages/monitoring/apm-summary-page-view-transaction-apdex-usage-data", "popularity": 1, - "external_id": "ee8bce401d0623e8b85d84a6a20bd8a72b9764ef", - "category_1": "New Relic Alerts", - "category_2": "Alert notifications", - "image": "", - "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/update-alert-notification-channels", - "published_at": "2020-08-15T07:46:52Z", - "updated_at": "2020-08-11T06:42:27Z", - "category_0": "Alerts and Applied intelligence", + "external_id": "107da0571b646cfe203af6c1114369e164edb390", + "category_1": "APM UI pages", + "category_2": "Monitoring", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/crop-apm-overview-hosts112116.png", + "url": "https://docs.newrelic.com/docs/apm/apm-ui-pages/monitoring/apm-summary-page-view-transaction-apdex-usage-data", + "published_at": "2020-08-18T12:28:49Z", + "updated_at": "2020-08-15T05:47:46Z", + "category_0": "APM", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.53039706, + "_score": 0.1375314, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Update alert notification channels", - "sections": "Update alert notification channels", - "info": "Read about how to update alerts notification channels. ", - "category_2": "Alert notifications", - "body": " to a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. Choose a channel, and then click Alert policies. From the selected policy, use the windows to select, remove, or clear all notification channels. Assign a channel to policies To add" + "title": "APM Summary page: View transaction, Apdex, usage data", + "sections": "View your app's summary page", + "info": "New Relic APM's Summary page provides charts and tables that you can drill down into details about your selected app’s performance.", + "category_1": "APM UI pages", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/apm/apm-ui-pages/monitoring/apm-summary-page-view-transaction-apdex-usage-data", + "body": " your applications and services, use the entity explorer. View your app's summary page Here are two ways to reach the Summary page: Entity explorer: Go to one.newrelic.com > Entity explorer > (select an app). APM: Go to one.newrelic.com > APM > (select an app). For more information, see" }, - "id": "5f2dbad928ccbcb8ca88dfed" + "id": "5f377702196a67008755e629" }, { - "body": "You must save a new notification channel or any changes to an existing notification channel before testing it. Alerts will then send a test message to your chosen destination. Request the test To test a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Follow standard procedures to add a new notification channel or to update an existing notification channel, and save it. Select a notification channel, and then click Envelope Message Icon Send a test notification. Review the test confirmation message, and then click Got it. Troubleshoot the test results A confirmation message will automatically show up in the user interface that indicates where the test was sent (for example, email) and whether it was successful. Also, the test notification message itself includes detailed information, including: The person who requested the test Links to policies for the channel Links to all notification channels and policies for the account When troubleshooting problems, review the test notification message, and verify the setup requirements for the type of notification channel you selected. If necessary, make additional changes to your notification channel, and test it again as needed. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "body": "Browser monitoring's Geography page provides a world view with color-coded Apdex scores and other performance information about your end users' experience. You can select specific geographic regions, such as countries or states, and then you can drill down to detailed information about page load performance and historical performance. Contents View performance data by region Firewalls may have an impact on the geographical data collected about your end users. To view or sort the performance information by location: one.newrelic.com > Browser > (select an app) > Geo: This page provides a world view and drill-down details of color-coded performance information for geographic locations. Go to one.newrelic.com > Browser > (select an app) > Geo > Global (for a world view). OR Go to one.newrelic.com > Browser > (select an app) > Geo > (select a location) (for a specific location you identified in the Browser application settings). To drill down to a specific area, select a location from the list, or select any area on the geographical map. To view additional details about the selected location, select the Page load performance or Historical performance links. To return to the main Geography page, select X (Close). one.newrelic.com > Browser > (select an app) > Geo > (select a location): If you selected specific locations from Settings > Application settings, the Geography page includes tabs to view their performance data directly. Use page functions Use any of our standard user interface functions and page functions to drill down into detailed information. Here is a summary of additional options with the Geography page: If you want to... Do this... Change how the performance data appears Select your choice from the Sort by menu. Adjust the amount of information that appears Select or clear the Hide <% throughput checkbox (<1% for global view, <2% for selected locations). View a map of a specific location Do any of these as applicable: Select the location's name from the Geo > Global list. Select its physical location on the map. If you have pre-selected the location from Application settings, select its tab. View summary performance information about a specific location Mouse over any colored area. View drill-down details After you select a specific location, the Page load performance page shows: Average page load time in seconds Number of page views and active sessions as pages per minute (ppm) Recent browser traces if applicable one.newrelic.com > Browser > (select an app) > Geo > (select a location): After you select a specific location, you can view specific details about Page load performance and Historical performance. In addition, the Historical performance page shows comparison data for the selected time period, yesterday, and last week for the selected location. This includes: Response time Apdex Throughput in pages per minute (ppm) For more help Additional documentation resources include the Page views page (details about end users' overall experience with your site). If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "type": "docs", "document_type": "page", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert notifications", - "info": "Be sure to save your alerts notification channels before testing them to make sure they're working properly.", - "nodeid": 6491, + "breadcrumb": "Contents / Browser monitoring / Browser monitoring / Additional standard features", + "info": "Browser's Geography feature shows color-coded Apdex scores and page load performance for your end users' experience around the world.", + "nodeid": 1921, "sections": [ - "New Relic Alerts", - "Get started", - "Alert policies", - "Alert conditions", - "Alert violations", - "Alert Incidents", - "Alert notifications", + "Browser monitoring", + "Getting started", + "Guides", + "Installation", + "Configuration", + "Browser agent and SPA API", + "Page load timing resources", + "Browser Pro features", + "Additional standard features", + "Performance quality", "Troubleshooting", - "Rules, limits, and glossary", - "Alerts and Nerdgraph", - "REST API alerts", - "Test alert notification channels", - "Request the test", - "Troubleshoot the test results", + "Browser Geography: Webpage performance by location", + "Contents", + "View performance data by region", + "Use page functions", + "View drill-down details", "For more help" ], - "title": "Test alert notification channels", + "title": "Browser Geography: Webpage performance by location", "popularity": 1, - "external_id": "fcea4cf920f099fa1fcf7fab3760d57bdf2e02b7", - "category_1": "New Relic Alerts", - "category_2": "Alert notifications", - "image": "", - "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/test-alert-notification-channels", - "published_at": "2020-08-15T07:46:52Z", - "updated_at": "2020-08-11T04:16:54Z", - "category_0": "Alerts and Applied intelligence", + "external_id": "ccbfe8376f2aee5d35b31dbcee84ff1cbff5b094", + "category_1": "Browser monitoring", + "category_2": "Additional standard features", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/geo_overview.png", + "url": "https://docs.newrelic.com/docs/browser/new-relic-browser/additional-standard-features/browser-geography-webpage-performance-location", + "published_at": "2020-08-18T11:30:40Z", + "updated_at": "2020-08-15T09:25:45Z", + "category_0": "Browser monitoring", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.52835745, + "_score": 0.118906915, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Test alert notification channels", - "sections": "Test alert notification channels", - "info": "Be sure to save your alerts notification channels before testing them to make sure they're working properly.", - "category_2": "Alert notifications", - "body": "You must save a new notification channel or any changes to an existing notification channel before testing it. Alerts will then send a test message to your chosen destination. Request the test To test a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, then click" + "sections": "View performance data by region", + "info": "Browser's Geography feature shows color-coded Apdex scores and page load performance for your end users' experience around the world.", + "body": " performance and historical performance. Contents View performance data by region Firewalls may have an impact on the geographical data collected about your end users. To view or sort the performance information by location: one.newrelic.com > Browser > (select an app) > Geo: This page provides a world" }, - "id": "5f2dbb3664441fd3a556a97c" + "id": "561c8bbc827a6617ad000172" }, { - "body": "You can use alerts to set up notification channels, and attach those channels to policies. Your selected channels provide fast and consistent ways for the right personnel to be notified about incidents. For example, notifications allow you to include charts about the incident to provide context and share them with your team. Alerts offers several notification channels, including webhooks, Slack rooms, email, and more. You'll be notified by your notification channels when incidents are opened, acknowledged, or closed. This document explains the available notification channels and how to set them up. This document is about alerts notifications. For general information about unsubscribing from other New Relic emails, including marketing emails, weekly reports, and announcements, see Unsubscribe from New Relic emails. View notification channels To see all notification channels in your account: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Add or remove notification channels To set up a new notification channel: On the Notification channels, click New notification channel. Select the type of channel and complete other required steps for it. To add or remove a notification policy or channel: Select a specific notification channel, select Alert policies, and add or remove a policy. OR Select a specific policy, select Notification channels, and add or remove a channel. Instructions for specific notification channels These are the available notification channel types. User For your convenience, we automatically load all users and their email addresses for the selected account. If your account has one or more sub-accounts, the notification channel includes only users for the currently selected master or sub-account. Use the User notification channel to select existing account team members and admins. To view the Users list or to add users to alert policies: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. A user channel also sends push notifications to any of the user's registered mobile devices. A device is registered if the user has logged into New Relic using the mobile app on the device. Email We automatically add every individual and their email address on the selected account to the User notification channel and you can select them there. You don't need to add existing New Relic accounts to the Email channel. To add an email channel for other users, follow these guidelines: Field Description Email (required) In general, use the Email notification channel to identify user emails or email aliases that are not already on the selected account. For example, if you have a dev-ops@company.com email alias for your DevOps team, add the email alias to the Email channel. Otherwise, use the User notification channel to select specific users on your DevOps team. For easier maintenance, add a single non-user email address or alias to a single alert notification channel. If you want to use the email channel for more than one email, create an email group or alias outside your account. These email addresses can be the same as or different from email addresses already on your account. Users can unsubscribe from general (non-alerts-related) emails, but they cannot unsubscribe from alerts email notifications. Instead, the account Owner, Admin, or add-on manager must remove users from the policy's email notification channel. Include JSON attachment (optional) To include a JSON attachment with the email notification, select this checkbox. OpsGenie You must have an existing OpsGenie account integrated with New Relic in order to provide the following information: Field Description Channel name (required) A meaningful name for the OpsGenie notification channel (maximum 64 characters). API key (required) The API key generated from your OpsGenie integration used to authenticate API requests. Teams (optional) List of team names that are responsible for the alert. OpsGenie runs team escalation policies to calculate which users will receive notifications. Tags (optional) A comma-separated list of labels attached to the alert. To overwrite the OpsGenie Quiet Hours setting for urgent alerts, add an OverwriteQuietHours tag. Recipients (optional) One or more names of users, groups, on-call schedules, escalation policies, etc., that OpsGenie uses to calculate where to send notifications. PagerDuty You must have an existing PagerDuty account in order to provide the following information: Field Description Service name (required) The name of your service integrating with PagerDuty for notifications. Integration key (required) The unique service identifier used by PagerDuty's Integration API to trigger, acknowledge, and resolve incidents for the service. Slack Before adding Slack notifications, you must create a unique webhook integration using Slack's New Relic integration. If you want web, transaction, server, and mobile alerts to be posted in separate channels, you must set up separate integrations for each one. Field Description Channel name (required) A meaningful name for the Slack notification channel (maximum 64 characters); for example, Network Ops Center. URL (required) Copy and paste the New Relic webhook integration URL that you've set up with Slack. For example: https://hooks.slack.com/services/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 Be sure to include https:// in the URL. Do not use http://. Team channel (optional) If used, include # before the name of the Slack channel where alert notifications are sent; for example, #NOC. VictorOps You must have an existing VictorOps account in order to provide the following required information: Field Description Channel name (required) A meaningful name for this notification channel (maximum 64 characters). For example, if the VictorOps Route key is for your Technical Support team, you could name this channel Tech Support - VictorOps. Key (required) VictorOps generates a unique key for each account. It maps the VictorOps account to its associated integrations. Route key (optional) This key maps the alert or incident to a specific team. Webhook Webhooks are HTTP POST messages containing JSON documents delivered to a destination URL. When an incident is opened, acknowledged, or closed, our webhook feature sends a message to your URL with any relevant information, such as a description of the event and a link back to New Relic. You also have the option to customize the payload in the POST message for further integration into your system. If your endpoint does not acknowledge the POST request within 10 seconds, the Alerts UI may indicate a failed notification event for the related incident. Before adding webhook notifications, you must have an endpoint set up to respond with a status code between 200 and 206 after receiving the following required information: Field Description Channel name (required) A meaningful name for the webhook (maximum 64 characters). Base url (required) The endpoint that will receive the POST message and trigger customized behaviors in your system. If you want to include a port number in the webhook URL, make sure the port is available for requests. Otherwise the webhook will not work. Basic auth (optional) To require basic authentication for the webhook, select Add basic auth, and provide the user name and password to authenticate the webhook. Custom headers (optional) To include headers with webhooks, select Add custom headers, and provide the name and value for each header. Use custom payload (optional) To use the default values, leave blank. To view and edit the default values, select Add custom payload. Payload (for custom payloads only) Your customized POST message code. This field includes: A list of variables you can use Syntax highlighting, based on payload type Payload type (for custom payloads only) Specify the message format: JSON (default) or Form. xMatters You must have an existing xMatters account in order to provide the following information: Field Description Channel name (required) Name your channel so you can identify it easily when associating it with a policy. Integration url (required) The unique integration url provided by xMatters pointing to your xMatters account. Receive mobile push notifications In order to receive mobile push notifications, your device must be registered and listed in (account) > User preferences. If the device is not listed in User preferences, log out of the app, log back in, and check again to see if it is listed. To receive mobile push notifications: Log in to your New Relic account via the mobile app at least once to ensure the device is registered. Add the user channel to the alert policy. Switch push notifications On for the device. Acknowledge alert notifications Anyone in your account can acknowledge notifications through the user interface or email notification. Acknowledging an incident in New Relic also acknowledges any associated incident in PagerDuty. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "body": "Browser monitoring supports the uploading of source maps, which are used to un-minify error stack traces on the JS errors page. This document explains how to use the API to publish (upload) source maps to Browser. Prepare for using the source map API In order to upload source maps to Browser via the API, you'll need this information: An admin API key for the New Relic account The New Relic application ID for the deployed app The full JavaScript file URL Optionally, if the JavaScript URL doesn't automatically have release info appended to it, the release name and ID What is the JavaScript URL? Every time the agent captures an error in your code, it's associated with the URL of the JavaScript in which it occurred. This is the src attribute of the script tag in your HTML. This full JavaScript URL is required when sending source maps to Browser. You can find the URL for an error's JavaScript file in Browser, on the JS errors page. See Browser monitoring source maps for more on finding these errors in the UI. Is a release name and ID required? Many organizations include a version number or hash in the JavaScript URL. This is generally added to \"bust\" caches to ensure your users get the most recent version of your code. This type of URL might look something like: https://example.com/assets/application-59.min.js https://example.com/assets/bundle-d6d031.min.js https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.js If your app's URLs automatically have the version info appended to it, the Browser agent has everything it needs in order to match errors with your code. You can move ahead to generating source maps. If this doesn't apply to you, and JS URLs do not have version info appended, you’ll have to assist the agent by specifying a release name and ID with the API. Are there limits to source map uploads? There is no limit to the overall number of source maps you can upload. However, the API is rate-limited: You can upload a maximum of 100 source maps per minute You can upload a maximum of 5,000 source maps per day Source map files can be a maximum of 50Mb in size. Push source maps to New Relic Now that you have one or more source maps, you are ready to publish it to Browser. You can use any of these methods to send source maps to Browser: Use the New Relic npm module with the API via the command line or via a client-side JavaScript build/deploy script like Gulp or Grunt. Use API curl commands. Use the Browser UI. Use npm module via command line or client-side script The easiest and recommended way to upload source maps to Browser is to use the our new @newrelic/publish-sourcemap npm module. It provides a command line tool and Javascript API to accomplish this task. More documentation is available in the npm repo. Here are some examples of using the npm module via the command line. The following examples are for US accounts. For EU accounts, the endpoint is https://sourcemaps.service.eu.newrelic.com. For more information, see Introduction to the EU region data center. npm command line: Publish Here's an example of uploading source maps using the npm module via the command line. Note that the source map can come from a local file or a remote URL. npm install -g @newrelic/publish-sourcemap publish-sourcemap PATH_TO_SOURCE_MAP_FILE (local or remote) PATH_TO_ORIGINAL_FILE --nrAdminKey=YOUR_NEW_RELIC_ADMIN_API_KEY --applicationId=YOUR_NEW_RELIC_APP_ID npm command line: List published maps Here's an example of listing published source maps: list-sourcemaps --applicationId=YOUR_APP_ID --nrAdminKey=YOUR_NEW_RELIC_ADMIN_KEY Options: --applicationId Browser application id --nrAdminKey New Relic admin API key npm command line: Delete Here's an example of deleting a source map: delete-sourcemap --applicationId=YOUR_APP_ID --nrAdminKey=YOUR_NEW_RELIC_ADMIN_API_KEY --sourcemapId=YOUR_SOURCE_MAP_ID Options: --applicationId Browser application id --nrAdminKey New Relic admin API key --sourcemapId Unique id generated for a source map Here are some examples of using the npm module to publish from client-side JavaScript: npm via Node.js script: Publish Here's an example of publishing a source map via a Node.js script: var publishSourcemap = require(‘@newrelic/publish-sourcemap’).publishSourcemap publishSourcemap({ sourcemapPath: 'SOURCE_MAP_FULL_PATH', javascriptUrl: 'JS_URL', applicationId: YOUR_NEW_RELIC_APP_ID, nrAdminKey: 'YOUR_NEW_RELIC_ADMIN_API_KEY' }, function (err) { console.log(err || 'Sourcemap upload done')}) npm via Node.js script: List published maps Here's an example of listing all published source maps: var listSourcemaps = require(‘@newrelic/publish-sourcemap’).listSourcemaps listSourcemaps({ sourcemapPath: 'SOURCE_MAP_FULL_PATH', javascriptUrl: 'JS_URL', applicationId: YOUR_NEW_RELIC_APP_ID, nrAdminKey: 'YOUR_NEW_RELIC_ADMIN_API_KEY', }, function (err, res) { console.log(err || res.body)}) npm via Node.js script: Delete Here's an example of deleting a source map file via a Node.js script: var deleteSourcemap = require(‘@newrelic/publish-sourcemap’).deleteSourcemap deleteSourcemap({ sourcemapId: 'SOURCE_MAP_ID', applicationId: YOUR_NEW_RELIC_APP_ID, nrAdminKey: 'YOUR_NEW_RELIC_ADMIN_API_KEY', }, function (err) { console.log(err || 'Deleted source map')}) When you're done, go to the JS errors page in Browser, select an error grouping, and see if your error stack traces have been un-minified. Use API via curl Below are some examples of using curl to publish, list, and delete source maps: curl: Upload maps An example of using API via curl to publish maps to Browser: curl -H \"Newrelic-Api-Key: YOUR_NEW_RELIC_ADMIN_API_KEY\" \\ -F \"sourcemap=@SOURCE_MAP_PATH\" \\ -F \"javascriptUrl=JS_URL\" \\ -F \"releaseId=YOUR_RELEASE_ID\" \\ -F \"releaseName=YOUR_UI_PAGE\" \\ https://sourcemaps.service.newrelic.com/v2/applications/YOUR_NEW_RELIC_APP_ID/sourcemaps curl: List existing maps Below is an example of how to get a list of source maps previously uploaded to New Relic via curl. New Relic returns the source map's unique SOURCEMAP_ID and its components: curl \\ -H \"Newrelic-Api-Key: YOUR_NEW_RELIC_ADMIN_API_KEY\" \\ https://sourcemaps.service.newrelic.com/v2/applications/YOUR_NEW_RELIC_APP_ID/sourcemaps curl: Delete map To delete a source map: Use the GET endpoint to list existing source maps and locate the SOURCEMAP_ID. Run the following command via curl: curl -X DELETE \\ -H \"Newrelic-Api-Key: YOUR_NEW_RELIC_ADMIN_API_KEY\" \\ https://sourcemaps.service.newrelic.com/v2/applications/YOUR_NEW_RELIC_APP_ID/sourcemaps/SOURCEMAP_ID When you're done, go to the JS errors page in Browser, select an error grouping, and see if your error stack traces have been un-minified. Troubleshoot source maps If you are having trouble generating source maps from your build system, or if your errors in Browser are remaining minified, see the source maps troubleshooting documentation. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "type": "docs", "document_type": "page", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert notifications", - "info": "Read about how to set up alerts notification channels so you can be notified when incidents are opened, acknowledged, or closed.", - "nodeid": 6281, + "breadcrumb": "Contents / Browser monitoring / Browser monitoring / Browser Pro features", + "info": "For Browser, how to upload and use source maps with the Browser API.", + "nodeid": 11696, "sections": [ - "New Relic Alerts", - "Get started", - "Alert policies", - "Alert conditions", - "Alert violations", - "Alert Incidents", - "Alert notifications", + "Browser monitoring", + "Getting started", + "Guides", + "Installation", + "Configuration", + "Browser agent and SPA API", + "Page load timing resources", + "Browser Pro features", + "Additional standard features", + "Performance quality", "Troubleshooting", - "Rules, limits, and glossary", - "Alerts and Nerdgraph", - "REST API alerts", - "Notification channels: Control where to send alerts", - "View notification channels", - "Add or remove notification channels", - "Instructions for specific notification channels", - "Receive mobile push notifications", - "Acknowledge alert notifications", + "Upload source maps via API", + "Prepare for using the source map API", + "Push source maps to New Relic", + "Use npm module via command line or client-side script", + "Use API via curl", + "Troubleshoot source maps", "For more help" ], - "title": "Notification channels: Control where to send alerts", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/notification-channels-control-where-send-alerts", + "title": "Upload source maps via API", "popularity": 1, - "external_id": "65878aca7993877ee748776c87e9225c90687e3f", - "category_1": "New Relic Alerts", - "category_2": "Alert notifications", + "external_id": "6bc1cf3a1c7f6a2b7bdf464b7a6578b093950182", + "category_1": "Browser monitoring", + "category_2": "Browser Pro features", "image": "", - "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/notification-channels-control-where-send-alerts", - "published_at": "2020-08-15T11:49:29Z", - "updated_at": "2020-08-15T11:49:29Z", - "category_0": "Alerts and Applied intelligence", + "url": "https://docs.newrelic.com/docs/browser/new-relic-browser/browser-pro-features/upload-source-maps-api", + "published_at": "2020-08-18T16:05:37Z", + "updated_at": "2020-08-15T08:45:07Z", + "category_0": "Browser monitoring", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.48945573, + "_score": 0.09365238, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Notification channels: Control where to send alerts", - "sections": "Notification channels: Control where to send alerts", - "info": "Read about how to set up alerts notification channels so you can be notified when incidents are opened, acknowledged, or closed.", - "category_2": "Alert notifications", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/notification-channels-control-where-send-alerts", - "body": " account: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Add or remove notification channels To set up a new notification channel: On the Notification channels, click New notification channel. Select the type of channel and complete other required steps" + "title": "Upload source maps via API", + "sections": "Page load timing resources", + "info": "For Browser, how to upload and use source maps with the Browser API.", + "body": ": 'SOURCE_MAP_ID', applicationId: YOUR_NEW_RELIC_APP_ID, nrAdminKey: 'YOUR_NEW_RELIC_ADMIN_API_KEY', }, function (err) { console.log(err || 'Deleted source map')}) When you're done, go to the JS errors page in Browser, select an error grouping, and see if your error stack traces have been un-minified. Use API" }, - "id": "5f2dbad864441fb7d256a9db" - } - ], - "/terms": [ + "id": "5c6905d607552356e245ca12" + }, { - "body": "The REST API endpoints allow you to create conditions for your policies. This glossary contains the names and descriptions of each of the fields that you can use to define or update a condition. Required and optional fields The API includes four types of New Relic Alerts conditions: APM External services Synthetic monitoring Plugins All of the fields used with a specific condition type are required except for these optional fields: enabled (defaults to false) runbook_url user_defined Field definitions Not every field listed in this glossary is required for every condition type. The condition type for which a field must be used is listed in each description. condition_scope This field allows you to scope a condition to either a JVM instance or to a whole application. This may be one of the strings: instance application Used for: Conditions Entity conditions For instance-based and JVM health metrics, see also violation_close_timer. enabled This is the status of your alert condition and is optional. The default is false. This field may be used to enable or disable a condition for maintenance or testing periods. Used for: Conditions External service conditions Synthetic monitoring conditions Plugin conditions entities This is an array of entity IDs identifying the objects which will be monitored with your condition. These may be application IDs, browser IDs, plugin IDs, key transaction IDs, external service IDs, etc. These are entered as a series of comma separated integers if there is more than one. Used for: Conditions External service conditions Plugin conditions expected_groups This is the number of groups you expect to see at any given time. It is used in combination with the ignore_overlap option. Used for: NRQL outlier conditions external_service_url This is the URL of the external service to be monitored. This string must not include the protocol. For example, use example.com, not https://example.com. Used for: External service conditions ignore_overlap If disabled, this looks for a convergence (or overlapping) of groups. If the condition is looking for two or more groups, and the returned values can't be separated into that number of distinct groups, then that will also produce a violation. This type of overlap event is represented on a chart by group bands touching. Used for: NRQL outlier conditions metric The metric field is used for three alert categories. The exact parameters available for use depend on the setting in the type field. These are listed below according to their alert type field. Alerts plugin conditions For Plugin conditions this is the metric, which has been defined in a plugin, that will be used to trigger a notification. Alerts conditions The value specified in the type field controls which of the parameters may be specified. The type field and corresponding available parameter names are listed in the following table. Only one may be specified. type Parameter apm_app_metric apdex error_percentage response_time_web response_time_background throughput_web throughput_background user_defined apm_kt_metric apdex error_percentage error_count response_time throughput browser_metric end_user_apdex total_page_load page_rendering web_application network dom_processing request_queuing ajax_response_time page_views_with_js_errors page_view_throughput ajax_throughput user_defined browser_metric_baseline page_view_throughput average_response_time ajax_response_time ajax_application_time mobile_metric database images json, network view_loading network_error_percentage status_error_percentage user_defined Alerts external service conditions The value specified in the type field controls which of the parameters may be specified. The type field and corresponding available parameter names are listed in the following table. Only one may be specified. type Parameter apm_external_service apdex error_percentage response_time_web response_time_background throughput_web throughput_background user_defined apm_app_metric_baseline external_service_transaction_time error_count database_transaction_time throughput_web response_time_web non_web_transaction_time web_transaction_database_time non_web_transaction_database_time mobile_external_service response_time_average response_time_minimum response_time_maximum throughput network_failure_percentage http_status_error_percentage metric_description This is a title for the metric which is displayed in notifications. Make this descriptive and unique so the reader will understand the nature of plugin metric being used to trigger an alert. Used for: Plugin conditions monitor_id This is the GUID of the Synthetic monitoring to alert on. Used for: Synthetic monitoring conditions name This condition title will allow to you identify it in the UI. Follow the guidelines for making this descriptive but short. Used for: Conditions External service conditions Synthetic monitoring conditions Plugin conditions nrql[query] This is the NRQL query that alerts monitors as part of a NRQL condition. Used for: NRQL conditions nrql[since_value] This is the timeframe (in minutes) in which to evaluate the specified NRQL query. since_value must be between 1 and 20. Used for: NRQL conditions plugin[guid] This is the GUID of the plugin for which the trigger is being defined. Used for: Plugin conditions plugin[id] This is the ID of the plugin for which the trigger is being defined. Used for: Plugin conditions runbook_url The runbook URL to display in notifications. This field is optional. Used for: Conditions External service conditions Synthetic monitoring conditions Plugin conditions terms[duration] This is the time (in minutes) for the condition to persist before triggering an event. It corresponds to the duration set when adding a threshold in the UI. Used for: Conditions terms[operator] This determines what comparison will be used between the value_function and the terms[threshold] value to trigger an event. It corresponds to the operation selected when adding a threshold in the UI. It must be one of the following strings: above below equal Used for: Conditions External service conditions Plugin conditions terms[priority] This corresponds to the severity level selected when setting the threshold values for the condition in the UI. This must be one of the following strings: critical warning Used for: Conditions External service conditions Plugin conditions terms[threshold] This is the threshold that the value_function must be compared to using the terms[operator] for an event to be triggered. It corresponds to the numeric value specified in the UI when adding the threshold values. This is a numeric value and must be 0 (zero) or greater. Used for: Conditions External service conditions Plugin conditions terms[time_function] This corresponds to the settings made in the UI when adding the threshold values. The choices are: all (corresponding to for at least in the UI) any (corresponding to at least once in in the UI) Used for: Conditions External service conditions Plugin conditions type This defines the type of metric that will be used for the alert. Allowable content for the metric field depends on the type value chosen. There are two product categories : Alerts conditions For this category, type is set to one of the following strings indicating the type of alerts condition. type Use apm_app_metric APM application metric will trigger an alert. apm_app_metric_baseline APM application metric will trigger an alert (using a baseline threshold). apm_kt_metric APM key transaction metric will trigger an alert. browser_metric Browser metric will trigger an alert. browser_metric_baseline Browser metric will trigger an alert (using a baseline threshold). mobile_metric Mobile metric will trigger an alert. Used for: Conditions Alerts external service conditions For this category, type is set to one of the following strings indicating the type of external service condition. type Use apm_external_service APM external metric will trigger an alert. mobile_external_service Mobile external metric will trigger an alert. Used for: External service conditions user_defined[metric] (optional) This is the name of a user defined custom metric to be used to determine if an event should be triggered. The user_defined[value_function] associated with the metric is compared with the terms[threshold] value when evaluating if an incident should be triggered. The comparison is performed using the operator defined by terms[operator]. Used for: Conditions External service conditions Synthetic monitoring conditions Plugin conditions user_defined[value_function] (optional) This is the numeric value obtained from the custom metric specified by user_defined[metric]. It is compared with the terms[threshold] value when evaluating if an incident should be triggered. The comparison is performed using the operator defined by terms[operator]. One of these value functions must be specified: average min max total sample_size Used for: Conditions value_function This is the value function used from the plugin metric. This may be one of the strings: min max average sample_size total percent Used for: Plugin conditions When used for a NRQL condition, the options are: single_value (condition is evaluated based on each query's returned value) sum (condition is evaluated based on the sum of each query's returned values over the specified duration) violation_time_limit_seconds Use to automatically close instance-based violations after the number of seconds specified. Must be one of these values: 3600 7200 14400 28800 43200 86400 Used for: Location conditions NRQL conditions violation_close_timer Use to automatically close instance-based violations, including JVM health metric violations, after the number of hours specified. Must be one of these values: 1 2 4 8 12 24 Used for: apm_app_metric (with condition_scope set to instance) apm_jvm_metric For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,000 documents, plus storage type. Each document can have a maximum length of 64 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / REST API alerts", - "info": "This glossary defines the alerts API fields, and provides links to relevant content to help better understand each one.", - "nodeid": 9276, + "info": "Intro to NerdStorage on New Relic One", "sections": [ - "New Relic Alerts", - "Get started", - "Alert policies", - "Alert conditions", - "Alert violations", - "Alert Incidents", - "Alert notifications", - "Troubleshooting", - "Rules, limits, and glossary", - "Alerts and Nerdgraph", - "REST API alerts", - "Alerts conditions API field names", - "Required and optional fields", - "Field definitions", - "For more help" + "Intro to NerdStorage", + "Use NerdStorage in your apps", + "Data model", + "Limits", + "Data access", + "Permissions for working with NerdStorage" ], - "title": "Alerts conditions API field names", + "title": "Intro to NerdStorage", "popularity": 1, - "external_id": "08f92bd7e576017eb032cdd843c616c7c04fba11", - "category_1": "New Relic Alerts", + "external_id": "709e06c25376d98b2191ca369b4d139e5084bd62", "image": "", - "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/rest-api-alerts/alerts-conditions-api-field-names", - "published_at": "2020-08-15T13:54:16Z", - "updated_at": "2020-08-15T13:54:16Z", - "category_0": "Alerts and Applied intelligence", + "url": "https://developer.newrelic.com/explore-docs/nerdstorage/", + "published_at": "2020-08-18T02:11:48Z", + "updated_at": "2020-08-14T01:50:34Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.07458653, + "_score": 0.07781543, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Alerts conditions API field names", - "sections": "Alert conditions", - "info": "This glossary defines the alerts API fields, and provides links to relevant content to help better understand each one.", - "category_0": "Alerts and Applied intelligence", - "body": ". Used for: Plugin conditions runbook_url The runbook URL to display in notifications. This field is optional. Used for: Conditions External service conditions Synthetic monitoring conditions Plugin conditions terms[duration] This is the time (in minutes) for the condition to persist before triggering" + "sections": "Use NerdStorage in your apps", + "body": " as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{"lastNumber": 42, "another": [1]}', 'document-2-of-collection-1': '"userToken"', // ... }, 'another-collection': { 'fruits': '["pear", "apple" }, - "id": "5f2dee1128ccbc1e7588dff5" - }, + "id": "5efa989ee7b9d2048e7bab92" + } + ], + "/collect-data/custom-attributes": [ { - "body": "As a customer, you are eligible to participate in New Relic’s Developer Program. Additional information and resources are available at New Relic’s Developer Program site. By downloading, accessing, or using the developer resources (including the CLI), you agree that usage of the developer resources is pursuant to the New Relic Developers Terms and Conditions and that you have the authority to bind your organization. Such terms do not have to be signed in order to be binding. If you do not agree to these terms and conditions, your sole remedy is to not use these developer resources. If your use of the New Relic developer resources are covered under a separate agreement, the above does not apply to you. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "body": "New Relic allows you to collect custom attributes. For example, you can create a custom attribute to track the user name associated with a slow or failing request. This document contains links to docs on how to do this for APM, infrastructure monitoring, browser monitoring, and mobile monitoring. APM: Record custom attributes Review the list of reserved terms used by NRQL. Using reserved terms can cause issues. To enable and use custom attributes for APM, follow the procedure for your APM agent: C SDK To add custom attributes to applications monitored by the C SDK, call one of the attribute functions; for example, newrelic_add_attribute_double(). The key name for your custom attribute depends on what you specify when you call the function. Go Custom attribute collection is enabled by default in the Go agent. However, you can disable custom attribute collection. Java Custom attribute collection is enabled by default in Java. You can collect custom attributes using XML and the Java agent APIs. These two methods can be used in conjunction with each other. Method How to do it Specify attributes in XML XML allows you to specify custom attributes without changing any of your source code. You can have multiple XML files for custom attributes that are grouped by some logical facet. To set custom attributes for your Java app via XML: Review the New Relic Java agent's documentation about XML file format, methods and classes, and examples. From your Extensions directory within the New Relic Java agent, create a single XML file. Define the methods you want New Relic to monitor by editing your XML file directly. Define an XML instrumentation file using the New Relic UI. This may require additional config in the common: block of your newrelic.yml. See Report custom attributes under Instrumentation options for more detail. Call the agent's API Example 1: Adding custom attributes to transactions To collect custom attributes using the agent's API, call the relevant methods: For each method you want to record an attribute for, call NewRelic.addCustomParameter(...). Optional: Include or exclude certain attributes with attributes.include and attributes.exclude. For example, to record a variable named userId, include this code in the parent method: NewRelic.addCustomParameter(\"userId\", userId); Example 2: Adding custom attributes to spans in distributed traces To collect custom attributes using the agent's API, call the relevant methods: For each span (currently executing method) that you want to record an attribute for, call NewRelic.getAgent().getTracedMethod().addCustomAttribute(...). Optional: Include or exclude certain attributes with span_events.attributes.include and span_events.attributes.exclude. For example, to record a variable named userId on the current span, include this code in the associated method: NewRelic.getAgent().getTracedMethod().addCustomAttribute(\"userId\", userId); Collect user attributes The Java agent also includes a built-in mechanism to enable user attributes and collect user information from HttpServletRequest.getUserPrincipal() as custom attributes. .NET Custom attribute collection is enabled by default in .NET. To collect custom attributes, call the relevant API methods: For each method for which you want to record an attribute, call AddCustomAttribute. Optional: Include or exclude attributes with the include and exclude configuration options. For example, to record attributes for a coupon code (string) and an item ID code (number), you could include this code in the parent method: IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); ITransaction transaction = agent.CurrentTransaction; transaction .AddCustomAttribute(\"Discount Code\", \"Summer Super Sale\") .AddCustomAttribute(\"Item Code\", 31456); Node.js Custom attribute collection is enabled by default in Node.js. To collect custom attributes, call the relevant API method: For each attribute you want to record, call newrelic.addCustomAttribute. To record multiple attributes using a single call, use newrelic.addCustomAttributes. For example, to record attributes for a coupon code and an item ID code, you could include this in the parent method: newrelic.addCustomAttributes({ \"Discount Code\": \"Summer Super Sale\", \"Item Code\": 31456 }); PHP Custom attribute collection is enabled by default in PHP. To collect custom attributes, call the relevant API method for each method that you want to record an attribute; newrelic_add_custom_parameter for transaction events and spans newrelic_add_custom_span_parameter for only spans For example, to record a variable named $userId, include this code in the parent method: newrelic_add_custom_parameter ('userID', $userId) Python Custom attribute collection is enabled by default in Python. To collect custom attributes, call add_custom_parameter for each method that you want to record an attribute. For example, to record a variable named user_id, include this code in the parent method: newrelic.agent.add_custom_parameter('user_id', user_id) Ruby Custom attribute collection is enabled by default in Ruby. To collect custom attributes, call the relevant API methods: For Ruby agent version 3.12.0 or higher, use the add_custom_attributes method. For example, to record a variable named @user_id, include this code in the parent method: ::NewRelic::Agent.add_custom_attributes({ user_id: @user.id }) For Ruby agent version 3.11.2 or lower, use the add_custom_parameters method. For example, to record a variable named @user_id, include this code in the parent method: ::NewRelic::Agent.add_custom_parameters({ user_id: @user.id }) Browser monitoring: Record custom attributes The browser agent provides an API to specify extra details associated with a page view or browser interaction, either by forwarding attributes from APM to browser monitoring or by specifying custom attributes through JavaScript. Values forwarded from the APM agent are encoded and injected into browser attributes by our browser agent. Infrastructure monitoring: Record custom attributes Our Infrastructure monitoring lets you create custom attributes that are used to annotate the data from the infrastructure agent. You can use this metadata to build filter sets, group your results, and annotate your data. Mobile monitoring: Record custom attributes Mobile agents include API calls to record custom attributes: For an overview of mobile monitoring custom data, see Insert custom events and attributes Android method: setAttribute iOS method: setAttribute For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "type": "docs", "document_type": "page", - "breadcrumb": "Contents / Licenses / Product or service licenses / Developer Edition", - "info": "New Relic Developer edition policy", - "nodeid": 39641, + "breadcrumb": "Contents / Using New Relic / Cross-product functions / Install and configure", + "info": "How to add custom attributes to data reported from some New Relic products. ", + "nodeid": 2726, "sections": [ - "Product or service licenses", - "New Relic One", - "APM", - "Browser", - "Developer Edition", - "Infrastructure", - "Insights", - "Logs", - "Mobile", - "Synthetics", - "Mobile apps", - "Plugins", - "Miscellaneous", - "Developer Program Resources", + "Cross-product functions", + "Install and configure", + "Troubleshooting", + "Collect custom attributes", + "APM: Record custom attributes", + "Browser monitoring: Record custom attributes", + "Infrastructure monitoring: Record custom attributes", + "Mobile monitoring: Record custom attributes", "For more help" ], - "title": "Developer Program Resources", + "title": "Collect custom attributes", "popularity": 1, - "external_id": "98308cfffa652e4c25967e1be5b848b9c28ca410", - "category_1": "Product or service licenses", - "category_2": "Developer Edition", + "external_id": "5a43638e8ef969ce9f0b16fedf433317e67bb4a6", + "category_1": "Cross-product functions", + "category_2": "Install and configure", "image": "", - "url": "https://docs.newrelic.com/docs/licenses/product-or-service-licenses/new-relic-developer-edition/developer-program-resources", - "published_at": "2020-08-16T02:26:06Z", - "updated_at": "2020-08-08T19:17:02Z", - "category_0": "Licenses", + "url": "https://docs.newrelic.com/docs/using-new-relic/data/customize-data/collect-custom-attributes", + "published_at": "2020-08-18T14:20:45Z", + "updated_at": "2020-08-11T00:28:22Z", + "category_0": "Using New Relic", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.06383784, + "_score": 0.73719656, "_version": null, "_explanation": null, "sort": null, "highlight": { - "body": " is pursuant to the New Relic Developers Terms and Conditions and that you have the authority to bind your organization. Such terms do not have to be signed in order to be binding. If you do not agree to these terms and conditions, your sole remedy is to not use these developer resources. If your" + "title": "Collect custom attributes", + "sections": "Collect custom attributes", + "info": "How to add custom attributes to data reported from some New Relic products. ", + "body": ". APM: Record custom attributes Review the list of reserved terms used by NRQL. Using reserved terms can cause issues. To enable and use custom attributes for APM, follow the procedure for your APM agent: C SDK To add custom attributes to applications monitored by the C SDK, call one of the attribute" }, - "id": "5f338507e7b9d2f670c9de83" + "id": "5e9a9d9728ccbc90cdd949ca" }, { - "body": "logo-newrelic Search Products Pricing Solutions Help Center About New Relic for iOS or Android    New Relic Insights App for iOS Search icon Sign Up Log In Products New Relic One Platform Overview Telemetry Data Platform Full-Stack Observability Applied Intelligence Solutions By Topic DevOps Cloud Adoption Cloud Native Digital Customer Experience By Industry E-commerce and Retail Media Public Sector By Technology Amazon Web Services Pivotal Cloud Foundry Microsoft Azure Google Cloud Platform Kubernetes Help Center Learn Docs Build on New Relic Explore open source projects Training Get help Community forum Global technical support Expert services About Our Customers Over 17,000 customers love New Relic, from Fortune 500 enterprises to small businesses around the globe. Our Blog The latest news, tips, and insights from the world of New Relic and digital intelligence. Our Company About Us Leadership Meetups and Events Resources   Investor Relations Newsroom Partner Program Contact Us logo-newrelic Want to use our logo? There's a page for that, including instructions and different styles and formats. Sorry about grabbing your right-click. Just trying to be helpful. You can also go home. Back to top icon New Relic Inc. Terms of Service Paid Accounts Customers that access New Relic’s platform through a paid subscription are governed by the Terms of Service set forth immediately above. Unpaid Accounts Customers that access New Relic’s platform on an unpaid (e.g. trials, proof of concepts, New Relic Developer Edition or ‘lite’) basis are governed by the Terms of Service set forth immediately above. Community Forums Community Forum participants ask and answer questions about New Relic’s platform.  Use of the Community Form is governed by the terms and conditions set forth immediately above. New Relic Data Processing Addendum Customers who currently send, or intend to send, personal data to the New Relic Services for processing should download and complete the Data Processing Addendum set forth immediately above. Data Processing Addendum FAQ  This guide is designed to assist customers in their completion of the New Relic Data Processing Addendum. COMPANY Careers and Culture Partner Program Investor Relations NewRelic.org Suppliers Portal CONNECT Contact Us Request Demo Events international newrelic.co.jp (Japanese) newrelic.fr (French) newrelic.de (German) Terms of Service DMCA Policy Privacy Policy Cookie Policy UK Slavery Act of 2015 ©2008-20 New Relic, Inc. All rights reserved", - "type": "", - "info": "", + "body": "In New Relic, attributes are key-value pairs containing information that determines the properties of an event or transaction. These key-value pairs can help you gain greater insight into your application and query your data. View and use attributes Both default APM attributes and custom attributes for your C application appear in: APM transaction traces and error analytics APM events C-specific attributes Before creating custom attributes, review New Relic's list of reserved terms used by NRQL. Otherwise unexpected results may occur. To add custom attributes to your C application, call one of the attribute functions in the C SDK API; for example, newrelic_add_attribute_double(). The key name for your custom attribute depends on what you specify when you call the function. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", + "document_type": "page", + "breadcrumb": "Contents / APM agents / C SDK / Instrumentation", + "info": "You can create custom attributes for your C app to supplement the New Relic event data that automatically includes default APM attributes.", + "nodeid": 15891, "sections": [ - "Terms of Service", - "COMPANY", - "CONNECT", - "international" + "C SDK", + "Get started", + "Install and configure", + "Instrumentation", + "Troubleshooting", + "Use default or custom attributes (C SDK)", + "View and use attributes", + "C-specific attributes", + "For more help" ], - "title": "Terms of Service Agreement | New Relic", + "title": "Use default or custom attributes (C SDK)", "popularity": 1, - "external_id": "f1539ad0dbd46a29c243907400c646ed11c33bd1", - "image": "https://newrelic.com/content/dam/new-relic/opengraph/NROG_Image.png", - "url": "https://newrelic.com/termsandconditions/terms", - "published_at": "2020-08-17T17:20:45Z", - "updated_at": "2020-07-30T07:25:28Z", + "external_id": "45876c14a1d258566a824f7c49a50bb8c8fb709d", + "category_1": "C SDK", + "category_2": "Instrumentation", + "image": "", + "url": "https://docs.newrelic.com/docs/agents/c-sdk/instrumentation/use-default-or-custom-attributes-c-sdk", + "published_at": "2020-08-18T08:14:25Z", + "updated_at": "2020-08-15T02:11:23Z", + "category_0": "APM agents", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.05789522, + "_score": 0.6753373, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Terms of Service Agreement | New Relic", - "sections": "Terms of Service", - "body": " of concepts, New Relic Developer Edition or ‘lite’) basis are governed by the Terms of Service set forth immediately above. Community Forums Community Forum participants ask and answer questions about New Relic’s platform.  Use of the Community Form is governed by the terms and conditions set forth" + "title": "Use default or custom attributes (C SDK)", + "sections": "Use default or custom attributes (C SDK)", + "info": "You can create custom attributes for your C app to supplement the New Relic event data that automatically includes default APM attributes.", + "body": " for your C application appear in: APM transaction traces and error analytics APM events C-specific attributes Before creating custom attributes, review New Relic's list of reserved terms used by NRQL. Otherwise unexpected results may occur. To add custom attributes to your C application, call one" }, - "id": "5ac68e78c75d077fcb6edc38" + "id": "5cd8abf7e621f45d85a089a9" }, { - "body": "As a customer with a paid subscription to New Relic products, you are eligible to participate in preview access of the New Relic One platform (e.g. Telemetry Data Platform, Full Stack Observability, and Applied Intelligence products) for the period beginning July 31, 2020 and ending December 31, 2020 (“Preview Access”). BY DOWNLOADING, ACCESSING, INDICATING YOUR AGREEMENT TO, OR USING THE PREVIEW ACCESS PRODUCTS, YOU AGREE THAT YOUR PREVIEW ACCESS USAGE IS PURSUANT TO THESE SEPARATE TERMS AND CONDITIONS IN LIEU OF ANY OTHER TERMS. These terms do not have to be signed in order to be binding. If you do not agree to these terms and conditions, your sole remedy is to not participate in Preview Access. New Relic reserves the right to terminate or restrict Preview Access, in whole or in part, at any time. Notwithstanding the foregoing and any other materials provided by New Relic, select customers are ineligible for the Preview Access. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "body": "When adding custom attribute values to transactions, custom events, spans, and errors, the APIs accept an object. This describes how these values are processed and how they will appear in APM. In all cases, NULL values are not recorded. .NET type How the value will be represented byte, Int16, Int32, Int64 sbyte, UInt16, UInt32, UInt64 As an integral value float, double, decimal A decimal-based number string A string truncated after 255-bytes. Empty strings are supported. bool True or false DateTime A string representation following the ISO-8601 format, including time zone information: 2020-02-13T11:31:19.5767650-08:00 TimeSpan A decimal-based number representing number of seconds. everything else the ToString() method will be applied. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "type": "docs", "document_type": "page", - "breadcrumb": "Contents / Licenses / Product or service licenses / New Relic One", - "info": "", - "nodeid": 39366, + "breadcrumb": "Contents / APM agents / .NET agent / Attributes", + "info": "APM's .NET agent: how custom attribute values are processed and how they will appear in APM.", + "nodeid": 37891, "sections": [ - "Product or service licenses", - "New Relic One", - "APM", - "Browser", - "Developer Edition", - "Infrastructure", - "Insights", - "Logs", - "Mobile", - "Synthetics", - "Mobile apps", - "Plugins", - "Miscellaneous", - "Preview access for New Relic One", + ".NET agent", + "Getting started", + "Install", + "Azure installation", + "Other installation", + "Configuration", + "Other features", + "Custom instrumentation", + "API guides", + ".NET agent API", + "Attributes", + "Troubleshooting", + "Azure troubleshooting", + "Custom attributes (.NET)", "For more help" ], - "title": "Preview access for New Relic One", + "title": "Custom attributes (.NET)", "popularity": 1, - "external_id": "eae3865081d3bd8ad2dd8b6eaf0fe0147355360c", - "category_1": "Product or service licenses", - "category_2": "New Relic One", + "external_id": "c3b5f5db21c8e5f07ee67eb3b58ab5028e242a9a", + "category_1": ".NET agent", + "category_2": "Attributes", "image": "", - "url": "https://docs.newrelic.com/docs/licenses/product-or-service-licenses/new-relic-one/preview-access-new-relic-one", - "published_at": "2020-08-15T12:54:17Z", - "updated_at": "2020-07-31T04:41:27Z", - "category_0": "Licenses", + "url": "https://docs.newrelic.com/docs/agents/net-agent/attributes/custom-attributes-net", + "published_at": "2020-08-18T18:23:33Z", + "updated_at": "2020-08-18T18:23:32Z", + "category_0": "APM agents", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.05295947, + "_score": 0.529183, "_version": null, "_explanation": null, "sort": null, "highlight": { - "body": ", 2020 (“Preview Access”). BY DOWNLOADING, ACCESSING, INDICATING YOUR AGREEMENT TO, OR USING THE PREVIEW ACCESS PRODUCTS, YOU AGREE THAT YOUR PREVIEW ACCESS USAGE IS PURSUANT TO THESE SEPARATE TERMS AND CONDITIONS IN LIEU OF ANY OTHER TERMS. These terms do not have to be signed in order to be binding" + "title": "Custom attributes (.NET)", + "sections": "Custom attributes (.NET)", + "info": "APM's .NET agent: how custom attribute values are processed and how they will appear in APM.", + "category_2": "Attributes", + "body": "When adding custom attribute values to transactions, custom events, spans, and errors, the APIs accept an object. This describes how these values are processed and how they will appear in APM. In all cases, NULL values are not recorded. .NET type How the value will be represented byte, Int16, Int32", + "breadcrumb": "Contents / APM agents / .NET agent / Attributes" }, - "id": "5f23a0f7e7b9d29da9c82305" + "id": "5e7d76e628ccbcb3d13419d6" }, { - "body": "New Relic Open Source External Projects Highlighted Projects New Relic Projects Menu External Projects Highlighted Projects New Relic Projects NEW RELIC, INC. INDIVIDUAL CONTRIBUTOR LICENSE AGREEMENT Thank you for your interest in contributing to the open source projects of New Relic, Inc. (“New Relic”). In order to clarify the intellectual property license granted with Contributions from any person or entity, New Relic must have a Contributor License Agreement (\"Agreement\") on file that has been signed by each Contributor, indicating agreement to the license terms below. This Agreement is for your protection as a Contributor as well as the protection of New Relic; it does not change your rights to use your own Contributions for any other purpose. You accept and agree to the following terms and conditions for Your present and future Contributions submitted to New Relic. Except for the licenses granted herein to New Relic and recipients of software distributed by New Relic, You reserve all right, title, and interest in and to Your Contributions. Definitions. \"You\" (or \"Your\") shall mean the copyright owner or legal entity authorized by the copyright owner that is entering into this Agreement with New Relic. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. \"Contribution\" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to New Relic for inclusion in, or documentation of, any of the products managed or maintained by New Relic (the \"Work\"). For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to New Relic or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, New Relic for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as \"Not a Contribution.\" Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to New Relic and to recipients of software distributed by New Relic a perpetual, worldwide, non-exclusive, no-charge, royalty-free, transferable, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to New Relic and to recipients of software distributed by New Relic a perpetual, worldwide, non-exclusive, no-charge, royalty-free, transferable, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contributions alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that Your Contribution, or the Work to which You have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed. You represent that You are legally entitled to grant the above licenses. If Your employer(s) has rights to intellectual property that You create that includes Your Contributions, You represent that You have received permission to make Contributions on behalf of that employer, that Your employer has waived such rights for Your Contributions to New Relic, or that Your employer has executed a separate Agreement with New Relic. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which You are personally aware and which are associated with any part of Your Contributions. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. Should You wish to submit work that is not Your original creation, You may submit it to New Relic separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which You are personally aware, and conspicuously marking the work as \"Submitted on behalf of a third-party: [named here] \". You agree to notify New Relic of any facts or circumstances of which You become aware that would make these representations inaccurate in any respect. New Relic Open Source Standards External Projects Highlighted Projects New Relic Projects Edit this page Create an issue Copyright © 2020 New Relic Inc.Version 1.8.4", - "type": "opensource", + "body": "Collect data Through our opensource agents or APIs, New Relic makes it easy to collect data from any source. The guides in this section provide strategies for collecting and querying data for use in your existing implementation, or in apps you build. The opportunities are endless. Guides to collect data   Add custom attributes Use custom attributes for deeper analysis 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 10 min Query data with NRQL Query default event data, custom events, and attributes 15 min Collect data - any source APIs, agents, OS emitters - get any data", + "type": "developer", "document_type": "page", "info": "", "sections": [ - "NEW RELIC, INC.", - "INDIVIDUAL CONTRIBUTOR LICENSE AGREEMENT", - "Definitions." + "Collect data", + "Guides to collect data", + "Add custom attributes", + "Create custom events", + "Build queries with NerdGraph", + "Query data with NRQL", + "Collect data - any source" ], - "title": "New Relic Open Source Contributor License Agreement", + "title": "Collect data", "popularity": 1, - "external_id": "478151b2a97835e82c3cd1eaa49610793dc56783", + "external_id": "fb5d6f75b61858b09e3e8c63f3b2af97813f47b6", "image": "", - "url": "https://opensource.newrelic.com/cla/", - "published_at": "2020-08-17T01:53:40Z", - "updated_at": "2020-08-13T01:57:04Z", + "url": "https://developer.newrelic.com/collect-data/", + "published_at": "2020-08-18T02:08:12Z", + "updated_at": "2020-08-18T01:45:02Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0462754, + "_score": 0.46906766, "_version": null, "_explanation": null, "sort": null, "highlight": { - "body": " is for your protection as a Contributor as well as the protection of New Relic; it does not change your rights to use your own Contributions for any other purpose. You accept and agree to the following terms and conditions for Your present and future Contributions submitted to New Relic. Except" + "sections": "Add custom attributes", + "body": " data   Add custom attributes Use custom attributes for deeper analysis 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 10 min Query data with NRQL Query default event data, custom events, and attributes 15 min Collect data - any source APIs, agents, OS emitters - get any data" }, - "id": "5f31822264441fcbe056a984" + "id": "5efa997328ccbc768c307de2" + }, + { + "body": "newrelic.agent.add_custom_parameters(items) Adds one or more custom attributes to a transaction. Description This call records one or more custom attributes (a key/value tuple attached to your transaction). The call name is add_custom_parameters because \"custom attributes\" were previously called \"custom parameters\". Attributes may be found in New Relic APM if the transaction is associated with an error or if a transaction trace is generated for that transaction. Attributes can also be found and queried in Insights or New Relic One. Before you create custom attributes, review New Relic's list of reserved terms used by NRQL and Insights. Parameters Parameter Description items list Required. Each item in the list must be a tuple, with the first element being a key, and the second its value. Each key is a string representing the name of an attribute, and each corresponding value is the value to add to the current transaction for this attribute. Values can be int, float, string, or boolean. Only the first 255 characters are retained for both keys and values. Return value(s) Returns True if all attributes were added successfully. Example(s) Adding custom parameters to background task An example of adding custom parameters to a background task: @newrelic.agent.background_task() def send_request(): response = requests.get(\"http://example.com\") newrelic.agent.add_custom_parameters( [(\"url_path_status_code\", response.status_code)] ) Using custom parameters to troubleshoot You can also use custom parameters to troubleshoot performance issues. For example, you might see occasional slow response times from a pool of memcache instances, but you don't know what instance is causing the problem. You might add an attribute to the transaction indicating the server, like so: # Set server_ip to be the current server processing the transaction newrelic.agent.add_custom_parameters([ (\"memcache_query_frontend_lookup\", \"server_ip\") ])", + "type": "docs", + "document_type": "api_doc", + "breadcrumb": "Contents » APM agents / Python agent / Python agent API", + "info": "New Relic Python API: This call adds a custom attribute (key/value tuple) to a transaction.", + "nodeid": 27406, + "sections": [ + "Python agent", + "Getting started", + "Installation", + "Configuration", + "Supported features", + "Back-end services", + "Custom instrumentation", + "API guides", + "Python agent API", + "Web frameworks and servers", + "Hosting services", + "Attributes", + "Troubleshooting", + "add_custom_parameters", + "Description", + "Parameters", + "Return value(s)", + "Example(s)", + "Adding custom parameters to background task", + "Using custom parameters to troubleshoot", + "For more help" + ], + "title": "add_custom_parameters (Python agent API)", + "popularity": 1, + "external_id": "4a0759cb3bd46dfabe6d34a678cc7c644ff79773", + "category_1": "Python agent", + "category_2": "Python agent API", + "image": "", + "url": "https://docs.newrelic.com/docs/agents/python-agent/python-agent-api/addcustomparameters-python-agent-api", + "published_at": "2020-08-18T12:18:44Z", + "updated_at": "2020-08-15T10:25:58Z", + "category_0": "APM agents", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 0.379156, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "sections": "Attributes", + "info": "New Relic Python API: This call adds a custom attribute (key/value tuple) to a transaction.", + "body": "newrelic.agent.add_custom_parameters(items) Adds one or more custom attributes to a transaction. Description This call records one or more custom attributes (a key/value tuple attached to your transaction). The call name is add_custom_parameters because "custom attributes" were previously called" + }, + "id": "5c4055440cc37f4ab32ef6be" } ], - "/explore-docs/nerdstorage": [ + "/automate-workflows/get-started-new-relic-cli": [ { - "body": "Add, query, and mutate data using NerdStorage 45 min NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. Using NerdStorage, you can create individual documents of up to 64kb in size, create different collections of documents, and store data by entity, account, or user level. This guide explains how to add data and documents to NerdStorage. For an introduction to what NerdStorage is and how it works, see Intro to NerdStorage. Before you begin This guide requires that you have an API key and the New Relic One CLI as described in Set up your development environment. Get started First, get the NerdStorage app running successfully inside New Relic One. Step 1 of 3 Clone the example applications from the GitHub repo. Step 2 of 3 Use the New Relic One CLI to update the application UUID and run the application locally. In the terminal, switch to the /nr1-how-to/use-nerdstorage directory: cd / nr1 - how - to / use - nerdstorage; Copy Update the UUID and serve the application: nr1 nerdpack:uuid -gf nr1 nerdpack:serve Copy Step 3 of 3 Once the app is successfully served, your terminal will return the URL to view your running application on New Relic One. Load the URL. Click Apps and under Other apps you'll see the Use Nerdstorage app listed. Click to launch the app. Add data to NerdStorage Once the app is up and running on New Relic One, you can prepare the app and start adding data. On the How To Use NerdStorage app screen, there's a Saved to NerdStorage pane with a field for adding data. However, if you type something you'll get an error message. This is because you need to be set up to store data at the User level. You can do this with the help of the UserStorageMutation component. Step 1 of 3 Open the application’s ./nerdlets/use-nerdstorage-nerdlet/index.js file in the text editor of your choice and find the code for the TextField and Button used to enter data. The Button onClick prop makes a call to a helper method called _addToNerdStorage, and you need to update it to add UserStorageMutation The UserStorage NerdStorage components require a collection and documentId. In the constructor method in the application’s index.js file, you can see the variables being provided. In the .js file, it will look something like this: constructor(props) { super(props) this.collectionId = 'mycollection'; this.documentId = 'learning-nerdstorage'; this.state = { isOpen: true, storage: [], text: '', }; this._addToNerdStorage = this._addToNerdStorage.bind(this); this._removeFromNerdStorage = this._removeFromNerdStorage.bind(this); this._deleteDocument = this._deleteDocument.bind(this); } Copy Step 2 of 3 Import the UserStorageMutation by adding it to your import statement at the top of the index.js file: import { UserStorageMutation } from 'nr1'; Copy Then update the helper with this code beginning with _addToNerdStorage: _addToNerdStorage(){ const { text, storage } = this.state; storage.push(text); this.setState({storage}, () => { UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.WRITE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, document: { storage }, }) .then((res) => { this.setState({text: ''}); Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.NORMAL }); }) .catch((err) => console.log(err)); }); } Copy Step 3 of 3 Return to your running How To Use NerdStorage app screen on New Relic One and reload the page. Add some text in the text entry field and click the check button. This will update NerdStorage and trigger a Toast notification inside the app. You should then see the text you typed displayed as a table row below the text entry field. Query data from NerdStorage Once you get data storage working as described in the section above, you also need to get the app properly reading data from NerdStorage, or the app will reload with an empty state every time you navigate away from the app page and back. To do this, add the UserStorageQuery component and update the componentDidMount method. Step 1 of 3 Import the UserStorageQuery by adding it to the import statement in the application’s ./nerdlets/use-nerdstorage-nerdlet/index.js file. import { UserStorageMutation, UserStorageQuery } from 'nr1'; Copy Step 2 of 3 Then, add the following componentDidMount method to your application: componentDidMount(){ UserStorageQuery.query({ collection: this.collectionId, documentId: this.documentId, }) .then(({ data }) => { if(data !== null) { this.setState({storage: data.storage}); } }) .catch(err => console.log(err)); } Copy Step 3 of 3 Back inside the NerdStorage app, test your changes by adding a few more rows using the text entry field. Then exit and relaunch the application. The application should load and show all the data you entered before you navigated away. Mutate data in NerdStorage Each NerdStorage entry displayed in the table inside the app has a trash button that can be used to update a specific entry. The trash button works by making a call to the _removeFromNerdStorage helper method. Step 1 of 1 To get this process working, update the code in _removeFromNerdStorage: _removeFromNerdStorage(index, data){ const { storage } = this.state; storage.pop(data); this.setState({storage}, () => { UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.WRITE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, document: { storage }, }) .then((res) => { Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.NORMAL }); }) .catch((err) => console.log(err)); }); } Copy Once you do this, clicking the trash button removes the item it's associated with, and the app updates to show the change. Delete collection from NerdStorage While the trash button is a good method for removing specific entries one at a time, you may also want the ability to delete a whole NerdStorage document at once. You can do this by adding the Delete Document button to your app. Step 1 of 2 Add a new GridItem to the application immediately before the closing Grid tag. In the new GridItem add the following code to display your new button: ; Copy Step 2 of 2 Because the new Delete Document button will be calling the _deleteDocument helper method, you'll need to update that using this code: _deleteDocument(){ this.setState({storage: []}); UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.DELETE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, }); Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.CRITICAL }); } Copy Back inside the application, you should now see both the individual trash buttons and the newly added Delete Document button. Next steps Now that you’ve successfully implemented NerdStorage into a New Relic One application, you can store and mutate data connected to your User. For more information on the various NerdStorage components, please visit the New Relic developer website API documentation.", + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", "type": "developer", "document_type": "page", - "info": "NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next.", + "info": "The command line tools for performing tasks against New Relic APIs", "sections": [ - "Add, query, and mutate data using NerdStorage", + "New Relic CLI Reference", + "New Relic CLI commands", + "Options", + "Commands" + ], + "title": "New Relic CLI Reference", + "popularity": 1, + "tags": "new relic cli", + "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", + "image": "", + "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", + "published_at": "2020-08-18T02:11:50Z", + "updated_at": "2020-08-14T01:47:12Z", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 9.215137, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "New Relic CLI Reference", + "sections": "New Relic CLI Reference", + "info": "The command line tools for performing tasks against New Relic APIs", + "tags": "new relic cli", + "body": " the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql" + }, + "id": "5efa989ee7b9d2024b7bab97" + }, + { + "body": "Quickly tag a set of resources 5 min Tags help you group, search, filter, and focus the data about your entities, which can be anything from applications to hosts to services. Tagging entities using the New Relic CLI is a good candidate for automation. In this 5-minute guide, you use the New Relic CLI to add multiple tags to one of your entities. Before you begin For this guide you need your New Relic personal API Key: Create it at the Account settings screen for your account. Step 1 of 6 Install the New Relic CLI You can download the New Relic CLI via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 6 Create your New Relic CLI profile New Relic CLI profiles contain credentials and settings that you can apply to any CLI command. To create your first CLI profile, run the profiles add command. Don't forget to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey API_KEY -r us # Set the profile as default newrelic profiles default -n tutorial Copy Step 3 of 6 Search for an entity Your New Relic account might have hundreds of entities: Have a quick look by opening the Entity explorer. In the terminal, run entity search to retrieve a list of entities from your account as JSON. In the example, you're searching for all entities with \"test\" in their name. # Change the `name` to match any of your existing entities newrelic entity search --name \"test\" Copy Step 4 of 6 If there are matching entities in your account, the query yields data in JSON format, similar to this workload example. Select an entity from the results and look for its guid value; the guid is the unique identifier of the entity. Write it down. { \"accountId\": 123456789, \"domain\": \"NR1\", \"entityType\": \"WORKLOAD_ENTITY\", \"guid\": \"F7B7AE59FDED4204B846FB08423DB18E\", \"name\": \"Test workload\", \"reporting\": true, \"type\": \"WORKLOAD\" }, Copy Step 5 of 6 Add tags and tag lists to your entity With your entity guid, you can add tags right away. You can do so by invoking the entities tags create command. What if you want to add multiple tags? You can use tag sets for that: While tags are key-value pairs separated by colons, tag sets are comma-separated lists of tags. For example: tag1:value1,tag2:value2 Note Adding tags is an asynchronous operation: it could take a little while for the tags to get created. # Adding a single tag newrelic entity tags create --guid GUID --tag key:value # Adding multiple tags newrelic entity tags create --guid GUID --tag tag1:test,tag2:test Copy Step 6 of 6 Check that the tags are there To make sure that the tags have been added to your entities, retrieve them using the entity tags get command. All tags associated with your entity are retrieved as a JSON array. newrelic entity tags get --guid GUID Tip Tags can be deleted at any time by invoking the entity tags delete command followed by the same arguments you used to create them. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Next steps Have a look at all the New Relic CLI commands. For example, you could create a New Relic workflow using workload create. If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.", + "type": "developer", + "document_type": "page", + "info": "Add tags to applications you instrument for easier filtering and organization.", + "sections": [ + "Quickly tag a set of resources", "Before you begin", - "Get started", - "Add data to NerdStorage", - "Query data from NerdStorage", - "Mutate data in NerdStorage", - "Delete collection from NerdStorage", + "Install the New Relic CLI", + "Linux", + "macOS", + "Windows", + "Create your New Relic CLI profile", + "Search for an entity", + "Add tags and tag lists to your entity", + "Note", + "Check that the tags are there", + "Tip", "Next steps" ], - "title": "Add, query, and mutate data using NerdStorage", + "title": "Quickly tag a set of resources", "popularity": 1, - "external_id": "97cc9637edea35ecd68683f1010f67a5f8c79038", - "image": "https://developer.newrelic.com/static/e03456a7ed8556f83bd3329ea38b261d/8f217/add-data-NerdStorage.png", - "url": "https://developer.newrelic.com/build-apps/add-query-mutate-data-nerdstorage/", - "published_at": "2020-08-17T01:48:54Z", - "updated_at": "2020-08-14T01:50:34Z", + "external_id": "c7c374812f8295e409a9b06d552de51ceefc666b", + "image": "", + "url": "https://developer.newrelic.com/automate-workflows/5-mins-tag-resources/", + "published_at": "2020-08-18T02:08:12Z", + "updated_at": "2020-08-14T01:45:08Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.8732451, + "_score": 0.42740965, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Add, query, and mutate data using NerdStorage", - "sections": "Add data to NerdStorage", - "info": "NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next.", - "body": " collections of documents, and store data by entity, account, or user level. This guide explains how to add data and documents to NerdStorage. For an introduction to what NerdStorage is and how it works, see Intro to NerdStorage. Before you begin This guide requires that you have an API key" + "title": "Quickly tag a set of resources", + "sections": "Install the New Relic CLI", + "info": "Add tags to applications you instrument for easier filtering and organization.", + "body": " by invoking the entity tags delete command followed by the same arguments you used to create them. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Next steps Have a look at all the New Relic CLI commands. For example" }, - "id": "5efa98d4e7b9d26d6b7bab74" + "id": "5efa999d64441fa74a5f7e2d" }, { - "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.", + "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform", "type": "developer", "document_type": "page", - "info": "Intro to New Relic One API components", + "info": "", "sections": [ - "Intro to New Relic One API components", - "Components of the SDK", - "UI components", - "Chart components", - "Query and storage components", - "Platform APIs" + "Automate workflows", + "Guides to automate workflows", + "Quickly tag resources", + "Automate common tasks", + "Set up New Relic using the Kubernetes operator", + "Set up New Relic using Terraform" ], - "title": "Intro to New Relic One API components", + "title": "Automate workflows", "popularity": 1, - "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2", + "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871", "image": "", - "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/", - "published_at": "2020-08-17T01:54:02Z", - "updated_at": "2020-08-14T01:47:12Z", + "url": "https://developer.newrelic.com/automate-workflows/", + "published_at": "2020-08-18T02:04:53Z", + "updated_at": "2020-08-17T01:55:15Z", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 0.3421702, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "sections": "Set up New Relic using the Kubernetes operator", + "body": " solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform" + }, + "id": "5efa999c196a67dfb4766445" + }, + { + "body": "Contain the complexity - Observability made simple New Relic’s Kubernetes cluster explorer empowers Kubernetes nerds to move beyond infrastructure metrics and investigate deeper into applications, traces, logs, and events—with a single click—while staying grounded in a centralized UI. Join us at KubeCon and CloudNativeCon Europe August 17-20 to learn more. Check out the complete schedule of New Relic talks to make the most of your KubeCon experience. Learn more. Get coding Create a free account 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events Start the guide 7 min Add tags to apps Add tags to applications you instrument for easier filtering and organization Start the guide 12 min Build a Hello, World! app Build a Hello, World! app and publish it to your local New Relic One Catalog Start the guide Get inspired 30 min Add a table to your app Add a table to your New Relic One app 15 min Collect data - any source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add a time picker to your app Add a time picker to a sample application   Add custom attributes Use custom attributes for deeper analysis Show 18 more guides Looking for more inspiration? Check out the open source projects built by the New Relic community. New Relic developer champions New Relic Champions are solving big problems using New Relic as their linchpin and are recognized as experts and leaders in the New Relic technical community. Nominate a developer champion Learn more about developer champions New Relic Podcasts We like to talk, especially to developers about developer things. Join us for conversations on open source, observability, software design and industry news. Listen", + "type": "developer", + "document_type": "page", + "info": "", + "sections": [ + "Contain the complexity - Observability made simple", + "Get coding", + "Create custom events", + "Add tags to apps", + "Build a Hello, World! app", + "Get inspired", + "Add a table to your app", + "Collect data - any source", + "Automate common tasks", + "Create a custom map view", + "Add a time picker to your app", + "Add custom attributes", + "New Relic developer champions", + "New Relic Podcasts" + ], + "title": "New Relic Developers", + "popularity": 1, + "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab", + "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png", + "url": "https://developer.newrelic.com/", + "published_at": "2020-08-18T02:03:42Z", + "updated_at": "2020-08-15T01:36:10Z", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 0.2277025, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "New Relic Developers", + "sections": "New Relic developer champions", + "body": " to your app Add a table to your New Relic One app 15 min Collect data - any source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add" + }, + "id": "5d6fe49a64441f8d6100a50f" + }, + { + "body": "Explore NerdGraph using the API Explorer 25 min NerdGraph is New Relic's GraphQL API. It allows you to get all the information you need in a single request. With NerdGraph API Explorer you don't need to know the query format: using the Query Builder you can browse our entire graph and compose queries just by selecting the items you want and filling out their required values. Before you begin Go to api.newrelic.com/graphiql and log in using your New Relic user ID and password: the NerdGraph API Explorer loads up. Make sure you have a valid New Relic API key. You can create one directly from the NerdGraph API Explorer. Step 1 of 5 Build a query to retrieve your name Time for your first NerdGraph query. Search for your name in the New Relic database: Erase everything in the query editor. Select the following fields in the query explorer in this order: actor, user, name. This GraphQL snippet appears in the editor. { actor { user { name } } } Copy Step 2 of 5 Click the play button to see the result With this query, you're telling NerdGraph to retrieve your name. You're asking for the name field, which is nested within the user field. This refers to the user who owns the API key, which in turn is nested within actor. Click the play button to see the result: It has almost the same shape as the request. All the fields in the Query Builder make up what's called the GraphQL schema, which describes all the available data types and their attributes. To learn more about each field, click the Docs button, or hover over a field in the editor. Step 3 of 5 Add more fields to your query Now you can try adding more fields to your query. The simplest way is clicking the fields in the Query Builder: The API Explorer knows where the attributes should go in the query. In the example, you add the account id and email fields. Once again, running the GraphQL query results in just the data you need, without over or under-fetching data. Notice that the id field has an argument: passing arguments is a powerful way of customizing your NerdGraph queries. Every field and object can contain arguments, so instead of running multiple queries, you just compose the one that you need. { actor { user { name email } account(id: 12345678) } } Copy Step 4 of 5 Experiment with mutations In GraphQL, mutations are a way to execute queries with side effects that can alter the data by creating, updating, or deleting objects (Commonly referred to as CRUD operations in REST APIs). Ready for your first mutation? Erase what's in the editor. Scroll down the Query Builder and expand mutation. Select the fields in the following screenshot: In this case, you're trying to add a custom tag to an entity. Notice that the editor complains if you don't select errors: mutations must have a way of telling you how the operation performed in the backend (failed requests result in null responses). Tip Unlike REST, GraphQL APIs like NerdGraph can return partial responses. For example, if you try adding tags to multiple entities, some mutations can fail and others succeed; all is logged in the GraphQL response you get. Step 5 of 5 Try your NerdGraph query in the terminal Let's say that you've built a NerdGraph query you're happy with and you want to test it elsewhere. To capture code-ready queries and mutations: Select the Tools menu. Copy the query as a curl call or as a New Relic CLI command. # cURL version curl https://api.newrelic.com/graphql \\ -H 'Content-Type: application/json' \\ -H 'API-Key: API_KEY_REDACTED' \\ --data-binary '{\"query\":\"{\\n actor {\\n user {\\n name\\n email\\n }\\n account(id: 12345678)\\n }\\n}\\n\", \"variables\":\"\"}' # New Relic CLI version newrelic nerdgraph query '{ actor { user { name email } account(id: 12345678) } } ' Copy Next steps Now you know the basics of composing and testing NerdGraph queries, but how do you turn them into client or server code? Solutions such as GraphQL Code Generator can help you turn the NerdGraph queries into code for your implementation. Try creating more complex queries by clicking fields and expanding objects in the Query Builder (be careful with mutations though, since they could write data to your account). For more information on NerdGraph and explore other projects from the developer community, check out the threads on the Explorer’s Hub.", + "type": "developer", + "document_type": "page", + "info": "Learn to explore NerdGraph, our GraphQL API, and build the queries you need.", + "sections": [ + "Explore NerdGraph using the API Explorer", + "Before you begin", + "Build a query to retrieve your name", + "Click the play button to see the result", + "Add more fields to your query", + "Experiment with mutations", + "Tip", + "Try your NerdGraph query in the terminal", + "Next steps" + ], + "title": "Explore NerdGraph using the API Explorer", + "popularity": 1, + "external_id": "df1f04edc2336c69769d946edbaf263a5339bc92", + "image": "https://developer.newrelic.com/static/0ce8c387a290d7fbd6be155322be9bce/bc8d6/create-account.png", + "url": "https://developer.newrelic.com/collect-data/get-started-nerdgraph-api-explorer/", + "published_at": "2020-08-18T02:08:12Z", + "updated_at": "2020-08-14T01:45:09Z", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 0.19488293, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "Explore NerdGraph using the API Explorer", + "sections": "Explore NerdGraph using the API Explorer", + "info": "Learn to explore NerdGraph, our GraphQL API, and build the queries you need.", + "body": " and mutations: Select the Tools menu. Copy the query as a curl call or as a New Relic CLI command. # cURL version curl https://api.newrelic.com/graphql \\ -H 'Content-Type: application/json' \\ -H 'API-Key: API_KEY_REDACTED' \\ --data-binary '{"query":"{\\n actor {\\n user {\\n name\\n email\\n }\\n account(id" + }, + "id": "5efa9973196a6791f4766402" + } + ], + "/explore-docs/newrelic-cli": [ + { + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", + "type": "developer", + "document_type": "page", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "sections": [ + "New Relic One CLI reference", + "Installing the New Relic One CLI", + "Tip", + "New Relic One CLI Commands", + "Get started", + "Configure your CLI preferences", + "Set up your Nerdpacks", + "Manage your Nerdpack subscriptions", + "Install and manage plugins", + "Manage catalog information" + ], + "title": "New Relic One CLI reference", + "popularity": 1, + "tags": [ + "New Relic One app", + "nerdpack commands" + ], + "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", + "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", + "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-18T01:50:36Z", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 0.6042674, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "New Relic One CLI reference", + "sections": "New Relic One CLI reference", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use" + }, + "id": "5efa989e28ccbc535a307dd0" + }, + { + "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", + "type": "developer", + "document_type": "page", + "info": "An overview of common commands you can use with the New Relic One CLI.", + "sections": [ + "New Relic One CLI common commands", + "Command details", + "nr1 help", + "See commands and get details", + "Usage", + "Arguments", + "Examples", + "nr1 update", + "Update your CLI", + "nr1 create", + "Create a new component", + "Options", + "nr1 profiles", + "Manage your profiles keychain", + "Commands", + "nr1 autocomplete", + "See autocomplete installation instructions", + "nr1 nrql", + "Query using NRQL" + ], + "title": "New Relic One CLI common commands", + "popularity": 1, + "external_id": "503e515e1095418f8d19329517344ab209d143a4", + "image": "", + "url": "https://developer.newrelic.com/explore-docs/nr1-common/", + "published_at": "2020-08-18T02:06:04Z", + "updated_at": "2020-08-14T01:48:10Z", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 0.36333603, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "New Relic One CLI common commands", + "sections": "New Relic One CLI common commands", + "info": "An overview of common commands you can use with the New Relic One CLI.", + "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1" + }, + "id": "5f28bd6ae7b9d267996ade94" + }, + { + "body": "New Relic One CLI catalog commands To manage your catalog, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder. Command details nr1 catalog:info Get catalog details Shows the information about your application that's displayed in the catalog. If run within a specific Nerdpack folder, the info from that Nerdpack will be shown. If you don't want to get info from your local Nerdpack, use the --nerdpack-id=NERDPACK_ID option to query from a specific Nerdpack. Usage $ nr1 catalog:info Options -f, --field=FIELD Specifies which field you want info from. -i, --nerdpack-id=NERDPACK_ID Specifies which Nerdpack to get info from. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 catalog:submit Send info to the catalog Gathers the information you add to the catalog directory for your application and saves it to the catalog. See our catalog docs for details on adding screenshots and metadata to your applications to make them easy to find, attractive, and informative. This command must be run on a Nerdpack folder. The command will search for specific files using convention names. Usage $ nr1 catalog:submit Options -P, --skip-screenshots Skips upload of screenshot assets. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", + "type": "developer", + "document_type": "page", + "info": "An overview of the CLI commands you can use to manage your New Relic One catalog information.", + "sections": [ + "New Relic One CLI catalog commands", + "Command details", + "nr1 catalog:info", + "Get catalog details", + "Usage", + "Options", + "nr1 catalog:submit", + "Send info to the catalog" + ], + "title": "New Relic One CLI catalog commands", + "popularity": 1, + "external_id": "e94d6ad2cd04e2c01aecef526778d341867b3031", + "image": "", + "url": "https://developer.newrelic.com/explore-docs/nr1-catalog/", + "published_at": "2020-08-18T02:06:04Z", + "updated_at": "2020-08-14T01:49:24Z", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 0.3152471, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "New Relic One CLI catalog commands", + "sections": "New Relic One CLI catalog commands", + "info": "An overview of the CLI commands you can use to manage your New Relic One catalog information.", + "body": "New Relic One CLI catalog commands To manage your catalog, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits" + }, + "id": "5f28bd6a64441f805eb11a26" + }, + { + "body": "New Relic One CLI plugin commands To install and manage your plugins, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Command details nr1 plugins:install Install a plugin Installs a plugin into the CLI. You can install plugins from npm or a Git URL. Please note that installing a plugin will override the core plugin. For example, if you have a core plugin that has a 'hello' command, then installing a plugin with a 'hello' command will override the core plugin implementation. This is useful if you want to update the core plugin functionality without patching and updating the whole CLI. Usage $ nr1 plugins:install PLUGIN Arguments PLUGIN: the name, path, or URL of the plugin you want to install. required Options -f, --force Runs yarn install --force. This forces a re-download of all the plugin's packages. -h, --help Shows CLI help. --verbose Adds extra information to the output. Examples $ nr1 plugins:install myplugin $ nr1 plugins:install https://github.com/someuser/someplugin $ nr1 plugins:install someuser/someplugin Aliases $ nr1 plugins:add nr1 plugins:link Link your plugin Links a local plugin into the CLI for development. Please note that linking a plugin will override your user-installed plugin or core plugin. For example, if you have a user-installed or core plugin that has a 'hello' command, linking a plugin with a 'hello' command will override the user-installed or core plugin implementation. This is useful for development work. Usage $ nr1 plugins:link PLUGIN Arguments PLUGIN: the name, path, or URL of the plugin you want to link. required Options -h, --help Shows CLI help. --verbose Adds extra information to the output. Examples $ nr1 plugins:link myplugin $ nr1 plugins:link someuser/someplugin nr1 plugins:update Update your plugins Updates all of your installed plugins. Usage $ nr1 plugins:update Options -h, --help Shows CLI help. --verbose Adds extra information to the output. nr1 plugins:uninstall Uninstall your plugin Removes a plugin from the CLI. Usage $ nr1 plugins:uninstall PLUGIN Arguments PLUGIN: the name of the plugin you want to uninstall. required Options -h, --help Shows CLI help. --verbose Adds extra information to the output. Aliases $ nr1 plugins:unlink $ nr1 plugins:remove", + "type": "developer", + "document_type": "page", + "info": "An overview of the CLI commands you can use to install and manage your plugins.", + "sections": [ + "New Relic One CLI plugin commands", + "Command details", + "nr1 plugins:install", + "Install a plugin", + "Usage", + "Arguments", + "Options", + "Examples", + "Aliases", + "nr1 plugins:link", + "Link your plugin", + "nr1 plugins:update", + "Update your plugins", + "nr1 plugins:uninstall", + "Uninstall your plugin" + ], + "title": "New Relic One CLI plugin commands", + "popularity": 1, + "external_id": "6e94c2de165c2b01c2b15c9297a7314f1895112e", + "image": "", + "url": "https://developer.newrelic.com/explore-docs/nr1-plugins/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-14T01:50:34Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.023052836, + "_score": 0.29591545, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Intro to New Relic One API components", - "sections": "Intro to New Relic One API components", - "info": "Intro to New Relic One API components", - "body": " settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc" + "title": "New Relic One CLI plugin commands", + "sections": "New Relic One CLI plugin commands", + "info": "An overview of the CLI commands you can use to install and manage your plugins.", + "body": "New Relic One CLI plugin commands To install and manage your plugins, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin" }, - "id": "5efa989e28ccbc4071307de5" + "id": "5f28bd6a196a670ddd19d000" }, { - "body": "Build apps You know better than anyone what information is crucial to your business, and how best to visualize it. Sometimes, this means going beyond dashboards to creating your own app. With React and GraphQL, you can create custom views tailored to your business. These guides are designed to help you start building apps, and dive into our library of components. We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a \"Hello, World!\" application Build a \"Hello, World!\" app and publish it to New Relic One 20 min Publish and deploy apps Start sharing the apps you build 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 30 min Add a table to your app Add a table to your New Relic One app 20 min Set up your development environment Prepare to build apps and contribute to this site 30 min Create a custom map view Build an app to show page view data on a map", + "body": "New Relic One CLI config commands To configure your New Relic One CLI preferences, use the commands below. You can click any command to see its usage options and additional details about the command. Run nr1 config:list to see all your existing configurations and their keys. Command Description nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Command details nr1 config:set Set a configuration Sets a specific configuration value given a configuration key. By default, the command will prompt you for a new value after providing a key, but you can also use the --k, --key=KEY option to skip this step. Usage $ nr1 config:set OPTION Options -k, --key=KEY The key of the config. (required) -V, --value=VALUE The value of the config. --profile=PROFILE The authentication profile you want to use. -t, --this-profile-only If present, this configuration will only apply while running with the specified profile. --verbose Adds extra information to the output. Examples $ nr1 config:set --key=proxyEnabled $ nr1 config:set --key=proxyEnabled --value=ENABLED nr1 config:get See your configuration Shows the value for a specific configuration. Usage $ nr1 config:get OPTION Options -k, --key=KEY The key of the config. (required) --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 config:list See all your configurations Shows a list of all your configuration choices, including the configuration key, value, and origin. Usage $ nr1 config:list Options --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. Aliases $ nr1 config:ls nr1 config:delete Remove a configuration Removes the value of a specific configuration. Usage $ nr1 config:delete OPTION Options -k, --key=KEY The key of the config. (required) --profile=PROFILE The authentication profile you want to use. -t, --this-profile-only If present, this configuration will only apply while running with the specified profile. --verbose Adds extra information to the output. Aliases nr1 config:remove nr1 config:rm Examples: $ nr1 config:delete --key=proxyHttp", "type": "developer", "document_type": "page", - "info": "", + "info": "An overview of the commands you can use to configure your New Relic One CLI preferences.", "sections": [ - "Build apps", - "Guides to build apps", - "Create a \"Hello, World!\" application", - "Publish and deploy apps", - "Add, query, and mutate data using NerdStorage", - "Add the NerdGraphQuery component to an application", - "Add a time picker to your app", - "Add a table to your app", - "Set up your development environment", - "Create a custom map view" + "New Relic One CLI config commands", + "Command details", + "nr1 config:set", + "Set a configuration", + "Usage", + "Options", + "Examples", + "nr1 config:get", + "See your configuration", + "nr1 config:list", + "See all your configurations", + "Aliases", + "nr1 config:delete", + "Remove a configuration", + "Examples:" ], - "title": "Build apps", + "title": "New Relic One CLI config commands", "popularity": 1, - "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", + "external_id": "a6e1583bae1b92f3fcee75cd8a5196d13f28f08d", "image": "", - "url": "https://developer.newrelic.com/build-apps/", - "published_at": "2020-08-17T01:50:24Z", - "updated_at": "2020-08-17T01:50:23Z", + "url": "https://developer.newrelic.com/explore-docs/nr1-config/", + "published_at": "2020-08-18T02:11:49Z", + "updated_at": "2020-08-04T01:44:08Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.008559607, + "_score": 0.24779199, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Add, query, and mutate data using NerdStorage", - "body": " min Publish and deploy apps Start sharing the apps you build 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 20 minutes Add the Nerd" + "title": "New Relic One CLI config commands", + "sections": "New Relic One CLI config commands", + "info": "An overview of the commands you can use to configure your New Relic One CLI preferences.", + "body": "New Relic One CLI config commands To configure your New Relic One CLI preferences, use the commands below. You can click any command to see its usage options and additional details about the command. Run nr1 config:list to see all your existing configurations and their keys. Command Description nr1" }, - "id": "5efa999d64441fc0f75f7e21" - }, + "id": "5f28bd6828ccbca2072376f4" + } + ], + "/build-apps/howto-use-nrone-table-components": [ { - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", + "body": "TableHeaderCell Usage Copy Props There are no props for this component.", "type": "developer", "document_type": "page", - "info": "The command line tools for performing tasks against New Relic APIs", + "info": "A TableHeaderCell component!", "sections": [ - "New Relic CLI Reference", - "New Relic CLI commands", - "Options", - "Commands" + "TableHeaderCell", + "Usage", + "Props" ], - "title": "New Relic CLI Reference", + "title": "TableHeaderCell", "popularity": 1, - "tags": "new relic cli", - "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", + "external_id": "2a4be1419d1a6e501a8eed915b8acf7c9798259d", "image": "", - "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-08-17T01:54:02Z", - "updated_at": "2020-08-14T01:47:12Z", + "url": "https://developer.newrelic.com/components/table-header-cell/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-03T04:46:36Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.007368074, + "_score": 3.722324, "_version": null, "_explanation": null, "sort": null, "highlight": { - "info": "The command line tools for performing tasks against New Relic APIs", - "body": " the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql" + "title": "TableHeaderCell", + "sections": "TableHeaderCell", + "info": "A TableHeaderCell component!", + "body": "TableHeaderCell Usage Copy Props There are no props for this component." }, - "id": "5efa989ee7b9d2024b7bab97" + "id": "5efa9906196a67523e76646e" }, { - "body": "Query and store data 10 min To help you build a New Relic One application, we provide you with the New Relic One SDK. Here you can learn how to use the SDK query components, which allow you to make queries and mutations via NerdGraph, our GraphQL endpoint. Query-related React components can be identified by the Query suffix. Mutation-related components can be identified by the Mutation prefix. Components overview Our data components are based on React Apollo. The most basic component is NerdGraphQuery, which accepts any GraphQL (or GraphQL AST generated by the graphql-tag library as the query parameter, and a set of query variables passed as variables. Over this query, we have created an additional set of queries, which can be divided into four groups: User queries: These allow you to query the current user and its associated accounts. Components in this category: UserStorageQuery and AccountsQuery. Entities queries: Because New Relic One is entity-centric, we use queries to make access to your entities easier. You can count, search, list, query, and favorite them. Components in this category: EntityCountQuery, EntitySearchQuery, EntitiesByDomainTypeQuery, EntitiesByGuidsQuery, EntityByGuidQuery, EntityByNameQuery. Storage queries: New Relic One provides a simple storage mechanism that we call NerdStorage. This can be used by Nerdpack creators to store application configuration setting data, user-specific data, and other small pieces of data. Components in this category: UserStorageQuery, AccountStorageQuery, EntityStorageQuery, UserStorageMutation, AccountStorageMutation, and EntityStorageMutation. For details, see NerdStorage. NRQL queries: To be able to query your New Relic data via NRQL (New Relic Query Language), we provide a NrqlQuery component. This component can return data in different formats, so that you can use it for charting and not only for querying. Query components All query components accept a function as a children prop where the different statuses can be passed. This callback receives an object with the following properties: loading: Boolean that is set to true when data fetching is happening. Our components use the cache-and-network strategy, meaning that after the data has loaded, subsequent data reloads might be triggered first with stale data, then refreshed when the most recent data has arrived. data: Root property where the data requested is retrieved. The structure matches a root structure based on the NerdGraph schema. This is true even for highly nested data structures, which means you’ll have to traverse down to find the desired data. error: Contains an Error instance when the query fails. Set to undefined when data is loading or the fetch was successful. fetchMore: Callback function that can be called when the query is being loaded in chunks. The function will only be present when it’s feasible to do so, more data is available, and no fetchMore has already been triggered. Data is loaded in batches of 200 by default. Other components provided by the platform (like the Dropdown or the List) are capable of accepting fetchMore, meaning you can combine them easily. Mutation components Mutation components also accept a children as a function, like the query ones. The mutation can be preconfigured at the component level, and a function is passed back that you can use in your component. This is the standard React Apollo approach for performing mutations, but you might find it easier to use our static mutation method added to the component. More on this topic below. Static methods All of the described components also expose a static method so that they can be used imperatively rather than declaratively. All Query components have a static Query method, and all Mutation components have a mutation method. These static methods accept the same props as their query component, but passed as an object. For example: // Declarative way (using components). function renderAccountList() { return ( ); } // Imperative way (using promises). async function getAccountList() { let data = {}; try { data = await AccountsQuery.query(); } catch (error) { console.log('Failed to retrieve list: ' + error.message); return; } return data.actor.accounts.map((account) => { return account.name; }); } Copy Similarly, a mutation can happen either way; either declaratively or imperatively. NrqlQuery NrqlQuery deserves additional explanation, because there are multiple formats in which you can return data from it. To provide maximum functionality, all three are exposed through a formatType property. You can find its different values under NrqlQuery.formatType: NERD_GRAPH: Returns the format in which it arrives from NerdGraph. RAW: The format exposed by default in Insights and dashboards when being plotted as JSON. This format is useful if you have a pre-existing script in this format that you're willing to migrate to or incorporate with. CHART: The format used by the charting engine that we also expose. You can find a more detailed explanation of how to manipulate this format in the guide to chart components, and some examples. If you are willing to push data, we currently do not expose NrqlMutation. To do that, see the Event API for how to add custom events.", + "body": "TableRow Usage Copy Props There are no props for this component.", "type": "developer", "document_type": "page", - "info": "Reference guide for SDK query components using NerdGraph", + "info": "A TableRow component!", "sections": [ - "Query and store data", - "Components overview", - "Query components", - "Mutation components", - "Static methods", - "NrqlQuery" + "TableRow", + "Usage", + "Props" ], - "title": "Query and store data", + "title": "TableRow", "popularity": 1, - "external_id": "cbbf363393edeefbc4c08f9754b43d38fd911026", + "external_id": "b9ca0d4e07a506dd961eb2194c5344bfa9ab770d", "image": "", - "url": "https://developer.newrelic.com/explore-docs/query-and-store-data/", - "published_at": "2020-08-17T01:54:02Z", - "updated_at": "2020-08-01T01:42:02Z", + "url": "https://developer.newrelic.com/components/table-row/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-03T04:45:42Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0030633798, + "_score": 3.6806536, "_version": null, "_explanation": null, "sort": null, "highlight": { - "info": "Reference guide for SDK query components using NerdGraph", - "body": ", EntityByGuidQuery, EntityByNameQuery. Storage queries: New Relic One provides a simple storage mechanism that we call NerdStorage. This can be used by Nerdpack creators to store application configuration setting data, user-specific data, and other small pieces of data. Components in this category" + "title": "TableRow", + "sections": "TableRow", + "info": "A TableRow component!", + "body": "TableRow Usage Copy Props There are no props for this component." }, - "id": "5efa989e28ccbc2f15307deb" - } - ], - "/automate-workflows/5-mins-tag-resources": [ + "id": "5efa98d564441f93435f7e24" + }, { - "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag⁠ (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", "type": "developer", "document_type": "page", - "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "sections": [ - "Get started with the New Relic CLI", - "Before you begin", - "Install the New Relic CLI", - "Linux", - "macOS", - "Windows", - "Create your New Relic CLI profile", - "Get your application details", - "Add a simple tag to your application", - "Bonus step: Create a deployment marker", - "Next steps" + "New Relic One CLI reference", + "Installing the New Relic One CLI", + "Tip", + "New Relic One CLI Commands", + "Get started", + "Configure your CLI preferences", + "Set up your Nerdpacks", + "Manage your Nerdpack subscriptions", + "Install and manage plugins", + "Manage catalog information" ], - "title": "Get started with the New Relic CLI", + "title": "New Relic One CLI reference", "popularity": 1, "tags": [ - "api key", - "New Relic CLI", - "Tags", - "Entity", - "Deployment markers" + "New Relic One app", + "nerdpack commands" ], - "external_id": "531f2f3985bf64bb0dc92a642445887095048882", - "image": "", - "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/", - "published_at": "2020-08-17T01:48:54Z", - "updated_at": "2020-08-08T01:41:47Z", + "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", + "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", + "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-18T01:50:36Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.006377377, + "_score": 3.2519772, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Add a simple tag to your application", - "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", - "tags": "Tags", - "body": " to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3" + "title": "New Relic One CLI reference", + "sections": "Installing the New Relic One CLI", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": ". For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet" }, - "id": "5efa999c196a67c4e1766461" + "id": "5efa989e28ccbc535a307dd0" }, { - "body": "logo-newrelic Search Products Pricing Solutions Help Center About New Relic for iOS or Android    New Relic Insights App for iOS Search icon Sign Up Log In Products New Relic One Platform Overview Telemetry Data Platform Full-Stack Observability Applied Intelligence Solutions By Topic DevOps Cloud Adoption Cloud Native Digital Customer Experience By Industry E-commerce and Retail Media Public Sector By Technology Amazon Web Services Pivotal Cloud Foundry Microsoft Azure Google Cloud Platform Kubernetes Help Center Learn Docs Build on New Relic Explore open source projects Training Get help Community forum Global technical support Expert services About Our Customers Over 17,000 customers love New Relic, from Fortune 500 enterprises to small businesses around the globe. Our Blog The latest news, tips, and insights from the world of New Relic and digital intelligence. Our Company About Us Leadership Meetups and Events Resources   Investor Relations Newsroom Partner Program Contact Us logo-newrelic Want to use our logo? There's a page for that, including instructions and different styles and formats. Sorry about grabbing your right-click. Just trying to be helpful. You can also go home. Back to top icon Resources One place for ebooks, reports, videos, and more Filter Resources Language Clear All English Korean German French Japanese Content Type Clear All Analyst Report Article Tutorial Case Study eBook White Paper Datasheet Webinar Infographic Solution Sheet Video Topic Clear All Software Analytics Enterprise Customer Testimonial Performance Tuning Partners Training Mobile Culture Security DevOps Cloud SaaS Product Clear All Browser Plugins APM Insights Infrastructure Synthetics Mobile Featured Resources Datasheet New Relic One: A Simple, Powerful Platform for Observability White Paper New Relic One: Complete Observability, Simplified Video Check Out New Relic One COMPANY Careers and Culture Partner Program Investor Relations NewRelic.org Suppliers Portal CONNECT Contact Us Request Demo Events international newrelic.co.jp (Japanese) newrelic.fr (French) newrelic.de (German) Terms of Service DMCA Policy Privacy Policy Cookie Policy UK Slavery Act of 2015 ©2008-20 New Relic, Inc. All rights reserved", - "type": "", - "info": "", + "body": "Table Usage Copy Props There are no props for this component.", + "type": "developer", + "document_type": "page", + "info": "A Table component!", "sections": [ - "Featured Resources", - "COMPANY", - "CONNECT", - "international" + "Table", + "Usage", + "Props" ], - "title": "Resources", + "title": "Table", "popularity": 1, - "external_id": "57bee0529a922f26c17af709e06766adbaecd512", - "image": "https://newrelic.com/content/dam/new-relic/opengraph/NROG_Image.png", - "url": "https://newrelic.com/resources", - "published_at": "2020-08-18T00:10:28Z", - "updated_at": "2020-07-31T01:43:11Z", + "external_id": "878b3ab08dbd0a7df42558a970648013adde957f", + "image": "", + "url": "https://developer.newrelic.com/components/table/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-03T04:46:36Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.002346053, + "_score": 1.4275227, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Resources", - "sections": "Featured Resources", - "body": " Leadership Meetups and Events Resources   Investor Relations Newsroom Partner Program Contact Us logo-newrelic Want to use our logo? There's a page for that, including instructions and different styles and formats. Sorry about grabbing your right-click. Just trying to be helpful. You can also go" + "title": "Table", + "sections": "Table", + "info": "A Table component!", + "body": "Table Usage Copy Props There are no props for this component." }, - "id": "58a3b08ae621f42edadae752" + "id": "5efa98d428ccbcebbd307dfb" }, { - "body": "In New Relic APM, you can assign tags to key transactions. Tags are metadata associated with transactions. They're useful for applying to transactions that have things in common. For example, you might apply a checkout tag to all key transactions that are part of the checkout process. Then you can filter by checkout to see all of those transactions in one place. Access to this feature depends on your subscription level. Assign tags To assign a tag to a key transaction: From rpm.newrelic.com/apm or rpm.newrelic.com/browser, select Key transactions. From the index, select the tag tag icon beside the name of the transaction you want to tag. In the tag name box, type the tag's name. Press space to apply the tag. Use any Unicode characters except commas , , angle brackets < >, parentheses ( ), or square brackets [ ]. Select outside the tag name box to exit tag creation. Tag multiple transactions You can assign a tag to all visible transactions in the index: From rpm.newrelic.com/apm or rpm.newrelic.com/browser, select Key transactions. Follow the tag creation instructions in Assign tags. To remove a bulk tag: From the bulk tag dropdown, select a tag name's x symbol. Filter To filter the key transaction index by tags: In the key transaction index search field, select the dropdown dropdown icon and select by tags. Type in the tag name. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "UserTableRowCell Usage Copy Props There are no props for this component.", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / APM / Transactions / Key transactions", - "info": "In New Relic, you can assign tags to key transactions to group similar transactions together. This makes them easier to find and analyze. ", - "nodeid": 2826, + "info": "A UserTableRowCell component!", "sections": [ - "Tag key transactions", - "Assign tags", - "Tag multiple transactions", - "Filter", - "For more help" + "UserTableRowCell", + "Usage", + "Props" ], - "title": "Tag key transactions", + "title": "UserTableRowCell", "popularity": 1, - "external_id": "d34420b3fca7c278d3fca777cb590d01606563fd", - "category_1": "Transactions", - "category_2": "Key transactions", + "external_id": "765e8c8ba01ca8ae96c8e45e2223941812e17294", "image": "", - "url": "https://docs.newrelic.com/docs/apm/transactions/key-transactions/tagging-key-transactions", - "published_at": "2020-08-15T05:29:30Z", - "updated_at": "2020-07-24T23:58:26Z", - "category_0": "APM", + "url": "https://developer.newrelic.com/components/user-table-row-cell/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-03T04:46:36Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0017304065, + "_score": 1.3801258, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Tag key transactions", - "sections": "Assign tags", - "info": "In New Relic, you can assign tags to key transactions to group similar transactions together. This makes them easier to find and analyze. ", - "category_0": "APM", - "body": " the key transaction index by tags: In the key transaction index search field, select the dropdown dropdown icon and select by tags. Type in the tag name. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community" + "info": "A UserTableRowCell component!", + "body": "UserTableRowCell Usage Copy Props There are no props for this component." }, - "id": "5535dc470711e80f94000449" - }, + "id": "5efa98d464441f3b815f7e72" + } + ], + "/collect-data/get-started-nerdgraph-api-explorer": [ { - "body": "When you create a condition, you set thresholds that determine what will open a violation. This document explains what thresholds are and how to set them. What is a threshold? For a condition, thresholds are the settings that determine what opens a violation. Depending on a policy's incident preference, a violation may result in: The creation of an incident. Notifications being sent. Examples of thresholds: An application’s average web response time is greater than 5 seconds for 15 minutes. An application’s error rate per minute hits 10% or higher at least once in an hour. An application’s AJAX response time deviates a certain amount from its expected baseline behavior. Besides a mandatory critical threshold level, you can also set thresholds for a less serious warning level, which doesn't generate an incident or send a notification. View and set thresholds Thresholds are set during the process of creating a condition: Goal Instructions Set thresholds for a new condition Set thresholds as part of the process of creating a condition. View and update thresholds for existing conditions To view a condition’s thresholds: find that condition in the UI. To update thresholds, select a condition’s thresholds and make changes. To learn more about specific alert condition types (like baseline and NRQL), see Types of conditions. Details about other functionality and rules: Use the Alerts API You can list and edit conditions with the Alerts API. Set optional warning level You can set thresholds for two levels: critical (required) and warning (optional). Threshold level Details Critical (red) Required. When a violation occurs, it will send notifications depending on incident preference settings. Warning (yellow) Optional. Doesn't generate notifications. Use a warning threshold when you want to monitor when a system behavior is concerning or noteworthy but not important enough to require a notification. Set time intervals Different condition types have different minimum time intervals. For example, some condition types have a minimum time interval of 5 minutes (for example, APM metric alert conditions), and others have a minimum time interval of 1 minute (for example, NRQL alert conditions). Set URL for runbook instructions For how to set this via the UI, see Runbook instructions. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "body": "You can manage your policies, conditions, and muting rules programmatically using our GraphQL NerdGraph API. This is a powerful alternative to managing them in New Relic One or through the REST API. Alerts features you can manage with NerdGraph Here's what you can do in NerdGraph: Manage policies Use NRQL conditions Muting rules: suppress notifications The easiest way to discover alerts queries and mutations is through the NerdGraph API explorer. NerdGraph API explorer Our NerdGraph API explorer is a GraphiQL editor where you can prototype queries and mutations. Here are some examples showing how to find fields for queries and mutations. For general information about NerdGraph, see Introduction to NerdGraph. Queries To explore the various queries, look for the available queries under the actor.account.alerts namespace in NerdGraph API explorer: Mutations To explore various mutations, look in the alerts dropdown in the NerdGraph API explorer: For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "type": "docs", "document_type": "page", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert conditions", - "info": "In Alerts, thresholds are what determines when a condition will trigger a violation.", - "nodeid": 7261, + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph", + "info": "Read about how you can manage alerts conditions, policies, and muting rules using NerdGraph.", + "nodeid": 37751, "sections": [ "New Relic Alerts", "Get started", @@ -1160,204 +1467,189 @@ "Rules, limits, and glossary", "Alerts and Nerdgraph", "REST API alerts", - "Set thresholds for an alert condition", - "What is a threshold?", - "View and set thresholds", + "NerdGraph API: Examples", + "Alerts features you can manage with NerdGraph", + "NerdGraph API explorer", + "Queries", + "Mutations", "For more help" ], - "title": "Set thresholds for an alert condition", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/set-thresholds-alert-condition", + "title": "NerdGraph API: Examples ", "popularity": 1, - "external_id": "3b8b9a21021955bde8536ec49e7348f9bc1b6307", + "external_id": "017d6c34d340b9bc035e91483d675915fa5252eb", "category_1": "New Relic Alerts", - "category_2": "Alert conditions", - "image": "", - "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/set-thresholds-alert-condition", - "published_at": "2020-08-15T11:56:12Z", - "updated_at": "2020-08-09T18:39:13Z", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/alerts_query_0.png", + "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alerts-nerdgraph/nerdgraph-api-examples", + "published_at": "2020-08-18T18:16:49Z", + "updated_at": "2020-08-11T04:59:00Z", "category_0": "Alerts and Applied intelligence", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0015242578, + "_score": 0.5397293, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Set thresholds for an alert condition", - "sections": "Set thresholds for an alert condition", - "info": "In Alerts, thresholds are what determines when a condition will trigger a violation.", - "category_0": "Alerts and Applied intelligence", - "category_1": "New Relic Alerts", - "category_2": "Alert conditions", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/set-thresholds-alert-condition", - "body": " metric alert conditions), and others have a minimum time interval of 1 minute (for example, NRQL alert conditions). Set URL for runbook instructions For how to set this via the UI, see Runbook instructions. For more help If you need more help, check out these support and learning resources: Browse" + "title": "NerdGraph API: Examples ", + "sections": "Mutations", + "info": "Read about how you can manage alerts conditions, policies, and muting rules using NerdGraph.", + "body": " Use NRQL conditions Muting rules: suppress notifications The easiest way to discover alerts queries and mutations is through the NerdGraph API explorer. NerdGraph API explorer Our NerdGraph API explorer is a GraphiQL editor where you can prototype queries and mutations. Here are some examples showing", + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph" }, - "id": "5f2d847c64441fc0a656a98a" + "id": "5f2dbad864441fd15456a9eb" }, { - "body": "To ensure that New Relic correctly identifies API integration publishers, each integration needs a unique custom user agent string. If you are only using your integration internally, and don't plan on sharing it with anyone outside your organization, you don't need to set a unique custom agent string. Prerequisites This document assumes you plan to publicly distribute an integration that makes use of any of New Relic's public RESTful APIs. Examples of public distribution include: Publicizing your integration code on Github. Packaging your integration into a plugin, extension, or other package, and distributing it via a directory like WordPress Plugins. Offering an \"as a service\" integration between your product and New Relic, without actually distributing your integration code, like Runscope's integration. User agents When writing applications to work with New Relic's RESTful APIs (referred to as an integration in this document), you are creating an HTTP agent to manage information exchange between your application and New Relic. An integration identifies itself by submitting a standard identification string. In HTTP this string is included in the header field User-Agent. When using New Relic's RESTful APIs, set a User-Agent header that identifies your integration in API calls. This custom User-Agent string allows New Relic to identify the integration that is making requests to New Relic's APIs. By setting a custom user agent, New Relic can track: Usage statistics for your integration. Potentially buggy or abusive API usage. Set a user agent To set a custom user agent, include an agent string in the HTTP header User-Agent. Examples: Language Example cURL curl -H 'User-Agent: my-integration/1.2.3' Java (using GET) get.setHeader(\"User-Agent\", \"my-integration/1.2.3\"); PHP header('User-Agent: my-integration/1.2.3'); The minimum user agent string is the integration name and version: name/version. You can string together multiple values in a space-separated list. The full syntax is: name/version [(comments)] [name/version [(comments)]] [...]​ For the integration name, use a string that clearly and meaningfully identifies your integration. [icon-no] Ambiguous name: New Relic Integration [icon-yes] Clear and meaningful name: SaaS XYZTools Integration with New Relic For the integration version, use a build ID, commit hash, or other identifier that is updated when you release new integration versions. Wrap comments in parentheses () as a semi-colon separated list; Helpful comments to include: The publicly-accessible URL of your integration. For instance, a Github URL, or a page in your docs site that describes the integration. Contact information so that New Relic can easily reach the integration publisher. Information from the user agent string will never be shared, nor used by New Relic for any purpose other than discussing the integration with its publisher. Set custom user-agent for your integration You have an integration with the following identifying information: Name: MetricMeter Version: 3.2 URL: meter.me/info Contact: help​@​meter.me The custom user agent string would be: MetricMeter for New Relic/3.2 (meter.me/info; help​@​meter.me) User agent strings and New Relic New Relic captures user agent strings from API calls to identify their source. Using custom user agent strings for publicly-available integration is a recommended best practice. Depending on your business relationship with New Relic, it may be required. Labeling your integration with a custom user agent string does not affect its interaction with New Relic's APIs. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "body": "You can manage alerts conditions using our GraphQL NerdGraph API. Here are some conditions queries and mutations you can develop in our NerdGraph API explorer. See the NerdGraph introduction for help getting started with NerdGraph API explorer. This document covers the following: Steps to create a NRQL condition NRQL static condition NRQL baseline condition NRQL outlier condition Update a condition Update mutations List and filter NRQL conditions Singular NRQL condition queries Create a description Delete conditions Steps to create a NRQL condition Follow these steps: Decide which condition type you want to create (see NRQL Condition threshold types). Find your relevant policyID by doing one of the following: Use the NerdGraph policies API. Go to one.newrelic.com, in the top nav click Alerts & AI, then click Policies. Choose a policy. Find the ID under the policy name. Provide the appropriate mutation for your NRQL condition type and the relevant values. The NerdGraph GraphiQL explorer is the best place to find up-to-date documentation about the per-field specifics of the NerdGraph NRQL Conditions API. For example, questions like \"What does the valueFunction field accept?\" are best answered with the inline NerdGraph documentation. NRQL static condition Here's an example of creating a static condition: mutation { alertsNrqlConditionStaticCreate(accountId: YOUR_ACCOUNT_ID, policyId: YOUR_POLICY_ID, condition: { name: \"Low Host Count - Catastrophic\" enabled: true nrql: { query: \"SELECT uniqueCount(host) from Transaction where appName='my-app-name'\" evaluationOffset: 3 } terms: { threshold: 2 thresholdOccurrences: AT_LEAST_ONCE thresholdDuration: 600 operator: BELOW priority: CRITICAL } valueFunction: SINGLE_VALUE violationTimeLimit: TWENTY_FOUR_HOURS }) { id name } } NRQL baseline condition Here's an example of creating a baseline condition: mutation { alertsNrqlConditionBaselineCreate(accountId: YOUR_ACCOUNT_ID, policyId: YOUR_POLICY_ID, condition: { name: \"Baseline Condition\" enabled: true baselineDirection: UPPER_ONLY nrql: { query: \"SELECT average(duration) FROM Transaction\" evaluationOffset: 3 } terms: { threshold: 13 thresholdDuration: 180 thresholdOccurrences: ALL operator: ABOVE priority: CRITICAL } violationTimeLimit: TWENTY_FOUR_HOURS }) { id name baselineDirection } } NRQL outlier condition Here's an example of creating an outlier condition: mutation { alertsNrqlConditionOutlierCreate(accountId: YOUR_ACCOUNT_ID, policyId: YOUR_POLICY_ID, condition: { name: \"Outlier Condition\" enabled: true expectedGroups: 4 openViolationOnGroupOverlap: false nrql: { query: \"SELECT average(duration) FROM Transaction FACET httpResponseCode\" evaluationOffset: 3 } terms: { threshold: 1 thresholdDuration: 300 thresholdOccurrences: ALL operator: ABOVE priority: CRITICAL } violationTimeLimit: TWENTY_FOUR_HOURS }) { id name expectedGroups openViolationOnGroupOverlap } } Update a condition Complete the following: Determine the type of your existing condition by requesting the type field in a nrqlConditionsSearch query like this: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch { nrqlConditions { id type } } } } } } The type returned is what you use for your update mutation. For example, if the type returned is STATIC, use alertsNrqlConditionStaticUpdate. If the type returned is BASELINE, use alertsNrqlConditionBaselineUpdate. If the type returned is OUTLIER, use alertsNrqlConditionOutlierUpdate. Provide the id of your condition to your relevant condition type mutation. Note that you can only update conditions of the relevant type. Only provide update mutations for the fields you want to update. Fields you don't provide in the update are not touched. Update mutations Only fields that you provide in the update are changed. In the following example, baselineDirection returns unchanged, but name is updated. mutation { alertsNrqlConditionBaselineUpdate(id: YOUR_CONDITION_ID, accountId: YOUR_ACCOUNT_ID, condition: { name: \"Your updated name\" }) { id name baselineDirection } } List and filter NRQL conditions To list or filter your NRQL conditions, use the nrqlConditionsSearch query in NerdGraph. Use cursor pagination The basic of list functionality for NRQL conditions allows you to paginate through your NRQL conditions as well as request the total count of conditions per account. The nrqlConditionsSearch query utilizes cursor pagination to paginate through resources. The idea behind cursor pagination is that the client will request a cursor in a programmatic loop until the cursor comes back empty. An initial list response will look something like this: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch { nextCursor nrqlConditions { id name type } totalCount } } } } } This example returns a JSON response like this: { \"data\": { \"actor\": { \"account\": { \"alerts\": { \"nrqlConditionsSearch\": { \"nextCursor\": \"WOwfJ4+TWm9QTFeKMGyg+w==:QqkI8S4+Wwnpno6z+uk8kQ==\", \"nrqlConditions\": [ { \"id\": \"4432\", \"name\": \"Baseline Condition\", \"type\": \"BASELINE\" }, { \"id\": \"443\", \"name\": \"A static condition\", \"type\": \"STATIC\" }, // more conditions here in reality ], \"totalCount\": 435 } } } } }, } In order to paginate through conditions in the response, have the client request the cursor to be returned until the nextCursor returns from the response as null: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch(cursor: \"WOwfJ4+TWm9QTFeKMGyg+w==:QqkI8S4+Wwnpno6z+uk8kQ==\", ) { nextCursor nrqlConditions { id name type } totalCount } } } } } Request type-specific fields Certain fields are only available on specific NRQL condition types. The main reason that mutations are split between the different condition types is because they have minor differences between the fields they accept. For example, valueFunction is only relevant for static NRQL conditions and baselineDirection is only relevant on baseline NRQL conditions. But if these fields are only available on these certain condition types, how do we return them in a list of all of our condition types? The answer is a GraphQL convention known as inline fragments. Inline fragments allow you to access the data on a specific type of NRQL condition: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch { nrqlConditions { id name type ...on AlertsNrqlStaticCondition { valueFunction } ...on AlertsNrqlBaselineCondition { baselineDirection } ...on AlertsNrqlOutlierCondition { expectedGroups } } } } } } } In the previous example query, we are asking GraphQL to do the hard work for us to determine which NRQL conditions are the correct type. So, when the returned type is a static condition, it will return the valueFunction in the object. When the returned type is a baseline condition, it will return baselineDirection instead, and when the type is an outlier condition, it will return expectedGroups. Here is an example response: { \"data\": { \"actor\": { \"account\": { \"alerts\": { \"nrqlConditionsSearch\": { \"nrqlConditions\": [ { \"baselineDirection\": \"UPPER_ONLY\", \"id\": \"342\", \"name\": \"My baseline condition\", \"type\": \"BASELINE\" }, { \"id\": \"553\", \"name\": \"My static condition\", \"type\": \"STATIC\", \"valueFunction\": \"SINGLE_VALUE\" }, { \"expectedGroups\": 4, \"id\": \"802\", \"name\": \"My outlier condition\", \"type\": \"OUTLIER\" } ] } } } } } } Filter NRQL conditions You can filter NRQL conditions with the searchCriteria argument of the nrqlConditionsSearch query: Here's an example of filtering NRQL conditions with matching by name. This query returns NRQL conditions that match the provided name. Note that this match is case insensitive. { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch(searchCriteria: { name: \"Baseline Condition\" }) { nrqlConditions { id name type } } } } } } Singular NRQL condition queries You can use the NRQL condition API to query for a singular condition. Run the nrqlCondition query in the alerts namespace. Similar to type specific fields on the nrqlConditionSearch query, you can also use these inline fragmentsto request fields that are restricted to a NRQL condition type. { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlCondition(id: YOUR_CONDITION_ID) { id name ...on AlertsNrqlStaticCondition { valueFunction } } } } } } Update the description This will walk you through the procedure to create a description for a NRQL alert condition. 1. Get all the conditions for a policy: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditions(policyId: YOUR_POLICY_ID) { nextCursor results { id name description enabled nrql { query sinceValue } policyId runbookUrl terms { duration operator priority timeFunction threshold } type violationTimeLimit } } } } } } 2. Get the details for a single condition: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlCondition(id: \"YOUR_CONDITION_ID\") { description id enabled name nrql { query evaluationOffset } policyId runbookUrl terms { operator priority threshold thresholdDuration thresholdOccurrences } type violationTimeLimit } } } } } 3. Create a mutation with the description. Here's an empty mutation template: mutation { alertsNrqlConditionStaticUpdate(accountId: YOUR_ACCOUNT_ID, id: \"YOUR_CONDITION_ID\", condition: {description: \"\"}) { description } } Here'a an example mutation with an included example description: mutation { alertsNrqlConditionStaticUpdate(accountId: 123456, id: \"123456\", condition: {description: \"timestamp : {{timestamp}} \\n accountId : {{accountId}} \\n type : {{type}} \\n event : {{event}} \\n description : {{description}} \\n policyId : {{policyId}} \\n policyName: {{policyName}} \\n conditionName : {{conditionName}} \\n conditionId : {{conditionId}} \\n product : {{product}} \\n conditionType : {{conditionType}} \\n RunbookUrl : {{runbookUrl}} \\n nrqlQuery : {{nrqlQuery}} \\n nrqlEventType : {{nrqlEventType}} \\n targetID : {{targetId}} \\n targetName : {{targetName}} \\n commandLine : {{tag.commandLine}} \\n entityGuid : {{tag.entityGuid}} \\n entityName : {{tag.entityName}} \\n fullHostname : {{tag.fullHostname}} \\n instanceType : {{tag.instanceType}} \\n processDisplayName : {{tag.processDisplayName}}\"}) { description } } Delete conditions You can use the alertsConditionDelete mutation to delete any type of condition. You can only request the id field on a delete mutation; for example: mutation { alertsConditionDelete(accountId: YOUR_ACCOUNT_ID, id: YOUR_CONDITION_ID) { id } } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "type": "docs", "document_type": "page", - "breadcrumb": "Contents / APIs / REST API (v2) / Basic functions", - "info": "Using custom user agent strings for custom user agents that interact with the New Relic API is a recommended best practice. ", - "nodeid": 8206, + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph", + "info": "Examples of how to use the NerdGraph API explorer to create alert conditions, queries, and mutations.", + "nodeid": 37711, "sections": [ - "REST API (v2)", + "New Relic Alerts", "Get started", - "Basic functions", - "API Explorer v2", - "Account admin and usage", - "Alerts examples (v2)", - "Application examples (v2)", - "Browser examples (v2)", - "Labels examples (v2)", - "Mobile examples (v2)", - "Plugin examples (v2)", + "Alert policies", + "Alert conditions", + "Alert violations", + "Alert Incidents", + "Alert notifications", "Troubleshooting", - "Set a custom user agent", - "Prerequisites", - "User agents", - "Set a user agent", - "User agent strings and New Relic", + "Rules, limits, and glossary", + "Alerts and Nerdgraph", + "REST API alerts", + "NerdGraph API: NRQL condition alerts", + "Steps to create a NRQL condition", + "NRQL static condition", + "NRQL baseline condition", + "NRQL outlier condition", + "Update a condition", + "Update mutations", + "List and filter NRQL conditions", + "Singular NRQL condition queries", + "Update the description", + "Delete conditions", "For more help" ], - "title": "Set a custom user agent", - "popularity": 1, - "external_id": "8b3dcc2db39d03ce1b675c2bda6ac81e045ad6e6", - "category_1": "REST API (v2)", - "category_2": "Basic functions", - "image": "", - "url": "https://docs.newrelic.com/docs/apis/rest-api-v2/basic-functions/set-custom-user-agent", - "published_at": "2020-08-15T14:08:58Z", - "updated_at": "2020-08-10T18:13:54Z", - "category_0": "APIs", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0014199214, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "Set a custom user agent", - "sections": "Set a custom user agent", - "info": "Using custom user agent strings for custom user agents that interact with the New Relic API is a recommended best practice. ", - "category_0": "APIs", - "category_1": "REST API (v2)", - "body": "To ensure that New Relic correctly identifies API integration publishers, each integration needs a unique custom user agent string. If you are only using your integration internally, and don't plan on sharing it with anyone outside your organization, you don't need to set a unique custom agent" - }, - "id": "5e2c9c25e7b9d26b8bc7d0ef" - } - ], - "/build-apps/add-nerdgraphquery-guide": [ - { - "body": "Build apps You know better than anyone what information is crucial to your business, and how best to visualize it. Sometimes, this means going beyond dashboards to creating your own app. With React and GraphQL, you can create custom views tailored to your business. These guides are designed to help you start building apps, and dive into our library of components. We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a \"Hello, World!\" application Build a \"Hello, World!\" app and publish it to New Relic One 20 min Publish and deploy apps Start sharing the apps you build 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 30 min Add a table to your app Add a table to your New Relic One app 20 min Set up your development environment Prepare to build apps and contribute to this site 30 min Create a custom map view Build an app to show page view data on a map", - "type": "developer", - "document_type": "page", - "info": "", - "sections": [ - "Build apps", - "Guides to build apps", - "Create a \"Hello, World!\" application", - "Publish and deploy apps", - "Add, query, and mutate data using NerdStorage", - "Add the NerdGraphQuery component to an application", - "Add a time picker to your app", - "Add a table to your app", - "Set up your development environment", - "Create a custom map view" - ], - "title": "Build apps", + "title": "NerdGraph API: NRQL condition alerts ", "popularity": 1, - "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", + "external_id": "86591bd20017930f1e4eef1b1a76e3806298dbb9", + "category_1": "New Relic Alerts", "image": "", - "url": "https://developer.newrelic.com/build-apps/", - "published_at": "2020-08-17T01:50:24Z", - "updated_at": "2020-08-17T01:50:23Z", + "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alerts-nerdgraph/nerdgraph-api-nrql-condition-alerts", + "published_at": "2020-08-18T18:15:13Z", + "updated_at": "2020-08-11T04:56:49Z", + "category_0": "Alerts and Applied intelligence", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 1.2200222, + "_score": 0.27475727, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Add the NerdGraphQuery component to an application", - "body": " component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 30 min Add a table to your app Add a table to your New Relic One app 20" + "title": "NerdGraph API: NRQL condition alerts ", + "sections": "Update mutations", + "info": "Examples of how to use the NerdGraph API explorer to create alert conditions, queries, and mutations.", + "body": "You can manage alerts conditions using our GraphQL NerdGraph API. Here are some conditions queries and mutations you can develop in our NerdGraph API explorer. See the NerdGraph introduction for help getting started with NerdGraph API explorer. This document covers the following: Steps to create", + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph" }, - "id": "5efa999d64441fc0f75f7e21" + "id": "5f2dee1128ccbc562e88dfc1" }, { - "body": "NerdGraphQuery Usage Copy Props There are no props for this component.", - "type": "developer", + "body": "This document provides examples of how to use New Relic NerdGraph to query and modify your cloud integration configuration data, including Amazon AWS, Microsoft Azure, and Google Cloud Platform (GCP). Using the NerdGraph GraphiQL explorer, you can also query NRQL data. These examples for querying cloud integration configuration data use GraphQL queries and mutations: Queries: requests that are intended to only fetch data Mutations: requests that create or update data on the server Requirements Before querying cloud integration data with NerdGraph, ensure you have: Followed the instructions to connect cloud integrations with New Relic. Created an API key. Access the NerdGraph GraphiQL explorer To access the NerdGraph GraphiQL explorer: Go to https://api.newrelic.com/graphiql. Add any of the following examples. Query examples Queries are requests that are intended to only fetch data (no side effects). Queries in NerdGraph are not static, meaning that you can ask for more or less data depending on your needs. For each query, you can specify exactly what data you want to retrieve, as long as it is supported by the schema. Available provider accounts This query returns a list of all provider accounts available in your infrastructure data. Depending on the provider, additional properties can be requested. For example, for GCP, you can also ask for the serviceAccountId property, which is needed when linking a new GCP project to New Relic. Anonymous: { actor { account(id: ) { cloud { providers { id name slug ... on CloudGcpProvider { serviceAccountId } } } } } } Named: query cloudProviders { actor { account(id: ) { cloud { providers { id name slug } } } } } Specific provider account information This query returns information about a specific provider account for your Amazon AWS integration. The properties id, name, slug are requested, along with a list of integrations available to be monitored. { actor { account(id: ) { cloud { provider(slug: \"aws\") { id slug name services { id slug name } } } } } } Specific integration data from a specific cloud provider This query returns information about a specific cloud service integration of a provider. In this example, the integration is the Amazon AWS ALB monitoring integration and the provider is AWS. The properties id, name, slug, and isAllowed are requested with the available configuration parameters. { actor { account(id: ) { cloud { provider(slug: \"aws\") { service(slug: \"alb\") { id name slug isEnabled } } } } } } List of enabled cloud accounts This query returns the list of cloud accounts enabled with your New Relic account. (Your cloud account associates your New Relic account and a specific provider account with your integration.) You can enable multiple cloud provider accounts in the same New Relic account, even with the same cloud provider. { actor { account(id: ) { cloud { linkedAccounts { id name createdAt provider { id name } } } } } } Specific linked account data This query returns information about a linked account, including the properties name, providerId, and a list of the cloud integrations enabled for monitoring. { actor { account(id: ) { cloud { linkedAccount(id: ) { name provider { id name } integrations { id name createdAt updatedAt } } } } } } Enabled cloud integrations for all linked accounts This query returns all monitored integrations for all the provider cloud accounts. { actor { account(id: ) { cloud { linkedAccounts { name provider { id name } integrations { id name service { id name } createdAt updatedAt } } } } } } Specific cloud integration data for a specific linked account This query returns information about a specific integration from a specific linked account. { actor { account(id: ) { cloud { linkedAccount(id: ) { name provider { id name } integration(id: ) { id name service { id name } createdAt updatedAt } } } } } } Mutation examples Mutations are requests that are intended to have side effects, such as creating or updating data on the server. Mutations require the keyword mutation and the name of the mutation. NerdGraph mutations are restricted to a subset of all possible mutations. Link an account This mutation allows linking cloud provider accounts to a New Relic account, creating one or more linked accounts. It can link one specific cloud provider account (for example aws) to the New Relic account or multiple cloud provider accounts to one New Relic account. Required: The parameter is required and cannot be empty. It must be unique in your New Relic account. Other parameters are specific to the provider (AWS, GCP, and Azure) and are also required. In the following sections, you can see which parameters are required for each provider account. After linking an account the createdAt and updatedAt values are equal. mutation { cloudLinkAccount( accounts: { accountId: , aws: [{ name: , }] azure: [{ name: , }] gcp: [{ name: , }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } } } } Link an Amazon AWS account This mutation links an Amazon AWS provider account to your New Relic account. mutation { cloudLinkAccount( accountId: , accounts: { aws: [{ name: , arn: }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } } } } Link a Microsoft Azure account This mutation links a Microsoft Azure cloud subscription to the New Relic account. mutation { cloudLinkAccount( accountId: , accounts: { azure: [{ name: , applicationId: , clientSecret: , tenantId: , subscriptionId: }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } } } Link a Google Cloud Platform (GCP) project This mutation links a GCP project to the New Relic account. mutation { cloudLinkAccount( accountId: , accounts: { gcp: [{ name: , projectId: }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } } } Rename one or more cloud accounts This mutation allows you to rename one or more linked provider accounts. The name parameter is required, cannot be empty, and must be unique within your New Relic account. mutation { cloudRenameAccount( accountId: , accounts: [ { id: , name: }, { id: , name: } ] ) { linkedAccounts { id name } } } Enable an integration in a cloud account This mutation allows you to enable the monitoring of one or more specific cloud integrations in an existing cloud account. With this mutation, New Relic records data for the enabled integration from the provider account. For each provider account you have access to different input parameters, matching each available service. mutation { cloudConfigureIntegration ( accountId: , integrations: { : { : [{ linkedAccountId: , }] } } ) { integrations { id name integration { id slug } ... on SqsIntegration { awsRegions } } } } Enable an integration in multiple cloud accounts If you have many provider accounts linked, you can enable the same integration in the many cloud accounts at the same time. For the output of the operation, you can use GraphQL fragments for integration specific configuration parameters. mutation { cloudConfigureIntegration ( accountId: , integrations: { : { : [ { linkedAccountId: }, { linkedAccountId: } ] } } ) { integrations { id name integration { id name } ... on SqsIntegration { awsRegions } } } } Enable multiple integrations in multiple cloud accounts If you have multiple cloud accounts linked, you can also enable multiple integrations in multiple linked cloud accounts at the same time. For the output of the operation, you can use GraphQL fragments to ask for integration specific configuration parameters. mutation { cloudConfigureIntegration ( accountId: , integrations: { : { : [ { linkedAccountId: } ] : [ { linkedAccountId: } ] }, : { : [ { linkedAccountId: }, { linkedAccountId: } ] } } ) { integrations { id name service { id name } ... on SqsIntegration { awsRegions } } } } Modify an integration's configuration (regions, polling intervals, etc.) This mutation also allows you to modify one or more cloud integrations and change one or more configuration parameters. Each service will have specific parameters that you can modify. For parameters of a type list (for example, awsRegion) supply the full list. For the output of the operation, you can use GraphQL fragments to ask for integration specific configuration parameters. mutation { cloudConfigureIntegration ( accountId: , integrations: { : { : [{ linkedAccountId: , metricsPollingInterval: , : , : , }] } } ) { integrations { id name service { id slug } ... on SqsIntegration { metricsPollingInterval, , } } errors { type message } } } Disable (remove) an integration This mutation allows you to disable an integration and stop data collection for the specific cloud integration. mutation { cloudDisableIntegration ( accountId: , integrations: { : { : [ { linkedAccountId: } ] } } ) { disabledIntegrations { id name authLabel provider { id } } errors { type message } } } Unlink account This mutation allows you to unlink cloud provider accounts from New Relic account. This action can not be undone. However, you can link the account again, but account history will still be lost. mutation { cloudUnlinkAccount ( accountId: , accounts: { { linkedAccountId: } } ) { unlinkedAccounts { id name } errors { type message } } } Enable an Amazon AWS integration This example uses an Amazon AWS SQS integration and assumes you have connected an AWS account to New Relic. To enable an Amazon AWS integration: Send query to fetch account data Send a query to fetch data about the account, specifically available providers and already created provider accounts: { actor { account(id: ) { cloud { providers { id name slug } linkedAccounts { name integrations { id name } } } } } } Link AWS provider account Link an AWS provider account, if there is not one already linked or if you want to link another AWS account: Use your New Relic account identifier in the parameter. Provide a name for the provider account in the . Include the ARN of the AWS role used to fetch data from your AWS account. mutation { cloudLinkAccount( accountId: , accounts: { aws: [{ name: , arn: }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } errors { type message } } } Enable Amazon AWS SQS integration Use your New Relic account ID in the parameter and the ID of the provider account in the parameter value. mutation { cloudConfigureIntegration ( accountId: , integrations: { aws: { sqs: [ { linkedAccountId: } ] } } ) { integrations { id name service { id name } } errors { type message } } } Enable integration in multiple provider accounts If you have multiple accounts with the same provider account, you can enable the same integration in multiple provider accounts at the same time. Use your New Relic account ID in the parameter and the ID of the provider accounts in the parameter value. mutation { cloudConfigureIntegration ( accountId: , integrations: { aws: { sqs: [ { linkedAccountId: }, { linkedAccountId: , configuration_param_1: value_1, configuration_param_2: value_2 } ] } } }) { integrations { id name service { id name } } errors { type message } } } Change polling interval for Amazon AWS integration This example uses an Amazon AWS SQS integration and assumes you have connected an AWS account to New Relic. To change the polling interval of an AWS integration: Update the polling interval To update the polling interval for an Amazon AWS SQS integration, use your New Relic account ID in the parameter and the id of the linked provider account in the parameter value: mutation { cloudConfigureIntegration( accountId: , integrations: { aws : { sqs: [ { linkedAccountId: , metricsPollingInterval: 300 } ] } } ) { integrations { id name service { id slug } ... on SqsIntegration { metricsPollingInterval } } errors { type message } } } Disable Amazon AWS integration This example uses an Amazon AWS SQS integration and assumes you have connected an AWS account to New Relic. To disable an AWS integration: Disable the SQS integration Use your New Relic account identifier in the parameter and the ID of the linked cloud account the parameter value. mutation { cloudDisableIntegration ( accountId: , integrations: { aws: { sqs : [ { linkedAccountId: } ] } } ) { disabledIntegrations { id accountId name } errors { type message } } } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "A NerdGraphQuery component!", + "breadcrumb": "Contents / APIs / NerdGraph / Examples", + "info": "Use New Relic's NerdGraph (our GraphQL API) to query your New Relic Infrastructure cloud integration data. ", + "nodeid": 17141, "sections": [ - "NerdGraphQuery", - "Usage", - "Props" + "NerdGraph", + "Get started", + "Examples", + "NerdGraph cloud integrations API tutorial", + "Requirements", + "Access the NerdGraph GraphiQL explorer", + "Query examples", + "Mutation examples", + "Enable an Amazon AWS integration", + "Change polling interval for Amazon AWS integration", + "Disable Amazon AWS integration", + "For more help" ], - "title": "NerdGraphQuery", + "title": "NerdGraph cloud integrations API tutorial", "popularity": 1, - "external_id": "1ada6e056e031c141b2bb989e4ec200b3a7ce988", + "external_id": "15caa0b35be84f2e6245826a5c9ac8e49cad6a89", + "category_1": "NerdGraph", + "category_2": "Examples", "image": "", - "url": "https://developer.newrelic.com/components/nerd-graph-query/", - "published_at": "2020-08-17T01:51:28Z", - "updated_at": "2020-08-01T01:48:20Z", + "url": "https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-cloud-integrations-api-tutorial", + "published_at": "2020-08-18T03:42:15Z", + "updated_at": "2020-08-10T23:22:01Z", + "category_0": "APIs", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.024647346, + "_score": 0.2695496, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "NerdGraphQuery", - "sections": "NerdGraphQuery", - "info": "A NerdGraphQuery component!", - "body": "NerdGraphQuery Usage Copy Props There are no props for this component." + "title": "NerdGraph cloud integrations API tutorial", + "sections": "NerdGraph", + "info": "Use New Relic's NerdGraph (our GraphQL API) to query your New Relic Infrastructure cloud integration data. ", + "category_1": "NerdGraph", + "body": "This document provides examples of how to use New Relic NerdGraph to query and modify your cloud integration configuration data, including Amazon AWS, Microsoft Azure, and Google Cloud Platform (GCP). Using the NerdGraph GraphiQL explorer, you can also query NRQL data. These examples for querying", + "breadcrumb": "Contents / APIs / NerdGraph / Examples" }, - "id": "5efa999d28ccbc6bfd307ddb" + "id": "5d83537b28ccbc263a1b7bf7" }, { - "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", - "type": "developer", + "body": "You can manage your alerts policies using our GraphQL NerdGraph API. Here are some queries and mutations you can develop in our NerdGraph API explorer. See the NerdGraph introduction for help getting started with NerdGraph API explorer. List and filter policies The policiesSearch query allows you to paginate through all of your policies per account. It also allows some filtering functionality on the account policies. Listing all policies for an account Here's an example: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { policiesSearch { policies { id name incidentPreference } } } } } } Paginating through policies with cursor pagination In order to paginate through your policies, you must request the nextCursor field on your initial query. With cursor pagination, you continue to make a request through the result set until the nextCursor that is returned from the response comes back empty. This signifies that you reached the end of your results. Here's an example: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { policiesSearch { nextCursor policies { id name incidentPreference } totalCount } } } } } The code above returns a set of results like this: { \"data\": { \"actor\": { \"account\": { \"alerts\": { \"policiesSearch\": { \"nextCursor\": \"/8o0y2qiR54m6thkdgHgwg==:jZTXDFKbTkhKwvMx+CtsPVM=\", \"policies\": [ { \"id\": \"3455\", \"incidentPreference\": \"PER_POLICY\", \"name\": \"First Policy Name\" }, { \"id\": \"2123\", \"incidentPreference\": \"PER_POLICY\", \"name\": \"Another Policy\" }, // ... more policies here in reality ], \"totalCount\": 745 } } } } } } So, in your subsequent request, provide the cursor like so, until the cursor is empty: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { policiesSearch(cursor: \"/8o0y2qiR54m6thkdgHgwg==:jZTXDFKbTkhKwvMx+CtsPVM=\") { nextCursor policies { id name incidentPreference } totalCount } } } } } Find all policies by selected ids The API allows policy queries by a sub-select of ids. This will only return the information for these policies that you provide. { actor { account(id: YOUR_ACCOUNT_ID) { alerts { policiesSearch(searchCriteria: { ids: [A_POLICY_ID, ANOTHER_POLICY_ID] }) { policies { id name incidentPreference } } } } } } Find policy by id The API lets you query by policy id: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { policy(id: YOUR_POLICY_ID) { id name incidentPreference } } } } } Create a policy In order to create a policy, supply a name and an incidentPreference. The incident preference will configure how incidents get created for each condition created in the policy. For more information, refer to the documentation about choosing your incident preference. mutation { alertsPolicyCreate(accountId: YOUR_ACCOUNT_ID, policy: { name: \"Your Policy Name\" incidentPreference: PER_CONDITION }) { id name incidentPreference } } Update a policy When you update a policy, note that you don't need to supply all of the attributes on the policy. For example, you only need to supply the name if you only intend to update the name: mutation { alertsPolicyUpdate(accountId: YOUR_ACCOUNT_ID, id: YOUR_POLICY_ID, policy: { name: \"Updated Policy Name\" }) { id name incidentPreference } } Delete a policy You can delete policies via the NerdGraph API. Note that only the id may be requested back from a deleted resource: mutation { alertsPolicyDelete(accountId: YOUR_ACCOUNT_ID, id: YOUR_POLICY_ID) { id } } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "Build a \"Hello, World!\" app and publish it to New Relic One", + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph", + "info": "Read about how you can list, create, update, and delete policies using the NerdGraph API.", + "nodeid": 37716, "sections": [ - "Create a \"Hello, World!\" application", - "Before you begin", - "Create a local version of the \"Hello, World!\" application", - "Publish your application to New Relic", - "Add details to describe your project", - "Subscribe accounts to your application", - "Summary", - "Related information" + "New Relic Alerts", + "Get started", + "Alert policies", + "Alert conditions", + "Alert violations", + "Alert Incidents", + "Alert notifications", + "Troubleshooting", + "Rules, limits, and glossary", + "Alerts and Nerdgraph", + "REST API alerts", + "NerdGraph API: Alerts policies", + "List and filter policies", + "Create a policy", + "Update a policy", + "Delete a policy", + "For more help" ], - "title": "Create a \"Hello, World!\" application", + "title": "NerdGraph API: Alerts policies ", "popularity": 1, - "tags": [ - "nr1 cli", - "Nerdpack file structure", - "NR One Catalog", - "Subscribe applications" - ], - "external_id": "aa427030169067481fb69a3560798265b6b52b7c", - "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png", - "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/", - "published_at": "2020-08-17T01:55:14Z", - "updated_at": "2020-08-14T01:45:09Z", + "external_id": "cde6b52e96940389d03ae58acbfce482b5d455e6", + "category_1": "New Relic Alerts", + "image": "", + "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alerts-nerdgraph/nerdgraph-api-alerts-policies", + "published_at": "2020-08-18T18:15:13Z", + "updated_at": "2020-08-11T04:56:49Z", + "category_0": "Alerts and Applied intelligence", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0045782626, + "_score": 0.2629376, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Create a "Hello, World!" application", - "sections": "Create a local version of the "Hello, World!" application", - "info": "Build a "Hello, World!" app and publish it to New Relic One", - "tags": "Subscribe applications", - "body": " information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project" + "title": "NerdGraph API: Alerts policies ", + "sections": "Alerts and Nerdgraph", + "info": "Read about how you can list, create, update, and delete policies using the NerdGraph API.", + "body": "You can manage your alerts policies using our GraphQL NerdGraph API. Here are some queries and mutations you can develop in our NerdGraph API explorer. See the NerdGraph introduction for help getting started with NerdGraph API explorer. List and filter policies The policiesSearch query allows you", + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph" }, - "id": "5efa9973196a67d16d76645c" + "id": "5f2dee1128ccbc65b688dfc1" }, { "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.", @@ -1377,1653 +1669,1757 @@ "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2", "image": "", "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/", - "published_at": "2020-08-17T01:54:02Z", + "published_at": "2020-08-18T02:07:10Z", "updated_at": "2020-08-14T01:47:12Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0033843808, + "_score": 0.22751394, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Intro to New Relic One API components", - "sections": "Query and storage components", - "info": "Intro to New Relic One API components", - "body": " is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration" + "sections": "Query and storage components", + "body": " is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration" }, "id": "5efa989e28ccbc4071307de5" - }, - { - "body": "Add, query, and mutate data using NerdStorage 45 min NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. Using NerdStorage, you can create individual documents of up to 64kb in size, create different collections of documents, and store data by entity, account, or user level. This guide explains how to add data and documents to NerdStorage. For an introduction to what NerdStorage is and how it works, see Intro to NerdStorage. Before you begin This guide requires that you have an API key and the New Relic One CLI as described in Set up your development environment. Get started First, get the NerdStorage app running successfully inside New Relic One. Step 1 of 3 Clone the example applications from the GitHub repo. Step 2 of 3 Use the New Relic One CLI to update the application UUID and run the application locally. In the terminal, switch to the /nr1-how-to/use-nerdstorage directory: cd / nr1 - how - to / use - nerdstorage; Copy Update the UUID and serve the application: nr1 nerdpack:uuid -gf nr1 nerdpack:serve Copy Step 3 of 3 Once the app is successfully served, your terminal will return the URL to view your running application on New Relic One. Load the URL. Click Apps and under Other apps you'll see the Use Nerdstorage app listed. Click to launch the app. Add data to NerdStorage Once the app is up and running on New Relic One, you can prepare the app and start adding data. On the How To Use NerdStorage app screen, there's a Saved to NerdStorage pane with a field for adding data. However, if you type something you'll get an error message. This is because you need to be set up to store data at the User level. You can do this with the help of the UserStorageMutation component. Step 1 of 3 Open the application’s ./nerdlets/use-nerdstorage-nerdlet/index.js file in the text editor of your choice and find the code for the TextField and Button used to enter data. The Button onClick prop makes a call to a helper method called _addToNerdStorage, and you need to update it to add UserStorageMutation The UserStorage NerdStorage components require a collection and documentId. In the constructor method in the application’s index.js file, you can see the variables being provided. In the .js file, it will look something like this: constructor(props) { super(props) this.collectionId = 'mycollection'; this.documentId = 'learning-nerdstorage'; this.state = { isOpen: true, storage: [], text: '', }; this._addToNerdStorage = this._addToNerdStorage.bind(this); this._removeFromNerdStorage = this._removeFromNerdStorage.bind(this); this._deleteDocument = this._deleteDocument.bind(this); } Copy Step 2 of 3 Import the UserStorageMutation by adding it to your import statement at the top of the index.js file: import { UserStorageMutation } from 'nr1'; Copy Then update the helper with this code beginning with _addToNerdStorage: _addToNerdStorage(){ const { text, storage } = this.state; storage.push(text); this.setState({storage}, () => { UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.WRITE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, document: { storage }, }) .then((res) => { this.setState({text: ''}); Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.NORMAL }); }) .catch((err) => console.log(err)); }); } Copy Step 3 of 3 Return to your running How To Use NerdStorage app screen on New Relic One and reload the page. Add some text in the text entry field and click the check button. This will update NerdStorage and trigger a Toast notification inside the app. You should then see the text you typed displayed as a table row below the text entry field. Query data from NerdStorage Once you get data storage working as described in the section above, you also need to get the app properly reading data from NerdStorage, or the app will reload with an empty state every time you navigate away from the app page and back. To do this, add the UserStorageQuery component and update the componentDidMount method. Step 1 of 3 Import the UserStorageQuery by adding it to the import statement in the application’s ./nerdlets/use-nerdstorage-nerdlet/index.js file. import { UserStorageMutation, UserStorageQuery } from 'nr1'; Copy Step 2 of 3 Then, add the following componentDidMount method to your application: componentDidMount(){ UserStorageQuery.query({ collection: this.collectionId, documentId: this.documentId, }) .then(({ data }) => { if(data !== null) { this.setState({storage: data.storage}); } }) .catch(err => console.log(err)); } Copy Step 3 of 3 Back inside the NerdStorage app, test your changes by adding a few more rows using the text entry field. Then exit and relaunch the application. The application should load and show all the data you entered before you navigated away. Mutate data in NerdStorage Each NerdStorage entry displayed in the table inside the app has a trash button that can be used to update a specific entry. The trash button works by making a call to the _removeFromNerdStorage helper method. Step 1 of 1 To get this process working, update the code in _removeFromNerdStorage: _removeFromNerdStorage(index, data){ const { storage } = this.state; storage.pop(data); this.setState({storage}, () => { UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.WRITE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, document: { storage }, }) .then((res) => { Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.NORMAL }); }) .catch((err) => console.log(err)); }); } Copy Once you do this, clicking the trash button removes the item it's associated with, and the app updates to show the change. Delete collection from NerdStorage While the trash button is a good method for removing specific entries one at a time, you may also want the ability to delete a whole NerdStorage document at once. You can do this by adding the Delete Document button to your app. Step 1 of 2 Add a new GridItem to the application immediately before the closing Grid tag. In the new GridItem add the following code to display your new button: ; Copy Step 2 of 2 Because the new Delete Document button will be calling the _deleteDocument helper method, you'll need to update that using this code: _deleteDocument(){ this.setState({storage: []}); UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.DELETE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, }); Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.CRITICAL }); } Copy Back inside the application, you should now see both the individual trash buttons and the newly added Delete Document button. Next steps Now that you’ve successfully implemented NerdStorage into a New Relic One application, you can store and mutate data connected to your User. For more information on the various NerdStorage components, please visit the New Relic developer website API documentation.", - "type": "developer", - "document_type": "page", - "info": "NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next.", - "sections": [ - "Add, query, and mutate data using NerdStorage", - "Before you begin", - "Get started", - "Add data to NerdStorage", - "Query data from NerdStorage", - "Mutate data in NerdStorage", - "Delete collection from NerdStorage", - "Next steps" - ], - "title": "Add, query, and mutate data using NerdStorage", - "popularity": 1, - "external_id": "97cc9637edea35ecd68683f1010f67a5f8c79038", - "image": "https://developer.newrelic.com/static/e03456a7ed8556f83bd3329ea38b261d/8f217/add-data-NerdStorage.png", - "url": "https://developer.newrelic.com/build-apps/add-query-mutate-data-nerdstorage/", - "published_at": "2020-08-17T01:48:54Z", - "updated_at": "2020-08-14T01:50:34Z", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0031635338, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "Add, query, and mutate data using NerdStorage", - "sections": "Add, query, and mutate data using NerdStorage", - "info": "NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next.", - "body": " NerdStorage, or the app will reload with an empty state every time you navigate away from the app page and back. To do this, add the UserStorageQuery component and update the componentDidMount method. Step 1 of 3 Import the UserStorageQuery by adding it to the import statement in the application" - }, - "id": "5efa98d4e7b9d26d6b7bab74" } ], - "/collect-data/collect-data-from-any-source": [ + "/build-apps/add-time-picker-guide": [ { - "body": "There are many ways to get data into your New Relic account. Any New Relic user can use any of our data ingest methods to report data to our Telemetry Data Platform. New Relic-built agents and integrations When you enable New Relic solutions like APM, browser monitoring, mobile monitoring, infrastructure monitoring, or any of our wide array of integrations, by default you'll receive data from your monitored applications, hosts, services, or other entities. To browse all New Relic-built tools and solutions, see New Relic integrations. Agent APIs Some of our monitoring solutions come with APIs and/or SDKs that allow you to customize the data reported and how it reports. For more information, see the relevant product: APM agent APIs Browser API Mobile API Infrastructure monitoring: the Flex integration tool Telemetry SDKs If our more curated solutions don't work for you, our open source Telemetry SDKs let you build your own solution. These SDKs are language wrappers for our data-ingest APIs (below) that let you send telemetry data to New Relic without requiring install of an agent. APIs for sending metrics, traces, logs, and events If our more curated solutions don't work for you, we also have data-ingest APIs: Trace API Event API Metric API Log API To learn about the differences between these data types, see Data types. New Relic One applications You can build entirely custom applications that reside in New Relic One and make use of any data you want. You can use existing open source New Relic One apps, or share your own with the open source community. For details, see New Relic One applications. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Get started", - "info": "An introduction to how to get data into New Relic. ", - "nodeid": 36051, + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "sections": [ - "Ingest and manage data", + "New Relic One CLI reference", + "Installing the New Relic One CLI", + "Tip", + "New Relic One CLI Commands", "Get started", - "Understand data", - "Manage data", - "Ingest APIs", - "Get data into New Relic", - "New Relic-built agents and integrations", - "Agent APIs", - "Telemetry SDKs", - "APIs for sending metrics, traces, logs, and events", - "New Relic One applications", - "For more help" + "Configure your CLI preferences", + "Set up your Nerdpacks", + "Manage your Nerdpack subscriptions", + "Install and manage plugins", + "Manage catalog information" ], - "title": "Get data into New Relic", + "title": "New Relic One CLI reference", "popularity": 1, - "external_id": "7a413b4d7e5bd81088a08507ae4bad64c7e24b2d", - "category_1": "Ingest and manage data", - "category_2": "Get started", - "image": "", - "url": "https://docs.newrelic.com/docs/telemetry-data-platform/get-data-new-relic/getting-started/introduction-new-relic-data-ingest-apis-sdks", - "published_at": "2020-08-15T11:16:52Z", - "updated_at": "2020-08-10T23:16:39Z", - "category_0": "Telemetry Data Platform", + "tags": [ + "New Relic One app", + "nerdpack commands" + ], + "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", + "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", + "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-18T01:50:36Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.16922116, + "_score": 0.87591255, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "APIs for sending metrics, traces, logs, and events", - "category_0": "Telemetry Data Platform", - "body": " also have data-ingest APIs: Trace API Event API Metric API Log API To learn about the differences between these data types, see Data types. New Relic One applications You can build entirely custom applications that reside in New Relic One and make use of any data you want. You can use existing open", - "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Get started" + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use" }, - "id": "5f24aa60196a67ede394f5f3" + "id": "5efa989e28ccbc535a307dd0" }, { - "body": "Our Telemetry SDKs are an open source set of API client libraries that send metrics and trace data to the New Relic platform. We offer open-source integrations for telemetry tools like Prometheus, Istio, and OpenCensus that were created using our Telemetry SDKs. If those solutions (or our other integrations) don't meet your needs, you can use the Telemetry SDKs to create your own telemetry data solutions. Requirements and compatibility To build with the Telemetry SDKs, you will need an Event API insert key. New Relic has contributed the Telemetry SDK to the open source community under an Apache 2.0 license. Available libraries The Telemetry SDKs are open source software on GitHub. Use the language-specific GitHub links below to get library details, coding examples, and procedures for how to use the SDKs. We currently support the following libraries, with more to be created in the future: Language Library Supported data types Java Java library on GitHub New Relic Metrics New Relic Traces Node/TypeScript NodeJS library on GitHub New Relic Metrics New Relic Traces Python Python library on GitHub New Relic Metrics New Relic Events New Relic Traces Go Go library on Github New Relic Metrics New Relic Traces .NET .NET library on GitHub .NET package in NuGet New Relic Metrics New Relic Traces For more on the supported data types: Metrics: see the Metric API Traces: see the Trace API Write your own Telemetry SDK or contribute to an existing one If you need a Telemetry SDK in a language that does not currently exist or want to contribute to an existing library, please see the Telemetry SDK specifications. Integrations built with the Telemetry SDKs To see the integrations built using our Telemetry SDKs, see Open source telemetry integrations. For all monitoring solutions, see our integrations page. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "PlatformStateContext Usage Copy Props There are no props for this component.", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs", - "info": "Report custom telemetry data with New Relic's open-source Telemetry SDKs.", - "nodeid": 35471, + "info": "A PlatformStateContext component!", "sections": [ - "Ingest and manage data", - "Get started", - "Understand data", - "Manage data", - "Ingest APIs", - "Telemetry SDKs: Report custom telemetry data", - "Requirements and compatibility", - "Available libraries", - "Write your own Telemetry SDK or contribute to an existing one", - "Integrations built with the Telemetry SDKs", - "For more help" + "PlatformStateContext", + "Usage", + "Props" ], - "title": "Telemetry SDKs: Report custom telemetry data", + "title": "PlatformStateContext", "popularity": 1, - "external_id": "47a4c8f38c1b1674504ea302d865fd499e90ea39", - "category_1": "Ingest and manage data", - "category_2": "Ingest APIs", + "external_id": "aa6b86b3dc0dcd7cd758b20655318b108875cce7", "image": "", - "url": "https://docs.newrelic.com/docs/telemetry-data-platform/get-started/capabilities/telemetry-sdks-send-custom-telemetry-data-new-relic", - "published_at": "2020-08-15T04:22:06Z", - "updated_at": "2020-08-11T01:15:34Z", - "category_0": "Telemetry Data Platform", + "url": "https://developer.newrelic.com/components/platform-state-context/", + "published_at": "2020-08-18T02:04:52Z", + "updated_at": "2020-08-01T01:47:08Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.16732475, + "_score": 0.3045187, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Telemetry SDKs: Report custom telemetry data", - "sections": "Telemetry SDKs: Report custom telemetry data", - "info": "Report custom telemetry data with New Relic's open-source Telemetry SDKs.", - "category_0": "Telemetry Data Platform", - "category_2": "Ingest APIs", - "body": " Metrics New Relic Traces .NET .NET library on GitHub .NET package in NuGet New Relic Metrics New Relic Traces For more on the supported data types: Metrics: see the Metric API Traces: see the Trace API Write your own Telemetry SDK or contribute to an existing one If you need a Telemetry SDK", - "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs" + "title": "PlatformStateContext", + "sections": "PlatformStateContext", + "info": "A PlatformStateContext component!", + "body": "PlatformStateContext Usage Copy Props There are no props for this component." }, - "id": "5d89fefbe7b9d2537ed30dc1" + "id": "5efa997128ccbccc6f307dc0" }, { - "body": "New Relic products report a variety of default event data to your account. This document will explain how to report your own custom events and attributes. Overview of reporting custom events and attributes Event data is one of the fundamental New Relic data types. Events are reported by most New Relic products, and we give you several options for reporting your own custom events. Reporting custom events allows you to create more useful and customized queries and charts of your data, and is a key part of optimizing how New Relic works for you. Before beginning, it's important to know that reporting a large number of custom events and/or attributes can cause degraded query performance, or cause you to approach or pass data collection rate limits. For optimal performance, first think about what data you want to analyze, and then create only the events and/or attributes necessary to meet these specific goals. Be aware of the following data and subscription requirements for inserting and accessing custom data: Ensure you follow limits and requirements around event/attribute data types, naming syntax, and size. The amount of data you have access to over time depends on your data retention policy. Send custom events and attributes Methods for sending custom events and attributes include: Source How to send custom data APM agent Use APM agent APIs to report custom events and custom attributes. Browser agent Add custom attributes to the PageView event via the Browser API call addCustomAttribute. Send PageAction event and attributes via Browser API. Forward APM agent custom attributes to PageView event. Event API To report custom events not associated with other New Relic products, use the Event API. Infrastructure Add custom attributes to default Infrastructure events. Use the Flex integration tool to report your own custom event data. Mobile agent Use the mobile agent API to send custom events and attributes. Synthetics Add custom attributes to the SyntheticCheck event via the $util.insights tools. For ways to report other types of custom data, see: Metric API Logs Trace API Extend data retention To learn about how to extend how long events are retained in your account, see Event data retention. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "Build apps You know better than anyone what information is crucial to your business, and how best to visualize it. Sometimes, this means going beyond dashboards to creating your own app. With React and GraphQL, you can create custom views tailored to your business. These guides are designed to help you start building apps, and dive into our library of components. We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a \"Hello, World!\" application Build a \"Hello, World!\" app and publish it to New Relic One 20 min Publish and deploy apps Start sharing the apps you build 20 min Set up your development environment Prepare to build apps and contribute to this site 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 30 min Add a table to your app Add a table to your New Relic One app 30 min Create a custom map view Build an app to show page view data on a map", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / Insights / Event data sources / Custom events", - "info": "An overview of the options for sending custom event data to New Relic. ", - "nodeid": 13806, + "info": "", "sections": [ - "Event data sources", - "Default events", - "Custom events", - "Report custom event data", - "Overview of reporting custom events and attributes", - "Send custom events and attributes", - "Extend data retention", - "For more help" + "Build apps", + "Guides to build apps", + "Create a \"Hello, World!\" application", + "Publish and deploy apps", + "Set up your development environment", + "Add the NerdGraphQuery component to an application", + "Add a time picker to your app", + "Add, query, and mutate data using NerdStorage", + "Add a table to your app", + "Create a custom map view" ], - "title": "Report custom event data", + "title": "Build apps", "popularity": 1, - "external_id": "afb5f5a81ae06b22935d98c470ed9cabd7c9da6b", - "category_1": "Event data sources", - "category_2": "Custom events", + "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", "image": "", - "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/report-custom-event-data", - "published_at": "2020-08-15T10:09:18Z", - "updated_at": "2020-07-26T05:52:23Z", - "category_0": "Insights", + "url": "https://developer.newrelic.com/build-apps/", + "published_at": "2020-08-18T02:08:12Z", + "updated_at": "2020-08-18T01:45:02Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.13008063, + "_score": 0.23860641, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Report custom event data", - "sections": "Event data sources", - "info": "An overview of the options for sending custom event data to New Relic. ", - "category_1": "Event data sources", - "category_2": "Custom events", - "body": " the Flex integration tool to report your own custom event data. Mobile agent Use the mobile agent API to send custom events and attributes. Synthetics Add custom attributes to the SyntheticCheck event via the $util.insights tools. For ways to report other types of custom data, see: Metric API Logs Trace", - "breadcrumb": "Contents / Insights / Event data sources / Custom events" + "title": "Build apps", + "sections": "Add a time picker to your app", + "body": " it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one" }, - "id": "5e8e7f9de7b9d2aa122cf0f6" + "id": "5efa999d64441fc0f75f7e21" }, { - "body": "New Relic offers a variety of APIs and SDKs you can use to: Retrieve data from New Relic. Send data to New Relic. Adjust settings. This section of the docs provides examples and reference documentation for our API endpoints. For developer-focused content on how to use and customize New Relic, see developer.newrelic.com. NerdGraph (GraphQL) NerdGraph is New Relic's GraphQL API, an efficient and flexible query language that lets you request exactly the data you need, without over-fetching or under-fetching. While typical REST APIs require loading from multiple URLs, NerdGraph calls get all the data you need in a single request. NerdGraph also makes it easier to evolve APIs over time and enables powerful developer tools. New Relic provides a powerful GraphQL tool to explore the API with embedded schema definitions. To get started, go to api.newrelic.com/graphiql. For sample queries and mutations, use our NerdGraph tutorials. REST APIs by capability New Relic capabilities, like APM, infrastructure monitoring, or alerts, are often used together, and sometimes they overlap in functionality. This is why multiple APIs may be relevant to each area. Some API functionality will depend on your access to features and data. To learn more about different API key types, see Understand New Relic API keys. Alerts Use the REST API for alerts and the API Explorer to: Create and manage policies, conditions, and notification channels. Create alert conditions based on NRQL queries. Create alert conditions based on data from other New Relic capabilities. APM API resources for application monitoring include: Resource Details REST API REST API features include: Retrieve APM data, including metrics, Apdex, error rates, and host data. Report deployments. Change the app name in the UI. Agent APIs Every APM language agent has an API that lets you customize the agent's default behavior, including reporting custom data. APM agent APIs include: C SDK API Go agent API Java agent API .NET agent API Node.js agent API PHP agent API Python agent API Ruby agent API Query API To query APM data, use the Query API. Account management APIs For APIs related to accounts and subscription usage, see the account-related APIs. Browser monitoring The Browser API resources include: Resource Details Browser agent API Use the Browser agent API for tasks such as: Report custom end user data to browser monitoring. Monitor asynchronous browser activity using SPA API calls. Insert custom data into New Relic dashboards . Manage source maps. REST API With the REST API you can: Retrieve page load timing data and throughput. Add or list apps monitored by browser monitoring. Manage alerts conditions for your browser data. Query API To retrieve browser monitoring data, use the Query API. Account management APIs For APIs related to accounts and subscription usage, see the account-related APIs. Infrastructure monitoring The Infrastructure API resources include: Resource Details Query API To retrieve infrastructure data, use the Query API. This API can also be used to retrieve subscription usage data. Infrastructure alert API To manage your infrastructure alerts, use the Infrastructure alert API. Integrations SDK To make your own custom integrations for reporting data to infrastructure monitoring, use the Integrations SDK. NerdGraph You can use NerdGraph (our GraphQL API) to query your cloud integration data and make changes to cloud integration settings. Mobile monitoring Mobile API resources include: Resource Details Mobile agent APIs Mobile APIs let you custom instrument your own code and send events to New Relic. See the platform-specific documentation: iOS Android Unity REST API Use the REST API for such tasks as: Retrieve a list of monitored apps. Get subscription usage data. Get metric names and data. Get crash count and crash rate data. Manage New Relic alerts conditions for your mobile apps. Query API To retrieve Mobile data from New Relic, use the Query API. Account management APIs For account-related APIs, see Account APIs. Synthetic monitoring Synthetics API resources include: Resource Details Synthetics REST API The Synthetics REST API functionality includes: Create and manage synthetics monitors. Manage synthetics alert notifications. Add labels to monitors, and retrieve monitors with specific labels. Query API To retrieve synthetics event data, use the Query API. Alerts API To create and manage alert conditions that target synthetics monitors, use the Alerts API. Telemetry APIs for core data types We offer several APIs that allow you to get our core data types (metrics, logs, traces, and events) into New Relic without the use of an installed agent. Data type Description Trace API Send distributed tracing data to New Relic. Event API Send event data to New Relic. Metric API Send metrics to New Relic from any source (including other telemetry monitoring services). Log API Send your log data to New Relic. Account management, admin, and usage APIs Like any other New Relic product or service, you want to be confident that your APIs protect you and your customers' data privacy. The following are API resources related to New Relic account administration and usage. For more information about API capabilities, see the specific New Relic API. For more information about New Relic's security measures, see our security and privacy documentation, or visit the New Relic security website. Resource Details REST API REST API features include: Find your API keys, account ID, and information needed to use the REST API. Return a list of account users. Get SLA report data for browser and application monitoring. Subscription usage You can use the Query API to retrieve subscription usage data. This can be helpful to see how usage compares to your current subscription level, or for doing departmental chargebacks. If you implemented the REST API for querying subscription usage data prior to July 10, 2018, those usage-related REST APIs are now deprecated. You should use the Query API, which requires creating an API key. For more on switching to the new API format, see the transition guide. Partner API To retrieve information about your New Relic partner account, sub-accounts, and users, use the Partner API. Other APIs Insights API resources for Insights include: Resource Details Insert events API To report custom data use the Event insertion API. Query API To query your Insights data using NRQL-formatted queries, use the Query API. This API can also be used to retrieve subscription usage data. Dashboard API To create, read, update, and delete dashboards, use the Dashboard API. Other New Relic product APIs You can also report custom data from other New Relic features. For more information, see the API sections for other products. NerdGraph You can use NerdGraph (our GraphQL API) to query data with NRQL. Plugins Use the REST API for New Relic plugins and the API Explorer to: Get a list of plugins, including their names, IDs, and GUIDs. List one or more plugin components, their output, and their metric timeslice data. Developers and New Relic partners can also use New Relic's Plugin API to write an agent in any language that can work directly with the API for plugins. This allows you to send your own metric data to our plugins and view data received from the API in New Relic. See APIs in action For more on how you as a developer can optimize your ability to solve problems using New Relic, go to developer.newrelic.com. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application. In this guide, you are going to build a sample table using various New Relic One components. Before you begin If you haven't already installed the New Relic One CLI, step through the quick start in New Relic One. This process also gets you an API key. In addition, to complete the steps in this guide, you need a GitHub account, and to have Node.js installed on your machine. See [Setting up your development environment](/build-apps/set-up-dev-env) for more info. Clone and set up the example application Step 1 of 4 Clone the nr1-how-to example application from GitHub to your local machine. Then, navigate to the app directory. The example app lets you experiment with tables. git clone https://github.com/newrelic/nr1-how-to.git` cd nr1-how-to/create-a-table/nerdlets/create-a-table-nerdlet` Copy Step 2 of 4 Edit the index.json file and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install dependencies nr1 nerdpack:serve # Serve the demo app locally Copy Step 4 of 4 Open one.newrelic.com/?nerdpacks=local in your browser. Click Apps*, and then in the Other apps section, you should see a Create a table** launcher. That's the demo application you're going to work on. Go ahead and select it. Have a good look at the demo app. There's a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You'll use Table components to add a new table in the second row. Work with table components Step 1 of 10 Navigate to the `nerdlets/create-a-table-nerdlet` subdirectory and open the `index.js` file. Add the following components to the import statement at the top of the file so that it looks like the example: Table TableHeader TableHeaderCell TableRow TableRowCell import { Table, TableHeader, TableHeaderCell, TableRow, TableRowCell, PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart, } from 'nr1'; Copy Step 2 of 10 Add a basic Table component Locate the empty GridItem in index.js: This is where you start building the table. Add the initial component. The items property collects the data by calling _getItems(), which contains sample values.
; Copy Step 3 of 10 Add the header and rows As the Table component renders a fixed number of header cells and rows, your next step is adding header components, as well as a function that returns the required table rows. Inside of the Table component, add the TableHeader and then a TableHeaderCell child for each heading. Since you don't know how many rows you'll need, your best bet is to call a function to build as many TableRows as items returned by _getItems(). Application Size Company Team Commit ; { ({ item }) => ( {item.name} {item.value} {item.company} {item.team} {item.commit} ); } Copy Step 4 of 10 Take a look at the application running in New Relic One: you should see something similar to the screenshot below. Step 5 of 10 Replace standard table cells with smart cells The New Relic One library includes cell components that can automatically format certain data types, like users, metrics, and entity names. The table you've just created contains columns that can benefit from those components: Application (an entity name) and Size (a metric). Before you can use EntityTitleTableRowCell and MetricTableRowCell, you have to add them to the import statement first. import { EntityTitleTableRowCell, MetricTableRowCell, ... /* All previous components */ } from 'nr1'; Copy Step 6 of 10 Update your table rows by replacing the first and second TableRowCells with entity and metric cells. Notice that EntityTitleTableRowCell and MetricTableRowCell are self-closing tags. { ({ item }) => ( {item.company} {item.team} {item.commit} ); } Copy Step 7 of 10 Time to give your table a second look: The cell components you've added take care of properly formatting the data. Step 8 of 10 Add some action to your table! Tables are great, but interactive tables can be better: As a last update, you are going to allow users to act on each data row. Add the _getActions() method to your index.js file, right before _getItems(). As you may have guessed from the code, _getActions() spawns an alert box when you click Team or Commit cells. _getActions() { return [ { label: 'Alert Team', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__ALERT, onClick: (evt, { item, index }) => { alert(`Alert Team: ${item.team}`); }, }, { label: 'Rollback Version', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__UNDO, onClick: (evt, { item, index }) => { alert(`Rollback from: ${item.commit}`); }, }, ]; } Copy Step 9 of 10 Find the TableRow component in your return statement and point the actions property to _getActions(). The TableRow actions property defines a set of actions that appear when the user hovers over a table row. Actions have a mandatory text and an onClick callback, but can also display an icon or be disabled if needed. Copy Step 10 of 10 Go back to your application and try hovering over any of the rows: Notice how the two available actions appear. When you click them, a function triggers with the selected row data as an argument, and an alert displays in your browser. Next steps You've built a table into a New Relic One application, using components to format data automatically and provide contextual actions. Well done! Keep exploring the Table components, their properties, and how to use them, in our SDK documentation.", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / APIs / Get started / Intro to APIs", - "info": "An introduction to all of the available New Relic APIs. ", - "nodeid": 15691, + "info": "Add a table to your New Relic One app.", "sections": [ - "Get started", - "Intro to APIs", - "Introduction to New Relic APIs", - "NerdGraph (GraphQL)", - "REST APIs by capability", - "Telemetry APIs for core data types", - "Account management, admin, and usage APIs", - "Other APIs", - "See APIs in action", - "For more help" + "Add tables to your New Relic One application", + "Before you begin", + "Clone and set up the example application", + "Work with table components", + "Next steps" ], - "title": "Introduction to New Relic APIs", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/apis/get-started/intro-apis/introduction-new-relic-apis", + "title": "Add tables to your New Relic One application", "popularity": 1, - "external_id": "bb3a7314b2407cfa765425553484cb364e27e7e3", - "category_1": "Get started", - "category_2": "Intro to APIs", - "image": "", - "url": "https://docs.newrelic.com/docs/apis/get-started/intro-apis/introduction-new-relic-apis", - "published_at": "2020-08-15T02:10:32Z", - "updated_at": "2020-08-10T01:40:52Z", - "category_0": "APIs", + "external_id": "7ff7a8426eb1758a08ec360835d9085fae829936", + "image": "https://developer.newrelic.com/static/e637c7eb75a9dc01740db8fecc4d85bf/1d6ec/table-new-cells.png", + "url": "https://developer.newrelic.com/build-apps/howto-use-nrone-table-components/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-14T01:46:10Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.11196153, + "_score": 0.20037782, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Introduction to New Relic APIs", - "sections": "Telemetry APIs for core data types", - "info": "An introduction to all of the available New Relic APIs. ", - "category_0": "APIs", - "category_2": "Intro to APIs", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/apis/get-started/intro-apis/introduction-new-relic-apis", - "body": ". Telemetry APIs for core data types We offer several APIs that allow you to get our core data types (metrics, logs, traces, and events) into New Relic without the use of an installed agent. Data type Description Trace API Send distributed tracing data to New Relic. Event API Send event data to New" + "title": "Add tables to your New Relic One application", + "sections": "Add tables to your New Relic One application", + "info": "Add a table to your New Relic One app.", + "body": " and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create" }, - "id": "5d4ae71be7b9d211b4d535a4" + "id": "5efa989ee7b9d2ad567bab51" }, { - "body": "Information about New Relic Trace API data requirements, including: Data specifications and max limits Required metadata (headers, query parameters) Response validation details This document applies to the entire Trace API. For rules regarding specific data formats, see: New Relic-format trace data Zipkin-format trace data Endpoint details and maximum limits All trace data is sent via a POST to: https://trace-api.newrelic.com/trace/v1 If your account hosts data in the EU data center, ensure you're using the proper API endpoints for EU region accounts. Currently, the Trace API accepts two types of data formats: zipkin: For reporting Zipkin trace data. Zipkin data must be Zipkin JSON v2. newrelic: For reporting all other trace data. Data limits and rules: Condition Limit with subscription Max age of span timestamp values 20 minutes. timestamp must be within 20 minutes of current time at ingest, or within 20 minutes from the time the last span with the same trace.id was received by New Relic. Max payload size 1 MB (gzip compression supported) Max requests per minute 100K Max spans per minute per account family Dependent on agreement. Max limit: 2M. Max spans per trace 50K Max attributes per span 200 Max span attribute value length 4000 characters Allowed HTTP protocols HTTPS only Cross-account visibility of span details Potential data obfuscation To see an example of how span limits are enforced, see Exceeding limits. Restricted attributes The attributes in the table below are restricted in the newrelic-format JSON (in the attributes block) and in the zipkin-format JSON (in the tags block). Any values with these keys will be omitted: Restricted attribute description entityGuid string Unique identifier for the entity that created this span. Generated from service.name, if available. guid string Used for backwards compatibility with data from New Relic APM agents. Request metadata (headers and query parameters) The following table shows the required request metadata for all trace data formats. This metadata can be sent as HTTP headers on an ingest request or, in some cases, provided as query parameters, which may be required for tracing frameworks that don't allow header modification. Security note: We suggest using headers because query parameters are present in the URL and may be logged before being encrypted and received by New Relic. All data sent as query parameters must be URL-safe. Header Query param? Details Content-Type No Required. Must be application/json. Content-Length No Required. The length of the request body in octets (8-bit bytes) unless sent with chunked encoding. This header is generally set by default by the underlying HTTP client sending the data and in most cases should not require any additional effort by the end user. Api-Key Yes (case-sensitive) Required. The Trace API requires the Event API insert key. If this is provided as both a header and a query parameter, the values must match. Content-Encoding No Required if compressed payload. The value must be gzip. Data-Format Yes Required for zipkin. Optional for newrelic. If present, Data-Format-Version must also be present. Data-Format-Version Yes Required for zipkin. If present, Data-Format must also be present. There are only two possible pairings for these values: If Data-Format is zipkin, Data-Format-Version must be 2. If Data-Format is newrelic, Data-Format-Version must be 1. x-request-id No Optional - Reserved for future use. The value must be a valid UUID4. The value is expected to be unique for each request. Response validation A response for successfully sending trace data will include a requestId. For example: {\"requestId\":\"c1bb62fc-001a-b000-0000-016bb152e1bb\"} There are two ways success/errors are signaled: HTTP status code (synchronous). Authentication and request errors will be signaled via HTTP status code. See HTTP status codes Code Meaning 202 Data accepted. This means that you've passed preliminary checks, but is not a guarantee that the data has been successfully parsed and indexed as part of a distributed trace. 400 The structure of the request was invalid. Errors with query parameters, etc. 403 Authentication error. May occur with an invalid license key or if you lack necessary entitlement to use the Trace API. 404 The request path is incorrect. 405 For any request method other than POST. 408 The request took too long to reach the endpoint. 411 The Content-Length header wasn’t included. 413 The payload was too big. 414 The request URI was too long. 415 The Content-Type or Content-Encoding was invalid. 429 The request rate quota has been exceeded. 431 The request headers are too long. 5xx There was a server error (please retry). NrIntegrationError events (asynchronous). Errors with the JSON payload or other semantic errors are asynchronously signaled via NrIntegrationError events that are stored in the account whose license key is associated with the request. For all errors of this type, the attribute newRelicFeature will be Distributed Tracing and requestId will be the requestId from the endpoint response. If you receive a 202 response and don't see an NrIntegrationError event, your data should be visible in New Relic One's global distributed tracing UI in about a minute. You should be able to find the trace using a standard trace search like: traceId = TRACE_ID_SENT Exceeding span limits When you exceed your span rate limit, an NrIntegrationError event is generated. You can query rate limit messages with this NRQL: SELECT * FROM NrIntegrationError WHERE newRelicFeature = 'Distributed Tracing' AND category = 'RateLimit' AND rateLimitType = 'SpansPerMinute' To get a notification when you exceed the limit, you can set up a NRQL alert. We calculate a rolling 10-minute average based on your span rate limit. This allows for temporary rate bursts, and lets us prioritize keeping and dropping complete traces instead of indiscriminately dropping spans on a per minute limit basis. In the example below of exceeding the rate, the rate limit is the default 100,000 spans per minute. New Relic allows a burst above 100K for a couple of minutes without downsampling, because the remaining minutes in the 10-minute window averaged under 100K spans/minute. For the previous 10 minutes (8:50 - 9:00) the service received 60,000 spans/minute. Minute Spans sent to API Total for past 10 minutes 8:59 60,000 600,000 9:00 40,000 580,000 9:01 50,000 570,000 9:02 250,000 760,000 9:03 220,000 920,000 9:04 125,000 985,000 9:05 70,000 995,000 9:06 50,000 985,000 9:07 40,000 965,000 9:08 40,000 945,000 9:09 40,000 925,000 For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / Understand dependencies / Distributed tracing / Trace API", - "info": "For New Relic Trace API: requirements, rules, max limits, and validation rules and responses. ", - "nodeid": 35391, + "info": "Intro to New Relic One API components", "sections": [ - "Distributed tracing", - "Get started", - "Enable and configure", - "Other requirements", - "UI and data", - "Trace API", - "Troubleshooting", - "Trace API general requirements and limits", - "Endpoint details and maximum limits", - "Restricted attributes", - "Request metadata (headers and query parameters)", - "Response validation", - "Exceeding span limits", - "For more help" + "Intro to New Relic One API components", + "Components of the SDK", + "UI components", + "Chart components", + "Query and storage components", + "Platform APIs" ], - "title": "Trace API general requirements and limits ", + "title": "Intro to New Relic One API components", "popularity": 1, - "external_id": "9558eae24905dbe37b40d6e428ce551721bc188f", - "category_1": "Distributed tracing", - "category_2": "Trace API", + "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2", "image": "", - "url": "https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/trace-api/trace-api-general-requirements-limits", - "published_at": "2020-08-15T04:17:58Z", - "updated_at": "2020-07-31T01:48:53Z", - "category_0": "Understand dependencies", + "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-14T01:47:12Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.10384698, + "_score": 0.19302298, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Trace API general requirements and limits ", - "sections": "Trace API", - "info": "For New Relic Trace API: requirements, rules, max limits, and validation rules and responses. ", - "category_1": "Distributed tracing", - "category_2": "Trace API", - "body": " sending the data and in most cases should not require any additional effort by the end user. Api-Key Yes (case-sensitive) Required. The Trace API requires the Event API insert key. If this is provided as both a header and a query parameter, the values must match. Content-Encoding No Required", - "breadcrumb": "Contents / Understand dependencies / Distributed tracing / Trace API" + "body": ". They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet" }, - "id": "5d8a2ac764441f19066f6f4d" + "id": "5efa989e28ccbc4071307de5" } ], - "/collect-data/query-data-nrql": [ + "/terms": [ { - "body": "APM reports metric data in the form of metric timeslice data, and you can use NRQL to query and facet this type of data. Why query metric timeslice data? We report metrics in several ways. One variety of metric data we call metric timeslice data; this is the type of data used to generate many of the charts in APM, Mobile, and Browser (for more details, see metric timeslice data). Historically, this type of data couldn't be queried via our query language, NRQL. But now we are converting popular APM metrics from metric timeslice data to more-detailed dimensional metric data, which opens them up for querying via NRQL and via our NerdGraph API. This capability allows you to create powerful, in-depth custom visualizations of these important APM metrics. And this includes being able to query your custom metrics. Where to query? We recommend querying APM metric timeslice data using New Relic One query builder in advanced mode. This experience offers full NRQL functionality, and also gives helpful auto-complete suggestions and feedback on query errors. You can also incorporate NRQL queries in our NerdGraph (GraphQL) API. How to construct a query In APM, some charts have the option to view the NRQL query that generated that chart. This can be a good option for understanding how to query metrics. The NRQL query examined below is slightly modified from the error rate chart on the APM summary page. FROM Metric SELECT count(apm.service.error.count) / count(apm.service.transaction.duration) WHERE (entity.guid = 'AN_ENTITY_GUID') AND (transactionType = 'Web') SINCE 1 day ago TIMESERIES Here is a breakdown of how the parts of this query work: Query segment What does it do? FROM Metric Metric is one of our core data types, and metric timeslice data is stored as this data type. For general tips on querying Metric data, see Metric query examples. SELECT count(apm.service.error.count) / count(apm.service.transaction.duration) This math generates a count of errors out of a total count of transaction metrics. This query uses the converted metric names. Note that you can use other aggregator functions. WHERE (entity.guid = 'AN_ENTITY_GUID') You must specify at least one data source. You can select a single entity's GUID, as shown here, or you can select multiple sources. This query uses entity.guid, but you can also use appId or appName. AND (transactionType = 'Web') Sets the transaction type to web, meaning that background/non-web transactions won't be counted. SINCE 1 day ago Selecting a time range. TIMESERIES This optional clause displays the results in a time-based chart. For general information on NRQL syntax, including FROM, FACET, and TIMESERIES, see Intro to NRQL. For more queries, see Query examples. How metric timeslice data is converted The conversion of original APM metric timeslice metrics into dimensional metrics that are available for querying is an ongoing process and isn't complete. If you don't see a metric you're looking for in this section, see Generic queries. Here are how the original APM metric timeslice metrics are converted into dimensional metrics: Metric timeslice structure Dimensional metric structure APM metric names are represented as single strings of segments separated by forward slashes. For example, the “Datastore/statement/MySQL/users/select” metric represents the time spent in a select database operation on the users table. A single dimensional metric named apm.service.datastore.operation.duration represents the entire group of datastore metrics. This metric has three attributes representing the data values encoded into the metric name, datastoreType, table and operation: datastoreType = ‘MySQL’ table = ‘users’ operation = ‘select’ Some of the APM metrics made available as dimensional metrics: Metric name Description Attributes apm.service.cpu.usertime.utilization Time spent in user-mode code percentage apm.service.datastore.operation.duration Response time for database calls broken out by table operations datastoreType, table, operation apm.service.error.count Summary error count metrics transactionType apm.service.external.host.duration Response time for external calls broken out by external host name external.host apm.service.instance.count Count of the number of agent instances apm.service.memory.physical Process memory in MB apm.service.transaction.apdex Apdex scores per transaction transactionName, transactionType apm.service.transaction.duration Response time per transaction keyTransactionName, transactionName, transactionType apm.service.transaction.error.count Error counts per transaction keyTransactionName, transactionName, transactionType apm.service.transaction.external.duration External call response time by transaction type transactionType To understand more about the general structure of metric timeslice data, including some common examples, see Metric timeslice data. Attributes These attributes are available in addition to the metric-specific attributes listed in the APM dimensional metrics table above. Name Description appName The name of the application. appId The ID of the application. entity.guid The GUID of the application. host The host of the monitored process. host.bootId The ID of the boot of the host, if available. host.displayName The display_name of the host, if it was set in the agent. instanceName For Java APM agents, host : port metricName The name of the dimensional metric. metricTimesliceName The timeslice name of the legacy metric. Generic queries with the newrelic.timeslice.value metric For metrics that haven't been converted to dimensional metrics, or for your own custom metrics, we have a dimensional metric named newrelic.timeslice.value. We recommend using the dimensional metrics from the table above when possible. When to use newrelic.timeslice.value? Given a metric timeslice name, you can query to see if it has a converted dimensional metric equivalent with this syntax: from Metric SELECT uniques(metricName) where metricTimesliceName = 'Datastore/statement/MySQL/test/select' If the only metric name returned is newrelic.timeslice.value, you'll need to query your data using this general approach. Facet on a wildcarded metric name segment Some metric timeslice names include attribute values as segments of the metric name. For example, our APM agents report metrics by tracking the duration of external calls using this format: External/{externalHost}/all Here, {externalHost} represents the host name for the outbound network call. Here's an example of a generic newrelic.timeslice.value query of a custom metric that facets on a wildcarded metric segment: FROM Metric SELECT count(newrelic.timeslice.value) WHERE appName = 'MY APP' WITH METRIC_FORMAT 'Custom/Labels/{action}' TIMESERIES FACET action In this query, {action} creates a temporary attribute, action, which is then used by FACET action. You can use any name you want, because it's only an attribute that exists for the duration of the query. You should choose a name that does not conflict with an existing attribute name. Here's another example of a faceted wildcard query: This shows a NRQL query of metric timeslice data that facets the rate of Flask functions by the wildcarded process name. Recommended aggregator functions Recommended NRQL aggregator functions include: apdex average sum count rate uniques Query examples Some examples of querying metric timeslice data: Facet by multiple app names This query uses WHERE… IN to specify two applications and then facet by them: FROM Metric SELECT rate(count(apm.service.transaction.duration), 1 minute) as 'Web throughput' WHERE appName IN ('MY_APPLICATION', 'MY_OTHER_APPLICATION') AND (transactionType = 'Web') FACET appName TIMESERIES Throughput-per-minute rate This query displays requests-per-minute chart using the rate function: FROM Metric SELECT rate(count(apm.service.transaction.duration), 1 minute) as 'HttpDispatcher requests_per_minute' WHERE appName = 'MY_APPLICATION' AND (transactionType = 'Web') TIMESERIES SINCE 3 days ago Facet by host-related attributes This query displays a requests-per-minute chart faceted by host name: FROM Metric SELECT count(apm.service.transaction.duration) as 'HttpDispatcher requests_per_minute' WHERE appName = 'MY_APPLICATION' AND (transactionType = 'Web') TIMESERIES SINCE 3 hours ago FACET host LIMIT 20 Instead of using host, you can facet by other host-related attributes, like host.bootId. Query of average duration of a metric This queries the average duration for a metric using average: FROM Metric SELECT average(apm.service.transaction.duration) as 'HttpDispatcher average duration' WHERE appName = 'MY_APPLICATION' AND (transactionType = 'Web') TIMESERIES SINCE 3 days ago For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "body": "The REST API endpoints allow you to create conditions for your policies. This glossary contains the names and descriptions of each of the fields that you can use to define or update a condition. Required and optional fields The API includes four types of New Relic Alerts conditions: APM External services Synthetic monitoring Plugins All of the fields used with a specific condition type are required except for these optional fields: enabled (defaults to false) runbook_url user_defined Field definitions Not every field listed in this glossary is required for every condition type. The condition type for which a field must be used is listed in each description. condition_scope This field allows you to scope a condition to either a JVM instance or to a whole application. This may be one of the strings: instance application Used for: Conditions Entity conditions For instance-based and JVM health metrics, see also violation_close_timer. enabled This is the status of your alert condition and is optional. The default is false. This field may be used to enable or disable a condition for maintenance or testing periods. Used for: Conditions External service conditions Synthetic monitoring conditions Plugin conditions entities This is an array of entity IDs identifying the objects which will be monitored with your condition. These may be application IDs, browser IDs, plugin IDs, key transaction IDs, external service IDs, etc. These are entered as a series of comma separated integers if there is more than one. Used for: Conditions External service conditions Plugin conditions expected_groups This is the number of groups you expect to see at any given time. It is used in combination with the ignore_overlap option. Used for: NRQL outlier conditions external_service_url This is the URL of the external service to be monitored. This string must not include the protocol. For example, use example.com, not https://example.com. Used for: External service conditions ignore_overlap If disabled, this looks for a convergence (or overlapping) of groups. If the condition is looking for two or more groups, and the returned values can't be separated into that number of distinct groups, then that will also produce a violation. This type of overlap event is represented on a chart by group bands touching. Used for: NRQL outlier conditions metric The metric field is used for three alert categories. The exact parameters available for use depend on the setting in the type field. These are listed below according to their alert type field. Alerts plugin conditions For Plugin conditions this is the metric, which has been defined in a plugin, that will be used to trigger a notification. Alerts conditions The value specified in the type field controls which of the parameters may be specified. The type field and corresponding available parameter names are listed in the following table. Only one may be specified. type Parameter apm_app_metric apdex error_percentage response_time_web response_time_background throughput_web throughput_background user_defined apm_kt_metric apdex error_percentage error_count response_time throughput browser_metric end_user_apdex total_page_load page_rendering web_application network dom_processing request_queuing ajax_response_time page_views_with_js_errors page_view_throughput ajax_throughput user_defined browser_metric_baseline page_view_throughput average_response_time ajax_response_time ajax_application_time mobile_metric database images json, network view_loading network_error_percentage status_error_percentage user_defined Alerts external service conditions The value specified in the type field controls which of the parameters may be specified. The type field and corresponding available parameter names are listed in the following table. Only one may be specified. type Parameter apm_external_service apdex error_percentage response_time_web response_time_background throughput_web throughput_background user_defined apm_app_metric_baseline external_service_transaction_time error_count database_transaction_time throughput_web response_time_web non_web_transaction_time web_transaction_database_time non_web_transaction_database_time mobile_external_service response_time_average response_time_minimum response_time_maximum throughput network_failure_percentage http_status_error_percentage metric_description This is a title for the metric which is displayed in notifications. Make this descriptive and unique so the reader will understand the nature of plugin metric being used to trigger an alert. Used for: Plugin conditions monitor_id This is the GUID of the Synthetic monitoring to alert on. Used for: Synthetic monitoring conditions name This condition title will allow to you identify it in the UI. Follow the guidelines for making this descriptive but short. Used for: Conditions External service conditions Synthetic monitoring conditions Plugin conditions nrql[query] This is the NRQL query that alerts monitors as part of a NRQL condition. Used for: NRQL conditions nrql[since_value] This is the timeframe (in minutes) in which to evaluate the specified NRQL query. since_value must be between 1 and 20. Used for: NRQL conditions plugin[guid] This is the GUID of the plugin for which the trigger is being defined. Used for: Plugin conditions plugin[id] This is the ID of the plugin for which the trigger is being defined. Used for: Plugin conditions runbook_url The runbook URL to display in notifications. This field is optional. Used for: Conditions External service conditions Synthetic monitoring conditions Plugin conditions terms[duration] This is the time (in minutes) for the condition to persist before triggering an event. It corresponds to the duration set when adding a threshold in the UI. Used for: Conditions terms[operator] This determines what comparison will be used between the value_function and the terms[threshold] value to trigger an event. It corresponds to the operation selected when adding a threshold in the UI. It must be one of the following strings: above below equal Used for: Conditions External service conditions Plugin conditions terms[priority] This corresponds to the severity level selected when setting the threshold values for the condition in the UI. This must be one of the following strings: critical warning Used for: Conditions External service conditions Plugin conditions terms[threshold] This is the threshold that the value_function must be compared to using the terms[operator] for an event to be triggered. It corresponds to the numeric value specified in the UI when adding the threshold values. This is a numeric value and must be 0 (zero) or greater. Used for: Conditions External service conditions Plugin conditions terms[time_function] This corresponds to the settings made in the UI when adding the threshold values. The choices are: all (corresponding to for at least in the UI) any (corresponding to at least once in in the UI) Used for: Conditions External service conditions Plugin conditions type This defines the type of metric that will be used for the alert. Allowable content for the metric field depends on the type value chosen. There are two product categories : Alerts conditions For this category, type is set to one of the following strings indicating the type of alerts condition. type Use apm_app_metric APM application metric will trigger an alert. apm_app_metric_baseline APM application metric will trigger an alert (using a baseline threshold). apm_kt_metric APM key transaction metric will trigger an alert. browser_metric Browser metric will trigger an alert. browser_metric_baseline Browser metric will trigger an alert (using a baseline threshold). mobile_metric Mobile metric will trigger an alert. Used for: Conditions Alerts external service conditions For this category, type is set to one of the following strings indicating the type of external service condition. type Use apm_external_service APM external metric will trigger an alert. mobile_external_service Mobile external metric will trigger an alert. Used for: External service conditions user_defined[metric] (optional) This is the name of a user defined custom metric to be used to determine if an event should be triggered. The user_defined[value_function] associated with the metric is compared with the terms[threshold] value when evaluating if an incident should be triggered. The comparison is performed using the operator defined by terms[operator]. Used for: Conditions External service conditions Synthetic monitoring conditions Plugin conditions user_defined[value_function] (optional) This is the numeric value obtained from the custom metric specified by user_defined[metric]. It is compared with the terms[threshold] value when evaluating if an incident should be triggered. The comparison is performed using the operator defined by terms[operator]. One of these value functions must be specified: average min max total sample_size Used for: Conditions value_function This is the value function used from the plugin metric. This may be one of the strings: min max average sample_size total percent Used for: Plugin conditions When used for a NRQL condition, the options are: single_value (condition is evaluated based on each query's returned value) sum (condition is evaluated based on the sum of each query's returned values over the specified duration) violation_time_limit_seconds Use to automatically close instance-based violations after the number of seconds specified. Must be one of these values: 3600 7200 14400 28800 43200 86400 Used for: Location conditions NRQL conditions violation_close_timer Use to automatically close instance-based violations, including JVM health metric violations, after the number of hours specified. Must be one of these values: 1 2 4 8 12 24 Used for: apm_app_metric (with condition_scope set to instance) apm_jvm_metric For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "type": "docs", "document_type": "page", - "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / NRQL query tutorials", - "info": "In New Relic, you can query metric timeslice data from APM using NRQL. ", - "nodeid": 36916, + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / REST API alerts", + "info": "This glossary defines the alerts API fields, and provides links to relevant content to help better understand each one.", + "nodeid": 9276, "sections": [ - "NRQL: New Relic Query Language", + "New Relic Alerts", "Get started", - "NRQL query tools", - "NRQL query tutorials", - "Query APM metric timeslice data with NRQL", - "Why query metric timeslice data?", - "Where to query?", - "How to construct a query", - "How metric timeslice data is converted", - "Attributes", - "Generic queries with the newrelic.timeslice.value metric", - "When to use newrelic.timeslice.value?", - "Facet on a wildcarded metric name segment", - "Recommended aggregator functions", - "Query examples", + "Alert policies", + "Alert conditions", + "Alert violations", + "Alert Incidents", + "Alert notifications", + "Troubleshooting", + "Rules, limits, and glossary", + "Alerts and Nerdgraph", + "REST API alerts", + "Alerts conditions API field names", + "Required and optional fields", + "Field definitions", "For more help" ], - "title": "Query APM metric timeslice data with NRQL", + "title": "Alerts conditions API field names", "popularity": 1, - "external_id": "f536406572d7d2aafd2df6acd5da36a035ef82c3", - "category_1": "NRQL: New Relic Query Language", - "category_2": "NRQL query tutorials", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-one-nrql-query-metric-timeslice-data.png", - "url": "https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/nrql-query-tutorials/query-apm-metric-timeslice-data-nrql", - "published_at": "2020-08-15T03:15:39Z", - "updated_at": "2020-08-15T03:15:39Z", - "category_0": "Query your data", + "external_id": "08f92bd7e576017eb032cdd843c616c7c04fba11", + "category_1": "New Relic Alerts", + "image": "", + "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/rest-api-alerts/alerts-conditions-api-field-names", + "published_at": "2020-08-18T04:25:33Z", + "updated_at": "2020-08-15T13:54:16Z", + "category_0": "Alerts and Applied intelligence", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.1998386, + "_score": 0.0668915, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Query APM metric timeslice data with NRQL", - "sections": "Query APM metric timeslice data with NRQL", - "info": "In New Relic, you can query metric timeslice data from APM using NRQL. ", - "category_0": "Query your data", - "category_1": "NRQL: New Relic Query Language", - "category_2": "NRQL query tutorials", - "body": "APM reports metric data in the form of metric timeslice data, and you can use NRQL to query and facet this type of data. Why query metric timeslice data? We report metrics in several ways. One variety of metric data we call metric timeslice data; this is the type of data used to generate many", - "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / NRQL query tutorials" + "title": "Alerts conditions API field names", + "sections": "Alert conditions", + "info": "This glossary defines the alerts API fields, and provides links to relevant content to help better understand each one.", + "category_0": "Alerts and Applied intelligence", + "body": ". Used for: Plugin conditions runbook_url The runbook URL to display in notifications. This field is optional. Used for: Conditions External service conditions Synthetic monitoring conditions Plugin conditions terms[duration] This is the time (in minutes) for the condition to persist before triggering" }, - "id": "5f2b1349196a67379343fbcf" + "id": "5f2dee1128ccbc1e7588dff5" }, { - "body": "You can use NRQL to query the application data collected by New Relic APM, New Relic Browser, and New Relic Mobile. You can then use this data to answer a variety of questions. Here are some basic examples. Unique users How many unique user sessions did you have in the last week? SELECT uniqueCount(session) FROM PageView SINCE 1 week ago Unique user trends Were your unique user sessions up or down last week compared to the week before? SELECT uniqueCount(session) FROM PageView SINCE 1 week ago COMPARE WITH 1 week ago Pageview trends How can I graph the number of unique users yesterday compared to the day before? SELECT count(*) FROM PageView SINCE 1 day ago COMPARE WITH 1 day ago TIMESERIES AUTO OS version How many of your mobile users are on the latest OS version? SELECT uniqueCount(uuid) FROM MobileSession FACET osVersion SINCE 7 days ago Key account Apdex What is the Apdex score for a particularly important customer? If you have defined some custom attributes, you can query to monitor how this customer experiences your app from a performance standpoint: SELECT apdex(duration, t: 0.4) FROM Transaction WHERE customerName='ReallyImportantCustomer' SINCE 1 day ago For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "body": "As a customer, you are eligible to participate in New Relic’s Developer Program. Additional information and resources are available at New Relic’s Developer Program site. By downloading, accessing, or using the developer resources (including the CLI), you agree that usage of the developer resources is pursuant to the New Relic Developers Terms and Conditions and that you have the authority to bind your organization. Such terms do not have to be signed in order to be binding. If you do not agree to these terms and conditions, your sole remedy is to not use these developer resources. If your use of the New Relic developer resources are covered under a separate agreement, the above does not apply to you. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "type": "docs", "document_type": "page", - "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / NRQL query tutorials", - "info": "Basic examples of using NRQL to query app data collected by New Relic products.", - "nodeid": 11996, + "breadcrumb": "Contents / Licenses / Product or service licenses / Developer Edition", + "info": "New Relic Developer edition policy", + "nodeid": 39641, "sections": [ - "NRQL: New Relic Query Language", - "Get started", - "NRQL query tools", - "NRQL query tutorials", - "App data NRQL query examples", - "Unique users", - "Unique user trends", - "Pageview trends", - "OS version", - "Key account Apdex", + "Product or service licenses", + "New Relic One", + "APM", + "Browser", + "Developer Edition", + "Infrastructure", + "Insights", + "Logs", + "Mobile", + "Synthetics", + "Mobile apps", + "Plugins", + "Miscellaneous", + "Developer Program Resources", "For more help" ], - "title": "App data NRQL query examples", + "title": "Developer Program Resources", "popularity": 1, - "external_id": "73d096e7e4470dd2fe07eb3aebc18271fc13a243", - "category_1": "NRQL: New Relic Query Language", - "category_2": "NRQL query tutorials", + "external_id": "98308cfffa652e4c25967e1be5b848b9c28ca410", + "category_1": "Product or service licenses", + "category_2": "Developer Edition", "image": "", - "url": "https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/nrql-query-tutorials/app-data-nrql-query-examples", - "published_at": "2020-08-15T09:00:28Z", - "updated_at": "2020-08-05T14:57:07Z", - "category_0": "Query your data", + "url": "https://docs.newrelic.com/docs/licenses/product-or-service-licenses/new-relic-developer-edition/developer-program-resources", + "published_at": "2020-08-18T17:43:42Z", + "updated_at": "2020-08-08T19:17:02Z", + "category_0": "Licenses", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.1477018, + "_score": 0.060060218, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "App data NRQL query examples", - "sections": "App data NRQL query examples", - "info": "Basic examples of using NRQL to query app data collected by New Relic products.", - "category_0": "Query your data", - "category_1": "NRQL: New Relic Query Language", - "category_2": "NRQL query tutorials", - "body": "You can use NRQL to query the application data collected by New Relic APM, New Relic Browser, and New Relic Mobile. You can then use this data to answer a variety of questions. Here are some basic examples. Unique users How many unique user sessions did you have in the last week? SELECT uniqueCount", - "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / NRQL query tutorials" + "body": " is pursuant to the New Relic Developers Terms and Conditions and that you have the authority to bind your organization. Such terms do not have to be signed in order to be binding. If you do not agree to these terms and conditions, your sole remedy is to not use these developer resources. If your" }, - "id": "5f306ff2e7b9d226eac9debb" + "id": "5f338507e7b9d2f670c9de83" }, { - "body": "Add custom attributes to your New Relic data There are countless filters and pivots you might want to apply to your data. By adding custom attributes to your data, you can see beyond your code and analyze your business in-depth. A common pattern when using custom attributes is to capture user information, e.g. name, id, email, etc. This allows you to 'link' your operational data with your business data. For example, if you have the user information, you tie together your service desk and CRM data with the operational data in New Relic. Step 1 of 2 You can add a userid custom attribute to your APM-reported data (Transaction and TransactionError events) with the opensource Java APM agent's API. NewRelic.addCustomParameter('userid', userId); Copy Step 2 of 2 Once added, you can run a NRQL query that uses the 'userid' custom attribute. Once you have added a custom attribute like 'userid', you can use it to filter and facet your NRQL queries. -- Get a count of errors experienced by a single filtered userid faceted by date and error message SELECT count(*) FROM TransactionError WHERE userid = '1401961100' FACET dateOf(timestamp), `error.message` SINCE 1 week ago Copy", - "type": "developer", - "document_type": "page", - "info": "Add metadata for more detailed analysis", + "body": "logo-newrelic Search Products Pricing Solutions Help Center About New Relic for iOS or Android    New Relic Insights App for iOS Search icon Sign Up Log In Products New Relic One Platform Overview Telemetry Data Platform Full-Stack Observability Applied Intelligence Solutions By Topic DevOps Cloud Adoption Cloud Native Digital Customer Experience By Industry E-commerce and Retail Media Public Sector By Technology Amazon Web Services Pivotal Cloud Foundry Microsoft Azure Google Cloud Platform Kubernetes Help Center Learn Docs Build on New Relic Explore open source projects Training Get help Community forum Global technical support Expert services About Our Customers Over 17,000 customers love New Relic, from Fortune 500 enterprises to small businesses around the globe. Our Blog The latest news, tips, and insights from the world of New Relic and digital intelligence. Our Company About Us Leadership Meetups and Events Resources   Investor Relations Newsroom Partner Program Contact Us logo-newrelic Want to use our logo? There's a page for that, including instructions and different styles and formats. Sorry about grabbing your right-click. Just trying to be helpful. You can also go home. Back to top icon New Relic Inc. Terms of Service Paid Accounts Customers that access New Relic’s platform through a paid subscription are governed by the Terms of Service set forth immediately above. Unpaid Accounts Customers that access New Relic’s platform on an unpaid (e.g. trials, proof of concepts, New Relic Developer Edition or ‘lite’) basis are governed by the Terms of Service set forth immediately above. Community Forums Community Forum participants ask and answer questions about New Relic’s platform.  Use of the Community Form is governed by the terms and conditions set forth immediately above. New Relic Data Processing Addendum Customers who currently send, or intend to send, personal data to the New Relic Services for processing should download and complete the Data Processing Addendum set forth immediately above. Data Processing Addendum FAQ  This guide is designed to assist customers in their completion of the New Relic Data Processing Addendum. COMPANY Careers and Culture Partner Program Investor Relations NewRelic.org Suppliers Portal CONNECT Contact Us Request Demo Events international newrelic.co.jp (Japanese) newrelic.fr (French) newrelic.de (German) Terms of Service DMCA Policy Privacy Policy Cookie Policy UK Slavery Act of 2015 ©2008-20 New Relic, Inc. All rights reserved", + "type": "", + "info": "", "sections": [ - "Add custom attributes to your New Relic data" + "Terms of Service", + "COMPANY", + "CONNECT", + "international" ], - "title": "Add custom attributes to your New Relic data", + "title": "Terms of Service Agreement | New Relic", "popularity": 1, - "tags": [ - "Custom Attributes", - "NRQL" - ], - "external_id": "b7c3eb72c1c275d97df9c6232d50bd675ac2e39a", - "image": "https://developer.newrelic.com/static/2dd8a32b57677b2e8d2497147d8ebc26/2663f/custom-attribute-query.png", - "url": "https://developer.newrelic.com/collect-data/custom-attributes/", - "published_at": "2020-08-17T01:54:02Z", - "updated_at": "2020-08-04T01:39:41Z", + "external_id": "f1539ad0dbd46a29c243907400c646ed11c33bd1", + "image": "https://newrelic.com/content/dam/new-relic/opengraph/NROG_Image.png", + "url": "https://newrelic.com/termsandconditions/terms", + "published_at": "2020-08-18T02:00:39Z", + "updated_at": "2020-07-30T07:25:28Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.10260282, + "_score": 0.059077285, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Add custom attributes to your New Relic data", - "sections": "Add custom attributes to your New Relic data", - "tags": "NRQL", - "body": " APM-reported data (Transaction and TransactionError events) with the opensource Java APM agent's API. NewRelic.addCustomParameter('userid', userId); Copy Step 2 of 2 Once added, you can run a NRQL query that uses the 'userid' custom attribute. Once you have added a custom attribute like 'userid" + "title": "Terms of Service Agreement | New Relic", + "sections": "Terms of Service", + "body": " of concepts, New Relic Developer Edition or ‘lite’) basis are governed by the Terms of Service set forth immediately above. Community Forums Community Forum participants ask and answer questions about New Relic’s platform.  Use of the Community Form is governed by the terms and conditions set forth" }, - "id": "5efa999de7b9d2985d7bab67" + "id": "5ac68e78c75d077fcb6edc38" }, { - "body": "Collect data Through our opensource agents or APIs, New Relic makes it easy to collect data from any source. The guides in this section provide strategies for collecting and querying data for use in your existing implementation, or in apps you build. The opportunities are endless. Guides to collect data 15 min Collect data - any source APIs, agents, OS emitters - get any data 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 10 min Query data with NRQL Query default event data, custom events, and attributes   Add custom attributes Use custom attributes for deeper analysis", - "type": "developer", + "body": "As a customer with a paid subscription to New Relic products, you are eligible to participate in preview access of the New Relic One platform (e.g. Telemetry Data Platform, Full Stack Observability, and Applied Intelligence products) for the period beginning July 31, 2020 and ending December 31, 2020 (“Preview Access”). BY DOWNLOADING, ACCESSING, INDICATING YOUR AGREEMENT TO, OR USING THE PREVIEW ACCESS PRODUCTS, YOU AGREE THAT YOUR PREVIEW ACCESS USAGE IS PURSUANT TO THESE SEPARATE TERMS AND CONDITIONS IN LIEU OF ANY OTHER TERMS. These terms do not have to be signed in order to be binding. If you do not agree to these terms and conditions, your sole remedy is to not participate in Preview Access. New Relic reserves the right to terminate or restrict Preview Access, in whole or in part, at any time. Notwithstanding the foregoing and any other materials provided by New Relic, select customers are ineligible for the Preview Access. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", + "breadcrumb": "Contents / Licenses / Product or service licenses / New Relic One", "info": "", + "nodeid": 39366, "sections": [ - "Collect data", - "Guides to collect data", - "Collect data - any source", - "Create custom events", - "Build queries with NerdGraph", - "Query data with NRQL", - "Add custom attributes" + "Product or service licenses", + "New Relic One", + "APM", + "Browser", + "Developer Edition", + "Infrastructure", + "Insights", + "Logs", + "Mobile", + "Synthetics", + "Mobile apps", + "Plugins", + "Miscellaneous", + "Preview access for New Relic One", + "For more help" ], - "title": "Collect data", + "title": "Preview access for New Relic One", "popularity": 1, - "external_id": "fb5d6f75b61858b09e3e8c63f3b2af97813f47b6", + "external_id": "eae3865081d3bd8ad2dd8b6eaf0fe0147355360c", + "category_1": "Product or service licenses", + "category_2": "New Relic One", "image": "", - "url": "https://developer.newrelic.com/collect-data/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-17T01:55:15Z", + "url": "https://docs.newrelic.com/docs/licenses/product-or-service-licenses/new-relic-one/preview-access-new-relic-one", + "published_at": "2020-08-18T11:19:02Z", + "updated_at": "2020-07-31T04:41:27Z", + "category_0": "Licenses", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.084585264, + "_score": 0.050509326, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Collect data", - "sections": "Query data with NRQL", - "body": " data 15 min Collect data - any source APIs, agents, OS emitters - get any data 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 10 min Query data with NRQL Query default event data, custom events, and attributes   Add custom attributes Use custom attributes for deeper analysis" + "body": ", 2020 (“Preview Access”). BY DOWNLOADING, ACCESSING, INDICATING YOUR AGREEMENT TO, OR USING THE PREVIEW ACCESS PRODUCTS, YOU AGREE THAT YOUR PREVIEW ACCESS USAGE IS PURSUANT TO THESE SEPARATE TERMS AND CONDITIONS IN LIEU OF ANY OTHER TERMS. These terms do not have to be signed in order to be binding" }, - "id": "5efa997328ccbc768c307de2" + "id": "5f23a0f7e7b9d29da9c82305" }, { - "body": "The Python agent supports asyncio event loop diagnostics. When there are transactions blocking or delaying an event loop, the agent is able to generate diagnostics to help find and resolve them. Requirements Requires Python agent version 5.0.0.124 or higher. View in New Relic UI In APM, your event loop transaction data will be in the transaction breakdown table and the trace details page. Event loop metrics will appear in the transaction Breakdown table: rpm.newrelic.com/apm > (select an app) > Monitoring > Transactions > (select a transaction): The transaction’s Breakdown table flags event loops with asyncio. Time spent waiting on other transactions will be shown in the transaction Trace details page: rpm.newrelic.com/apm > (select an app) > Transactions > (select a transaction trace) > Trace details: The Trace details page contains a table with breakdowns for each segment (method or function call) in a transaction trace. Event Loop NRQL Queries eventLoopTime and eventLoopWait attributes will be available via NRQL query. An example query might be: SELECT count(*) as 'count', average(eventLoopTime) as 'loopTime', average(eventLoopWait) as 'loopWait' FROM Transaction facet name In New Relic One, you might see results like this: one.newrelic.com > Query your data > Advanced (NRQL): Use advanced (NRQL) to write a query to find event loops. Where to diagnose event loops Event loop diagnostics will be available by default through our existing aiohttp, sanic, and Tornado instrumentation frameworks. Coroutines using the Python agent API background_task and web_transaction decorator APIs also support asyncio's event loops. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "New Relic Open Source External Projects Highlighted Projects New Relic Projects Menu External Projects Highlighted Projects New Relic Projects NEW RELIC, INC. INDIVIDUAL CONTRIBUTOR LICENSE AGREEMENT Thank you for your interest in contributing to the open source projects of New Relic, Inc. (“New Relic”). In order to clarify the intellectual property license granted with Contributions from any person or entity, New Relic must have a Contributor License Agreement (\"Agreement\") on file that has been signed by each Contributor, indicating agreement to the license terms below. This Agreement is for your protection as a Contributor as well as the protection of New Relic; it does not change your rights to use your own Contributions for any other purpose. You accept and agree to the following terms and conditions for Your present and future Contributions submitted to New Relic. Except for the licenses granted herein to New Relic and recipients of software distributed by New Relic, You reserve all right, title, and interest in and to Your Contributions. Definitions. \"You\" (or \"Your\") shall mean the copyright owner or legal entity authorized by the copyright owner that is entering into this Agreement with New Relic. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. \"Contribution\" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to New Relic for inclusion in, or documentation of, any of the products managed or maintained by New Relic (the \"Work\"). For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to New Relic or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, New Relic for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as \"Not a Contribution.\" Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to New Relic and to recipients of software distributed by New Relic a perpetual, worldwide, non-exclusive, no-charge, royalty-free, transferable, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to New Relic and to recipients of software distributed by New Relic a perpetual, worldwide, non-exclusive, no-charge, royalty-free, transferable, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contributions alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that Your Contribution, or the Work to which You have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed. You represent that You are legally entitled to grant the above licenses. If Your employer(s) has rights to intellectual property that You create that includes Your Contributions, You represent that You have received permission to make Contributions on behalf of that employer, that Your employer has waived such rights for Your Contributions to New Relic, or that Your employer has executed a separate Agreement with New Relic. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which You are personally aware and which are associated with any part of Your Contributions. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. Should You wish to submit work that is not Your original creation, You may submit it to New Relic separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which You are personally aware, and conspicuously marking the work as \"Submitted on behalf of a third-party: [named here] \". You agree to notify New Relic of any facts or circumstances of which You become aware that would make these representations inaccurate in any respect. New Relic Open Source Standards External Projects Highlighted Projects New Relic Projects Edit this page Create an issue Copyright © 2020 New Relic Inc.Version 1.8.4", + "type": "opensource", "document_type": "page", - "breadcrumb": "Contents / APM agents / Python agent / Supported features", - "info": "The Python agent supports asyncio event loop diagnostics, giving you insight into transactions delaying or blocking the completion of event loops.", - "nodeid": 38456, + "info": "", "sections": [ - "Python agent", - "Getting started", - "Installation", - "Configuration", - "Supported features", - "Back-end services", - "Custom instrumentation", - "API guides", - "Python agent API", - "Web frameworks and servers", - "Hosting services", - "Attributes", - "Troubleshooting", - "Python event loop diagnostics", - "Requirements", - "View in New Relic UI", - "Event Loop NRQL Queries", - "Where to diagnose event loops", - "For more help" + "NEW RELIC, INC.", + "INDIVIDUAL CONTRIBUTOR LICENSE AGREEMENT", + "Definitions." ], - "title": "Python event loop diagnostics", + "title": "New Relic Open Source Contributor License Agreement", "popularity": 1, - "external_id": "99e401f6e559d60ac3d2feaff5129472d30b4f59", - "category_1": "Python agent", - "category_2": "Supported features", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/python-event-loop-trace-details.png", - "url": "https://docs.newrelic.com/docs/agents/python-agent/supported-features/python-event-loop-diagnostics", - "published_at": "2020-08-15T12:30:52Z", - "updated_at": "2020-08-15T12:30:52Z", - "category_0": "APM agents", + "external_id": "478151b2a97835e82c3cd1eaa49610793dc56783", + "image": "", + "url": "https://opensource.newrelic.com/cla/", + "published_at": "2020-08-18T02:21:01Z", + "updated_at": "2020-08-13T01:57:04Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.033411164, + "_score": 0.04286772, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Event Loop NRQL Queries", - "body": " In New Relic One, you might see results like this: one.newrelic.com > Query your data > Advanced (NRQL): Use advanced (NRQL) to write a query to find event loops. Where to diagnose event loops Event loop diagnostics will be available by default through our existing aiohttp, sanic, and Tornado" + "body": " is for your protection as a Contributor as well as the protection of New Relic; it does not change your rights to use your own Contributions for any other purpose. You accept and agree to the following terms and conditions for Your present and future Contributions submitted to New Relic. Except" }, - "id": "5eb6bf2fe7b9d2792c4b8143" + "id": "5f31822264441fcbe056a984" } ], - "/build-apps/add-time-picker-guide": [ + "/collect-data/collect-data-from-any-source": [ { - "body": "Build apps You know better than anyone what information is crucial to your business, and how best to visualize it. Sometimes, this means going beyond dashboards to creating your own app. With React and GraphQL, you can create custom views tailored to your business. These guides are designed to help you start building apps, and dive into our library of components. We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a \"Hello, World!\" application Build a \"Hello, World!\" app and publish it to New Relic One 20 min Publish and deploy apps Start sharing the apps you build 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 30 min Add a table to your app Add a table to your New Relic One app 20 min Set up your development environment Prepare to build apps and contribute to this site 30 min Create a custom map view Build an app to show page view data on a map", - "type": "developer", + "body": "Our Telemetry SDKs are an open source set of API client libraries that send metrics and trace data to the New Relic platform. We offer open-source integrations for telemetry tools like Prometheus, Istio, and OpenCensus that were created using our Telemetry SDKs. If those solutions (or our other integrations) don't meet your needs, you can use the Telemetry SDKs to create your own telemetry data solutions. Requirements and compatibility To build with the Telemetry SDKs, you will need an Event API insert key. New Relic has contributed the Telemetry SDK to the open source community under an Apache 2.0 license. Available libraries The Telemetry SDKs are open source software on GitHub. Use the language-specific GitHub links below to get library details, coding examples, and procedures for how to use the SDKs. We currently support the following libraries, with more to be created in the future: Language Library Supported data types Java Java library on GitHub New Relic Metrics New Relic Traces Node/TypeScript NodeJS library on GitHub New Relic Metrics New Relic Traces Python Python library on GitHub New Relic Metrics New Relic Events New Relic Traces Go Go library on Github New Relic Metrics New Relic Traces .NET .NET library on GitHub .NET package in NuGet New Relic Metrics New Relic Traces For more on the supported data types: Metrics: see the Metric API Traces: see the Trace API Write your own Telemetry SDK or contribute to an existing one If you need a Telemetry SDK in a language that does not currently exist or want to contribute to an existing library, please see the Telemetry SDK specifications. Integrations built with the Telemetry SDKs To see the integrations built using our Telemetry SDKs, see Open source telemetry integrations. For all monitoring solutions, see our integrations page. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "", + "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs", + "info": "Report custom telemetry data with New Relic's open-source Telemetry SDKs.", + "nodeid": 35471, "sections": [ - "Build apps", - "Guides to build apps", - "Create a \"Hello, World!\" application", - "Publish and deploy apps", - "Add, query, and mutate data using NerdStorage", - "Add the NerdGraphQuery component to an application", - "Add a time picker to your app", - "Add a table to your app", - "Set up your development environment", - "Create a custom map view" + "Ingest and manage data", + "Get started", + "Understand data", + "Manage data", + "Ingest APIs", + "Telemetry SDKs: Report custom telemetry data", + "Requirements and compatibility", + "Available libraries", + "Write your own Telemetry SDK or contribute to an existing one", + "Integrations built with the Telemetry SDKs", + "For more help" ], - "title": "Build apps", + "title": "Telemetry SDKs: Report custom telemetry data", "popularity": 1, - "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", + "external_id": "47a4c8f38c1b1674504ea302d865fd499e90ea39", + "category_1": "Ingest and manage data", + "category_2": "Ingest APIs", "image": "", - "url": "https://developer.newrelic.com/build-apps/", - "published_at": "2020-08-17T01:50:24Z", - "updated_at": "2020-08-17T01:50:23Z", + "url": "https://docs.newrelic.com/docs/telemetry-data-platform/get-started/capabilities/telemetry-sdks-send-custom-telemetry-data-new-relic", + "published_at": "2020-08-18T15:15:03Z", + "updated_at": "2020-08-11T01:15:34Z", + "category_0": "Telemetry Data Platform", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.20110384, + "_score": 0.16237712, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Build apps", - "sections": "Add a time picker to your app", - "body": " component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 30 min Add a table to your app Add a table to your New Relic One app 20" + "title": "Telemetry SDKs: Report custom telemetry data", + "sections": "Telemetry SDKs: Report custom telemetry data", + "info": "Report custom telemetry data with New Relic's open-source Telemetry SDKs.", + "category_0": "Telemetry Data Platform", + "category_2": "Ingest APIs", + "body": " Metrics New Relic Traces .NET .NET library on GitHub .NET package in NuGet New Relic Metrics New Relic Traces For more on the supported data types: Metrics: see the Metric API Traces: see the Trace API Write your own Telemetry SDK or contribute to an existing one If you need a Telemetry SDK", + "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs" }, - "id": "5efa999d64441fc0f75f7e21" + "id": "5d89fefbe7b9d2537ed30dc1" }, { - "body": "Contain the complexity - Observability made simple New Relic’s Kubernetes cluster explorer empowers Kubernetes nerds to move beyond infrastructure metrics and investigate deeper into applications, traces, logs, and events—with a single click—while staying grounded in a centralized UI. Join us at KubeCon and CloudNativeCon Europe August 17-20 to learn more. Check out the complete schedule of New Relic talks to make the most of your KubeCon experience. Learn more. Get coding Create a free account 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events Start the guide 7 min Add tags to apps Add tags to applications you instrument for easier filtering and organization Start the guide 12 min Build a Hello, World! app Build a Hello, World! app and publish it to your local New Relic One Catalog Start the guide Get inspired 30 min Add a table to your app Add a table to your New Relic One app 15 min Collect data - any source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add a time picker to your app Add a time picker to a sample application   Add custom attributes Use custom attributes for deeper analysis Show 18 more guides Looking for more inspiration? Check out the open source projects built by the New Relic community. New Relic developer champions New Relic Champions are solving big problems using New Relic as their linchpin and are recognized as experts and leaders in the New Relic technical community. Nominate a developer champion Learn more about developer champions New Relic Podcasts We like to talk, especially to developers about developer things. Join us for conversations on open source, observability, software design and industry news. Listen", - "type": "developer", + "body": "There are many ways to get data into your New Relic account. Any New Relic user can use any of our data ingest methods to report data to our Telemetry Data Platform. New Relic-built agents and integrations When you enable New Relic solutions like APM, browser monitoring, mobile monitoring, infrastructure monitoring, or any of our wide array of integrations, by default you'll receive data from your monitored applications, hosts, services, or other entities. To browse all New Relic-built tools and solutions, see New Relic integrations. Agent APIs Some of our monitoring solutions come with APIs and/or SDKs that allow you to customize the data reported and how it reports. For more information, see the relevant product: APM agent APIs Browser API Mobile API Infrastructure monitoring: the Flex integration tool Telemetry SDKs If our more curated solutions don't work for you, our open source Telemetry SDKs let you build your own solution. These SDKs are language wrappers for our data-ingest APIs (below) that let you send telemetry data to New Relic without requiring install of an agent. APIs for sending metrics, traces, logs, and events If our more curated solutions don't work for you, we also have data-ingest APIs: Trace API Event API Metric API Log API To learn about the differences between these data types, see Data types. New Relic One applications You can build entirely custom applications that reside in New Relic One and make use of any data you want. You can use existing open source New Relic One apps, or share your own with the open source community. For details, see New Relic One applications. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "", + "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Get started", + "info": "An introduction to how to get data into New Relic. ", + "nodeid": 36051, "sections": [ - "Contain the complexity - Observability made simple", - "Get coding", - "Create custom events", - "Add tags to apps", - "Build a Hello, World! app", - "Get inspired", - "Add a table to your app", - "Collect data - any source", - "Automate common tasks", - "Create a custom map view", - "Add a time picker to your app", - "Add custom attributes", - "New Relic developer champions", - "New Relic Podcasts" + "Ingest and manage data", + "Get started", + "Understand data", + "Manage data", + "Ingest APIs", + "Get data into New Relic", + "New Relic-built agents and integrations", + "Agent APIs", + "Telemetry SDKs", + "APIs for sending metrics, traces, logs, and events", + "New Relic One applications", + "For more help" ], - "title": "New Relic Developers", + "title": "Get data into New Relic", "popularity": 1, - "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab", - "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png", - "url": "https://developer.newrelic.com/", - "published_at": "2020-08-17T01:47:47Z", - "updated_at": "2020-08-15T01:36:10Z", + "external_id": "7a413b4d7e5bd81088a08507ae4bad64c7e24b2d", + "category_1": "Ingest and manage data", + "category_2": "Get started", + "image": "", + "url": "https://docs.newrelic.com/docs/telemetry-data-platform/get-data-new-relic/getting-started/introduction-new-relic-data-ingest-apis-sdks", + "published_at": "2020-08-18T15:33:40Z", + "updated_at": "2020-08-10T23:16:39Z", + "category_0": "Telemetry Data Platform", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.1470877, + "_score": 0.148056, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Add a time picker to your app", - "body": " a time picker to your app Add a time picker to a sample application   Add custom attributes Use custom attributes for deeper analysis Show 18 more guides Looking for more inspiration? Check out the open source projects built by the New Relic community. New Relic developer champions New Relic" + "sections": "APIs for sending metrics, traces, logs, and events", + "category_0": "Telemetry Data Platform", + "body": " also have data-ingest APIs: Trace API Event API Metric API Log API To learn about the differences between these data types, see Data types. New Relic One applications You can build entirely custom applications that reside in New Relic One and make use of any data you want. You can use existing open", + "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Get started" }, - "id": "5d6fe49a64441f8d6100a50f" + "id": "5f24aa60196a67ede394f5f3" }, { - "body": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application. In this guide, you are going to build a sample table using various New Relic One components. Before you begin If you haven't already installed the New Relic One CLI, step through the quick start in New Relic One. This process also gets you an API key. In addition, to complete the steps in this guide, you need a GitHub account, and to have Node.js installed on your machine. See [Setting up your development environment](/build-apps/set-up-dev-env) for more info. Clone and set up the example application Step 1 of 4 Clone the nr1-how-to example application from GitHub to your local machine. Then, navigate to the app directory. The example app lets you experiment with tables. git clone https://github.com/newrelic/nr1-how-to.git` cd nr1-how-to/create-a-table/nerdlets/create-a-table-nerdlet` Copy Step 2 of 4 Edit the index.json file and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install dependencies nr1 nerdpack:serve # Serve the demo app locally Copy Step 4 of 4 Open one.newrelic.com/?nerdpacks=local in your browser. Click Apps*, and then in the Other apps section, you should see a Create a table** launcher. That's the demo application you're going to work on. Go ahead and select it. Have a good look at the demo app. There's a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You'll use Table components to add a new table in the second row. Work with table components Step 1 of 10 Navigate to the `nerdlets/create-a-table-nerdlet` subdirectory and open the `index.js` file. Add the following components to the import statement at the top of the file so that it looks like the example: Table TableHeader TableHeaderCell TableRow TableRowCell import { Table, TableHeader, TableHeaderCell, TableRow, TableRowCell, PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart, } from 'nr1'; Copy Step 2 of 10 Add a basic Table component Locate the empty GridItem in index.js: This is where you start building the table. Add the initial component. The items property collects the data by calling _getItems(), which contains sample values.
; Copy Step 3 of 10 Add the header and rows As the Table component renders a fixed number of header cells and rows, your next step is adding header components, as well as a function that returns the required table rows. Inside of the Table component, add the TableHeader and then a TableHeaderCell child for each heading. Since you don't know how many rows you'll need, your best bet is to call a function to build as many TableRows as items returned by _getItems(). Application Size Company Team Commit ; { ({ item }) => ( {item.name} {item.value} {item.company} {item.team} {item.commit} ); } Copy Step 4 of 10 Take a look at the application running in New Relic One: you should see something similar to the screenshot below. Step 5 of 10 Replace standard table cells with smart cells The New Relic One library includes cell components that can automatically format certain data types, like users, metrics, and entity names. The table you've just created contains columns that can benefit from those components: Application (an entity name) and Size (a metric). Before you can use EntityTitleTableRowCell and MetricTableRowCell, you have to add them to the import statement first. import { EntityTitleTableRowCell, MetricTableRowCell, ... /* All previous components */ } from 'nr1'; Copy Step 6 of 10 Update your table rows by replacing the first and second TableRowCells with entity and metric cells. Notice that EntityTitleTableRowCell and MetricTableRowCell are self-closing tags. { ({ item }) => ( {item.company} {item.team} {item.commit} ); } Copy Step 7 of 10 Time to give your table a second look: The cell components you've added take care of properly formatting the data. Step 8 of 10 Add some action to your table! Tables are great, but interactive tables can be better: As a last update, you are going to allow users to act on each data row. Add the _getActions() method to your index.js file, right before _getItems(). As you may have guessed from the code, _getActions() spawns an alert box when you click Team or Commit cells. _getActions() { return [ { label: 'Alert Team', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__ALERT, onClick: (evt, { item, index }) => { alert(`Alert Team: ${item.team}`); }, }, { label: 'Rollback Version', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__UNDO, onClick: (evt, { item, index }) => { alert(`Rollback from: ${item.commit}`); }, }, ]; } Copy Step 9 of 10 Find the TableRow component in your return statement and point the actions property to _getActions(). The TableRow actions property defines a set of actions that appear when the user hovers over a table row. Actions have a mandatory text and an onClick callback, but can also display an icon or be disabled if needed. Copy Step 10 of 10 Go back to your application and try hovering over any of the rows: Notice how the two available actions appear. When you click them, a function triggers with the selected row data as an argument, and an alert displays in your browser. Next steps You've built a table into a New Relic One application, using components to format data automatically and provide contextual actions. Well done! Keep exploring the Table components, their properties, and how to use them, in our SDK documentation.", - "type": "developer", + "body": "New Relic products report a variety of default event data to your account. This document will explain how to report your own custom events and attributes. Overview of reporting custom events and attributes Event data is one of the fundamental New Relic data types. Events are reported by most New Relic products, and we give you several options for reporting your own custom events. Reporting custom events allows you to create more useful and customized queries and charts of your data, and is a key part of optimizing how New Relic works for you. Before beginning, it's important to know that reporting a large number of custom events and/or attributes can cause degraded query performance, or cause you to approach or pass data collection rate limits. For optimal performance, first think about what data you want to analyze, and then create only the events and/or attributes necessary to meet these specific goals. Be aware of the following data and subscription requirements for inserting and accessing custom data: Ensure you follow limits and requirements around event/attribute data types, naming syntax, and size. The amount of data you have access to over time depends on your data retention policy. Send custom events and attributes Methods for sending custom events and attributes include: Source How to send custom data APM agent Use APM agent APIs to report custom events and custom attributes. Browser agent Add custom attributes to the PageView event via the Browser API call addCustomAttribute. Send PageAction event and attributes via Browser API. Forward APM agent custom attributes to PageView event. Event API To report custom events not associated with other New Relic products, use the Event API. Infrastructure Add custom attributes to default Infrastructure events. Use the Flex integration tool to report your own custom event data. Mobile agent Use the mobile agent API to send custom events and attributes. Synthetics Add custom attributes to the SyntheticCheck event via the $util.insights tools. For ways to report other types of custom data, see: Metric API Logs Trace API Extend data retention To learn about how to extend how long events are retained in your account, see Event data retention. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "Add a table to your New Relic One app.", + "breadcrumb": "Contents / Insights / Event data sources / Custom events", + "info": "An overview of the options for sending custom event data to New Relic. ", + "nodeid": 13806, "sections": [ - "Add tables to your New Relic One application", - "Before you begin", - "Clone and set up the example application", - "Work with table components", - "Next steps" + "Event data sources", + "Default events", + "Custom events", + "Report custom event data", + "Overview of reporting custom events and attributes", + "Send custom events and attributes", + "Extend data retention", + "For more help" ], - "title": "Add tables to your New Relic One application", + "title": "Report custom event data", "popularity": 1, - "external_id": "7ff7a8426eb1758a08ec360835d9085fae829936", - "image": "https://developer.newrelic.com/static/e637c7eb75a9dc01740db8fecc4d85bf/1d6ec/table-new-cells.png", - "url": "https://developer.newrelic.com/build-apps/howto-use-nrone-table-components/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-14T01:46:10Z", + "external_id": "afb5f5a81ae06b22935d98c470ed9cabd7c9da6b", + "category_1": "Event data sources", + "category_2": "Custom events", + "image": "", + "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/report-custom-event-data", + "published_at": "2020-08-18T07:15:53Z", + "updated_at": "2020-07-26T05:52:23Z", + "category_0": "Insights", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.050594516, + "_score": 0.12379804, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Add tables to your New Relic One application", - "sections": "Add tables to your New Relic One application", - "info": "Add a table to your New Relic One app.", - "body": " and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create" + "title": "Report custom event data", + "sections": "Event data sources", + "info": "An overview of the options for sending custom event data to New Relic. ", + "category_1": "Event data sources", + "category_2": "Custom events", + "body": " the Flex integration tool to report your own custom event data. Mobile agent Use the mobile agent API to send custom events and attributes. Synthetics Add custom attributes to the SyntheticCheck event via the $util.insights tools. For ways to report other types of custom data, see: Metric API Logs Trace", + "breadcrumb": "Contents / Insights / Event data sources / Custom events" }, - "id": "5efa989ee7b9d2ad567bab51" + "id": "5e8e7f9de7b9d2aa122cf0f6" }, { - "body": "Add custom attributes to your New Relic data There are countless filters and pivots you might want to apply to your data. By adding custom attributes to your data, you can see beyond your code and analyze your business in-depth. A common pattern when using custom attributes is to capture user information, e.g. name, id, email, etc. This allows you to 'link' your operational data with your business data. For example, if you have the user information, you tie together your service desk and CRM data with the operational data in New Relic. Step 1 of 2 You can add a userid custom attribute to your APM-reported data (Transaction and TransactionError events) with the opensource Java APM agent's API. NewRelic.addCustomParameter('userid', userId); Copy Step 2 of 2 Once added, you can run a NRQL query that uses the 'userid' custom attribute. Once you have added a custom attribute like 'userid', you can use it to filter and facet your NRQL queries. -- Get a count of errors experienced by a single filtered userid faceted by date and error message SELECT count(*) FROM TransactionError WHERE userid = '1401961100' FACET dateOf(timestamp), `error.message` SINCE 1 week ago Copy", - "type": "developer", + "body": "New Relic offers a variety of APIs and SDKs you can use to: Retrieve data from New Relic. Send data to New Relic. Adjust settings. This section of the docs provides examples and reference documentation for our API endpoints. For developer-focused content on how to use and customize New Relic, see developer.newrelic.com. NerdGraph (GraphQL) NerdGraph is New Relic's GraphQL API, an efficient and flexible query language that lets you request exactly the data you need, without over-fetching or under-fetching. While typical REST APIs require loading from multiple URLs, NerdGraph calls get all the data you need in a single request. NerdGraph also makes it easier to evolve APIs over time and enables powerful developer tools. New Relic provides a powerful GraphQL tool to explore the API with embedded schema definitions. To get started, go to api.newrelic.com/graphiql. For sample queries and mutations, use our NerdGraph tutorials. REST APIs by capability New Relic capabilities, like APM, infrastructure monitoring, or alerts, are often used together, and sometimes they overlap in functionality. This is why multiple APIs may be relevant to each area. Some API functionality will depend on your access to features and data. To learn more about different API key types, see Understand New Relic API keys. Alerts Use the REST API for alerts and the API Explorer to: Create and manage policies, conditions, and notification channels. Create alert conditions based on NRQL queries. Create alert conditions based on data from other New Relic capabilities. APM API resources for application monitoring include: Resource Details REST API REST API features include: Retrieve APM data, including metrics, Apdex, error rates, and host data. Report deployments. Change the app name in the UI. Agent APIs Every APM language agent has an API that lets you customize the agent's default behavior, including reporting custom data. APM agent APIs include: C SDK API Go agent API Java agent API .NET agent API Node.js agent API PHP agent API Python agent API Ruby agent API Query API To query APM data, use the Query API. Account management APIs For APIs related to accounts and subscription usage, see the account-related APIs. Browser monitoring The Browser API resources include: Resource Details Browser agent API Use the Browser agent API for tasks such as: Report custom end user data to browser monitoring. Monitor asynchronous browser activity using SPA API calls. Insert custom data into New Relic dashboards . Manage source maps. REST API With the REST API you can: Retrieve page load timing data and throughput. Add or list apps monitored by browser monitoring. Manage alerts conditions for your browser data. Query API To retrieve browser monitoring data, use the Query API. Account management APIs For APIs related to accounts and subscription usage, see the account-related APIs. Infrastructure monitoring The Infrastructure API resources include: Resource Details Query API To retrieve infrastructure data, use the Query API. This API can also be used to retrieve subscription usage data. Infrastructure alert API To manage your infrastructure alerts, use the Infrastructure alert API. Integrations SDK To make your own custom integrations for reporting data to infrastructure monitoring, use the Integrations SDK. NerdGraph You can use NerdGraph (our GraphQL API) to query your cloud integration data and make changes to cloud integration settings. Mobile monitoring Mobile API resources include: Resource Details Mobile agent APIs Mobile APIs let you custom instrument your own code and send events to New Relic. See the platform-specific documentation: iOS Android Unity REST API Use the REST API for such tasks as: Retrieve a list of monitored apps. Get subscription usage data. Get metric names and data. Get crash count and crash rate data. Manage New Relic alerts conditions for your mobile apps. Query API To retrieve Mobile data from New Relic, use the Query API. Account management APIs For account-related APIs, see Account APIs. Synthetic monitoring Synthetics API resources include: Resource Details Synthetics REST API The Synthetics REST API functionality includes: Create and manage synthetics monitors. Manage synthetics alert notifications. Add labels to monitors, and retrieve monitors with specific labels. Query API To retrieve synthetics event data, use the Query API. Alerts API To create and manage alert conditions that target synthetics monitors, use the Alerts API. Telemetry APIs for core data types We offer several APIs that allow you to get our core data types (metrics, logs, traces, and events) into New Relic without the use of an installed agent. Data type Description Trace API Send distributed tracing data to New Relic. Event API Send event data to New Relic. Metric API Send metrics to New Relic from any source (including other telemetry monitoring services). Log API Send your log data to New Relic. Account management, admin, and usage APIs Like any other New Relic product or service, you want to be confident that your APIs protect you and your customers' data privacy. The following are API resources related to New Relic account administration and usage. For more information about API capabilities, see the specific New Relic API. For more information about New Relic's security measures, see our security and privacy documentation, or visit the New Relic security website. Resource Details REST API REST API features include: Find your API keys, account ID, and information needed to use the REST API. Return a list of account users. Get SLA report data for browser and application monitoring. Subscription usage You can use the Query API to retrieve subscription usage data. This can be helpful to see how usage compares to your current subscription level, or for doing departmental chargebacks. If you implemented the REST API for querying subscription usage data prior to July 10, 2018, those usage-related REST APIs are now deprecated. You should use the Query API, which requires creating an API key. For more on switching to the new API format, see the transition guide. Partner API To retrieve information about your New Relic partner account, sub-accounts, and users, use the Partner API. Other APIs Insights API resources for Insights include: Resource Details Insert events API To report custom data use the Event insertion API. Query API To query your Insights data using NRQL-formatted queries, use the Query API. This API can also be used to retrieve subscription usage data. Dashboard API To create, read, update, and delete dashboards, use the Dashboard API. Other New Relic product APIs You can also report custom data from other New Relic features. For more information, see the API sections for other products. NerdGraph You can use NerdGraph (our GraphQL API) to query data with NRQL. Plugins Use the REST API for New Relic plugins and the API Explorer to: Get a list of plugins, including their names, IDs, and GUIDs. List one or more plugin components, their output, and their metric timeslice data. Developers and New Relic partners can also use New Relic's Plugin API to write an agent in any language that can work directly with the API for plugins. This allows you to send your own metric data to our plugins and view data received from the API in New Relic. See APIs in action For more on how you as a developer can optimize your ability to solve problems using New Relic, go to developer.newrelic.com. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "Add metadata for more detailed analysis", + "breadcrumb": "Contents / APIs / Get started / Intro to APIs", + "info": "An introduction to all of the available New Relic APIs. ", + "nodeid": 15691, "sections": [ - "Add custom attributes to your New Relic data" + "Get started", + "Intro to APIs", + "Introduction to New Relic APIs", + "NerdGraph (GraphQL)", + "REST APIs by capability", + "Telemetry APIs for core data types", + "Account management, admin, and usage APIs", + "Other APIs", + "See APIs in action", + "For more help" ], - "title": "Add custom attributes to your New Relic data", + "title": "Introduction to New Relic APIs", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/apis/get-started/intro-apis/introduction-new-relic-apis", "popularity": 1, - "tags": [ - "Custom Attributes", - "NRQL" - ], - "external_id": "b7c3eb72c1c275d97df9c6232d50bd675ac2e39a", - "image": "https://developer.newrelic.com/static/2dd8a32b57677b2e8d2497147d8ebc26/2663f/custom-attribute-query.png", - "url": "https://developer.newrelic.com/collect-data/custom-attributes/", - "published_at": "2020-08-17T01:54:02Z", - "updated_at": "2020-08-04T01:39:41Z", + "external_id": "bb3a7314b2407cfa765425553484cb364e27e7e3", + "category_1": "Get started", + "category_2": "Intro to APIs", + "image": "", + "url": "https://docs.newrelic.com/docs/apis/get-started/intro-apis/introduction-new-relic-apis", + "published_at": "2020-08-18T02:45:47Z", + "updated_at": "2020-08-10T01:40:52Z", + "category_0": "APIs", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0052304845, + "_score": 0.10374672, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Add custom attributes to your New Relic data", - "sections": "Add custom attributes to your New Relic data", - "info": "Add metadata for more detailed analysis", - "tags": "Custom Attributes", - "body": "Add custom attributes to your New Relic data There are countless filters and pivots you might want to apply to your data. By adding custom attributes to your data, you can see beyond your code and analyze your business in-depth. A common pattern when using custom attributes is to capture user" + "title": "Introduction to New Relic APIs", + "sections": "Telemetry APIs for core data types", + "info": "An introduction to all of the available New Relic APIs. ", + "category_0": "APIs", + "category_2": "Intro to APIs", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/apis/get-started/intro-apis/introduction-new-relic-apis", + "body": ". Telemetry APIs for core data types We offer several APIs that allow you to get our core data types (metrics, logs, traces, and events) into New Relic without the use of an installed agent. Data type Description Trace API Send distributed tracing data to New Relic. Event API Send event data to New" }, - "id": "5efa999de7b9d2985d7bab67" + "id": "5d4ae71be7b9d211b4d535a4" }, { - "body": "AccountPicker Usage Copy Props There are no props for this component.", - "type": "developer", + "body": "New Relic offers several tools to help obtain the information needed to provide useful metrics about your Node.js application. These include: Reading the route names (if used) from the Express and Restify routers Using the API to name the current request, either with simple names or groups of controllers with actions Support rules that are stored in your agent's configuration that can mark requests to be renamed or ignored based on regular expressions matched against the request's raw URLs (also available as API calls) The number of names that New Relic tracks needs to be small enough so that the user experience is robust. It also needs to be large enough to provide the right amount of information (without overwhelming you with data) so that you can identify problem spots in your applications more easily. For more information, see the Node.js agent configuration documentation and the Node.js agent API documentation on Github. Request names The Node.js agent captures the HTTP method along with a potentially parameterized path (such as /user/:id) or a regular expression (such as /^/user/([-0-9a-f]+)$/). These pieces of information become part of the request name. If you have support for slow transaction traces and have enabled capture_params in your config file, the transaction trace will also have the request's parameters and their values attached to it. If you are dissatisfied with the request names that the Node.js agent uses, you can use API calls to create more descriptive names. If grouping your requests under the generic name, then /* is sufficient, and you do not need to customize your configuration file or API calls. Requirements New Relic uses request names to group requests for many charts and tables. The value of these visualizations will drop as the number of different request names increases. For example, do not include potentially dynamic data like GUIDs, numerical IDs, or timestamps in the request names you create. If your request is slow enough to generate a transaction trace, that trace will contain the original URL. If you enable parameter capture, the parameters will also be attached to the trace. Avoid having more than 50 different transaction names. For example, if you have more than a couple hundred different request names, rethink your naming strategy. Avoid metric grouping issues The request naming API helps New Relic avoid problems with trying to handle too many metrics, which sometimes is referred to as \"metric explosion.\" New Relic has several strategies to deal with these issues; the most severe is simply to add offending applications to your deny list. The main reason for you to be careful in using these request-naming tools is to prevent that from happening to your applications. For more information, see Metric grouping issues. Guidelines Define your configuration rules from the most specific to the most general. The first rules listed in your config file or added with the Node.js transaction naming API will be applied first and should be narrowly targeted. More general \"fall-through\" rules should be added toward the end of the list, because they will be evaluated in the order they were configured or added using the Node.js transaction naming API. URL pattern matching An online retailer has a URL pattern like this: /user/customers/all/prospects /user/customers/all/current /user/customers/all/returning /user/customers/John /user/customers/Jane The retailer could create rules like this: // newrelic.js exports.config={ //other configuration rules:{ name:[ { pattern: \"/user/customers/all/prospects/\", name: \"/user/customers/all/prospects\" }, { pattern: \"/user/customers/all/.*\", name: \"/user/customers/all\" }, { pattern: \"/user/customers/.*\", name: \"/user/customers/:customer\" } ] } } With these rules, the retailer would create three transaction names: /user/customers/:customer /user/customers/all /user/customers/all/prospects If the retailer reversed the order, the rules would catch all transactions in :customer, which would not be as useful. Load the request naming API Make sure that loading the New Relic module is the first thing your application does, as it needs to bootstrap itself before the rest of your application loads: var newrelic = require('newrelic'); This returns the request naming API. You can safely require the module from multiple modules in your application, as it only initializes itself once. Request API calls Here is a summary of the Request API calls for New Relic's Node.js agent. newrelic.setTransactionName(name) Name the current request, following the request naming requirements. You can call this function anywhere within the context of an HTTP request handler, at any time after handling of the request has started, but before the request has finished. In general, if the request and response objects are in scope, you can set the name. Explicitly calling newrelic.setTransactionName() will override any names set by Express or Restify routes. Also, calls to newrelic.setTransactionName() and newrelic.setControllerName() will overwrite each other. The last one to run before the request ends wins. newrelic.setControllerName(name, [action]) Name the current request using a controller-style pattern, optionally including the current controller action. If the action is omitted, New Relic will include the HTTP method (GET, POST, etc.) as the action. The rules for when you can call newrelic.setControllerName() are the same as they are for newrelic.setTransactionName(), including the request naming requirements. Explicitly calling newrelic.setControllerName() will override any names set by Express or Restify routes. Also, calls to newrelic.setTransactionName() and newrelic.setControllerName() will overwrite each other. The last one to run before the request ends wins. Custom instrumentation API calls Use these API calls to expand your instrumentation with custom instrumentation. newrelic.instrument(moduleName, onRequire [, onError]) Sets an instrumentation callback for a specific module. The provided onRequire callback will be fired when the given module is loaded with require. The moduleName parameter should be the string that will be passed to require; for example, 'express' or 'amqplib/callback_api'. The optional onError callback is called if the onRequire parameters throws an error. This is useful for debugging your instrumentation. Use this method to: Add instrumentation for modules not currently instrumented by New Relic. Instrument your own code. Replace the Node.js agent's built-in instrumentation with your own. For more information, see New Relic's Node.js instrumentation tutorial on Github. newrelic.instrumentDatastore(moduleName, onRequire [, onError]) Sets an instrumentation callback for a datastore module. This method is just like newrelic.instrument(), except it provides a datastore-specialized shim. For more information, see New Relic's Node.js datastore instrumentation tutorial on Github. newrelic.instrumentLoadedModule(moduleName, moduleInstance) The instrumentLoadedModule method allows you to add stock instrumentation to specific modules in situations where it's impossible to have require('newrelic'); as the first line of your app's main module. // load the agent const newrelic = require('newrelic') // module loaded before newrelic const expressModule = require('express') // instrument express _after_ the agent has been loaded newrelic.instrumentLoadedModule( 'express', // the module's name, as a string expressModule // the module instance ); This method cannot instrument any arbitrary module. Its purpose is to add modules that were missed because the agent was not loaded as the first thing in your program. The instrumentLoadedModule method can only instrument modules the agent would normally instrument. You can see a list of these modules in the agent's lib/instrumentations module. newrelic.instrumentMessages(moduleName, onRequire [, onError]) Sets an instrumentation callback for a message service client module. This method is just like newrelic.instrument(), except it provides a message-service-specialized shim. For more information, see New Relic's Node.js message service instrumentation tutorial on Github. newrelic.instrumentWebframework(moduleName, onRequire [, onError]) Sets an instrumentation callback for a web framework module. This method is just like newrelic.instrument(), except it provides a web-framework-specialized shim. For more information, see New Relic's Node.js web framework instrumentation tutorial on Github. newrelic.startWebTransaction(url, handle) Instrument the specified web transaction. Using this API call, you can instrument transactions that New Relic does not automatically detect. The url defines the transaction name and needs to be static. Do not include variable data such as user ID. The handle defines the function you want to instrument. New Relic will capture any metrics that would be captured by auto-instrumentation, as well as manual instrumentation via startSegment(). You must handle custom transactions manually by calling newrelic.getTransaction() at the start of your transaction, and then call transaction.end() when you are finished. New Relic begins timing the transaction when newrelic.startWebTransaction() is called and ends the transaction when transaction.end() is called. You can also return a promise to indicate the end of the transaction. Please note that if this promise rejects, it does not automatically hook into New Relic’s error tracking. This needs to be done manually with noticeError(). newrelic.startBackgroundTransaction(name, [group], handle) Instrument the specified background transaction. Using this API call, you can expand New Relic's instrumentation to capture data from background transactions. The name defines the transaction name and needs to be static. Do not include variable data such as user ID. The group is optional, and it allows you to group similar jobs together via the transaction type in the user interface. Like name, the group needs to be static. The handle defines a function that includes the entire background job you want to instrument. New Relic will capture any metrics that would be captured by auto-instrumentation, as well as manual instrumentation via startSegment(). You must handle custom transactions manually by calling newrelic.getTransaction() at the start of your transaction, and then call transaction.end() when you are finished. New Relic begins timing the transaction when newrelic.startBackgroundTransaction() is called and ends the transaction when transaction.end() is called. You can also return a promise to indicate the end of the transaction. Please note that if this promise rejects, it does not automatically hook into New Relic’s error tracking. This needs to be done manually with noticeError(). newrelic.getTransaction() Returns a handle on the currently executing transaction. This handle can then be used to interact with a given transaction safely from any context. It is best used with newrelic.startWebTransaction() and newrelic.startBackgroundTransaction(). Please refer to the transaction handle section for more details. newrelic.endTransaction() End the current web or background custom transaction. This method requires being in the correct transaction context when called. This API call takes no arguments. newrelic.startSegment(name, record, handler, callback) Instrument a particular method to improve visibility into a transaction, or optionally turn it into a metric. The name defines a name for the segment. This name will be visible in transaction traces and as a new metric in the New Relic UI. The record flag defines whether the segment should be recorded as a metric. The handler is the function you want to track as a segment. The optional callback is a function passed to the handler to fire after its work is done. The agent begins timing the segment when startSegment is called. The segment is ended when either the handler finishes executing, or callback is fired, if it is provided. Custom metrics API calls Use these API calls to record additional arbitrary metrics: newrelic.recordMetric(name, value) Use recordMetric to record an event-based metric, usually associated with a particular duration. The name must be a string following standard metric naming rules. The value will usually be a number, but it can also be an object. When value is a numeric value, it should represent the magnitude of a measurement associated with an event; for example, the duration for a particular method call. When value is an object, it must contain count, total, min, max, and sumOfSquares keys, all with number values. This form is useful to aggregate metrics on your own and report them periodically; for example, from a setInterval. These values will be aggregated with any previously collected values for the same metric. The names of these keys match the names of the keys used by the platform API. newrelic.incrementMetric(name, [amount]) Use incrementMetric to update a metric that acts as a simple counter. The count of the selected metric will be incremented by the specified amount, defaulting to 1. Custom events API calls Use these API calls to record additional events: newrelic.recordCustomEvent(eventType, attributes) Use recordCustomEvent to record an event-based metric, usually associated with a particular duration. The eventType must be an alphanumeric string less than 255 characters. The attributes must be an object of key and value pairs. The keys must be shorter than 255 characters, and the values must be string, number, or boolean. Recording a custom event The following example demonstrates recording a custom event with multiple attributes. const attributes = { attribute1: 'value1', attribute2: 2 } newrelic.recordCustomEvent('MessagingEvent', attributes) Transaction handle methods This section details the methods provided by the TransactionHandle class instance that can be obtained through newrelic.getTransaction(). Use these methods to interact directly with the current transaction: transactionHandle.end([callback]) Use transactionHandle.end to end the transaction referenced by the handle instance. The callback is invoked when the transaction has fully ended. The finished transaction passed to the callback as the first argument. transactionHandle.ignore() Use transactionHandle.ignore to ignore the transaction referenced by the handle instance. transactionHandle.insertDistributedTraceHeaders(headers) This API requires distributed tracing to be enabled. For context on how to use this call and its partner call acceptDistributedTraceHeaders, first read Enable distributed tracing with agent APIs. transactionHandle.insertDistributedTraceHeaders is used to implement distributed tracing. It modifies the headers map that is passed in by adding W3C Trace Context headers and New Relic Distributed Trace headers. The New Relic headers can be disabled with distributed_tracing.exclude_newrelic_header: true in the config. This method replaces the deprecated createDistributedTracePayload method, which only creates New Relic Distributed Trace payloads. Generating distributed trace headers In the following example, by calling insertDistributedTraceHeaders with an empty object, the appropriate Distributed Trace headers and W3C Trace Context headers will be generated for the transaction. // Call newrelic.getTransaction to retrieve a handle on the current transaction. const transactionHandle = newrelic.getTransaction() // This could be a header object from an incoming request as well const headersObject = {} newrelic.startBackgroundTransaction('background task', function executeTransaction() { const transaction = newrelic.getTransaction() // generate the headers transaction.insertDistributedTraceHeaders(headersObject) }) transactionHandle.acceptDistributedTraceHeaders(transportType, headers) This API requires distributed tracing to be enabled. For context on how to use this call and its partner call insertDistributedTraceHeaders, first read Enable distributed tracing with agent APIs. transactionHandle.acceptDistributedTraceHeaders is used to instrument the called service for inclusion in a distributed trace. It links the spans in a trace by accepting a payload generated by insertDistributedTraceHeaders or generated by some other W3C Trace Context compliant tracer. This method accepts the headers of an incoming request, looks for W3C Trace Context headers, and if not found, falls back to New Relic distributed trace headers. This method replaces the deprecated acceptDistributedTracePayload method, which only handles New Relic distributed trace payloads. transportType should be one of the following strings: AMQP HTTP HTTPS IronMQ JMS Kafka Other Queue Unknown headers should be an object containing all the headers in the incoming request. The keys must be lowercase. Accept incoming distributed trace headers The following example demonstrates adding distributed trace headers retrieved from a Kafka message. In this example, we assume that the incoming Kafka message has Distributed Trace headers inserted. // incoming Kafka message headers const headersObject = message.headers // Call newrelic.getTransaction to retrieve a handle on the current transaction. const transactionHandle = newrelic.getTransaction() newrelic.startBackgroundTransaction('background task', function executeTransaction() { const transaction = newrelic.getTransaction() // accept the headers transaction.acceptDistributedTraceHeaders('Kafka', headersObject) }) transactionHandle.createDistributedTracePayload() This method is deprecated and will be fully removed in the next major release! Please use insertDistributedTraceHeaders This API requires distributed tracing to be enabled. For instructions on how to use this call, along with its partner call acceptDistributedTracePayload, see Enable distributed tracing with agent APIs. This call is used to implement distributed tracing. It generates a payload that is read by the receiving application with acceptDistributedTracePayload. Note: In order to maintain proper ordering of spans in a trace, you must generate the payload in the context of the span that sends it. The DistributedTracePayload object has two available methods used for generating the payload in different formats: DistributedTracePayload#text: returns a JSON representation of the payload. Link a nested background transaction // Call newrelic.getTransaction to retrieve a handle on the current transaction. var transactionHandle = newrelic.getTransaction() var payload = transactionHandle.createDistributedTracePayload() var jsonPayload = payload.text() newrelic.startBackgroundTransaction('background task', function executeTransaction() { var backgroundHandle = newrelic.getTransaction() // Link the nested transaction by accepting the payload with the background transaction's handle backgroundHandle.acceptDistributedTracePayload(jsonPayload) }) DistributedTracePayload#httpSafe: returns a base64 encoded JSON representation of the payload. Place payload on an outgoing request // Call newrelic.getTransaction to retrieve a handle on the current transaction. var transactionHandle = newrelic.getTransaction() var payload = transactionHandle.createDistributedTracePayload() // Place the base64 encoded value on an outbound request header. req.headers[myTracingHeader] = payload.httpSafe() transactionHandle.acceptDistributedTracePayload(payload) This method is deprecated and will be fully removed in the next major release! Please use acceptDistributedTraceHeaders This API requires distributed tracing to be enabled. For context on how to use this call and its partner call createDistributedTracePayload, first read Enable distributed tracing with agent APIs. transactionHandle.acceptDistributedTracePayload is used to instrument the called service for inclusion in a distributed trace. It links the spans in a trace by accepting the payload generated by createDistributedTracePayload. transactionHandle.isSampled() Returns whether this trace is being sampled. Other API calls New Relic's Node.js agent includes additional API calls. newrelic.addCustomAttribute(name, value) Set a custom attribute value to be displayed along with the transaction trace in the New Relic UI. This must be called within the context of a transaction so it has a place to set the custom attributes. Custom attributes will appear in New Relic APM's transaction trace detail view and in errors for the transaction. Add custom attribute newrelic.addCustomAttribute('attribute1', 'value1') If you want to use your custom attributes, avoid using any of the reserved terms used by NRQL when naming them. newrelic.addCustomAttributes(attributes) Set multiple custom attribute values to be displayed along with the transaction trace in the New Relic UI. The attributes should be passed as a single object. This must be called within the context of a transaction so it has a place to set the custom attributes. Custom attributes will appear in the transaction trace detail view and in errors for the transaction. Adding custom attributes const attributes = { attribute1: 'value1', attribute2: 2 } newrelic.addCustomAttributes(attributes) If you want to use your custom attributes, avoid using any of the reserved terms used by NRQL when naming them. newrelic.addCustomSpanAttribute(name, value) Set a custom span attribute value to be displayed along with a transaction trace span in the New Relic UI. This must be called within the context of an active segment/span so it has a place to set the custom span attributes. Custom span attributes will appear in the Attributes section of the span detail view. Add custom span attribute newrelic.addCustomSpanAttribute('attribute1', 'value') This API requires distributed tracing and span events to be enabled. If you want to use your custom span attributes, avoid using any of the reserved terms used by NRQL when naming them. newrelic.addCustomSpanAttributes(attributes) Set multiple custom span attribute values to be displayed along with the transaction trace spans in the New Relic UI. The attributes should be passed as a single object. This must be called within the context of an active segment/span so it has a place to set the custom span attributes. Custom span attributes will appear in the Attributes section of the span detail view. Add custom span attributes const attributes = { attribute1: 'value1', attribute2: 'value2' } newrelic.addCustomSpanAttributes(attributes) This API requires distributed tracing and span events to be enabled. If you want to use your custom span attributes, avoid using any of the reserved terms used by NRQL when naming them. newrelic.getBrowserTimingHeader() Returns the HTML snippet to be inserted into the header of HTML pages to enable New Relic Browser. The HTML will instruct the browser to fetch a small JavaScript file and start the page timer. newrelic.setIgnoreTransaction(ignored) Tell the module whether or not to ignore a given request. This allows you to explicitly filter long-polling, irrelevant routes or requests you know will be time-consuming. This also allows you to gather metrics for requests that otherwise would be ignored. To ignore the transaction, set the parameter to true will ignore the transaction. To prevent a transaction from being ignored with this function, pass the parameter false. Passing null or undefined will not change whether the transaction is ignored. newrelic.noticeError(error, [customParameters]) Use this call if your app is doing its own error handling with domains or try/catch clauses, but you want all of the information about how many errors are coming out of the app to be centrally managed. Unlike other Node.js calls, this can be used outside of route handlers, but it will have additional context if called from within transaction scope. Errors recorded using this method do not obey the ignore_status_codes configuration value. newrelic.shutdown([options], callback) Use this method to gracefully shut down the agent. options options.collectPendingData - type boolean - Tell the agent whether to send any pending data to the New Relic collector before shutting down. options.timeout - type number (ms) - The default time before forcing a shutdown. When collectPendingData is true, the agent will wait for a connection before shutting down. This timeout is useful for short lived processes, like AWS Lambda, in order to keep the process from staying open too long, while trying to connect. Example: newrelic.shutdown({collectPendingData: true, timeout: 3000}, (error) => { process.exit() }) newrelic.getLinkingMetadata() Returns key/value pairs which can be used to link traces or entities. It will only contain items with meaningful values. For instance, if distributed tracing is disabled, trace.id will not be included. newrelic.getTraceMetadata() Returns and object containing the current trace ID and span ID. This API requires distributed tracing to be enabled or an empty object will be returned. Rules for naming and ignoring requests If you do not want to put calls to the New Relic module directly into your application code, you can use pattern-based rules to name requests. There are two sets of rules: one for renaming requests, and one to mark requests to be ignored by New Relic's instrumentation. Here is the structure for rules in New Relic's Node.js agent. rules.name A list of rules of the format {pattern : \"pattern\", name : \"name\"} for matching incoming request URLs to pattern and naming the matching New Relic transaction's name. This acts as a regex replace, where you can set the pattern either as a string, or as a JavaScript regular expression literal, and both pattern and name are required. When passing a regex as a string, escape backslashes, as the agent does not keep them when given as a string in a pattern. Define your configuration rules from the most specific to the most general, as the patterns will be evaluated in order and are terminal in nature. For more information, see the naming guidelines. This can also be set with the environment variable NEW_RELIC_NAMING_RULES, with multiple rules passed in as a list of comma-delimited JSON object literals: NEW_RELIC_NAMING_RULES='{\"pattern\":\"^t\",\"name\":\"u\"},{\"pattern\":\"^u\",\"name\":\"t\"}' Optional rules attributes Additional optional attributes are available: Optional rules attributes Description terminate_chain Default: true When set to true (default), no further rules will be evaluated if this rule is a match. Setting this to false is useful when multiple rules should be used together. For example, one rule could be replacing a common pattern in many different URLs, while subsequent rule(s) would be more specific. replace_all Default: false When set to true, all matches of the pattern will be replaced. Otherwise, only the first match will be replaced. Using the g flag with regular expression literal will have the same effect. For example: pattern: '[0-9]+', replace_all: true This has the same effect as pattern: /[0-9]+/g. precedence By default the rules are evaluated in order, from first to last. If you prefer to have complete control over the order, you can give each rule a precedence attribute. The precedence is an integer number, and rules are evaluated in ascending order. If precedence is not explicitly defined, it will be set to 500 by default. Additional attributes are ignored. Testing your naming rules The Node.js agent comes with a command-line tool for testing naming rules. For more information, run the following command in terminal window in a directory where your app is installed: node node_modules/.bin/newrelic-naming-rules Naming rule examples Here are some examples of naming rules and the results. Match full URL pattern: \"^/items/[0-9]+$\", name: \"/items/:id\" will result in: /items/123 => /items/:id /orders/123 => /orders/123 (not replaced since the rule is a full match) Replace first match in URL pattern: \"[0-9]+\", name: \":id\" will result in: /orders/123 => /orders/:id /items/123 => /items/:id /orders/123/items/123 => /orders/:id/items/123 Replace all matches in any URL pattern: \"[0-9]+\", name: \":id\", replace_all: true will result in: /orders/123/items/123 => /orders/:id/items/:id Match group references Using regular expression match group references: pattern: '^/(items|orders)/[0-9]+$', name: '/\\\\1/:id' will result in: /orders/123 => /orders/:id /items/123 => /items/:id rules.ignore This can also be set via the environment variable NEW_RELIC_IGNORING_RULES, with multiple rules passed in as a list of comma-delimited patterns. Currently there is no way to escape commas in patterns. NEW_RELIC_IGNORING_RULES='^/socket\\.io/\\*/xhr-polling,ignore_me' Here are full examples of how rules are included in the configuration file: Naming rule example // newrelic.js exports.config = { // other configuration rules : { name : [ { pattern: \"/tables/name-here\", name: \"/name-hererule1\" } ] } Ignoring rule example If you are using socket.io, you will have a use case for ignoring rules right out of the box. To keep socket.io long-polling from dominating your response-time metrics and affecting the Apdex metrics for your application, add a rule such as: // newrelic.js exports.config = { // other configuration rules : { ignore : [ '^\\/socket\\.io\\/.*\\/xhr-polling' ] } }; API calls for rules Here are the API calls for naming and ignoring rules with New Relic's Node.js agent. newrelic.addNamingRule(pattern, name) Programmatic version of rules.name. Once naming rules are added, they cannot be removed until the Node process is restarted. They can also be added via the Node.js agent's configuration. Both parameters are required. newrelic.addIgnoringRule(pattern) Programmatic version of rules.ignore. Once ignoring rules are added, they cannot be removed until the Node process is restarted. They can also be added via the Node.js agent's configuration. This parameter is required. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "An AccountPicker component!", + "breadcrumb": "Contents / APM agents / Node.js agent / API guides", + "info": "How to use the Node.js API to name, rename, and ignore requests, and to read router names with New Relic's Node.js agent.", + "nodeid": 1596, "sections": [ - "AccountPicker", - "Usage", - "Props" + "Node.js agent", + "Getting started", + "Installation and configuration", + "Supported features", + "Attributes", + "API guides", + "Hosting services", + "Troubleshooting", + "Node.js agent API", + "Request names", + "Requirements", + "Avoid metric grouping issues", + "Guidelines", + "Load the request naming API", + "Request API calls", + "Custom instrumentation API calls", + "Custom metrics API calls", + "Custom events API calls", + "Transaction handle methods", + "Other API calls", + "Rules for naming and ignoring requests", + "Optional rules attributes", + "Testing your naming rules", + "Naming rule examples", + "API calls for rules", + "For more help" ], - "title": "AccountPicker", + "title": "Node.js agent API", "popularity": 1, - "external_id": "b293d6d32b9996d128b58183417f486f2735a1d7", + "external_id": "fb49a4025c716c56046403d960b0802bc7485af2", + "category_1": "Node.js agent", + "category_2": "API guides", "image": "", - "url": "https://developer.newrelic.com/components/account-picker/", - "published_at": "2020-08-17T01:48:54Z", - "updated_at": "2020-08-03T04:45:42Z", + "url": "https://docs.newrelic.com/docs/agents/nodejs-agent/api-guides/nodejs-agent-api", + "published_at": "2020-08-18T08:18:21Z", + "updated_at": "2020-08-18T08:18:21Z", + "category_0": "APM agents", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.005143428, + "_score": 0.10157165, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "AccountPicker", - "sections": "AccountPicker", - "info": "An AccountPicker component!", - "body": "AccountPicker Usage Copy Props There are no props for this component." + "title": "Node.js agent API", + "sections": "Node.js agent API", + "info": "How to use the Node.js API to name, rename, and ignore requests, and to read router names with New Relic's Node.js agent.", + "category_0": "APM agents", + "category_1": "Node.js agent", + "category_2": "API guides", + "body": " for slow transaction traces and have enabled capture_params in your config file, the transaction trace will also have the request's parameters and their values attached to it. If you are dissatisfied with the request names that the Node.js agent uses, you can use API calls to create more", + "breadcrumb": "Contents / APM agents / Node.js agent / API guides" }, - "id": "5efa989e64441f55335f7e37" + "id": "540a92a2c75d073d3d0006f7" } ], - "/build-apps/add-query-mutate-data-nerdstorage": [ + "/collect-data/custom-events": [ { - "body": "Build apps You know better than anyone what information is crucial to your business, and how best to visualize it. Sometimes, this means going beyond dashboards to creating your own app. With React and GraphQL, you can create custom views tailored to your business. These guides are designed to help you start building apps, and dive into our library of components. We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a \"Hello, World!\" application Build a \"Hello, World!\" app and publish it to New Relic One 20 min Publish and deploy apps Start sharing the apps you build 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 30 min Add a table to your app Add a table to your New Relic One app 20 min Set up your development environment Prepare to build apps and contribute to this site 30 min Create a custom map view Build an app to show page view data on a map", + "body": "Collect data from any source 15 min New Relic products report a lot of data “out of the box.” When you use products like APM, Browser, Mobile, Infrastructure monitoring, or an integration, by default you receive performance data. But you may want to bring data into New Relic that isn't collected by default. Maybe you want an API-based solution that doesn't require install of an agent. Maybe you want to bring telemetry data from another analysis service into New Relic. This page describes several ways to get data into New Relic. Step 1 of 6 Agent APIs If you use our APM, Browser, or Mobile agents to report data, you can use their associated APIs to report custom data. For example, if you monitor your application with the our APM Python agent, you can use the Python agent API to set up custom instrumentation. See the agent APIs. Step 2 of 6 Telemetry SDK Our Telemetry SDKs are language wrappers for our Trace API and Metric API (and eventually our Log API and Event API). These SDKs let you easily send metrics and trace data to New Relic without needing to install an agent. For customers, we offer open-source exporters and integrations that use the Telemetry SDKs to send metrics and trace data: Istio adaptor Prometheus OpenMetrics (for Docker | for Kubernetes) OpenCensus exporter (for Go | for Python) DropWizard exporter Micrometer exporter Want to build your own solution? See our Telemetry SDK docs. Step 3 of 6 Trace API Our Trace API lets you send distributed tracing data to New Relic and consolidate tracing data from multiple sources in one place. We accept trace data in two formats: Zipkin format New Relic format (if you don’t have Zipkin-format data, you’d use this) 1 curl -i -X POST https://trace-api.newrelic.com/trace/v1 \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"Api-Key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -H 'Data-Format: newrelic' \\ 5 -H 'Data-Format-Version: 1' \\ 6 -d '[ 7 { 8 \"common\": { 9 \"attributes\": { 10 \"service.name\": \"Test Service A\", 11 \"host\": \"host123.test.com\" 12 } 13 }, 14 \"spans\": [ 15 { 16 \"trace.id\": \"123456\", 17 \"id\": \"ABC\", 18 \"attributes\": { 19 \"duration.ms\": 12.53, 20 \"name\": \"/home\" 21 } 22 }, 23 { 24 \"trace.id\": \"123456\", 25 \"id\": \"DEF\", 26 \"attributes\": { 27 \"service.name\": \"Test Service A\", 28 \"host\": \"host456.test.com\", 29 \"duration.ms\": 2.97, 30 \"name\": \"/auth\", 31 \"parent.id\": \"ABC\" 32 } 33 } 34 ] 35 } 36 ]' Copy Step 4 of 6 Metric API You can use our Metric API to send metric data to New Relic from any source. 1 curl -i -X POST https://metric-api.newrelic.com/metric/v1 \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"Api-Key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -d '[ 5 { 6 \"metrics\": [ 7 { 8 \"name\": \"memory.heap\", 9 \"type\": \"gauge\", 10 \"value\": 2.3, 11 \"timestamp\": 1531414060739, 12 \"attributes\": { 13 \"host.name\": \"dev.server.com\" 14 } 15 } 16 ] 17 } 18 ]' Copy Step 5 of 6 Event API For sending arbitrary events to New Relic, you can use our Event API. We save these events as a new event type, which can then be queried via NRQL. (Eventually, the Telemetry SDKs will support the Event API.) 1 curl -i -X POST https://insights-collector.newrelic.com/v1/accounts/$ACCOUNT_ID/events \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"x-insert-key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -d '[ 5 { 6 \"eventType\": \"LoginEvent\", 7 \"service\": \"login-service\", 8 \"customerId\": \"xyz\" 9 } 10 ]' Copy Step 6 of 6 Log API If our existing logging integrations don’t meet your needs, you can use our Log API to send any arbitrary log data to New Relic. (Eventually, the Telemetry SDKs will support the Log API.) 1 curl -i -X POST https://log-api.newrelic.com/log/v1 \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"Api-Key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -d '[ 5 \"logs\": [ 6 { 7 \"timestamp\": 1593538496000, 8 \"message\": \"User xyz logged in\", 9 \"service\": \"login-service\", 10 \"hostname\": \"login.example.com\" 11 } 12 ] 13 ]' Copy", "type": "developer", "document_type": "page", - "info": "", + "info": "Open source emitters. APIs. New Relic agents. Get data from anywhere. ", "sections": [ - "Build apps", - "Guides to build apps", - "Create a \"Hello, World!\" application", - "Publish and deploy apps", - "Add, query, and mutate data using NerdStorage", - "Add the NerdGraphQuery component to an application", - "Add a time picker to your app", - "Add a table to your app", - "Set up your development environment", - "Create a custom map view" + "Collect data from any source", + "Agent APIs", + "Telemetry SDK", + "Trace API", + "Metric API", + "Event API", + "Log API" ], - "title": "Build apps", + "title": "Collect data from any source", "popularity": 1, - "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", + "tags": [ + "Agent API", + "Telemetry SDK", + "Trace API", + "Metric API", + "Event API" + ], + "external_id": "5bfb043fffe42ea4a78d5a90bf8e92aa8b8f8c33", "image": "", - "url": "https://developer.newrelic.com/build-apps/", - "published_at": "2020-08-17T01:50:24Z", - "updated_at": "2020-08-17T01:50:23Z", + "url": "https://developer.newrelic.com/collect-data/collect-data-from-any-source/", + "published_at": "2020-08-18T02:04:53Z", + "updated_at": "2020-08-14T01:45:09Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 1.0573717, + "_score": 8.521867, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Add, query, and mutate data using NerdStorage", - "body": " min Publish and deploy apps Start sharing the apps you build 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 20 minutes Add the NerdGraphQuery" + "sections": "Agent APIs", + "info": "Open source emitters. APIs. New Relic agents. Get data from anywhere. ", + "tags": "Agent API", + "body": " agents to report data, you can use their associated APIs to report custom data. For example, if you monitor your application with the our APM Python agent, you can use the Python agent API to set up custom instrumentation. See the agent APIs. Step 2 of 6 Telemetry SDK Our Telemetry SDKs are language" }, - "id": "5efa999d64441fc0f75f7e21" + "id": "5efa997128ccbc3c9a307dfd" }, { - "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,000 documents, plus storage type. Each document can have a maximum length of 64 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.", - "type": "developer", + "body": "New Relic products report a variety of default event data to your account. This document will explain how to report your own custom events and attributes. Overview of reporting custom events and attributes Event data is one of the fundamental New Relic data types. Events are reported by most New Relic products, and we give you several options for reporting your own custom events. Reporting custom events allows you to create more useful and customized queries and charts of your data, and is a key part of optimizing how New Relic works for you. Before beginning, it's important to know that reporting a large number of custom events and/or attributes can cause degraded query performance, or cause you to approach or pass data collection rate limits. For optimal performance, first think about what data you want to analyze, and then create only the events and/or attributes necessary to meet these specific goals. Be aware of the following data and subscription requirements for inserting and accessing custom data: Ensure you follow limits and requirements around event/attribute data types, naming syntax, and size. The amount of data you have access to over time depends on your data retention policy. Send custom events and attributes Methods for sending custom events and attributes include: Source How to send custom data APM agent Use APM agent APIs to report custom events and custom attributes. Browser agent Add custom attributes to the PageView event via the Browser API call addCustomAttribute. Send PageAction event and attributes via Browser API. Forward APM agent custom attributes to PageView event. Event API To report custom events not associated with other New Relic products, use the Event API. Infrastructure Add custom attributes to default Infrastructure events. Use the Flex integration tool to report your own custom event data. Mobile agent Use the mobile agent API to send custom events and attributes. Synthetics Add custom attributes to the SyntheticCheck event via the $util.insights tools. For ways to report other types of custom data, see: Metric API Logs Trace API Extend data retention To learn about how to extend how long events are retained in your account, see Event data retention. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "Intro to NerdStorage on New Relic One", + "breadcrumb": "Contents / Insights / Event data sources / Custom events", + "info": "An overview of the options for sending custom event data to New Relic. ", + "nodeid": 13806, "sections": [ - "Intro to NerdStorage", - "Use NerdStorage in your apps", - "Data model", - "Limits", - "Data access", - "Permissions for working with NerdStorage" + "Event data sources", + "Default events", + "Custom events", + "Report custom event data", + "Overview of reporting custom events and attributes", + "Send custom events and attributes", + "Extend data retention", + "For more help" ], - "title": "Intro to NerdStorage", + "title": "Report custom event data", "popularity": 1, - "external_id": "709e06c25376d98b2191ca369b4d139e5084bd62", + "external_id": "afb5f5a81ae06b22935d98c470ed9cabd7c9da6b", + "category_1": "Event data sources", + "category_2": "Custom events", "image": "", - "url": "https://developer.newrelic.com/explore-docs/nerdstorage/", - "published_at": "2020-08-17T01:54:02Z", - "updated_at": "2020-08-14T01:50:34Z", + "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/report-custom-event-data", + "published_at": "2020-08-18T07:15:53Z", + "updated_at": "2020-07-26T05:52:23Z", + "category_0": "Insights", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0091652945, + "_score": 0.5126784, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Intro to NerdStorage", - "sections": "Use NerdStorage in your apps", - "info": "Intro to NerdStorage on New Relic One", - "body": " and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order" + "title": "Report custom event data", + "sections": "Custom events", + "info": "An overview of the options for sending custom event data to New Relic. ", + "category_1": "Event data sources", + "category_2": "Custom events", + "body": " retention policy. Send custom events and attributes Methods for sending custom events and attributes include: Source How to send custom data APM agent Use APM agent APIs to report custom events and custom attributes. Browser agent Add custom attributes to the PageView event via the Browser API call", + "breadcrumb": "Contents / Insights / Event data sources / Custom events" }, - "id": "5efa989ee7b9d2048e7bab92" + "id": "5e8e7f9de7b9d2aa122cf0f6" }, { - "body": "Query and store data 10 min To help you build a New Relic One application, we provide you with the New Relic One SDK. Here you can learn how to use the SDK query components, which allow you to make queries and mutations via NerdGraph, our GraphQL endpoint. Query-related React components can be identified by the Query suffix. Mutation-related components can be identified by the Mutation prefix. Components overview Our data components are based on React Apollo. The most basic component is NerdGraphQuery, which accepts any GraphQL (or GraphQL AST generated by the graphql-tag library as the query parameter, and a set of query variables passed as variables. Over this query, we have created an additional set of queries, which can be divided into four groups: User queries: These allow you to query the current user and its associated accounts. Components in this category: UserStorageQuery and AccountsQuery. Entities queries: Because New Relic One is entity-centric, we use queries to make access to your entities easier. You can count, search, list, query, and favorite them. Components in this category: EntityCountQuery, EntitySearchQuery, EntitiesByDomainTypeQuery, EntitiesByGuidsQuery, EntityByGuidQuery, EntityByNameQuery. Storage queries: New Relic One provides a simple storage mechanism that we call NerdStorage. This can be used by Nerdpack creators to store application configuration setting data, user-specific data, and other small pieces of data. Components in this category: UserStorageQuery, AccountStorageQuery, EntityStorageQuery, UserStorageMutation, AccountStorageMutation, and EntityStorageMutation. For details, see NerdStorage. NRQL queries: To be able to query your New Relic data via NRQL (New Relic Query Language), we provide a NrqlQuery component. This component can return data in different formats, so that you can use it for charting and not only for querying. Query components All query components accept a function as a children prop where the different statuses can be passed. This callback receives an object with the following properties: loading: Boolean that is set to true when data fetching is happening. Our components use the cache-and-network strategy, meaning that after the data has loaded, subsequent data reloads might be triggered first with stale data, then refreshed when the most recent data has arrived. data: Root property where the data requested is retrieved. The structure matches a root structure based on the NerdGraph schema. This is true even for highly nested data structures, which means you’ll have to traverse down to find the desired data. error: Contains an Error instance when the query fails. Set to undefined when data is loading or the fetch was successful. fetchMore: Callback function that can be called when the query is being loaded in chunks. The function will only be present when it’s feasible to do so, more data is available, and no fetchMore has already been triggered. Data is loaded in batches of 200 by default. Other components provided by the platform (like the Dropdown or the List) are capable of accepting fetchMore, meaning you can combine them easily. Mutation components Mutation components also accept a children as a function, like the query ones. The mutation can be preconfigured at the component level, and a function is passed back that you can use in your component. This is the standard React Apollo approach for performing mutations, but you might find it easier to use our static mutation method added to the component. More on this topic below. Static methods All of the described components also expose a static method so that they can be used imperatively rather than declaratively. All Query components have a static Query method, and all Mutation components have a mutation method. These static methods accept the same props as their query component, but passed as an object. For example: // Declarative way (using components). function renderAccountList() { return (
    ({data, error}) => { if (error) { return
  • Failed to retrieve list: {error.message}
  • ; } return data.map((account) => {
  • {account.name}
  • }); }}
); } // Imperative way (using promises). async function getAccountList() { let data = {}; try { data = await AccountsQuery.query(); } catch (error) { console.log('Failed to retrieve list: ' + error.message); return; } return data.actor.accounts.map((account) => { return account.name; }); } Copy Similarly, a mutation can happen either way; either declaratively or imperatively. NrqlQuery NrqlQuery deserves additional explanation, because there are multiple formats in which you can return data from it. To provide maximum functionality, all three are exposed through a formatType property. You can find its different values under NrqlQuery.formatType: NERD_GRAPH: Returns the format in which it arrives from NerdGraph. RAW: The format exposed by default in Insights and dashboards when being plotted as JSON. This format is useful if you have a pre-existing script in this format that you're willing to migrate to or incorporate with. CHART: The format used by the charting engine that we also expose. You can find a more detailed explanation of how to manipulate this format in the guide to chart components, and some examples. If you are willing to push data, we currently do not expose NrqlMutation. To do that, see the Event API for how to add custom events.", - "type": "developer", + "body": "Custom events are useful to explore data for a single event you are interested in, including data from external sources, at a particular moment in time. To track arbitrary event data for apps monitored by your New Relic Go agent, add RecordCustomEvent to the apps. You can then query and visualize the event data. RecordCustomEvent parameters To add RecordCustomEvent to your Go app, use this format: RecordCustomEvent(eventType string, params map[string]interface{}) Parameter Description eventType string Required. The name of the event type to record. Must consist of alphanumeric characters, underscores _, or colons :. Must contain no more than 255 bytes. Must follow New Relic Insights data requirements for names, limits, and restricted characters. params map number, string, or boolean Required. Specify key/value pairs of attributes to annotate the event. Each value in the params map must be a number, string, or boolean. Keys must be less than 255 bytes. The params map must not contain more than 64 attributes. Example Here is an example of a custom event for a Go app: func customEvent(w http.ResponseWriter, r *http.Request) { io.WriteString(w, \"recording a custom event\") app.RecordCustomEvent(\"my_event_type\", map[string]interface{}{ \"myString\": \"hello\", \"myFloat\": 0.603, \"myInt\": 123, \"myBool\": true, }) } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "Reference guide for SDK query components using NerdGraph", + "breadcrumb": "Contents / APM agents / Go agent / Features", + "info": "To track arbitrary event data in New Relic Insights for apps monitored by your New Relic Go agent, use RecordCustomEvent.", + "nodeid": 13766, "sections": [ - "Query and store data", - "Components overview", - "Query components", - "Mutation components", - "Static methods", - "NrqlQuery" + "Go agent", + "Get started", + "Installation", + "Configuration", + "Instrumentation", + "API guides", + "Features", + "Troubleshooting", + "Create custom events (Go)", + "RecordCustomEvent parameters", + "Example", + "For more help" ], - "title": "Query and store data", + "title": "Create custom events (Go)", "popularity": 1, - "external_id": "cbbf363393edeefbc4c08f9754b43d38fd911026", + "external_id": "b4d19e4ff9eee2b00a40c4add7119820a5f4d3dc", + "category_1": "Go agent", + "category_2": "Features", "image": "", - "url": "https://developer.newrelic.com/explore-docs/query-and-store-data/", - "published_at": "2020-08-17T01:54:02Z", - "updated_at": "2020-08-01T01:42:02Z", + "url": "https://docs.newrelic.com/docs/agents/go-agent/features/create-custom-events-go", + "published_at": "2020-08-18T03:19:16Z", + "updated_at": "2020-08-15T02:23:50Z", + "category_0": "APM agents", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0025214653, + "_score": 0.47695023, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Query and store data", - "sections": "Query and store data", - "info": "Reference guide for SDK query components using NerdGraph", - "body": ", EntityByGuidQuery, EntityByNameQuery. Storage queries: New Relic One provides a simple storage mechanism that we call NerdStorage. This can be used by Nerdpack creators to store application configuration setting data, user-specific data, and other small pieces of data. Components in this category" + "title": "Create custom events (Go)", + "sections": "Create custom events (Go)", + "info": "To track arbitrary event data in New Relic Insights for apps monitored by your New Relic Go agent, use RecordCustomEvent.", + "category_0": "APM agents", + "category_1": "Go agent", + "body": "Custom events are useful to explore data for a single event you are interested in, including data from external sources, at a particular moment in time. To track arbitrary event data for apps monitored by your New Relic Go agent, add RecordCustomEvent to the apps. You can then query and visualize", + "breadcrumb": "Contents / APM agents / Go agent / Features" }, - "id": "5efa989e28ccbc2f15307deb" + "id": "5f374736e7b9d2653b909280" }, { - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", - "type": "developer", - "document_type": "page", - "info": "The command line tools for performing tasks against New Relic APIs", + "body": "NewRelic.Api.Agent.NewRelic.RecordCustomEvent(string eventType, IEnumerable attributeValues) Records a custom event with the given name and attributes. Requirements Agent version 4.6.29.0 or higher. Compatible with all app types. Description Records a custom event with the given name and attributes, which you can query in the query builder. To verify if an event is being recorded correctly, look for the data in dashboards. For related API calls, see the .NET agent API guide. Sending a lot of events can increase the memory overhead of the agent. Additionally, posts greater than 1MB in size will not be recorded regardless of the maximum number of events. Custom Events are limited to 64-attributes. For more information about how custom attribute values are processed, see the custom attributes guide. Parameters Parameter Description eventType string Required. The name of the event type to record. Strings over 255 characters will result in the API call not being sent to New Relic. The name can only contain alphanumeric characters, underscores _, and colons :. For additional restrictions on event type names, see Reserved words. attributeValues IEnumerable Required. Specify key/value pairs of attributes to annotate the event. Example(s) Record values var eventAttributes = new Dictionary() {   {\"foo\", \"bar\"},   {\"alice\", \"bob\"},   {\"age\", 32},   {\"height\",21.3f} }; NewRelic.Api.Agent.NewRelic.RecordCustomEvent(\"MyCustomEvent\", eventAttributes);", + "type": "docs", + "document_type": "api_doc", + "breadcrumb": "Contents » APM agents / .NET agent / .NET agent API", + "info": "New Relic .NET agent API call to report custom event data to New Relic.", + "nodeid": 11631, "sections": [ - "New Relic CLI Reference", - "New Relic CLI commands", - "Options", - "Commands" + ".NET agent", + "Getting started", + "Install", + "Azure installation", + "Other installation", + "Configuration", + "Other features", + "Custom instrumentation", + "API guides", + ".NET agent API", + "Attributes", + "Troubleshooting", + "Azure troubleshooting", + "RecordCustomEvent", + "Requirements", + "Description", + "Parameters", + "Example(s)", + "Record values", + "For more help" ], - "title": "New Relic CLI Reference", + "title": "RecordCustomEvent (.NET agent API)", "popularity": 1, - "tags": "new relic cli", - "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", + "external_id": "2a0a0d5ed597c962d9c7c2b02d2ae40380ec6d3d", + "category_1": ".NET agent", + "category_2": ".NET agent API", "image": "", - "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-08-17T01:54:02Z", - "updated_at": "2020-08-14T01:47:12Z", + "url": "https://docs.newrelic.com/docs/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api", + "published_at": "2020-08-18T16:02:14Z", + "updated_at": "2020-08-18T16:02:14Z", + "category_0": "APM agents", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0009854782, + "_score": 0.42349094, "_version": null, "_explanation": null, "sort": null, "highlight": { - "body": " the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql" + "title": "RecordCustomEvent (.NET agent API)", + "sections": ".NET agent API", + "info": "New Relic .NET agent API call to report custom event data to New Relic.", + "category_0": "APM agents", + "category_1": ".NET agent", + "category_2": ".NET agent API", + "body": "NewRelic.Api.Agent.NewRelic.RecordCustomEvent(string eventType, IEnumerable<string, object> attributeValues) Records a custom event with the given name and attributes. Requirements Agent version 4.6.29.0 or higher. Compatible with all app types. Description Records a custom event with the given", + "breadcrumb": "Contents » APM agents / .NET agent / .NET agent API" }, - "id": "5efa989ee7b9d2024b7bab97" + "id": "5f3bfb86196a674f83618a39" }, { - "body": "New Relic mobile monitoring includes a number of ways to customize and extend the data your mobile app reports. We refer to this type of implementation as \"custom instrumentation.\" This document explains how to get additional data into New Relic, and how to view that new data in the UI. Choose a custom data type You can use these options to create your own data types for custom instrumentation for your mobile apps. Using these four options, you can get a wide range of data based on your needs for your apps. Custom data options Description Session-level custom attributes In creating your own attributes, consisting of a key-value pair, you can add custom data for use in tracking session data. Custom breadcrumbs Useful for troubleshooting crash causes, custom breadcrumb events track the user's code-level path through the app by seeing which breadcrumb API calls were reached and reporting app status details from those moments. Custom interactions Custom interactions give you tracing power so you can debug method timings and improve network call efficiency. A common use of interactions is to understand the underlying activity associated with loading a particular app screen. Custom events You can instrument custom events to collect data about user activity as a user navigates through your app. That user activity will in turn trigger other data collection: a collection of breadcrumbs, auto-instrumented HTTP requests and errors, auto-instrumented interactions, and custom interactions. Add session-level custom attributes Custom attributes annotate (or \"tag\") your mobile monitoring data. A custom attribute consists of a key-value pair. For example, you might create the key userEmail with values such as alice@bigcorp.test and bob@example.com. The agent automatically attaches custom attributes to default mobile monitoring data, and to any breadcrumbs or custom events you create. You can use custom attributes to capture usage data that's relevant to your business. Common examples include account names or IDs, user emails, and subscription levels. You can then filter and facet in the Crash analysis page and via NRQL query. Setting custom attributes will add the key-value pair information at the session level. All default mobile monitoring events inherit these session-level custom attributes. As a best practice, use custom attributes to track a single value for a key that can be true across a session (for example, a user's subscription level, or whether SAML was used to log in). To track the change of a value over the course of a session, like a change in connection type, you would instead record a breadcrumb and its own custom attributes. To track a series of discrete user actions that occur across the course of a session, use custom events. To add custom attributes, see: Android: Use setAttribute() and incrementAttribute(). iOS: Use setAttribute() and incrementAttribute(). Record breadcrumbs Breadcrumbs track the state of your app as it runs, then report a snapshot of that state if your app crashes. This allows you to debug your mobile app crashes more easily. Custom interactions only inherit custom attributes created at the session level. Breadcrumbs will inherit those same session-level custom attributes, but optionally you can also report additional custom attributes specific to each recordBreadcrumb() API call. You can use breadcrumbs in several ways: You could record a breadcrumb event when your app receives an HTTP response, and also record the values in that response as custom attributes (for example, the response might tell the app what screen to display next or recording unique timestamps for each change in the course of a session). If the app crashes or throws errors, you will be able to see invalid data from the HTTP response. You could track the success of each step of your user login process, with perhaps a status attribute recording a success or failure key for each step. This would let you debug which step is causing issues. Once you have released a version of your app that creates MobileBreadcrumb custom events, you can see them in the crash event trail whenever they appear in the app's code path as part of a crashed session. You can also query them using NRQL and query either all breadcrumbs or just breadcrumbs from crashed sessions. This lets you see the frequency of app paths that include that particular breadcrumb. To add custom breadcrumbs, see: Android: Use recordBreadcrumb(). iOS: Use recordBreadcrumb(). Create custom interactions Our mobile monitoring agent begins instrumenting an interaction when it detects a screen load or partial screen load (such as fragments for Android or view controllers for iOS). New Relic automatically traces slow interactions, providing a complete, in-depth picture of a single slow interaction, including the methods that were called, what network requests were made, and the CPU and memory usage once that interaction started. Our mobile monitoring automatically selects data-rich traces. The specific criteria the agent looks for are interactions whose instrumented methods account for at least 30% of the overall interaction time. In addition to the auto-instrumentation, you can start a custom interaction to force the agent to start recording a trace beginning at that point in your app code and continuing across the subsequent methods and network calls. Custom interaction traces provide deep information. However, they increase the overhead of the agent compared to other custom data collection methods because of the large amount of data collected for the entire duration of an interaction. When associated with a crash, custom interactions show up in the crash event trail. You can also query them with NRQL for flexible analysis. Interactions are powerful for tracing but are less flexible in other ways than other custom data types: While custom breadcrumbs and custom events let you optimize your custom attributes to specific events, interactions can only inherit session-level attributes. You can also manually end a custom interaction. However, ensure that the interaction includes enough method activity to be recorded. If the agent does not detect any traced activity for 0.5 seconds, the agent stops the interaction tracing because it is assumed no interesting data remains. In addition, the agent can only trace one interaction at a time, so if a new interaction is triggered the current trace will automatically be stopped in preference for the new trace. To add custom interaction traces, see: Android: Use startInteraction() and endInteraction(). iOS: Create and complete interactions. You can also configure interaction tracing globally: Android: Disable entirely with withInteractionTracing(), or disable only auto-instrumented traces with withDefaultInteractions(). iOS: Disable entirely with NRFeatureFlag_InteractionTracing(), or disable only auto-instrumented traces with NRFeatureFlag_DefaultInteractions(). Record custom events Custom events are a powerful tool for reporting arbitrary user activity to New Relic. When associated with a crash, custom events show up in the crash event trail. You can also query them with NRQL for flexible analysis. Unlike custom interactions, custom events allow you to add custom attributes to a particular event within the user session. For example, you could record a custom event each time a user taps a button or accesses a certain feature, and then use NRQL to track how often that feature was used. Beyond a simple count, you can FACET on default mobile app attributes such as location, device, or carrier to analyze usage. Adding session-level custom attributes would let you further examine usage based on the criteria important to you, such as user subscription level or other user characteristics. Adding additional attributes for that custom event would allow you to track user behavior more closely: What data did they enter or what option did they select, for example. To add custom events, see: Android: Use recordCustomEvent(). iOS: Use recordCustomEvent(). For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "body": "The New Relic Event API is one way to report custom events to New Relic. The Event API lets you send custom event data to your New Relic account with a POST command. These events are then queryable and chartable using NRQL. If your account hosts data in the EU data center, ensure you are using the proper API endpoints for EU region accounts. Related content: Learn about all options for reporting custom events. For details about how event data is retained, see Event data retention. For how to add attributes to existing events, see Add custom attributes. Check out New Relic University’s tutorial Adding custom events with the Event API (aka the Insights API). Or, go directly to the full online course Custom data. Basic workflow The Event API is an asynchronous endpoint. This allows you to send a very large volume of POSTS, reliably, with very low response latency. To send a custom event to your New Relic account: Register an Insert API key. Before creating custom events or attributes, review New Relic's list of reserved terms used by NRQL. Generate JSON for the event by instrumenting your application, querying an API, or some other method. Submit a compressed JSON payload (for example, gzip or deflate) to the HTTPS endpoint using curl in a POST request. Recommendation: Set up NRQL alert conditions to notify you when parsing errors occur. This method will send the events directly into your account, where they will be accessible from any NRQL interface or with the Query API. The Event API limits the size, rate, and characters allowed in custom events. Also, like other events available in NRQL, custom events cannot be updated or deleted after they are created. If you have problems with your custom event, follow the troubleshooting procedures or create a new custom event. Register an Insert API key You must have the correct user permissions to register Insert API keys. Insert API keys are generated for an account. They aren't associated with a specific user. Anyone in the account with access to the Insert API key can use it. You submit multiple event types under a single Insert API key. However, to help ensure security, we recommend that you use different keys for different applications or data sources. To register an Insert API key: From one.newrelic.com, click the account dropdown and then click Account settings. Click API keys. On the next page, click Insights API keys. Next to the Insert keys heading, select the plus symbol and follow the instructions. The Insert key page lists the curl command necessary to add event data for the key. For security reasons, the Insert API key cannot be altered or read using the API. To change or read a key, use the New Relic UI. Format the JSON The Event API accepts specific formats for attributes included in the payload. Only float or string values are allowed. JSON format guidelines When defining attributes for your custom events, follow these JSON format guidelines. Attributes JSON format guidelines eventType Required: The event's name. Float and string values Float value format: \"label\":value String value format: \"label\":\"value\" Data types The API only accepts key-value pairs, not map/object or array values. Supported data types for this API are strings and numbers (integers or floats). For more information, see Data requirements. Digits in strings For performance-related reasons, we do not cast values submitted to the API. For example, we treat 123 as a number and \"123\" as a string. The database will only store up to 64 bit numbers. Any numbers larger than 64 bits will be truncated. Dates For attributes that contain date information, use an unformatted Unix timestamp in the Insights data formatter. You can define the date attribute either in seconds or in milliseconds, both relative to the Unix epoch. Time Unless otherwise specified, the timestamp for a submitted event is the time it was submitted to New Relic. To specify a different time for the event, use the timestamp attribute. The timestamp must be a 64-bit integer within 24 hours of the time the event is submitted to New Relic. JSON example Here is an example of a typical JSON data set for sending with the API. This call sends two Purchase type events as a JSON array. You can add multiple events in a single HTTP call using a JSON array. [ { \"eventType\":\"Purchase\", \"account\":3, \"amount\":259.54 }, { \"eventType\":\"Purchase\", \"account\":5, \"amount\":12309, \"product\":\"Item\" } ] When generating the JSON, make sure your attributes are properly formatted. Limits and restricted characters The following size and rate limits apply to events sent to the Event API: Payload total size: 1MB maximum per POST. We highly recommend using compression. Number of attributes per event: 255 maximum Length of attribute name: 255 characters Length of attribute value: 4096 maximum character length There are rate limits on the number of HTTP requests per minute sent to the Event API. Some specific attributes have additional restrictions: accountId: This is a reserved attribute name. If it is included, it will be dropped during ingest. appId: Value must be an integer. If it is not an integer, the attribute name and value will be dropped during ingest. eventType: Can be a combination of alphanumeric characters, _ underscores, and : colons. timestamp: Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds. Submit the custom event Data submitted to the Event API uses a compressed JSON format in a simple HTTPS POST request. The Insert key page in the Insights UI automatically generates a sample curl query for you to use as a template. This example uses gzip, but you can also use deflate. Linux/bash example gzip -c example_events.json | curl -X POST -H \"Content-Type: application/json\" -H \"X-Insert-Key: YOUR_KEY_HERE\" -H \"Content-Encoding: gzip\" https://insights-collector.newrelic.com/v1/accounts/YOUR_ACCOUNT_ID/events --data-binary @- Windows/PowerShell example $accountId = \"YOUR_ACCOUNT_ID\" $insertkey = \"YOUR_KEY_HERE\" # Replace with your custom event for the body $body = '[{\"eventType\": \"powershell\", \"account\": 4, \"amount\": 123, \"fileLocation\": \"c:\\\\temp2\", \"zipped\": \"true\" }]' $headers = @{} $headers.Add(\"X-Insert-Key\", \"$insertkey\") $headers.Add(\"Content-Encoding\", \"gzip\") $encoding = [System.Text.Encoding]::UTF8 $enc_data = $encoding.GetBytes($body) $output = [System.IO.MemoryStream]::new() $gzipStream = New-Object System.IO.Compression.GzipStream $output, ([IO.Compression.CompressionMode]::Compress) $gzipStream.Write($enc_data, 0, $enc_data.Length) $gzipStream.Close() $gzipBody = $output.ToArray() Invoke-WebRequest -Headers $headers -Method Post -Body $gzipBody \"https://insights-collector.newrelic.com/v1/accounts/$accountId/events\" Always use compression with every payload. This allows you to send more data, and it saves resources during parsing. Before generating your HTTP request, make sure it is properly formatted, including: The X-Insert-Key contains the correct Insert API key. The Content-Type is application/json. The request uses POST only. The API does not accept PUT and GET requests. The API supports HTTP/1.1 persistent connections. This is helpful to manage client-side performance under heavy event loads. Verify or troubleshoot request response The Event API follows a two-step process to process requests: The Event API synchronously acknowledges or rejects the request based on validation of the headers and payload size. The Event API asynchronously parses the payload after a successful HTTP response is provided to the client. This may generate an error due to missing or malformed data. These are classified as submission errors or parsing errors. All successful submissions receive a 200 response, regardless of any data errors that may exist within the payload. The response includes a uuid, which is a unique ID created for each request. The uuid also appears in any error events created for the request. Other potential issues: 10-second timeout: API calls exceeding 10 seconds will time out. Large payloads: Payloads exceeding 100 KB may see increased response times. Recommendation: In addition to checking for a success message, use the Insights data explorer to ensure your events are reporting correctly and to generate queries. Success response code Success message Comments 200 {\"success\":true,\"uuid\":\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"} Submission errors Payloads with submission errors are handled and returned to the sender through an HTTP response code. To troubleshoot payload submission errors, refer to these HTTP response codes. Submission errors Troubleshooting 400 Missing or invalid content length: Unable to process empty request. 403 Missing or invalid API key: Invalid Insert key, or the account does not have access to Insights. Register a valid Insert key. 408 Request timed out: Request took too long to process. 413 Content too large: Request is too large to process. Refer to the limits and restricted characters to troubleshoot. 415 Invalid content type: Must be application/JSON. The Event API accepts any content type except multi-part/related and assumes it can be parsed to JSON. 429 Too many requests due to rate limiting. 503 Service temporarily unavailable: Retry request Parsing errors Parsing errors occur if: An event is sent within a payload, but it is either missing data or is exceeding maximum limits. New Relic will drop the individual event from the payload, generate an NrIntegrationError event, and process the rest. The JSON payload includes malformed JSON or missing required data. Payloads with parsing errors receive a 200 response to indicate a successful submission. To help resolve parsing errors, a new NrIntegrationError event type is created. All parsing errors are due to NRQL queries. For error messages related to dropped events, New Relic will include the number of events that were dropped as part of the message. To troubleshoot requests with parsing errors, refer to these error messages. Parsing errors Troubleshooting X event(s) rejected because attribute appId was not an integer An appId attribute has a non-integer value, such as a decimal value or string. X event(s) rejected because eventType cannot contain the following characters: [., \\] An eventType attributed included an invalid character, such as a period or backslash. X event(s) rejected because attribute is missing attribute name An attribute name was set to null or an empty string. X event(s) rejected because attribute name exceeded maximum length An attribute name has more than 255 characters. X event(s) rejected because attribute value exceeded maximum length An attribute value was longer than 4096 characters. X event(s) rejected because event exceeded maximum number of attributes An event has more than 255 attributes. X event(s) rejected because missing required attributes eventType The eventType attribute is required for the custom event. Error parsing JSON payload There was an error parsing the request JSON because of formatting problems or corrupted data. Query and alert with NrIntegrationError The NrIntegrationError event allows you to query and set alerts on custom data being sent to your New Relic account. Recommendation: To have New Relic Alerts notify you about parsing errors, create a NRQL condition for NrIntegrationError. Use this example NRQL query: SELECT message FROM NrIntegrationError WHERE newRelicFeature = 'Event API' AND category = 'EventApiException' NrIntegrationError attributes Troubleshooting timestamp The timestamp when the request was received. The timestamp attribute takes an unformatted Unix timestamp. You can define timestamps either in seconds or in milliseconds, both relative to the Unix epoch. Do not use a decimal for the timestamp. If a decimal is used, the attribute will default to the timestamp when the custom event was created. newRelicFeature The name of the feature experiencing errors. For all custom event parsing errors, this will be Event API. apiKeyPrefix The first six characters of the Insert API key used for the request that generated an error. requestId The uuid returned by the the API for the request that generated an error. Category The category of the error. For custom events, this is EventApiException. Message Contents of the error message. Name The error's name. For custom events, this is always EventValidationException. eventTypeSample One of the event types that generated the error, when available. Find your data To find data sent via the Event API (and from integrations that use this API), you can query it. For example, to query a custom event using NRQL, you would run: SELECT * FROM YOUR_CUSTOM_EVENT For more on how to query, see Query data. Limit on HTTP requests The Event API has a rate limit of 100,000 HTTP requests (POSTs) per minute, per account. (Note that this is not a limit on the number of events per minute; only on the number of POSTs per minute.) This limit helps ensure that large traffic spikes in accounts across our multi-tenant platform do not negatively affect how the service performs for you. If your API usage exceeds 100k POSTs in a 1-minute window, we will reject subsequent API requests with a 429 response code for the remainder of the 1-minute window. At the end of the 1-minute window, the counter will be reset and allow traffic to resume. This limit is intended to be an upper threshold that you shouldn't hit under normal scenarios. If you have a high number of 429 responses, consider using the API less. If you are expecting a higher-than-normal activity level in the near future and want to prepare for that, contact technical support. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "type": "docs", "document_type": "page", - "breadcrumb": "Contents / Mobile / New Relic Mobile / Configuration", - "info": "For New Relic's mobile monitoring: learn how to send custom data, and which of the custom data types is best for your use case.", - "nodeid": 13961, + "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs", + "info": "Intro to New Relic's Event API, which lets you send custom event data to your New Relic account. ", + "nodeid": 17376, "sections": [ - "New Relic Mobile", + "Ingest and manage data", "Get started", - "Guides", - "Configuration", - "Add custom data to mobile monitoring", - "Choose a custom data type", - "Add session-level custom attributes", - "Record breadcrumbs", - "Create custom interactions", - "Record custom events", + "Understand data", + "Manage data", + "Ingest APIs", + "Use the Event API to report custom events", + "Basic workflow", + "Register an Insert API key", + "Format the JSON", + "Submit the custom event", + "Verify or troubleshoot request response", + "Query and alert with NrIntegrationError", + "Find your data", + "Limit on HTTP requests", "For more help" ], - "title": "Add custom data to mobile monitoring", + "title": "Use the Event API to report custom events", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/telemetry-data-platform/ingest-manage-data/ingest-apis/use-event-api-report-custom-events", "popularity": 1, - "external_id": "5e9a3b96793ee679a63e3d5a1db62f962d8e2b36", - "category_1": "New Relic Mobile", - "category_2": "Configuration", + "external_id": "589a1cbf9b6b64be620689b3af3cbadff0c67da2", + "category_1": "Ingest and manage data", + "category_2": "Ingest APIs", "image": "", - "url": "https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/maintenance/add-custom-data-new-relic-mobile", - "published_at": "2020-08-15T10:21:41Z", - "updated_at": "2020-08-15T10:21:41Z", - "category_0": "Mobile", + "url": "https://docs.newrelic.com/docs/telemetry-data-platform/ingest-manage-data/ingest-apis/use-event-api-report-custom-events", + "published_at": "2020-08-18T14:06:57Z", + "updated_at": "2020-08-15T09:07:03Z", + "category_0": "Telemetry Data Platform", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.00041962852, + "_score": 0.39592767, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Add custom data to mobile monitoring", - "sections": "Add custom data to mobile monitoring", - "info": "For New Relic's mobile monitoring: learn how to send custom data, and which of the custom data types is best for your use case.", - "body": " session. You can also query them using NRQL and query either all breadcrumbs or just breadcrumbs from crashed sessions. This lets you see the frequency of app paths that include that particular breadcrumb. To add custom breadcrumbs, see: Android: Use recordBreadcrumb(). iOS: Use recordBreadcrumb" + "title": "Use the Event API to report custom events", + "sections": "Use the Event API to report custom events", + "info": "Intro to New Relic's Event API, which lets you send custom event data to your New Relic account. ", + "category_2": "Ingest APIs", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/telemetry-data-platform/ingest-manage-data/ingest-apis/use-event-api-report-custom-events", + "body": "The New Relic Event API is one way to report custom events to New Relic. The Event API lets you send custom event data to your New Relic account with a POST command. These events are then queryable and chartable using NRQL. If your account hosts data in the EU data center, ensure you are using", + "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs" }, - "id": "59a14f2a8e9c0f4ac8eed8b3" + "id": "5f37a5b7196a6743a355e613" } ], - "/build-apps/build-hello-world-app": [ + "/automate-workflows/get-started-terraform": [ { - "body": "Nerdpack file structure A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. Here we explain: The file structure for a Nerdpack, a Nerdlet, and a launcher How to link a launcher file to a Nerdlet How to link your application with a monitored entity For basic component definitions, see our component reference. Generate Nerdpack components There are two ways to generate a Nerdpack template: Generate a Nerdpack: Use the New Relic One CLI command nr1 create and select Nerdpack to create a Nerdpack template that includes a Nerdlet and a launcher. Generate Nerdlet or launcher individually: Use the New Relic One CLI command nr1 create and choose either Nerdlet or launcher. This can be useful when adding Nerdlets to an existing Nerdpack. For documentation on generating and connecting Nerdpack components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │   └── my-nerdlet-launcher │   ├── icon.png │   └── nr1.json ├── nerdlets │   └── my-nerdlet-nerdlet │   ├── index.js │   ├── nr1.json │   └── styles.scss ├── node_modules │   ├── js-tokens │   ├── loose-envify │   ├── object-assign │   ├── prop-types │   ├── react │   ├── react-dom │   ├── react-is │   └── scheduler ├── nr1.json ├── package-lock.json └── package.json Copy Nerdlet file structure A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files, index.js, nr1.json, and styles.scss. Here is what the default files look like after being generated using the nr1 create command: index.js The JavaScript code of the Nerdlet. import React from 'react'; export default class MyAwesomeNerdpack extends React.Component { render() { return

Hello, my-awesome-nerdpack Nerdlet!

; } } Copy nr1.json The Nerdlet configuration file. { \"schemaType\": \"NERDLET\", \"id\": \"my-awesome-nerdpack-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\" } Copy Besides using the launcher as the access point for your application, you can also associate the application with a monitored entity to get it to appear in the entity explorer. To do this, add two additional fields to the config file of the first-launched Nerdlet: entities and actionCategory. In the following example, the Nerdlet has been associated with all Browser-monitored applications and will appear under the Monitor UI category : { \"schemaType\": \"NERDLET\", \"id\": \"my-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"Custom Data\", \"entities\": [{ \"domain\": \"BROWSER\", \"type\": \"APPLICATION\" }], \"actionCategory\": \"monitor\" } Copy To see this application in the UI, you would go to the entity explorer, select Browser applications, and select a monitored application. styles.scss An empty SCSS file for styling your application. icon.png The launcher icon that appears on the Apps page in New Relic One when an application is deployed. Launcher file structure Launchers have their own file structure. Note that: A launcher is not required; as an alternative to using a launcher, you can associate your application with a monitored entity. An application can have more than one launcher, which might be desired for an application with multiple Nerdlets. After generating a launcher using the nr1 create command, its folder contains two files: nr1.json The configuration file. { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy To connect a launcher to a Nerdlet, the rootNerdletId must match the id in the launched Nerdlet's nr1.json config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet. icon.png The icon displayed on the launcher for the app on the Apps page.", - "type": "developer", + "body": "In order to provide a unified experience, we're deprecating Synthetics monitor alert notifications and alert conditions violations, and replacing these pages with a new synthetic monitor overview experience in New Relic One. This new experience provides visibility into a monitor's open violations and alert conditions with the monitor results in a single view, removing the need to open multiple tabs to view violations or alert conditions. For more information, check the EoL Announcements page. If you want to receive alert notifications when a synthetic monitor fails, you can configure the alert notification either while creating a monitor or after you have created one. You can configure your monitor's alert policy directly from the Synthetics UI or via the Alerts UI for existing monitors. To identify which monitors do not have policies assigned to them, review their color-coded health status. Add a synthetic monitor to alert policies A monitor can be included in multiple alert policies. You can view the alert policies and conditions for the selected monitor from the Synthetics UI or from the Alerts UI. To add an existing monitor to an alert policy: Go to one.newrelic.com > Alerts & AI > Policies. From the list of existing alert policies, use the search box or scroll the list to locate one or more alert policies where the monitor has not already been added. Open the policy, then click Add a condition. Click Synthetics and then select the monitor. Fill out the remaining settings and click Create condition. Existing monitor: Remove from alert policy To remove an existing monitor from an existing alert policy: Go to one.newrelic.com > Alerts & AI > Policies. From the list of existing alert policies, use the search box or scroll the list to locate one or more alert policies where the monitor has not already been added. Select the trash can (delete) icon on the monitor's row. Receive alert notifications on a three-strike basis Synthetic alert notifications operate on a three-strike basis, sending an alert after three monitor attempts from a single location return an error. Your alert policy configuration and notification channel settings will determine when you receive alerts for specific monitors and locations. If you monitor a non-public app and add your selected public minion IPs to your allow list, you may very infrequently receive a false downtime alert. When a synthetic monitoring data center goes down, New Relic may decide to temporarily use an alternate host, which results in the temporary server's IP being blocked by your app. Mute (disable) monitor's alert notifications To temporarily disable alerting for a monitor, mute it: Go to one.newrelic.com > Synthetics > Monitors > (select a monitor). Click General under the Settings menu in the left menu sidebar. Click the Notifications button to Off. Muting a monitor's alert notifications will not mute multi-location alerts or NRQL alerts. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "An overview of the Nerdpack File Structure", + "breadcrumb": "Contents / Synthetic monitoring / Synthetic monitoring / Using monitors", + "info": "New Relic can use alerts to notify you about synthetic monitors's failures.", + "nodeid": 6371, "sections": [ - "Nerdpack file structure", - "Generate Nerdpack components", - "Nerdlet file structure", - "index.js", - "nr1.json", - "styles.scss", - "icon.png", - "Launcher file structure" + "Synthetic monitoring", + "Getting started", + "Guides", + "Using monitors", + "Monitor scripting", + "Administration", + "Private locations", + "UI pages", + "Synthetics API", + "Troubleshooting", + "Alerts for synthetic monitoring", + "Add a synthetic monitor to alert policies", + "Existing monitor: Remove from alert policy", + "Receive alert notifications on a three-strike basis", + "Mute (disable) monitor's alert notifications", + "For more help" ], - "title": "Nerdpack file structure", + "title": "Alerts for synthetic monitoring", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/synthetics/synthetic-monitoring/using-monitors/alerts-synthetic-monitoring", "popularity": 1, - "external_id": "c97bcbb0a2b3d32ac93b5b379a1933e7b4e00161", + "external_id": "b69353439d3cc180ca46c64bef5e8470cdda1636", + "category_1": "Synthetic monitoring", + "category_2": "Using monitors", "image": "", - "url": "https://developer.newrelic.com/explore-docs/nerdpack-file-structure/", - "published_at": "2020-08-17T01:54:02Z", - "updated_at": "2020-08-14T01:49:25Z", + "url": "https://docs.newrelic.com/docs/synthetics/synthetic-monitoring/using-monitors/alerts-synthetic-monitoring", + "published_at": "2020-08-18T11:09:08Z", + "updated_at": "2020-08-14T00:47:54Z", + "category_0": "Synthetic monitoring", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.88521993, + "_score": 0.5598317, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Nerdpack file structure", - "sections": "Nerdpack file structure", - "info": "An overview of the Nerdpack File Structure", - "body": " components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │   └── my-nerdlet-launcher │   ├── icon.png" + "title": "Alerts for synthetic monitoring", + "sections": "Mute (disable) monitor's alert notifications", + "info": "New Relic can use alerts to notify you about synthetic monitors's failures.", + "category_0": "Synthetic monitoring", + "category_1": "Synthetic monitoring", + "category_2": "Using monitors", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/synthetics/synthetic-monitoring/using-monitors/alerts-synthetic-monitoring", + "body": " the alert notification either while creating a monitor or after you have created one. You can configure your monitor's alert policy directly from the Synthetics UI or via the Alerts UI for existing monitors. To identify which monitors do not have policies assigned to them, review their color-coded health", + "breadcrumb": "Contents / Synthetic monitoring / Synthetic monitoring / Using monitors" }, - "id": "5efa989e196a671300766404" + "id": "5f31b60e196a6742d2fbd6c8" }, { - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", - "type": "developer", + "body": "If you delete a channel, you cannot restore it. If you want to keep the notification channel, you can remove it from any associated policy. Delete a channel To delete a channel permanently: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Optional: To find the notification channel easily, search the Notification channels index. From the Notification channels index, select the channel's delete icon, and then select the confirmation prompt to cancel or continue. When you delete (or remove) a channel, any policies associated with it will still remain. You must delete policies separately. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert notifications", + "info": "You can delete alerts notification channels permanently or you can keep channels but remove them from associated policies.", + "nodeid": 6471, "sections": [ - "New Relic One CLI reference", - "Installing the New Relic One CLI", - "New Relic One CLI Commands", + "New Relic Alerts", "Get started", - "Configure your CLI preferences", - "Set up your Nerdpacks", - "Manage your Nerdpack subscriptions", - "Install and manage plugins", - "Manage catalog information" + "Alert policies", + "Alert conditions", + "Alert violations", + "Alert Incidents", + "Alert notifications", + "Troubleshooting", + "Rules, limits, and glossary", + "Alerts and Nerdgraph", + "REST API alerts", + "Delete alert notification channels", + "Delete a channel", + "For more help" ], - "title": "New Relic One CLI reference", + "title": "Delete alert notification channels", "popularity": 1, - "tags": [ - "New Relic One app", - "nerdpack commands" - ], - "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", - "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", - "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-14T01:47:13Z", + "external_id": "dcea3b60f23ddeb74a7a0a0f44a5130cd9e2885d", + "category_1": "New Relic Alerts", + "category_2": "Alert notifications", + "image": "", + "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/delete-alert-notification-channels", + "published_at": "2020-08-18T18:07:05Z", + "updated_at": "2020-08-15T07:46:52Z", + "category_0": "Alerts and Applied intelligence", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.7960509, + "_score": 0.5424085, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI reference", - "sections": "New Relic One CLI reference", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "tags": "New Relic One app", - "body": " our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages" + "title": "Delete alert notification channels", + "sections": "Delete alert notification channels", + "info": "You can delete alerts notification channels permanently or you can keep channels but remove them from associated policies.", + "category_2": "Alert notifications", + "body": "If you delete a channel, you cannot restore it. If you want to keep the notification channel, you can remove it from any associated policy. Delete a channel To delete a channel permanently: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Optional: To find" }, - "id": "5efa989e28ccbc535a307dd0" + "id": "5f2dbb3628ccbc65c788dfcb" }, { - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", - "type": "developer", + "body": "Depending on the selected channel type, different values appear. Reference for updating channels Here's a quick reference for updating channels which also includes links to more detailed information and procedures. Add or remove policies assigned to a channel To add or remove policies assigned to a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. Choose a channel, and then click Alert policies. From the selected policy, use the windows to select, remove, or clear all notification channels. Assign a channel to policies To add a notification channel to one or more policies: Go to one.newrelic.com, in the top nav click Alerts & AI, click Policies. Choose a policy, click Notification channels, and then click Add notification channels. Choose a channel, and then click Update policy. Change a channel's name To rename an existing notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels, then choose a channel. From the Channel details, change the name (maximum 64 characters) based on the channel type if applicable, and then save. Check for policies assigned to a user To check whether an account user has any policies assigned: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. Optional: Search by \"user\" to browse users or a specific username or email. Choose the user, then click Alert policies. Check how many policies are assigned to a channel To check whether a notification channel has any policies assigned: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. The Policy subscriptions column lists how many policies are assigned to the channel. Create more channels To create a new notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. Click New notification channel. Delete a channel To delete a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. In the list, click the Delete icon. Test a saved channelView assigned alert policies To view the policies assigned to a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels, choose a channel, and then click Alert policies. OR To view the notification channels assigned to a policy: Go to one.newrelic.com, in the top nav click Alerts & AI, click Policies, choose a policy, then click Notification channels. Basic process Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels, then choose a channel. From the Channel details page, make any necessary changes, and then save. The user interface shows a Last modified time stamp for any changes to policies, including their conditions and notification channels. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "The command line tools for performing tasks against New Relic APIs", + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert notifications", + "info": "Read about how to update alerts notification channels. ", + "nodeid": 6481, "sections": [ - "New Relic CLI Reference", - "New Relic CLI commands", - "Options", - "Commands" + "New Relic Alerts", + "Get started", + "Alert policies", + "Alert conditions", + "Alert violations", + "Alert Incidents", + "Alert notifications", + "Troubleshooting", + "Rules, limits, and glossary", + "Alerts and Nerdgraph", + "REST API alerts", + "Update alert notification channels", + "Reference for updating channels", + "Basic process", + "For more help" ], - "title": "New Relic CLI Reference", + "title": "Update alert notification channels", "popularity": 1, - "tags": "new relic cli", - "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", + "external_id": "ee8bce401d0623e8b85d84a6a20bd8a72b9764ef", + "category_1": "New Relic Alerts", + "category_2": "Alert notifications", "image": "", - "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-08-17T01:54:02Z", - "updated_at": "2020-08-14T01:47:12Z", + "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/update-alert-notification-channels", + "published_at": "2020-08-18T18:07:05Z", + "updated_at": "2020-08-11T06:42:27Z", + "category_0": "Alerts and Applied intelligence", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.5129249, + "_score": 0.45523524, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic CLI Reference", - "sections": "New Relic CLI Reference", - "tags": "new relic cli", - "body": " - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads" + "title": "Update alert notification channels", + "sections": "Update alert notification channels", + "info": "Read about how to update alerts notification channels. ", + "category_2": "Alert notifications", + "body": " to a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. Choose a channel, and then click Alert policies. From the selected policy, use the windows to select, remove, or clear all notification channels. Assign a channel to policies To add" }, - "id": "5efa989ee7b9d2024b7bab97" + "id": "5f2dbad928ccbcb8ca88dfed" }, { - "body": "A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. This document explains: The file structure for a Nerdpack, a Nerdlet and a launcher How to link a launcher file to a Nerdlet How to link your application with a monitored entity For basic component definitions, see our developer site. Generate Nerdpack components There are two ways to generate a Nerdpack template: Generate Nerdpack. Use the CLI command nr1 create and select Nerdpack to create a Nerdpack template that includes a Nerdlet and a launcher. Generate Nerdlet or launcher individually. You can use the CLI command nr1 create and choose to select either a Nerdlet or launcher. This may be useful when adding Nerdlets to an existing Nerdpack. For a lesson on generating and connecting Nerdpack components, see the workshop. Nerdpack file structure When you generate a Nerdpack template using the CLI nr1 create command, it has this file structure: my-nerdlet ├── README.md ├── launchers │ └── my-nerdlet-launcher │ ├── icon.png │ └── nr1.json ├── nerdlets │ └── my-nerdlet-nerdlet │ ├── index.js │ ├── nr1.json │ └── styles.scss ├── node_modules │ ├── js-tokens │ ├── loose-envify │ ├── object-assign │ ├── prop-types │ ├── react │ ├── react-dom │ ├── react-is │ └── scheduler ├── nr1.json ├── package-lock.json └── package.json Nerdlet file structure A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files: index.js The JavaScript code. Here's what the default file looks like when a Nerdlet is generated with the CLI nr1 create: import React from 'react'; export default class MyAwesomeNerdpack extends React.Component { render() { return

Hello, my-awesome-nerdpack Nerdlet!

} } nr1.json Configuration file. Here is the default file generated by the CLI nr1 create command: { \"schemaType\": \"NERDLET\", \"id\": \"my-awesome-nerdpack-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\" } Besides using the launcher as the access point for your application, you can also associate the application with a monitored entity to get it to appear in the New Relic One entity explorer. To do this, add two additional fields to the config file of the first-launched Nerdlet: entities and actionCategory. In the following example, the Nerdlet has been associated with all New Relic Browser-monitored applications and will appear under the Monitor UI category : { \"schemaType\": \"NERDLET\", \"id\": \"my-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"Custom Data\", \"entities\": [{\"domain\": \"BROWSER\", \"type\": \"APPLICATION\"}], \"actionCategory\": \"monitor\" } To see this application in the UI, you would go to the New Relic One entity explorer, select Browser applications, and select a monitored application. styles.scss The file for CSS styles (Sass SCSS syntax). Launcher file structure When an application with a launcher file has been deployed, its launcher is located on the New Relic One home page (one.newrelic.com). A launcher is not required; as an alternative to using a launcher, you can associate your application with a monitored entity. An application can have more than one launcher; this may be desired for an application with multiple Nerdlets. A launcher folder contains two files: nr1.json The configuration file. Here is the default file template created by the nr1 create command: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } To connect a launcher to a Nerdlet, the rootNerdletId must match the id in the launched Nerdlet's nr1.json config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet. icon.png The launcher icon that appears on the one.newrelic.com home page when an application is deployed. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "body": "You must save a new notification channel or any changes to an existing notification channel before testing it. Alerts will then send a test message to your chosen destination. Request the test To test a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Follow standard procedures to add a new notification channel or to update an existing notification channel, and save it. Select a notification channel, and then click Envelope Message Icon Send a test notification. Review the test confirmation message, and then click Got it. Troubleshoot the test results A confirmation message will automatically show up in the user interface that indicates where the test was sent (for example, email) and whether it was successful. Also, the test notification message itself includes detailed information, including: The person who requested the test Links to policies for the channel Links to all notification channels and policies for the account When troubleshooting problems, review the test notification message, and verify the setup requirements for the type of notification channel you selected. If necessary, make additional changes to your notification channel, and test it again as needed. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "type": "docs", "document_type": "page", - "breadcrumb": "Contents / New Relic One / Use New Relic One / Build on New Relic One", - "info": "For building a New Relic One application: an explanation of the Nerdpack/Nerdlet file structure. ", - "nodeid": 36006, + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert notifications", + "info": "Be sure to save your alerts notification channels before testing them to make sure they're working properly.", + "nodeid": 6491, "sections": [ - "Use New Relic One", + "New Relic Alerts", "Get started", - "Core concepts", - "UI and data", - "Workloads", - "Build on New Relic One", - "Nerdpack file structure", - "Generate Nerdpack components", - "Nerdlet file structure", - "Launcher file structure", + "Alert policies", + "Alert conditions", + "Alert violations", + "Alert Incidents", + "Alert notifications", + "Troubleshooting", + "Rules, limits, and glossary", + "Alerts and Nerdgraph", + "REST API alerts", + "Test alert notification channels", + "Request the test", + "Troubleshoot the test results", "For more help" ], - "title": "Nerdpack file structure", - "popularity": 1, - "external_id": "6e3788bee17cb65b6dc210862e2a10399f78ff67", - "category_1": "Use New Relic One", - "category_2": "Build on New Relic One", + "title": "Test alert notification channels", + "popularity": 1, + "external_id": "fcea4cf920f099fa1fcf7fab3760d57bdf2e02b7", + "category_1": "New Relic Alerts", + "category_2": "Alert notifications", "image": "", - "url": "https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/new-relic-one-application-nerdpack-file-structure", - "published_at": "2020-08-15T11:15:51Z", - "updated_at": "2020-07-25T00:32:16Z", - "category_0": "New Relic One", + "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/test-alert-notification-channels", + "published_at": "2020-08-18T18:08:07Z", + "updated_at": "2020-08-11T04:16:54Z", + "category_0": "Alerts and Applied intelligence", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.46782482, + "_score": 0.45365188, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Nerdpack file structure", - "sections": "Nerdpack file structure", - "info": "For building a New Relic One application: an explanation of the Nerdpack/Nerdlet file structure. ", - "category_0": "New Relic One", - "category_1": "Use New Relic One", - "category_2": "Build on New Relic One", - "body": " file structure When you generate a Nerdpack template using the CLI nr1 create command, it has this file structure: my-nerdlet ├── README.md ├── launchers │ └── my-nerdlet-launcher │ ├── icon.png │ └── nr1.json ├── nerdlets │ └── my-nerdlet-nerdlet │ ├── index.js │ ├── nr1.json │ └── styles.scss", - "breadcrumb": "Contents / New Relic One / Use New Relic One / Build on New Relic One" + "title": "Test alert notification channels", + "sections": "Test alert notification channels", + "info": "Be sure to save your alerts notification channels before testing them to make sure they're working properly.", + "category_2": "Alert notifications", + "body": "You must save a new notification channel or any changes to an existing notification channel before testing it. Alerts will then send a test message to your chosen destination. Request the test To test a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, then click" }, - "id": "5da0e07a64441f1328edf241" + "id": "5f2dbb3664441fd3a556a97c" }, { - "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.", - "type": "developer", + "body": "You can use alerts to set up notification channels, and attach those channels to policies. Your selected channels provide fast and consistent ways for the right personnel to be notified about incidents. For example, notifications allow you to include charts about the incident to provide context and share them with your team. Alerts offers several notification channels, including webhooks, Slack rooms, email, and more. You'll be notified by your notification channels when incidents are opened, acknowledged, or closed. This document explains the available notification channels and how to set them up. This document is about alerts notifications. For general information about unsubscribing from other New Relic emails, including marketing emails, weekly reports, and announcements, see Unsubscribe from New Relic emails. View notification channels To see all notification channels in your account: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Add or remove notification channels To set up a new notification channel: On the Notification channels, click New notification channel. Select the type of channel and complete other required steps for it. To add or remove a notification policy or channel: Select a specific notification channel, select Alert policies, and add or remove a policy. OR Select a specific policy, select Notification channels, and add or remove a channel. Instructions for specific notification channels These are the available notification channel types. User For your convenience, we automatically load all users and their email addresses for the selected account. If your account has one or more sub-accounts, the notification channel includes only users for the currently selected master or sub-account. Use the User notification channel to select existing account team members and admins. To view the Users list or to add users to alert policies: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. A user channel also sends push notifications to any of the user's registered mobile devices. A device is registered if the user has logged into New Relic using the mobile app on the device. Email We automatically add every individual and their email address on the selected account to the User notification channel and you can select them there. You don't need to add existing New Relic accounts to the Email channel. To add an email channel for other users, follow these guidelines: Field Description Email (required) In general, use the Email notification channel to identify user emails or email aliases that are not already on the selected account. For example, if you have a dev-ops@company.com email alias for your DevOps team, add the email alias to the Email channel. Otherwise, use the User notification channel to select specific users on your DevOps team. For easier maintenance, add a single non-user email address or alias to a single alert notification channel. If you want to use the email channel for more than one email, create an email group or alias outside your account. These email addresses can be the same as or different from email addresses already on your account. Users can unsubscribe from general (non-alerts-related) emails, but they cannot unsubscribe from alerts email notifications. Instead, the account Owner, Admin, or add-on manager must remove users from the policy's email notification channel. Include JSON attachment (optional) To include a JSON attachment with the email notification, select this checkbox. OpsGenie You must have an existing OpsGenie account integrated with New Relic in order to provide the following information: Field Description Channel name (required) A meaningful name for the OpsGenie notification channel (maximum 64 characters). API key (required) The API key generated from your OpsGenie integration used to authenticate API requests. Teams (optional) List of team names that are responsible for the alert. OpsGenie runs team escalation policies to calculate which users will receive notifications. Tags (optional) A comma-separated list of labels attached to the alert. To overwrite the OpsGenie Quiet Hours setting for urgent alerts, add an OverwriteQuietHours tag. Recipients (optional) One or more names of users, groups, on-call schedules, escalation policies, etc., that OpsGenie uses to calculate where to send notifications. PagerDuty You must have an existing PagerDuty account in order to provide the following information: Field Description Service name (required) The name of your service integrating with PagerDuty for notifications. Integration key (required) The unique service identifier used by PagerDuty's Integration API to trigger, acknowledge, and resolve incidents for the service. Slack Before adding Slack notifications, you must create a unique webhook integration using Slack's New Relic integration. If you want web, transaction, server, and mobile alerts to be posted in separate channels, you must set up separate integrations for each one. Field Description Channel name (required) A meaningful name for the Slack notification channel (maximum 64 characters); for example, Network Ops Center. URL (required) Copy and paste the New Relic webhook integration URL that you've set up with Slack. For example: https://hooks.slack.com/services/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 Be sure to include https:// in the URL. Do not use http://. Team channel (optional) If used, include # before the name of the Slack channel where alert notifications are sent; for example, #NOC. VictorOps You must have an existing VictorOps account in order to provide the following required information: Field Description Channel name (required) A meaningful name for this notification channel (maximum 64 characters). For example, if the VictorOps Route key is for your Technical Support team, you could name this channel Tech Support - VictorOps. Key (required) VictorOps generates a unique key for each account. It maps the VictorOps account to its associated integrations. Route key (optional) This key maps the alert or incident to a specific team. Webhook Webhooks are HTTP POST messages containing JSON documents delivered to a destination URL. When an incident is opened, acknowledged, or closed, our webhook feature sends a message to your URL with any relevant information, such as a description of the event and a link back to New Relic. You also have the option to customize the payload in the POST message for further integration into your system. If your endpoint does not acknowledge the POST request within 10 seconds, the Alerts UI may indicate a failed notification event for the related incident. Before adding webhook notifications, you must have an endpoint set up to respond with a status code between 200 and 206 after receiving the following required information: Field Description Channel name (required) A meaningful name for the webhook (maximum 64 characters). Base url (required) The endpoint that will receive the POST message and trigger customized behaviors in your system. If you want to include a port number in the webhook URL, make sure the port is available for requests. Otherwise the webhook will not work. Basic auth (optional) To require basic authentication for the webhook, select Add basic auth, and provide the user name and password to authenticate the webhook. Custom headers (optional) To include headers with webhooks, select Add custom headers, and provide the name and value for each header. Use custom payload (optional) To use the default values, leave blank. To view and edit the default values, select Add custom payload. Payload (for custom payloads only) Your customized POST message code. This field includes: A list of variables you can use Syntax highlighting, based on payload type Payload type (for custom payloads only) Specify the message format: JSON (default) or Form. xMatters You must have an existing xMatters account in order to provide the following information: Field Description Channel name (required) Name your channel so you can identify it easily when associating it with a policy. Integration url (required) The unique integration url provided by xMatters pointing to your xMatters account. Receive mobile push notifications In order to receive mobile push notifications, your device must be registered and listed in (account) > User preferences. If the device is not listed in User preferences, log out of the app, log back in, and check again to see if it is listed. To receive mobile push notifications: Log in to your New Relic account via the mobile app at least once to ensure the device is registered. Add the user channel to the alert policy. Switch push notifications On for the device. Acknowledge alert notifications Anyone in your account can acknowledge notifications through the user interface or email notification. Acknowledging an incident in New Relic also acknowledges any associated incident in PagerDuty. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "Intro to New Relic One API components", + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert notifications", + "info": "Read about how to set up alerts notification channels so you can be notified when incidents are opened, acknowledged, or closed.", + "nodeid": 6281, "sections": [ - "Intro to New Relic One API components", - "Components of the SDK", - "UI components", - "Chart components", - "Query and storage components", - "Platform APIs" + "New Relic Alerts", + "Get started", + "Alert policies", + "Alert conditions", + "Alert violations", + "Alert Incidents", + "Alert notifications", + "Troubleshooting", + "Rules, limits, and glossary", + "Alerts and Nerdgraph", + "REST API alerts", + "Notification channels: Control where to send alerts", + "View notification channels", + "Add or remove notification channels", + "Instructions for specific notification channels", + "Receive mobile push notifications", + "Acknowledge alert notifications", + "For more help" ], - "title": "Intro to New Relic One API components", + "title": "Notification channels: Control where to send alerts", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/notification-channels-control-where-send-alerts", "popularity": 1, - "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2", + "external_id": "65878aca7993877ee748776c87e9225c90687e3f", + "category_1": "New Relic Alerts", + "category_2": "Alert notifications", "image": "", - "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/", - "published_at": "2020-08-17T01:54:02Z", - "updated_at": "2020-08-14T01:47:12Z", + "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/notification-channels-control-where-send-alerts", + "published_at": "2020-08-18T18:51:22Z", + "updated_at": "2020-08-15T11:49:29Z", + "category_0": "Alerts and Applied intelligence", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.42975447, + "_score": 0.41058606, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Intro to New Relic One API components", - "sections": "Intro to New Relic One API components", - "info": "Intro to New Relic One API components", - "body": ", and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform" + "title": "Notification channels: Control where to send alerts", + "sections": "Notification channels: Control where to send alerts", + "info": "Read about how to set up alerts notification channels so you can be notified when incidents are opened, acknowledged, or closed.", + "category_2": "Alert notifications", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/notification-channels-control-where-send-alerts", + "body": " account: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Add or remove notification channels To set up a new notification channel: On the Notification channels, click New notification channel. Select the type of channel and complete other required steps" }, - "id": "5efa989e28ccbc4071307de5" + "id": "5f2dbad864441fb7d256a9db" } ], - "/explore-docs/newrelic-cli": [ + "/build-apps/add-query-mutate-data-nerdstorage": [ { - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", + "body": "Build apps You know better than anyone what information is crucial to your business, and how best to visualize it. Sometimes, this means going beyond dashboards to creating your own app. With React and GraphQL, you can create custom views tailored to your business. These guides are designed to help you start building apps, and dive into our library of components. We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a \"Hello, World!\" application Build a \"Hello, World!\" app and publish it to New Relic One 20 min Publish and deploy apps Start sharing the apps you build 20 min Set up your development environment Prepare to build apps and contribute to this site 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 30 min Add a table to your app Add a table to your New Relic One app 30 min Create a custom map view Build an app to show page view data on a map", "type": "developer", "document_type": "page", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "info": "", "sections": [ - "New Relic One CLI reference", - "Installing the New Relic One CLI", - "New Relic One CLI Commands", - "Get started", - "Configure your CLI preferences", - "Set up your Nerdpacks", - "Manage your Nerdpack subscriptions", - "Install and manage plugins", - "Manage catalog information" + "Build apps", + "Guides to build apps", + "Create a \"Hello, World!\" application", + "Publish and deploy apps", + "Set up your development environment", + "Add the NerdGraphQuery component to an application", + "Add a time picker to your app", + "Add, query, and mutate data using NerdStorage", + "Add a table to your app", + "Create a custom map view" ], - "title": "New Relic One CLI reference", + "title": "Build apps", "popularity": 1, - "tags": [ - "New Relic One app", - "nerdpack commands" - ], - "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", - "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", - "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-14T01:47:13Z", + "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", + "image": "", + "url": "https://developer.newrelic.com/build-apps/", + "published_at": "2020-08-18T02:08:12Z", + "updated_at": "2020-08-18T01:45:02Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.51749843, + "_score": 0.6154529, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI reference", - "sections": "New Relic One CLI reference", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "tags": "New Relic One app", - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use" + "sections": "Add, query, and mutate data using NerdStorage", + "body": " it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one" }, - "id": "5efa989e28ccbc535a307dd0" + "id": "5efa999d64441fc0f75f7e21" }, { - "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", + "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,000 documents, plus storage type. Each document can have a maximum length of 64 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.", "type": "developer", "document_type": "page", - "info": "An overview of common commands you can use with the New Relic One CLI.", + "info": "Intro to NerdStorage on New Relic One", "sections": [ - "New Relic One CLI common commands", - "Command details", - "nr1 help", - "See commands and get details", - "Usage", - "Arguments", - "Examples", - "nr1 update", - "Update your CLI", - "nr1 create", - "Create a new component", - "Options", - "nr1 profiles", - "Manage your profiles keychain", - "Commands", - "nr1 autocomplete", - "See autocomplete installation instructions", - "nr1 nrql", - "Query using NRQL" + "Intro to NerdStorage", + "Use NerdStorage in your apps", + "Data model", + "Limits", + "Data access", + "Permissions for working with NerdStorage" ], - "title": "New Relic One CLI common commands", + "title": "Intro to NerdStorage", "popularity": 1, - "external_id": "503e515e1095418f8d19329517344ab209d143a4", + "external_id": "709e06c25376d98b2191ca369b4d139e5084bd62", "image": "", - "url": "https://developer.newrelic.com/explore-docs/nr1-common/", - "published_at": "2020-08-17T01:54:01Z", - "updated_at": "2020-08-14T01:48:10Z", + "url": "https://developer.newrelic.com/explore-docs/nerdstorage/", + "published_at": "2020-08-18T02:11:48Z", + "updated_at": "2020-08-14T01:50:34Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.39616036, + "_score": 0.15920696, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI common commands", - "sections": "New Relic One CLI common commands", - "info": "An overview of common commands you can use with the New Relic One CLI.", - "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1" + "title": "Intro to NerdStorage", + "sections": "Intro to NerdStorage", + "info": "Intro to NerdStorage on New Relic One", + "body": " document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing" }, - "id": "5f28bd6ae7b9d267996ade94" + "id": "5efa989ee7b9d2048e7bab92" }, { - "body": "New Relic One CLI catalog commands To manage your catalog, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder. Command details nr1 catalog:info Get catalog details Shows the information about your application that's displayed in the catalog. If run within a specific Nerdpack folder, the info from that Nerdpack will be shown. If you don't want to get info from your local Nerdpack, use the --nerdpack-id=NERDPACK_ID option to query from a specific Nerdpack. Usage $ nr1 catalog:info Options -f, --field=FIELD Specifies which field you want info from. -i, --nerdpack-id=NERDPACK_ID Specifies which Nerdpack to get info from. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 catalog:submit Send info to the catalog Gathers the information you add to the catalog directory for your application and saves it to the catalog. See our catalog docs for details on adding screenshots and metadata to your applications to make them easy to find, attractive, and informative. This command must be run on a Nerdpack folder. The command will search for specific files using convention names. Usage $ nr1 catalog:submit Options -P, --skip-screenshots Skips upload of screenshot assets. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", + "body": "Query and store data 10 min To help you build a New Relic One application, we provide you with the New Relic One SDK. Here you can learn how to use the SDK query components, which allow you to make queries and mutations via NerdGraph, our GraphQL endpoint. Query-related React components can be identified by the Query suffix. Mutation-related components can be identified by the Mutation prefix. Components overview Our data components are based on React Apollo. The most basic component is NerdGraphQuery, which accepts any GraphQL (or GraphQL AST generated by the graphql-tag library as the query parameter, and a set of query variables passed as variables. Over this query, we have created an additional set of queries, which can be divided into four groups: User queries: These allow you to query the current user and its associated accounts. Components in this category: UserStorageQuery and AccountsQuery. Entities queries: Because New Relic One is entity-centric, we use queries to make access to your entities easier. You can count, search, list, query, and favorite them. Components in this category: EntityCountQuery, EntitySearchQuery, EntitiesByDomainTypeQuery, EntitiesByGuidsQuery, EntityByGuidQuery, EntityByNameQuery. Storage queries: New Relic One provides a simple storage mechanism that we call NerdStorage. This can be used by Nerdpack creators to store application configuration setting data, user-specific data, and other small pieces of data. Components in this category: UserStorageQuery, AccountStorageQuery, EntityStorageQuery, UserStorageMutation, AccountStorageMutation, and EntityStorageMutation. For details, see NerdStorage. NRQL queries: To be able to query your New Relic data via NRQL (New Relic Query Language), we provide a NrqlQuery component. This component can return data in different formats, so that you can use it for charting and not only for querying. Query components All query components accept a function as a children prop where the different statuses can be passed. This callback receives an object with the following properties: loading: Boolean that is set to true when data fetching is happening. Our components use the cache-and-network strategy, meaning that after the data has loaded, subsequent data reloads might be triggered first with stale data, then refreshed when the most recent data has arrived. data: Root property where the data requested is retrieved. The structure matches a root structure based on the NerdGraph schema. This is true even for highly nested data structures, which means you’ll have to traverse down to find the desired data. error: Contains an Error instance when the query fails. Set to undefined when data is loading or the fetch was successful. fetchMore: Callback function that can be called when the query is being loaded in chunks. The function will only be present when it’s feasible to do so, more data is available, and no fetchMore has already been triggered. Data is loaded in batches of 200 by default. Other components provided by the platform (like the Dropdown or the List) are capable of accepting fetchMore, meaning you can combine them easily. Mutation components Mutation components also accept a children as a function, like the query ones. The mutation can be preconfigured at the component level, and a function is passed back that you can use in your component. This is the standard React Apollo approach for performing mutations, but you might find it easier to use our static mutation method added to the component. More on this topic below. Static methods All of the described components also expose a static method so that they can be used imperatively rather than declaratively. All Query components have a static Query method, and all Mutation components have a mutation method. These static methods accept the same props as their query component, but passed as an object. For example: // Declarative way (using components). function renderAccountList() { return (
    ({data, error}) => { if (error) { return
  • Failed to retrieve list: {error.message}
  • ; } return data.map((account) => {
  • {account.name}
  • }); }}
); } // Imperative way (using promises). async function getAccountList() { let data = {}; try { data = await AccountsQuery.query(); } catch (error) { console.log('Failed to retrieve list: ' + error.message); return; } return data.actor.accounts.map((account) => { return account.name; }); } Copy Similarly, a mutation can happen either way; either declaratively or imperatively. NrqlQuery NrqlQuery deserves additional explanation, because there are multiple formats in which you can return data from it. To provide maximum functionality, all three are exposed through a formatType property. You can find its different values under NrqlQuery.formatType: NERD_GRAPH: Returns the format in which it arrives from NerdGraph. RAW: The format exposed by default in Insights and dashboards when being plotted as JSON. This format is useful if you have a pre-existing script in this format that you're willing to migrate to or incorporate with. CHART: The format used by the charting engine that we also expose. You can find a more detailed explanation of how to manipulate this format in the guide to chart components, and some examples. If you are willing to push data, we currently do not expose NrqlMutation. To do that, see the Event API for how to add custom events.", "type": "developer", "document_type": "page", - "info": "An overview of the CLI commands you can use to manage your New Relic One catalog information.", + "info": "Reference guide for SDK query components using NerdGraph", "sections": [ - "New Relic One CLI catalog commands", - "Command details", - "nr1 catalog:info", - "Get catalog details", - "Usage", - "Options", - "nr1 catalog:submit", - "Send info to the catalog" + "Query and store data", + "Components overview", + "Query components", + "Mutation components", + "Static methods", + "NrqlQuery" ], - "title": "New Relic One CLI catalog commands", + "title": "Query and store data", "popularity": 1, - "external_id": "e94d6ad2cd04e2c01aecef526778d341867b3031", + "external_id": "cbbf363393edeefbc4c08f9754b43d38fd911026", "image": "", - "url": "https://developer.newrelic.com/explore-docs/nr1-catalog/", - "published_at": "2020-08-17T01:54:02Z", - "updated_at": "2020-08-14T01:49:24Z", + "url": "https://developer.newrelic.com/explore-docs/query-and-store-data/", + "published_at": "2020-08-18T02:08:12Z", + "updated_at": "2020-08-01T01:42:02Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.33437508, + "_score": 0.13865894, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI catalog commands", - "sections": "New Relic One CLI catalog commands", - "info": "An overview of the CLI commands you can use to manage your New Relic One catalog information.", - "body": "New Relic One CLI catalog commands To manage your catalog, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits" + "title": "Query and store data", + "sections": "Query and store data", + "info": "Reference guide for SDK query components using NerdGraph", + "body": ", EntityByGuidQuery, EntityByNameQuery. Storage queries: New Relic One provides a simple storage mechanism that we call NerdStorage. This can be used by Nerdpack creators to store application configuration setting data, user-specific data, and other small pieces of data. Components in this category" }, - "id": "5f28bd6a64441f805eb11a26" + "id": "5efa989e28ccbc2f15307deb" }, { - "body": "New Relic One CLI plugin commands To install and manage your plugins, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Command details nr1 plugins:install Install a plugin Installs a plugin into the CLI. You can install plugins from npm or a Git URL. Please note that installing a plugin will override the core plugin. For example, if you have a core plugin that has a 'hello' command, then installing a plugin with a 'hello' command will override the core plugin implementation. This is useful if you want to update the core plugin functionality without patching and updating the whole CLI. Usage $ nr1 plugins:install PLUGIN Arguments PLUGIN: the name, path, or URL of the plugin you want to install. required Options -f, --force Runs yarn install --force. This forces a re-download of all the plugin's packages. -h, --help Shows CLI help. --verbose Adds extra information to the output. Examples $ nr1 plugins:install myplugin $ nr1 plugins:install https://github.com/someuser/someplugin $ nr1 plugins:install someuser/someplugin Aliases $ nr1 plugins:add nr1 plugins:link Link your plugin Links a local plugin into the CLI for development. Please note that linking a plugin will override your user-installed plugin or core plugin. For example, if you have a user-installed or core plugin that has a 'hello' command, linking a plugin with a 'hello' command will override the user-installed or core plugin implementation. This is useful for development work. Usage $ nr1 plugins:link PLUGIN Arguments PLUGIN: the name, path, or URL of the plugin you want to link. required Options -h, --help Shows CLI help. --verbose Adds extra information to the output. Examples $ nr1 plugins:link myplugin $ nr1 plugins:link someuser/someplugin nr1 plugins:update Update your plugins Updates all of your installed plugins. Usage $ nr1 plugins:update Options -h, --help Shows CLI help. --verbose Adds extra information to the output. nr1 plugins:uninstall Uninstall your plugin Removes a plugin from the CLI. Usage $ nr1 plugins:uninstall PLUGIN Arguments PLUGIN: the name of the plugin you want to uninstall. required Options -h, --help Shows CLI help. --verbose Adds extra information to the output. Aliases $ nr1 plugins:unlink $ nr1 plugins:remove", + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", "type": "developer", "document_type": "page", - "info": "An overview of the CLI commands you can use to install and manage your plugins.", + "info": "The command line tools for performing tasks against New Relic APIs", "sections": [ - "New Relic One CLI plugin commands", - "Command details", - "nr1 plugins:install", - "Install a plugin", - "Usage", - "Arguments", + "New Relic CLI Reference", + "New Relic CLI commands", "Options", - "Examples", - "Aliases", - "nr1 plugins:link", - "Link your plugin", - "nr1 plugins:update", - "Update your plugins", - "nr1 plugins:uninstall", - "Uninstall your plugin" + "Commands" ], - "title": "New Relic One CLI plugin commands", + "title": "New Relic CLI Reference", "popularity": 1, - "external_id": "6e94c2de165c2b01c2b15c9297a7314f1895112e", + "tags": "new relic cli", + "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", "image": "", - "url": "https://developer.newrelic.com/explore-docs/nr1-plugins/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-14T01:50:34Z", + "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", + "published_at": "2020-08-18T02:11:50Z", + "updated_at": "2020-08-14T01:47:12Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.3135669, + "_score": 0.09380336, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI plugin commands", - "sections": "New Relic One CLI plugin commands", - "info": "An overview of the CLI commands you can use to install and manage your plugins.", - "body": "New Relic One CLI plugin commands To install and manage your plugins, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin" + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" }, - "id": "5f28bd6a196a670ddd19d000" + "id": "5efa989ee7b9d2024b7bab97" }, { - "body": "New Relic One CLI config commands To configure your New Relic One CLI preferences, use the commands below. You can click any command to see its usage options and additional details about the command. Run nr1 config:list to see all your existing configurations and their keys. Command Description nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Command details nr1 config:set Set a configuration Sets a specific configuration value given a configuration key. By default, the command will prompt you for a new value after providing a key, but you can also use the --k, --key=KEY option to skip this step. Usage $ nr1 config:set OPTION Options -k, --key=KEY The key of the config. (required) -V, --value=VALUE The value of the config. --profile=PROFILE The authentication profile you want to use. -t, --this-profile-only If present, this configuration will only apply while running with the specified profile. --verbose Adds extra information to the output. Examples $ nr1 config:set --key=proxyEnabled $ nr1 config:set --key=proxyEnabled --value=ENABLED nr1 config:get See your configuration Shows the value for a specific configuration. Usage $ nr1 config:get OPTION Options -k, --key=KEY The key of the config. (required) --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 config:list See all your configurations Shows a list of all your configuration choices, including the configuration key, value, and origin. Usage $ nr1 config:list Options --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. Aliases $ nr1 config:ls nr1 config:delete Remove a configuration Removes the value of a specific configuration. Usage $ nr1 config:delete OPTION Options -k, --key=KEY The key of the config. (required) --profile=PROFILE The authentication profile you want to use. -t, --this-profile-only If present, this configuration will only apply while running with the specified profile. --verbose Adds extra information to the output. Aliases nr1 config:remove nr1 config:rm Examples: $ nr1 config:delete --key=proxyHttp", + "body": "Query data with NRQL 10 min With NRQL, you can query any of the default event data being reported by New Relic, plus any custom events and attributes you’ve added. Step 1 of 4 NRQL syntax is comparable to ANSI SQL. Learn more about NRQL syntax SELECT function(attribute) [AS 'label'][, ...] FROM event [WHERE attribute [comparison] [AND|OR ...]][AS 'label'][, ...] [FACET attribute | function(attribute)] [LIMIT number] [SINCE time] [UNTIL time] [WITH TIMEZONE timezone] [COMPARE WITH time] [TIMESERIES time] Copy Step 2 of 4 NRQL queries can be as simple as fetching rows of data in a raw tabular form to inspect individual events. Learn what events open source agents provide out of the box -- Fetch a list of Browser PageView events SELECT * FROM PageView Copy Step 3 of 4 NRQL queries can also do extremely powerful calculations before the data is presented to you, such as crafting funnels based on the way people actually use your website. Learn more about NRQL funnels -- See how many users visit, signup, browse and purchase from your site as a funnel SELECT funnel(session, WHERE pageUrl='http://www.demotron.com/' AS 'Visited Homepage', WHERE pageUrl='http://www.demotron.com/signup' AS 'Signed Up', WHERE pageUrl='http://www.demotron.com/browse' AS 'Browsed Items', WHERE pageUrl='http://www.demotron.com/checkout' AS 'Made Purchase') FROM PageView SINCE 12 hours ago Copy Step 4 of 4 Using NRQL, you can customize your New Relic experience by crafting diverse dashboards that show your data from multiple angles. You can share these dashboards with technical and non-technical stakeholders alike. Learn more and start building Documentation For an overview of NRQL syntax, see Introduction to NRQL. For a detailed description of all available functions, see NRQL syntax, components, and functions. NRU Tutorials To learn how to query and narrow a large data store by a specific parameter, watch the tutorial on Filtering queries with NRQL. Community forum Connect with other developers in the our Explorers Hub. GitHub For examples of integrations and other technologies, check us out on GitHub.", "type": "developer", "document_type": "page", - "info": "An overview of the commands you can use to configure your New Relic One CLI preferences.", + "info": "Query default event data as well as custom events and attributes with our powerful, SQL-like query language. Start querying now.", "sections": [ - "New Relic One CLI config commands", - "Command details", - "nr1 config:set", - "Set a configuration", - "Usage", - "Options", - "Examples", - "nr1 config:get", - "See your configuration", - "nr1 config:list", - "See all your configurations", - "Aliases", - "nr1 config:delete", - "Remove a configuration", - "Examples:" + "Query data with NRQL", + "Learn more and start building", + "Documentation", + "NRU Tutorials", + "Community forum", + "GitHub" ], - "title": "New Relic One CLI config commands", + "title": "Query data with NRQL", "popularity": 1, - "external_id": "a6e1583bae1b92f3fcee75cd8a5196d13f28f08d", - "image": "", - "url": "https://developer.newrelic.com/explore-docs/nr1-config/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-04T01:44:08Z", + "external_id": "7bb23b086badd7a572964357aad776116f5bfbbe", + "image": "https://developer.newrelic.com/static/eb2adf50e7680e8ba5b7daaf06c203d1/757a2/nr1-dashboard.png", + "url": "https://developer.newrelic.com/collect-data/query-data-nrql/", + "published_at": "2020-08-18T02:08:12Z", + "updated_at": "2020-08-14T01:46:10Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.25532177, + "_score": 0.08179283, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI config commands", - "sections": "New Relic One CLI config commands", - "info": "An overview of the commands you can use to configure your New Relic One CLI preferences.", - "body": "New Relic One CLI config commands To configure your New Relic One CLI preferences, use the commands below. You can click any command to see its usage options and additional details about the command. Run nr1 config:list to see all your existing configurations and their keys. Command Description nr1" + "title": "Query data with NRQL", + "sections": "Query data with NRQL", + "info": "Query default event data as well as custom events and attributes with our powerful, SQL-like query language. Start querying now.", + "body": "Query data with NRQL 10 min With NRQL, you can query any of the default event data being reported by New Relic, plus any custom events and attributes you’ve added. Step 1 of 4 NRQL syntax is comparable to ANSI SQL. Learn more about NRQL syntax SELECT function(attribute) [AS 'label'][, ...] FROM" }, - "id": "5f28bd6828ccbca2072376f4" + "id": "5efa999ce7b9d29f377bab69" } ], - "/build-apps/set-up-dev-env": [ + "/build-apps/add-nerdgraphquery-guide": [ { - "body": "Add, query, and mutate data using NerdStorage 45 min NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. Using NerdStorage, you can create individual documents of up to 64kb in size, create different collections of documents, and store data by entity, account, or user level. This guide explains how to add data and documents to NerdStorage. For an introduction to what NerdStorage is and how it works, see Intro to NerdStorage. Before you begin This guide requires that you have an API key and the New Relic One CLI as described in Set up your development environment. Get started First, get the NerdStorage app running successfully inside New Relic One. Step 1 of 3 Clone the example applications from the GitHub repo. Step 2 of 3 Use the New Relic One CLI to update the application UUID and run the application locally. In the terminal, switch to the /nr1-how-to/use-nerdstorage directory: cd / nr1 - how - to / use - nerdstorage; Copy Update the UUID and serve the application: nr1 nerdpack:uuid -gf nr1 nerdpack:serve Copy Step 3 of 3 Once the app is successfully served, your terminal will return the URL to view your running application on New Relic One. Load the URL. Click Apps and under Other apps you'll see the Use Nerdstorage app listed. Click to launch the app. Add data to NerdStorage Once the app is up and running on New Relic One, you can prepare the app and start adding data. On the How To Use NerdStorage app screen, there's a Saved to NerdStorage pane with a field for adding data. However, if you type something you'll get an error message. This is because you need to be set up to store data at the User level. You can do this with the help of the UserStorageMutation component. Step 1 of 3 Open the application’s ./nerdlets/use-nerdstorage-nerdlet/index.js file in the text editor of your choice and find the code for the TextField and Button used to enter data. The Button onClick prop makes a call to a helper method called _addToNerdStorage, and you need to update it to add UserStorageMutation The UserStorage NerdStorage components require a collection and documentId. In the constructor method in the application’s index.js file, you can see the variables being provided. In the .js file, it will look something like this: constructor(props) { super(props) this.collectionId = 'mycollection'; this.documentId = 'learning-nerdstorage'; this.state = { isOpen: true, storage: [], text: '', }; this._addToNerdStorage = this._addToNerdStorage.bind(this); this._removeFromNerdStorage = this._removeFromNerdStorage.bind(this); this._deleteDocument = this._deleteDocument.bind(this); } Copy Step 2 of 3 Import the UserStorageMutation by adding it to your import statement at the top of the index.js file: import { UserStorageMutation } from 'nr1'; Copy Then update the helper with this code beginning with _addToNerdStorage: _addToNerdStorage(){ const { text, storage } = this.state; storage.push(text); this.setState({storage}, () => { UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.WRITE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, document: { storage }, }) .then((res) => { this.setState({text: ''}); Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.NORMAL }); }) .catch((err) => console.log(err)); }); } Copy Step 3 of 3 Return to your running How To Use NerdStorage app screen on New Relic One and reload the page. Add some text in the text entry field and click the check button. This will update NerdStorage and trigger a Toast notification inside the app. You should then see the text you typed displayed as a table row below the text entry field. Query data from NerdStorage Once you get data storage working as described in the section above, you also need to get the app properly reading data from NerdStorage, or the app will reload with an empty state every time you navigate away from the app page and back. To do this, add the UserStorageQuery component and update the componentDidMount method. Step 1 of 3 Import the UserStorageQuery by adding it to the import statement in the application’s ./nerdlets/use-nerdstorage-nerdlet/index.js file. import { UserStorageMutation, UserStorageQuery } from 'nr1'; Copy Step 2 of 3 Then, add the following componentDidMount method to your application: componentDidMount(){ UserStorageQuery.query({ collection: this.collectionId, documentId: this.documentId, }) .then(({ data }) => { if(data !== null) { this.setState({storage: data.storage}); } }) .catch(err => console.log(err)); } Copy Step 3 of 3 Back inside the NerdStorage app, test your changes by adding a few more rows using the text entry field. Then exit and relaunch the application. The application should load and show all the data you entered before you navigated away. Mutate data in NerdStorage Each NerdStorage entry displayed in the table inside the app has a trash button that can be used to update a specific entry. The trash button works by making a call to the _removeFromNerdStorage helper method. Step 1 of 1 To get this process working, update the code in _removeFromNerdStorage: _removeFromNerdStorage(index, data){ const { storage } = this.state; storage.pop(data); this.setState({storage}, () => { UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.WRITE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, document: { storage }, }) .then((res) => { Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.NORMAL }); }) .catch((err) => console.log(err)); }); } Copy Once you do this, clicking the trash button removes the item it's associated with, and the app updates to show the change. Delete collection from NerdStorage While the trash button is a good method for removing specific entries one at a time, you may also want the ability to delete a whole NerdStorage document at once. You can do this by adding the Delete Document button to your app. Step 1 of 2 Add a new GridItem to the application immediately before the closing Grid tag. In the new GridItem add the following code to display your new button: ; Copy Step 2 of 2 Because the new Delete Document button will be calling the _deleteDocument helper method, you'll need to update that using this code: _deleteDocument(){ this.setState({storage: []}); UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.DELETE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, }); Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.CRITICAL }); } Copy Back inside the application, you should now see both the individual trash buttons and the newly added Delete Document button. Next steps Now that you’ve successfully implemented NerdStorage into a New Relic One application, you can store and mutate data connected to your User. For more information on the various NerdStorage components, please visit the New Relic developer website API documentation.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", "type": "developer", "document_type": "page", - "info": "NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next.", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "sections": [ - "Add, query, and mutate data using NerdStorage", - "Before you begin", + "New Relic One CLI reference", + "Installing the New Relic One CLI", + "Tip", + "New Relic One CLI Commands", "Get started", - "Add data to NerdStorage", - "Query data from NerdStorage", - "Mutate data in NerdStorage", - "Delete collection from NerdStorage", - "Next steps" + "Configure your CLI preferences", + "Set up your Nerdpacks", + "Manage your Nerdpack subscriptions", + "Install and manage plugins", + "Manage catalog information" ], - "title": "Add, query, and mutate data using NerdStorage", + "title": "New Relic One CLI reference", "popularity": 1, - "external_id": "97cc9637edea35ecd68683f1010f67a5f8c79038", - "image": "https://developer.newrelic.com/static/e03456a7ed8556f83bd3329ea38b261d/8f217/add-data-NerdStorage.png", - "url": "https://developer.newrelic.com/build-apps/add-query-mutate-data-nerdstorage/", - "published_at": "2020-08-17T01:48:54Z", - "updated_at": "2020-08-14T01:50:34Z", + "tags": [ + "New Relic One app", + "nerdpack commands" + ], + "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", + "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", + "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-18T01:50:36Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.036713816, + "_score": 1.6000241, "_version": null, "_explanation": null, "sort": null, "highlight": { - "body": " and the New Relic One CLI as described in Set up your development environment. Get started First, get the NerdStorage app running successfully inside New Relic One. Step 1 of 3 Clone the example applications from the GitHub repo. Step 2 of 3 Use the New Relic One CLI to update the application UUID and run" + "sections": "Set up your Nerdpacks", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": " your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first "Hello World" app, and serve it locally. Tip Use the NR1 VS Code" }, - "id": "5efa98d4e7b9d26d6b7bab74" + "id": "5efa989e28ccbc535a307dd0" }, { - "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", + "body": "Build apps You know better than anyone what information is crucial to your business, and how best to visualize it. Sometimes, this means going beyond dashboards to creating your own app. With React and GraphQL, you can create custom views tailored to your business. These guides are designed to help you start building apps, and dive into our library of components. We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a \"Hello, World!\" application Build a \"Hello, World!\" app and publish it to New Relic One 20 min Publish and deploy apps Start sharing the apps you build 20 min Set up your development environment Prepare to build apps and contribute to this site 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 30 min Add a table to your app Add a table to your New Relic One app 30 min Create a custom map view Build an app to show page view data on a map", "type": "developer", "document_type": "page", - "info": "Build a \"Hello, World!\" app and publish it to New Relic One", + "info": "", "sections": [ + "Build apps", + "Guides to build apps", "Create a \"Hello, World!\" application", - "Before you begin", - "Create a local version of the \"Hello, World!\" application", - "Publish your application to New Relic", - "Add details to describe your project", - "Subscribe accounts to your application", - "Summary", - "Related information" + "Publish and deploy apps", + "Set up your development environment", + "Add the NerdGraphQuery component to an application", + "Add a time picker to your app", + "Add, query, and mutate data using NerdStorage", + "Add a table to your app", + "Create a custom map view" ], - "title": "Create a \"Hello, World!\" application", + "title": "Build apps", "popularity": 1, - "tags": [ - "nr1 cli", - "Nerdpack file structure", - "NR One Catalog", - "Subscribe applications" - ], - "external_id": "aa427030169067481fb69a3560798265b6b52b7c", - "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png", - "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/", - "published_at": "2020-08-17T01:55:14Z", - "updated_at": "2020-08-14T01:45:09Z", + "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", + "image": "", + "url": "https://developer.newrelic.com/build-apps/", + "published_at": "2020-08-18T02:08:12Z", + "updated_at": "2020-08-18T01:45:02Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.034207165, + "_score": 0.79272, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Publish your application to New Relic", - "body": " installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Create a local version of the "Hello, World!" application The CLI allows you to run a local version of New" + "title": "Build apps", + "sections": "Add the NerdGraphQuery component to an application", + "body": " min Publish and deploy apps Start sharing the apps you build 20 min Set up your development environment Prepare to build apps and contribute to this site 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add" }, - "id": "5efa9973196a67d16d76645c" + "id": "5efa999d64441fc0f75f7e21" }, { - "body": "Add the NerdGraphQuery component to an application 20 minutes This guide steps you through the process of adding the NerdGraphQuery component to a sample transaction overview application. This allows you to query data from your New Relic account and add it to a dropdown menu. NerdGraph is our GraphQL implementation. GraphQL has some key differences when compared to REST: The client, not the server, determines what data is returned. You can easily collect data from multiple sources. For example, in a single query, you can get account information, infrastructure data, and issue a NRQL request. Note Before completing this exercise, you can experiment with GraphQL queries in our NerdGraph API explorer. We also have a 14-minute video that covers the steps below. Before you begin To develop projects, you need our New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete steps 1–4 of our CLI quick start, and be sure to make a copy of your account ID from step 1 because you’ll need it later. Note If you've already installed the New Relic One CLI, but you can't remember your account ID, start the CLI quick start again, and then click the Get your API key down arrow. The account ID is the number preceding your account name. For additional details, see Set up your development environment. Prepare the sample code To get started, complete these steps to update the application UUID (unique ID) and run the sample application locally: Step 1 of 7 If you haven't already done so, clone the example applications from our how-to GitHub repo. Here's an example using HTTPS: git clone https://github.com/newrelic/nr1-how-to.git Copy Step 2 of 7 Change to the directory use-nerdgraph-nerdlet: cd nr1-how-to/use-nerdgraph/nerdlets/use-nerdgraph-nerdlet Copy Step 3 of 7 In your preferred text editor, open index.js. Step 4 of 7 Replace with your account id: Note Your account ID is available in the CLI quick start (see Before you begin). this.accountId = ; Copy Step 5 of 7 Change to the /nr1-howto/use-nerdgraph directory: cd ../.. Copy Step 6 of 7 Execute these commands to update the UUID and serve the sample application: nr1 nerdpack:uuid -gf nr1 nerdpack:serve Copy Step 7 of 7 Once the sample application is successfully served, go to the local New Relic One homepage (https://one.newrelic.com/?nerdpacks=local), click Apps, and then click Use NerdGraph. After launching the Use NerdGraph application, you see a dashboard that gives an overview of the transactions in your account: Add the NerdGraphQuery component Now you can create a dropdown menu for changing the account the application is viewing. The first step is to import the NerdGraphQuery component into the application's index.js file. Note If you need more details about our example below, see the APIs and components page on https://developer.newrelic.com Step 1 of 3 Add the NerdGraphQuery component into the first StackItem inside of the return in the index.js file: {({ loading, error, data }) => { console.log({ loading, error, data }); if (loading) { return ; } if (error) { return 'Error!'; } return null; }} ; Copy Step 2 of 3 The NerdGraphQuery component takes a query object that states the source you want to access and the data you want returned. Add the following code to your index.js file in the render method: Note In the browser console, you can see the data from your query returned in an object that follows the same structure of the object in the initial query. const query = ` query($id: Int!) { actor { account(id: $id) { name } } } `; Copy Step 3 of 3 To take the data returned by the NerdGraph query and display it in the application, replace the return null in the current NerdGraphQuery component with this return statement: return {data.actor.account.name} Apps:; Copy When you go back to the browser and view your application, you see a new headline showing the name of your account returned from NerdGraph: How to use NerdGraphQuery.query At this point, you have implemented the NerdGraphQuery component with the application's render method and displayed the return data within the transaction overview application. Here's what you need to do next: Query NerdGraph inside of the componentDidMount lifecycle method. Save the returned data for later use in the application. Step 1 of 2 This code takes the response from NerdGraph and makes sure the results are processed, stored into the application state, and logged to the browser console for viewing. Add this code into the index.js file just under the constructor: componentDidMount() { const accountId = this.state; const gql = `{ actor { accounts { id name } } }`; const accounts = NerdGraphQuery.query({query: gql}) //The NerdGraphQuery.query method called with the query object to get your account data is stored in the accounts variable. accounts.then(results => { console.log('Nerdgraph Response:', results); const accounts = results.data.actor.accounts.map(account => { return account; }); const account = accounts.length > 0 && accounts[0]; this.setState({ selectedAccount: account, accounts }); }).catch((error) => { console.log('Nerdgraph Error:', error); }) } Copy Step 2 of 2 After the data is stored into state, display a selection so users can change accounts and update the application. To do this, add this code to index.js for the second StackItem in the return statement: { accounts && ( ); } Copy Review the results of the NerdGraph query After you complete these steps, look at the application in your browser, and note the following: The dropdown menu now displays the data returned from the NerdGraphQuery.query and allows you to select an account. After you select a new account, the application shows data from the new selection. The final index.js file should have code similar to the code below. This completed sample is in your nerdlet final.js. import React from 'react'; import { PlatformStateContext, NerdGraphQuery, Spinner, HeadingText, Grid, GridItem, Stack, StackItem, Select, SelectItem, AreaChart, TableChart, PieChart } from 'nr1' import { timeRangeToNrql } from '@newrelic/nr1-community'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class UseNerdgraphNerdletNerdlet extends React.Component { constructor(props){ super(props) this.state = { accountId: , accounts: null, selectedAccount: null, } } componentDidMount() { const accountId = this.state; const gql = `{ actor { accounts { id name } } }`; const accounts = NerdGraphQuery.query({ query: gql }) accounts.then(results => { console.log('Nerdgraph Response:', results); const accounts = results.data.actor.accounts.map(account => { return account; }); const account = accounts.length > 0 && accounts[0]; this.setState({ selectedAccount: account, accounts }); }).catch((error) => { console.log('Nerdgraph Error:', error); }) } selectAccount(option) { this.setState({ accountId: option.id, selectedAccount: option }); } render() { const { accountId, accounts, selectedAccount } = this.state; console.log({ accountId, accounts, selectedAccount }); const query = ` query($id: Int!) { actor { account(id: $id) { name } } } `; const variables = { id: accountId, }; const avgResTime = `SELECT average(duration) FROM Transaction FACET appName TIMESERIES AUTO `; const trxOverview = `FROM Transaction SELECT count(*) as 'Transactions', apdex(duration) as 'apdex', percentile(duration, 99, 95) FACET appName `; const errCount = `FROM TransactionError SELECT count(*) as 'Transaction Errors' FACET error.message `; const responseCodes = `SELECT count(*) as 'Response Code' FROM Transaction FACET httpResponseCode `; return ( {({loading, error, data}) => { if (loading) { return ; } if (error) { return 'Error!'; } return {data.actor.account.name} Apps:; }} {accounts && }
{(PlatformState) => { /* Taking a peek at the PlatformState */ const since = timeRangeToNrql(PlatformState); return ( <>
Transaction Overview
Average Response Time
Response Code
Transaction Errors
); }}
) } } Copy Summary Now that you've completed all the steps in this example, you've successfully queried data from your account using the NerdGraphQuery component in two methods: Using the NerdGraphQuery component inside the application's render method and then passing the returned data into the children's components. Using the NerdGraphQuery.query method to query data before the application renders.", + "body": "Map page views by region in a custom app 30 min New Relic has powerful and flexible tools for building custom apps and populating them with data. This guide shows you how to build a custom app and populate it with page view data using New Relic's Query Language (NRQL - pronounced 'nurkle'). Then you make your data interactive. And last, if you have a little more time and want to install a third-party React library, you can display the page view data you collect on a map of the world. In this guide, you build an app to display page view data in two ways: In a table On a map Please review the Before you begin section to make sure you have everything you need and don't get stuck halfway through. Before you begin In order to get the most out of this guide, you must have: A New Relic developer account, API key, and the command-line tool. If you don't have these yet, see the steps in Setting up your development environment New Relic Browser page view data to populate the app. Without this data, you won't be able to complete this guide. To add your data to a world map in the second half of the guide: npm, which you'll use during this section of the guide to install Leaflet, a third-party JavaScript React library used to build interactive maps. If you're new to React and npm, you can go here to install Node.js and npm. New Relic terminology The following are some terms used in this guide: New Relic application: The finished product where data is rendered in New Relic One. This might look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One that launches your application. Nerdlets: New Relic React components used to build your application. The three default files are index.js, nr1.json, and styles.scss, but you can customize and add your own. Build a custom app with a table chart Step 1 of 8 Query your browser data Use Query builder to write a NRQL query to see your page view data, as follows. On New Relic One, select Query your data (in the top right corner). That puts you in NRQL mode. You'll use NRQL to test your query before dropping the data into your table. Copy and paste this query into a clear query field, and then select Run. FROM PageView SELECT count(*), average(duration) WHERE appName = 'WebPortal' FACET countryCode, regionCode SINCE 1 week ago LIMIT 1000 Copy If you have PageView data, this query shows a week of average page views broken down by country and limited to a thousand items. The table will be full width and use the \"chart\" class defined in the CSS. If you don't have any results at this point, ensure your query doesn't have any errors. If your query is correct, you might not have the Browser agent installed. Step 2 of 8 Create and serve a new Nerdpack To get started, create a new Nerdpack, and serve it up to New Relic from your local development environment: Create a new Nerdpack for this app: nr1 create --type nerdpack --name pageviews-app Copy Serve the project up to New Relic: cd pageviews-app && nr1 nerdpack:serve Copy Step 3 of 8 Review your app files and view your app locally Navigate to your pageviews-app to see how it's structured. It contains a launcher folder, where you can customize the description and icon that will be displayed on the app's launcher in New Relic One. It also contains nerdlets, which each contain three default files: index.js, nr1.json, and styles.scss. You'll edit some of these files as part of this guide. For more information, see Nerdpack file structure. Now in your browser, open https://one.newrelic.com/?nerdpacks=local, and then click Apps to see the pageview-apps Nerdpack that you served up. When you select the launcher, you see a Hello message. Step 4 of 8 Hard code your account ID For the purposes of this exercise and for your convenience, hard code your account ID. In the pageview-app-nerdlet directory, in the index.js file, add this code between the import and export lines. (Read about finding your account ID here). const accountId = [Replace with your account ID]; Copy Step 5 of 8 Import the TableChart component To show your data in a table chart, import the TableChart component from New Relic One. To do so, in index.js, add this code under import React. import { TableChart } from `nr1`; Copy Step 6 of 8 Add a table with a single row To add a table with a single row, in the index.js file, replace this line: return

Hello, pageview-app-nerdlet Nerdlet!

; Copy with this export code: export default class PageViewApp extends React.Component { render() { return (
); } } Copy Step 7 of 8 Customize the look of your table (optional) You can use standard CSS to customize the look of your components. In the styles.scss file, add this CSS. Feel free to customize this CSS to your taste. .container { width: 100%; height: 99vh; display: flex; flex-direction: column; .row { margin: 10px; display: flex; flex-direction: row; } .chart { height: 250px; } } Copy Step 8 of 8 Get your data into that table Now that you've got a table, you can drop a TableChart populated with data from the NRQL query you wrote at the very beginning of this guide. Put this code into the row div. ; Copy Go to New Relic One and click your app to see your data in the table. (You might need to serve your app to New Relic again.) Congratulations! You made your app! Continue on to make it interactive and show your data on a map. Make your app interactive with a text field Once you confirm that data is getting to New Relic from your app, you can start customizing it and making it interactive. To do this, you add a text field to filter your data. Later, you use a third-party library called Leaflet to show that data on a world map. Step 1 of 3 Import the TextField component Like you did with the TableChart component, you need to import a TextField component from New Relic One. import { TextField } from 'nr1'; Copy Step 2 of 3 Add a row for your text field To add a text field filter above the table, put this code above the TableChart div. The text field will have a default value of \"US\".
{ this.setState({ countryCode: event.target.value }); }} />
; Copy Step 3 of 3 Build the text field object Above the render() function, add a constructor to build the text field object. constructor(props) { super(props); this.state = { countryCode: null } } Copy Then, add a constructor to your render() function. Above return, add: const { countryCode } = this.state; Copy Now add countryCode to your table chart query. ; Copy Reload your app to try out the text field. Get your data on a map To create the map, you use npm to install Leaflet. Step 1 of 9 Install Leaflet In your terminal, type: npm install --save leaflet react-leaflet Copy In your nerdlets styles.scss file, import the Leaflet CSS: @import `~leaflet/dist/leaflet.css`; Copy While you're in styles.scss, fix the width and height of your map: .containerMap { width: 100%; z-index: 0; height: 70vh; } Copy Step 2 of 9 Add a webpack config file for Leaflet Add a webpack configuration file .extended-webpackrc.js to the top-level folder in your nerdpack. This supports your use of map tiling information data from Leaflet. module.exports = { module: { rules: [ { test: /\\.(png|jpe?g|gif)$/, use: [ { loader: 'file-loader', options: {}, }, { loader: 'url-loader', options: { limit: 25000 }, }, ], }, ], }, }; Copy Step 3 of 9 Import modules from Leaflet In index.js, import modules from Leaflet. import { Map, CircleMarker, TileLayer } from 'react-leaflet'; Copy Step 4 of 9 Import additional modules from New Relic One You need several more modules from New Relic One to make the Leaflet map work well. Import them with this code: import { NerdGraphQuery, Spinner, Button, BlockText } from 'nr1'; Copy NerdGraphQuery lets you make multiple NRQL queries at once and is what will populate the map with data. Spinner adds a loading spinner. Button gives you button components. BlockText give you block text components. Step 5 of 9 Get data for the map Using latitude and longitude with country codes, you can put New Relic data on a map. mapData() { const { countryCode } = this.state; const query = `{ actor { account(id: 1606862) { mapData: nrql(query: \"SELECT count(*) as x, average(duration) as y, sum(asnLatitude)/count(*) as lat, sum(asnLongitude)/count(*) as lng FROM PageView FACET regionCode, countryCode WHERE appName = 'WebPortal' ${countryCode ? ` WHERE countryCode like '%${countryCode}%' ` : ''} LIMIT 1000 \") { results nrql } } } }`; return query; }; Copy Step 6 of 9 Customize the map marker colors Above the mapData function, add this code to customize the map marker colors. getMarkerColor(measure, apdexTarget = 1.7) { if (measure <= apdexTarget) { return '#11A600'; } else if (measure >= apdexTarget && measure <= apdexTarget * 4) { return '#FFD966'; } else { return '#BF0016'; } }; Copy Feel free to change the HTML color code values to your taste. In this example, #11A600 is green, #FFD966 is sort of yellow, and #BF0016 is red. Step 7 of 9 Set your map's default center point Set a default center point for your map using latitude and longitude. const defaultMapCenter = [10.5731, -7.5898]; Copy Step 8 of 9 Add a row for your map Between the text field row and the table chart row, insert a new row for the map content using NerdGraphQuery.
{({ loading, error, data }) => { if (loading) { return ; } if (error) { return 'Error'; } const { results } = data.actor.account.mapData; console.debug(results); return 'Hello'; }}
; Copy Reload your application in New Relic One to test that it works. Step 9 of 9 Replace \"Hello\" with the Leaflet code Replace return \"Hello\"; with: return ( {results.map((pt, i) => { const center = [pt.lat, pt.lng]; return ( { alert(JSON.stringify(pt)); }} /> ); })} ); Copy This code creates a world map centered on the latitude and longitude you chose using OpenStreetMap data and your marker colors. Reload your app to see the pageview data on the map!", "type": "developer", "document_type": "page", - "info": "The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application", + "info": "Build a New Relic app showing page view data on a world map.", "sections": [ - "Add the NerdGraphQuery component to an application", - "Note", + "Map page views by region in a custom app", "Before you begin", - "Prepare the sample code", - "Add the NerdGraphQuery component", - "How to use NerdGraphQuery.query", - "Review the results of the NerdGraph query", - "Summary" + "New Relic terminology", + "Build a custom app with a table chart", + "Query your browser data", + "Create and serve a new Nerdpack", + "Review your app files and view your app locally", + "Hard code your account ID", + "Import the TableChart component", + "Add a table with a single row", + "Customize the look of your table (optional)", + "Get your data into that table", + "Make your app interactive with a text field", + "Import the TextField component", + "Add a row for your text field", + "Build the text field object", + "Get your data on a map", + "Install Leaflet", + "Add a webpack config file for Leaflet", + "Import modules from Leaflet", + "Import additional modules from New Relic One", + "Get data for the map", + "Customize the map marker colors", + "Set your map's default center point", + "Add a row for your map", + "Replace \"Hello\" with the Leaflet code" ], - "title": "Add the NerdGraphQuery component to an application", + "title": "Map page views by region in a custom app", "popularity": 1, - "external_id": "6bd6c8a72eab352a3e8f4332570e286c7831ba84", - "image": "https://developer.newrelic.com/static/5dcf6e45874c1fa40bb6f21151af0c24/b01d9/no-name.png", - "url": "https://developer.newrelic.com/build-apps/add-nerdgraphquery-guide/", - "published_at": "2020-08-17T01:48:54Z", - "updated_at": "2020-08-14T01:49:25Z", + "external_id": "6ff5d696556512bb8d8b33fb31732f22bab455cb", + "image": "https://developer.newrelic.com/static/d87a72e8ee14c52fdfcb91895567d268/0086b/pageview.png", + "url": "https://developer.newrelic.com/build-apps/map-pageviews-by-region/", + "published_at": "2020-08-18T02:11:48Z", + "updated_at": "2020-08-14T01:45:09Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.027504843, + "_score": 0.39790472, "_version": null, "_explanation": null, "sort": null, "highlight": { - "info": "The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application", - "body": ", and then click the Get your API key down arrow. The account ID is the number preceding your account name. For additional details, see Set up your development environment. Prepare the sample code To get started, complete these steps to update the application UUID (unique ID) and run the sample" + "title": "Map page views by region in a custom app", + "sections": "Query your browser data", + "info": "Build a New Relic app showing page view data on a world map.", + "body": " <Spinner fillContainer />; } if (error) { return 'Error'; } const { results } = data.actor.account.mapData; console.debug(results); return 'Hello'; }} </NerdGraphQuery> </div>; Copy Reload your application in New Relic One to test that it works. Step 9 of 9 Replace "Hello" with the Leaflet code Replace" }, - "id": "5efa993c64441ff4865f7e32" + "id": "5efa993c196a67066b766469" }, { - "body": "Add a time picker 20 min This guide steps you through the process of adding access to our time picker in the sample transaction overview application. The sample application provides an overview of the telemetry data showing your account's transactions by application, average response time, HTTP response codes, and transaction errors. When you enable the time picker, users can specify the time range of data to view. We also have a 12 minute video that covers the steps below. Before you begin To develop projects, you need our New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete steps 1–4 of the CLI quick start. In step 1, be sure to make a copy of the number preceding your account name. This is your accound ID, and you’ll need it later. Note If you've already installed the New Relic One CLI, but you can't remember your account ID, start the CLI quick start again, and then click the Get your API key down arrow. The account ID is the number preceding your account name. For additional details, see Set up your development environment. Prepare the time picker sample code To get started, complete these steps to update the application UUID (unique ID) and run the sample application locally: Step 1 of 7 If you haven't already done so, clone the example applications from our how-to GitHub repo. git clone https://github.com/newrelic/nr1-how-to.git Copy Step 2 of 7 Change to the directory nr1-howto-add-time-picker-nerdlet: cd nr1-how-to/add-time-picker/nerdlets/nr1-howto-add-time-picker-nerdlet Copy Step 3 of 7 In your preferred text editor, open index.js. Step 4 of 7 Replace with your account id: Note Your account ID is available in the CLI quick start (see Before you begin). this.accountId = ; Copy Step 5 of 7 Change to the add-time-picker directory: cd / nr1 - how - to / add - time - picker; Copy Step 6 of 7 Execute these commands to update the UUID and serve the sample application: nr1 nerdpack:uuid -gf nr1 nerdpack:serve Copy Step 7 of 7 Once the sample application is successfully served, go to the local version of New Relic One (https://one.newrelic.com/?nerdpacks=local) click Apps, and click Add Time Picker. After launching the Add Time Picker application, you see a dashboard that gives an overview of the transactions in your New Relic account: By default, the application shows your data within the last 60 minutes. If you toggle the time picker, it doesn't update the charts because the transaction overview application isn't connected to the New Relic One platform. It has no access to the data from the time picker. In the following sections, you'll add the time picker to the example application and add the time to the queries. Import the PlatformStateContext component The first step in adding the time picker is to import the PlatformStateContext component. Note If you need more details about the PlatformStateContext example that follows, see the APIs and components page Here's what the PlatformStateContext component does: Wraps all of the code within the return statement of the render method Makes a function call passing in the New Relic platform state Returns all of the code within our current return statement Complete these steps: Step 1 of 5 In a text editor, open /add-time-picker/nerdlets/nr1-howto-add-time-picker-nerdlet/index.js. Step 2 of 5 Add the PlatformStateContext component to the end of the import statement so it looks like this: import { Grid, GridItem, HeadingText, AreaChart, TableChart, PieChart, PlatformStateContext, } from 'nr1'; Copy Step 3 of 5 Just below the current return insert this code for the PlatformStateContext component: {(platformState) => { return ( // ADD THE CURRENT RETURN CODE HERE ) }} Copy Step 4 of 5 Move the current application code so it is under the return of the PlatformState function call. The return statement should now look like this: return ( {(PlatformState) => { return ( <>
Transaction Overview
Average Response Time
Response Code
Transaction Errors
); }}
); Copy Step 5 of 5 Add a console.log statement to make sure you are seeing appropriate data. Insert the following code inside the PlatformState return statement just before the opening tag for the component: /* Taking a peek at the PlatformState */ console.log(PlatformState); Copy After you complete these steps, your browser console displays something like this: Add the time to the queries In your console, you should see some data from the New Relic platform state. Now you're ready to add timeRange data to update the charts in the transaction overview application. This step requires you to import the timeRangeToNrql utility method from the New Relic One community library. Note You can get more details on the New Relic One community library from our GitHub repo. This helper method takes your PlatformState.timeRange duration data, formats it from milliseconds, and returns a formatted SINCE statement to add to your NRQL. Step 1 of 4 Import the timeRangeToNrql method by inserting this line of code below the other import sections: Note You don't need to include the AccountDropdown from the community import example. import { timeRangeToNrql } from '@newrelic/nr1-community'; Copy Step 2 of 4 Pass the PlatformState to the timeRangeToNrql helper, and save its output as a since statement for later use: const since = timeRangeToNrql(PlatformState); Copy Step 3 of 4 After creating the since variable, go through the code in the PlatformStateContext return statement and concatenate the since variable in each of the existing chart component queries. Here's a TableChart example: ; Copy Step 4 of 4 After you update all of the chart components, confirm that the final index.js file looks similar to this: Note This completed sample code is in your nerdlet final.js. import React from 'react'; import { PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart, PieChart, } from 'nr1'; import { timeRangeToNrql } from '@newrelic/nr1-community'; export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props) { super(props); this.accountId = 1; } render() { const avgResTime = `SELECT average(duration) FROM Transaction FACET appName TIMESERIES AUTO `; const trxOverview = `FROM Transaction SELECT count(*) as 'Transactions', apdex(duration) as 'apdex', percentile(duration, 99, 95) FACET appName `; const errCount = `FROM TransactionError SELECT count(*) as 'Transaction Errors' FACET error.message `; const responseCodes = `SELECT count(*) as 'Response Code' FROM Transaction FACET httpResponseCode `; return ( {(PlatformState) => { /* Taking a peek at the PlatformState */ console.log(PlatformState); const since = timeRangeToNrql(PlatformState); console.log(since); return ( <>
Transaction Overview
Average Response Time
Response Code
Transaction Errors
); }}
); } } Copy Summary When you completed all the steps in this example, you successfully implemented the time picker in your application by importing the PlatformStateContext component and accessing its timePicker data object.", + "body": "Query and store data 10 min To help you build a New Relic One application, we provide you with the New Relic One SDK. Here you can learn how to use the SDK query components, which allow you to make queries and mutations via NerdGraph, our GraphQL endpoint. Query-related React components can be identified by the Query suffix. Mutation-related components can be identified by the Mutation prefix. Components overview Our data components are based on React Apollo. The most basic component is NerdGraphQuery, which accepts any GraphQL (or GraphQL AST generated by the graphql-tag library as the query parameter, and a set of query variables passed as variables. Over this query, we have created an additional set of queries, which can be divided into four groups: User queries: These allow you to query the current user and its associated accounts. Components in this category: UserStorageQuery and AccountsQuery. Entities queries: Because New Relic One is entity-centric, we use queries to make access to your entities easier. You can count, search, list, query, and favorite them. Components in this category: EntityCountQuery, EntitySearchQuery, EntitiesByDomainTypeQuery, EntitiesByGuidsQuery, EntityByGuidQuery, EntityByNameQuery. Storage queries: New Relic One provides a simple storage mechanism that we call NerdStorage. This can be used by Nerdpack creators to store application configuration setting data, user-specific data, and other small pieces of data. Components in this category: UserStorageQuery, AccountStorageQuery, EntityStorageQuery, UserStorageMutation, AccountStorageMutation, and EntityStorageMutation. For details, see NerdStorage. NRQL queries: To be able to query your New Relic data via NRQL (New Relic Query Language), we provide a NrqlQuery component. This component can return data in different formats, so that you can use it for charting and not only for querying. Query components All query components accept a function as a children prop where the different statuses can be passed. This callback receives an object with the following properties: loading: Boolean that is set to true when data fetching is happening. Our components use the cache-and-network strategy, meaning that after the data has loaded, subsequent data reloads might be triggered first with stale data, then refreshed when the most recent data has arrived. data: Root property where the data requested is retrieved. The structure matches a root structure based on the NerdGraph schema. This is true even for highly nested data structures, which means you’ll have to traverse down to find the desired data. error: Contains an Error instance when the query fails. Set to undefined when data is loading or the fetch was successful. fetchMore: Callback function that can be called when the query is being loaded in chunks. The function will only be present when it’s feasible to do so, more data is available, and no fetchMore has already been triggered. Data is loaded in batches of 200 by default. Other components provided by the platform (like the Dropdown or the List) are capable of accepting fetchMore, meaning you can combine them easily. Mutation components Mutation components also accept a children as a function, like the query ones. The mutation can be preconfigured at the component level, and a function is passed back that you can use in your component. This is the standard React Apollo approach for performing mutations, but you might find it easier to use our static mutation method added to the component. More on this topic below. Static methods All of the described components also expose a static method so that they can be used imperatively rather than declaratively. All Query components have a static Query method, and all Mutation components have a mutation method. These static methods accept the same props as their query component, but passed as an object. For example: // Declarative way (using components). function renderAccountList() { return (
    ({data, error}) => { if (error) { return
  • Failed to retrieve list: {error.message}
  • ; } return data.map((account) => {
  • {account.name}
  • }); }}
); } // Imperative way (using promises). async function getAccountList() { let data = {}; try { data = await AccountsQuery.query(); } catch (error) { console.log('Failed to retrieve list: ' + error.message); return; } return data.actor.accounts.map((account) => { return account.name; }); } Copy Similarly, a mutation can happen either way; either declaratively or imperatively. NrqlQuery NrqlQuery deserves additional explanation, because there are multiple formats in which you can return data from it. To provide maximum functionality, all three are exposed through a formatType property. You can find its different values under NrqlQuery.formatType: NERD_GRAPH: Returns the format in which it arrives from NerdGraph. RAW: The format exposed by default in Insights and dashboards when being plotted as JSON. This format is useful if you have a pre-existing script in this format that you're willing to migrate to or incorporate with. CHART: The format used by the charting engine that we also expose. You can find a more detailed explanation of how to manipulate this format in the guide to chart components, and some examples. If you are willing to push data, we currently do not expose NrqlMutation. To do that, see the Event API for how to add custom events.", "type": "developer", "document_type": "page", - "info": "Add a time picker to a sample application", + "info": "Reference guide for SDK query components using NerdGraph", "sections": [ - "Add a time picker", - "Before you begin", - "Note", - "Prepare the time picker sample code", - "Import the PlatformStateContext component", - "Add the time to the queries", - "Summary" + "Query and store data", + "Components overview", + "Query components", + "Mutation components", + "Static methods", + "NrqlQuery" ], - "title": "Add a time picker", + "title": "Query and store data", "popularity": 1, - "external_id": "2602edf3077388ba4fded3a76208e5e0ae1be98f", - "image": "https://developer.newrelic.com/static/7f679da4c4ffce5fa547a04b27ac700d/0086b/add-timepicker.png", - "url": "https://developer.newrelic.com/build-apps/add-time-picker-guide/", - "published_at": "2020-08-17T01:48:54Z", - "updated_at": "2020-08-14T01:45:09Z", + "external_id": "cbbf363393edeefbc4c08f9754b43d38fd911026", + "image": "", + "url": "https://developer.newrelic.com/explore-docs/query-and-store-data/", + "published_at": "2020-08-18T02:08:12Z", + "updated_at": "2020-08-01T01:42:02Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.027454417, + "_score": 0.29999372, "_version": null, "_explanation": null, "sort": null, "highlight": { - "body": " your account ID, start the CLI quick start again, and then click the Get your API key down arrow. The account ID is the number preceding your account name. For additional details, see Set up your development environment. Prepare the time picker sample code To get started, complete these steps to update" + "title": "Query and store data", + "sections": "Components overview", + "info": "Reference guide for SDK query components using NerdGraph", + "body": " be identified by the Query suffix. Mutation-related components can be identified by the Mutation prefix. Components overview Our data components are based on React Apollo. The most basic component is NerdGraphQuery, which accepts any GraphQL (or GraphQL AST generated by the graphql-tag library as the query" }, - "id": "5efa993d28ccbc91ff307dde" + "id": "5efa989e28ccbc2f15307deb" }, { - "body": "You can get Prometheus data flowing in New Relic with just a few simple steps. If you don't already have an account, you can sign up for New Relic right now. This page covers basic setup for the remote write integration, as well as a few common troubleshooting topics. For information on high availability integration, see the Prometheus High Availability resource. Set up the integration From the Prometheus remote write setup page, complete these steps. Enter a name for the Prometheus server you’re connecting to and your remote_write URL. The name you enter for the server will create an attribute on your data, and will be the name used to identify which Prometheus server you're connecting to. Add a new remote_write URL to your Prometheus YML file. A good place to add this information is under global_config in the file, at the same indentation level as the global section. The end result should look like this: remote_write: - url: https://metric-api.newrelic.com/prometheus/v1/write?X-License-Key=&prometheus_server= ​​​​If you are completing the remote write integration using Kubernetes (with or without Helm), you should instead add the remote write URL to your YAML operator file. The result should look something like this example. Restart your Prometheus server. View your data. Add Prometheus data Customize remote write behavior You may be interested in customizing the following parameters if you are writing to more than one account in New Relic or are connecting more than one Prometheus data source to the same account in New Relic. X-License Key Your account's license key is not an API key. The license key is used for authentication and to identify which account to write data into. Details: If you are configuring Prometheus to write into different New Relic accounts or sub-accounts you should use a different key on each remote write URL. prometheus_server URL parameter The prometheus_server parameter is a label or attribute used to add to stats that are written to NRDB. You should use this same label when configuring your Grafana data source to limit results to just those from a particular prometheus_server. Troubleshooting the integration If you receive an integration error message from New Relic or error messages in your Prometheus server logs after restarting your Prometheus server, there are several actions you can take to troubleshoot and get data flowing properly. Below are a few tips regarding common issues and error messages. Common errors and issues: Missing or incorrect characters in the remote write URL in the config file (for example the endpoint, license key, or prometheus_server name) or incorrect placement of the information in the file will result in the Prometheus server not starting, remote write not working properly, or errors appearing in Prometheus server logs. 400: bad request error. If no data appears with a bad request error, check your configuration file to confirm that the placement of the remote write information is correct, and that there are no missing or incorrect characters. 413: request entity too large. This means you have sent a request in which one or more fields, or the entire payload, has exceeded our limits. 429: rate limit error. This means you have hit a rate limit on the amount of data being sent at one time (for example cardinality or data points per minute). You can troubleshoot by reducing the amount of Prometheus or general metric data you are sending, or by requesting a rate-limit increase. You can investigate error messages in New Relic by doing either or both of the following: Run a query on the error message using NRQL then look at the Message field in UI to see a description of what went wrong. For example: SELECT * FROM NrIntegrationError WHERE newRelicFeature = 'Metrics' Investigate individual errors in time to see when and where they occur and any simultaneously occurring issues, and perform targeted troubleshooting based on what you find out. For example: SELECT count(*) FROM NrIntegrationError WHERE newRelicFeature = 'Metrics' TIMESERIES If you’ve validated that you can send data successfully but are unable to query it, you may be running into other kinds of limits, like the inspected count limit. This may manifest itself as an error message during the integration process that says: Unable to retrieve data for Prometheus data source . Remove the integration To remove the integration, remove the configuration code snippet from your Prometheus YML file and restart the server. When you remove the integration, this stops new data from flowing, but will not purge or remove any historical data. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / Integrations / Prometheus integrations / Install and configure", - "info": "How to set up or remove your Prometheus remote write integration on New Relic. ", - "nodeid": 38766, + "info": "Intro to New Relic One API components", "sections": [ - "Prometheus integrations", - "Get started", - "Install and configure", - "View and query data", - "Troubleshooting", - "Set up your Prometheus remote write integration", - "Set up the integration", - "Customize remote write behavior", - "Troubleshooting the integration", - "Remove the integration", - "For more help" + "Intro to New Relic One API components", + "Components of the SDK", + "UI components", + "Chart components", + "Query and storage components", + "Platform APIs" ], - "title": "Set up your Prometheus remote write integration", + "title": "Intro to New Relic One API components", "popularity": 1, - "external_id": "45a644202d25d6e49b8d4ffd61a4512316f5a38b", - "category_1": "Prometheus integrations", - "category_2": "Install and configure", + "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2", "image": "", - "url": "https://docs.newrelic.com/docs/integrations/prometheus-integrations/install-configure/set-your-prometheus-remote-write-integration", - "published_at": "2020-08-15T04:56:59Z", - "updated_at": "2020-07-31T01:42:36Z", - "category_0": "Integrations", + "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-14T01:47:12Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0045786276, + "_score": 0.2660732, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Set up your Prometheus remote write integration", - "sections": "Set up your Prometheus remote write integration", - "info": "How to set up or remove your Prometheus remote write integration on New Relic. ", - "body": " availability integration, see the Prometheus High Availability resource. Set up the integration From the Prometheus remote write setup page, complete these steps. Enter a name for the Prometheus server you’re connecting to and your remote_write URL. The name you enter for the server will create" + "title": "Intro to New Relic One API components", + "sections": "Query and storage components", + "info": "Intro to New Relic One API components", + "body": " is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration" }, - "id": "5f23770c28ccbc272332c204" + "id": "5efa989e28ccbc4071307de5" } ], - "/explore-docs/nerdpack-file-structure": [ + "/explore-docs/query-and-store-data": [ { - "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", + "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,000 documents, plus storage type. Each document can have a maximum length of 64 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.", "type": "developer", "document_type": "page", - "info": "Build a \"Hello, World!\" app and publish it to New Relic One", + "info": "Intro to NerdStorage on New Relic One", "sections": [ - "Create a \"Hello, World!\" application", - "Before you begin", - "Create a local version of the \"Hello, World!\" application", - "Publish your application to New Relic", - "Add details to describe your project", - "Subscribe accounts to your application", - "Summary", - "Related information" + "Intro to NerdStorage", + "Use NerdStorage in your apps", + "Data model", + "Limits", + "Data access", + "Permissions for working with NerdStorage" ], - "title": "Create a \"Hello, World!\" application", + "title": "Intro to NerdStorage", "popularity": 1, - "tags": [ - "nr1 cli", - "Nerdpack file structure", - "NR One Catalog", - "Subscribe applications" - ], - "external_id": "aa427030169067481fb69a3560798265b6b52b7c", - "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png", - "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/", - "published_at": "2020-08-17T01:55:14Z", - "updated_at": "2020-08-14T01:45:09Z", + "external_id": "709e06c25376d98b2191ca369b4d139e5084bd62", + "image": "", + "url": "https://developer.newrelic.com/explore-docs/nerdstorage/", + "published_at": "2020-08-18T02:11:48Z", + "updated_at": "2020-08-14T01:50:34Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 8.686924, + "_score": 0.25488237, "_version": null, "_explanation": null, "sort": null, "highlight": { - "tags": "Nerdpack file structure", - "body": " editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { "schemaType": "LAUNCHER", "id": "my-awesome-nerdpack-launcher", "description": "Describe me", "displayName": "INSERT_YOUR_TILE_LABEL_HERE", "rootNerdletId" + "body": " and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order" }, - "id": "5efa9973196a67d16d76645c" + "id": "5efa989ee7b9d2048e7bab92" }, { - "body": "A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. This document explains: The file structure for a Nerdpack, a Nerdlet and a launcher How to link a launcher file to a Nerdlet How to link your application with a monitored entity For basic component definitions, see our developer site. Generate Nerdpack components There are two ways to generate a Nerdpack template: Generate Nerdpack. Use the CLI command nr1 create and select Nerdpack to create a Nerdpack template that includes a Nerdlet and a launcher. Generate Nerdlet or launcher individually. You can use the CLI command nr1 create and choose to select either a Nerdlet or launcher. This may be useful when adding Nerdlets to an existing Nerdpack. For a lesson on generating and connecting Nerdpack components, see the workshop. Nerdpack file structure When you generate a Nerdpack template using the CLI nr1 create command, it has this file structure: my-nerdlet ├── README.md ├── launchers │ └── my-nerdlet-launcher │ ├── icon.png │ └── nr1.json ├── nerdlets │ └── my-nerdlet-nerdlet │ ├── index.js │ ├── nr1.json │ └── styles.scss ├── node_modules │ ├── js-tokens │ ├── loose-envify │ ├── object-assign │ ├── prop-types │ ├── react │ ├── react-dom │ ├── react-is │ └── scheduler ├── nr1.json ├── package-lock.json └── package.json Nerdlet file structure A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files: index.js The JavaScript code. Here's what the default file looks like when a Nerdlet is generated with the CLI nr1 create: import React from 'react'; export default class MyAwesomeNerdpack extends React.Component { render() { return

Hello, my-awesome-nerdpack Nerdlet!

} } nr1.json Configuration file. Here is the default file generated by the CLI nr1 create command: { \"schemaType\": \"NERDLET\", \"id\": \"my-awesome-nerdpack-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\" } Besides using the launcher as the access point for your application, you can also associate the application with a monitored entity to get it to appear in the New Relic One entity explorer. To do this, add two additional fields to the config file of the first-launched Nerdlet: entities and actionCategory. In the following example, the Nerdlet has been associated with all New Relic Browser-monitored applications and will appear under the Monitor UI category : { \"schemaType\": \"NERDLET\", \"id\": \"my-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"Custom Data\", \"entities\": [{\"domain\": \"BROWSER\", \"type\": \"APPLICATION\"}], \"actionCategory\": \"monitor\" } To see this application in the UI, you would go to the New Relic One entity explorer, select Browser applications, and select a monitored application. styles.scss The file for CSS styles (Sass SCSS syntax). Launcher file structure When an application with a launcher file has been deployed, its launcher is located on the New Relic One home page (one.newrelic.com). A launcher is not required; as an alternative to using a launcher, you can associate your application with a monitored entity. An application can have more than one launcher; this may be desired for an application with multiple Nerdlets. A launcher folder contains two files: nr1.json The configuration file. Here is the default file template created by the nr1 create command: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } To connect a launcher to a Nerdlet, the rootNerdletId must match the id in the launched Nerdlet's nr1.json config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet. icon.png The launcher icon that appears on the one.newrelic.com home page when an application is deployed. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "body": "The New Relic Java agent API lets you control, customize, and extend the functionality of the APM Java agent. This API consists of: Static methods on the com.newrelic.api.agent.NewRelic class A @Trace annotation for implementing custom instrumentation A hierarchy of API objects providing additional functionality Use this API to set up custom instrumentation of your Java app and collect more in-depth data. For detailed information about this API, see the complete Javadoc on GitHub. Another way to set up custom instrumentation is to use XML instrumentation. The XML option is simpler and does not require modification of your app code, but it lacks the complete functionality of the Java agent API. For best results when using the API, ensure that you have the latest Java agent release. Several APIs used in the examples require Java agent 3.36.0 or higher. For all available New Relic APIs, see Intro to APIs. Use the API To access the API class, add newrelic-api.jar to your application class path. The jar is in the New Relic Java agent's installation zip file. You can call the API when the Java agent is not running. The API methods are just stubs; the implementation is added when the Java agent loads the class. Transactions To instrument Transactions in your application, use the following APIs. If you want to... Use this Create a Transaction when New Relic does not create one automatically @Trace(dispatcher = true) on the method that encompasses the work to be reported. When this annotation is used on a method within the context of an existing transaction, this will not start a new transaction, but rather include the method in the existing transaction. Capture the duration of a method that New Relic does not automatically trace @Trace() on the method you want to time. Set the name of the current Transaction NewRelic.setTransactionName(...) Start the timer for the response time of the current Transaction and to cause a Transaction you create to be reported as a Web transaction, rather than as an Other transaction NewRelic.setRequestAndReponse(...) Add custom attributes to Transactions and TransactionEvents NewRelic.addCustomParameter(...) Prevent a Transaction from being reported to New Relic NewRelic.ignoreTransaction() Exclude a Transaction when calculating your app's Apdex score NewRelic.ignoreApdex() Instrument asynchronous work For detailed information, see Java agent API for asynchronous applications. If you want to... Use this Trace an asynchronous method if it is linked to an existing Transaction... @Trace(async = true) Link the Transaction associated with the Token on the current thread... Token.link() or Token.linkAndExpire() Expire a Token associated with the current Transaction... Token.expire() Stop timing a Segment and have it report as part of its parent Transaction Segment.end() Stop timing a Segment and not have it report as part of its parent Transaction Segment.ignore() Implement distributed tracing These APIs require distributed tracing to be enabled. Distributed tracing lets you see the path that a request takes as it travels through a distributed system. For general instructions on how to use the calls below to implement distributed tracing, see Use distributed tracing APIs. If you want to... Use this Create a payload to be sent to a called service. Transaction.createDistributedTracePayload() For more on obtaining references to the current transaction and other entities, see Obtain references. Accept a payload sent from the first service; this will link these services together in a trace. Transaction.acceptDistributedTracePayload(...) For more on obtaining references to the current transaction and other entities, see Obtain references. Payload used to connect services. The text() call returns a JSON string representation of the payload. DistributedTracePayload.text() Payload used to connect services. The httpSafe() call returns a base64 encoded JSON string representation of the payload. DistributedTracePayload.httpSafe() Add custom attributes to SpanEvents in distributed traces NewRelic.getAgent().getTracedMethod().addCustomAttribute(...) Implement cross application tracing To track external calls and add cross application tracing, use the following APIs: If you want to... Use this Trace across a custom transport channel that New Relic does not support by default, such as a proprietary RPC transport Transaction.getRequestMetadata(), .processRequestMetadata(...), .getResponseMetadata(), .processResponseMetadata(...) Also refer to the information in this document about using Transaction to obtain references to New Relic entities. View or change the metric name or a rollup metric name of a TracedMethod (A rollup metric name, such as OtherTransaction/all, is not scoped to a specific transaction. It represents all background transactions.) TracedMethod.getMetricName(), .setMetricName(...), .setRollupMetricName(...) Also refer to the information in this document about using TracedMethod to obtain references to New Relic entities. Report a call to an external HTTP service, database server, message queue, or other external resource that is being traced using the Java agent API's @Trace annotation TracedMethod.reportAsExternal(...) passing arguments constructed using ExternalParameters builder. Also refer to the information in this document about using TracedMethod to obtain references to New Relic entities. Enable and add cross application tracing when communicating with an external HTTP or JMS service that is instrumented by New Relic TracedMethod.addOutboundRequestHeaders(...) along with TracedMethod.reportAsExternal(...) Also refer to the information in this document about using TracedMethod to obtain references to New Relic entities. Add timing for an application server or dispatcher that is not supported automatically Transaction.setRequest(...), Transaction.setResponse(...), or NewRelic.setRequestAndResponse(...), and Transaction.markResponseSent() Also refer to the information in this document about using Transaction to obtain references to New Relic entities. Obtain references to New Relic entities Other tasks require the New Relic Agent object. The Agent object exposes multiple objects that give you the following functionality: If you want to... Use this Get a reference to the current Transaction NewRelic.getAgent().getTransaction() Get a Token to link asynchronous work NewRelic.getAgent().getTransaction().getToken() Start and get a reference to a Segment NewRelic.getAgent().getTransaction().startSegment() Get a reference to the method currently being traced NewRelic.getAgent().getTracedMethod() Get a reference to the Agent logger NewRelic.getAgent().getLogger() Get a reference to the Agent configuration NewRelic.getAgent().getConfig() Get a reference to an aggregator for custom metrics NewRelic.getAgent().getAggregator() Get a reference to Insights in order to record custom events NewRelic.getAgent().getInsights() Additional API functionality The following APIs provide additional functionality, such as setting app server info, reporting errors, adding page load timing information, recording custom metrics, and sending custom events to Insights. If you want to... Use this Explicitly set port, name, and version information for an application server or dispatcher and the instance name for a JVM NewRelic.setAppServerPort(...), .setServerInfo(...), and .setInstanceName(...) Report an error that New Relic does not report automatically NewRelic.noticeError(...) When inside a transaction, the first call to noticeError wins. Only 1 error will be reported per transaction. Add browser page load timing for Transactions that New Relic does not add to the header automatically NewRelic.getBrowserTimingHeader(), .getBrowserTimingFooter(), .setUserName(String name), .setAccountName(String name), and .setProductName(String name) Create and accumulate custom metrics NewRelic.recordMetric(...), .recordResponseTimeMetric(...), or .incrementCounter(...) Record Insights custom events Insights.recordCustomEvent(...) Or, use NewRelic.addCustomParameter(...) to add custom attributes to the New Relic-defined TransactionEvent type. Also refer to the information in this document about using Insights to obtain references to New Relic entities. Additional API usage examples For detailed code examples about using the APIs, see New Relic's documentation about custom instrumentation for: External calls, cross application traces, messaging, datastores, and web frameworks Cross application tracing and external datastore calls Apps using custom instrumentation with annotation Custom framework instrumentation API Preventing unwanted instrumentation Inserting custom attributes Inserting custom events Collecting custom metrics For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "type": "docs", "document_type": "page", - "breadcrumb": "Contents / New Relic One / Use New Relic One / Build on New Relic One", - "info": "For building a New Relic One application: an explanation of the Nerdpack/Nerdlet file structure. ", - "nodeid": 36006, + "breadcrumb": "Contents / APM agents / Java agent / API guides", + "info": "A goal-focused guide to New Relic's Java agent API, with links to relevant sections of the complete API documentation on GitHub.", + "nodeid": 11521, "sections": [ - "Use New Relic One", - "Get started", - "Core concepts", - "UI and data", - "Workloads", - "Build on New Relic One", - "Nerdpack file structure", - "Generate Nerdpack components", - "Nerdlet file structure", - "Launcher file structure", + "Java agent", + "Getting started", + "Installation", + "Additional installation", + "Heroku", + "Configuration", + "Attributes", + "Features", + "Instrumentation", + "Custom instrumentation", + "API guides", + "Async instrumentation", + "Troubleshooting", + "Guide to using the Java agent API", + "Use the API", + "Transactions", + "Instrument asynchronous work", + "Implement distributed tracing", + "Implement cross application tracing", + "Obtain references to New Relic entities", + "Additional API functionality", + "Additional API usage examples", "For more help" ], - "title": "Nerdpack file structure", + "title": "Guide to using the Java agent API ", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/agents/java-agent/api-guides/guide-using-java-agent-api", "popularity": 1, - "external_id": "6e3788bee17cb65b6dc210862e2a10399f78ff67", - "category_1": "Use New Relic One", - "category_2": "Build on New Relic One", + "external_id": "a31c751c7c29dd46effac2e568f7c0a92b033b18", + "category_1": "Java agent", + "category_2": "API guides", "image": "", - "url": "https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/new-relic-one-application-nerdpack-file-structure", - "published_at": "2020-08-15T11:15:51Z", - "updated_at": "2020-07-25T00:32:16Z", - "category_0": "New Relic One", + "url": "https://docs.newrelic.com/docs/agents/java-agent/api-guides/guide-using-java-agent-api", + "published_at": "2020-08-18T10:50:48Z", + "updated_at": "2020-08-15T02:29:16Z", + "category_0": "APM agents", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 1.2830935, + "_score": 0.028378151, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Nerdpack file structure", - "sections": "Nerdpack file structure", - "info": "For building a New Relic One application: an explanation of the Nerdpack/Nerdlet file structure. ", - "body": "A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. This document explains: The file structure for a Nerdpack, a Nerdlet and a launcher How to link a launcher file to a Nerdlet How to link your" + "body": "The New Relic Java agent API lets you control, customize, and extend the functionality of the APM Java agent. This API consists of: Static methods on the com.newrelic.api.agent.NewRelic class A @Trace annotation for implementing custom instrumentation A hierarchy of API objects providing additional" }, - "id": "5da0e07a64441f1328edf241" + "id": "5a3137f4e621f4576cf1e35f" }, { - "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", - "type": "developer", + "body": "[RSS] Released on:  Wednesday, February 15, 2017 - 09:55 Download Improvements APIs This release adds a number of APIs that will allow you to instrument and get expanded visibility into frameworks, libraries, and any custom code that New Relic does not automatically instrument. In addition to instrumenting your web frameworks, you can also instrument calls to and from messaging systems, database calls, and external calls! By passing context about your code to the APIs, you will get the same reporting, including cross application tracing, that you get with New Relic’s built-in instrumentation. Solr This release adds support for Solr versions 5 and 6 (up to and including version 6.3.0). Fixes Fixes a bug that prevents an application from starting up when a JAX-RS annotated method contains more than 8 parameters. Fixes an issue that affected Spring and JAX-RS applications compiled with the Java 8 flag javac -parameters. The issue would cause the application to throw a java.lang.reflect.MalformedParametersException exception. Fixes bug that affected applications implementing JAX-RS endpoints using static methods. The agent now reports WildFly dispatcher name and version. Fixes a bug in which Queue Time could be misreported on the Overview page for customers injecting the X-Queue-Start or X-Request-Start HTTP headers. This fix brings the Java Agent into compliance with the behavior of other New Relic Agents. Fixes an issue in which custom Hystrix Commands that are subclassed multiple times in Groovy cause an application to throw an exception on startup.", + "type": "docs", + "document_type": "release_notes", + "breadcrumb": "Contents / Release notes / APM agent release notes / Java agent release notes", + "info": "", + "nodeid": 11976, + "sections": [ + "APM agent release notes", + "Go agent release notes", + "Java agent release notes", + ".NET agent release notes", + "Node.js agent release notes", + "PHP agent release notes", + "Python agent release notes", + "Ruby agent release notes", + "C SDK release notes", + "Java Agent 3.36.0", + "Improvements", + "Fixes" + ], + "title": "Java Agent 3.36.0", + "popularity": -2, + "external_id": "f94f5c53e522a9835ea42514e90d9a39e81fd050", + "category_1": "APM agent release notes", + "category_2": "Java agent release notes", + "image": "", + "url": "https://docs.newrelic.com/docs/release-notes/agent-release-notes/java-release-notes/java-agent-3360", + "published_at": "2020-08-18T03:10:52Z", + "updated_at": "2018-04-14T23:39:35Z", + "category_0": "Release notes", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 0.026818182, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "body": " with the Java 8 flag javac -parameters. The issue would cause the application to throw a java.lang.reflect.MalformedParametersException exception. Fixes bug that affected applications implementing JAX-RS endpoints using static methods. The agent now reports WildFly dispatcher name and version. Fixes a bug" + }, + "id": "58a53cf38e9c0f755a81db4e" + }, + { + "body": "For your New Relic-monitored Java application, one custom instrumentation method is to use an XML file that lists the methods and classes you want to instrument. This documentation shows an example XML instrumentation file. For more information, see Java instrumentation by XML. Edit XML file in UI To edit your XML file directly from the New Relic UI: Go to one.newrelic.com > APM > (select an app) > Settings > Instrumentation. From here you can: Download a sample XML file. Select an edit existing XML file. Search the instrumentation history. XML file format The XML file format includes root and child nodes. Do not instrument all of your methods, as this can lead to a metric grouping issue. Root node: extension The root node of an XML file is extension. It can have three different attributes: Value Definition name A unique but descriptive name identifying your XML extension. enabled Identifies whether the extension will be read by the Java agent. Default is true. If false, New Relic will ignore the extension. version The version of the extension. If two extensions have the same name, only the extension with the highest version will be used. Instrumentation (child of extension) The instrumentation node is a child of extension. It can have one attribute: metricPrefix. This is the prefix used for the metric names when the nameTransaction node is not specified. Default is CUSTOM. Pointcut (child of instrumentation) The pointcut is a child node of instrumentation and can have several attributes. Also, a pointcut can have several different child nodes. Value Definition transactionStartPoint If a transaction is not already in progress when this pointcut is reached, then a transaction will be started. If a transaction is already in progress, then that transaction will continue. A new transaction will not be created. metricNameFormat The name format to use for a metric. If not present, then this will default to the class name followed by the method name. You can only set the metricNameFormat on pointcuts where transactionStartPoint is set to false. excludeFromTransactionTrace When true the transaction trace will not be provided if this pointcut initiates the transaction. If the pointcut is reached in the middle of a transaction, then the transaction trace will still be present, but this method will be excluded from the call graph. ignoreTransaction When true the entire transaction will be ignored. transactionType Sets the type of the transaction. Possible values are background (default, reported as a non-web transaction) and web (reported as a web transaction). Child nodes for pointcut A pointcut can have several different child nodes: Value Definition nameTransaction If this element is present, the agent will name the transaction using the class name and method(s) instrumented by this pointcut. methodAnnotation The case sensitive full name of an annotation class including the package name. All methods that are marked with this annotation will be matched. className The case sensitive name of the class to match, including the package name. Pair this node with the method node. If this node is present on a pointcut, then the interfaceName node cannot be present on the same pointcut node. The className node has the attribute includeSubclasses. If true the methods on the class with the matching name will be instrumented along with the matching methods on any child class of this class. If false (default), only methods on the exact class specified will be instrumented. The className must follow these rules: Inner classes can be instrumented. The full package structure with dots between packages must be used. To match subclasses of the specified class, set the attribute includeSubclasses to true. interfaceName The case sensitive name of an interface, including the package name, whose implementation classes will be matched. Pair this node with the method node. If this node is present on a pointcut, then the className node cannot be present on the same pointcut node. The interfaceName must follow this rule: The full package structure with dots between packages must be used. method A method on the class to instrument. Pair this node with a className node. Also, the method node can have children. Child nodes for method The method node can have several children. For more information and examples, see Troubleshooting Java custom instrumentation. Value Definition name The exact case sensitive name of the method to match. A method name node must follow these rules: Public, protected, private, and package methods can all be instrumented. Static and instance methods can be instrumented. Constructors cannot be instrumented. parameters The parameter types of the method specified in order. If the parameters element is not present, then all methods matching the name will be matched. This includes private and protected declarations. A method parameters node contains a list of the method's parameters, specified by type elements. Here are the major rules for the type elements: Primitives are specified using their normal name: int, float, double, long, byte, short, boolean, char. Objects require a full package structure. For example, do not use String in the XML; instead, use java.lang.String. Do not use generics with collection objects. For example, write java.util.List instead of java.util.List. Include brackets for arrays. For example, an array of integers will be int[ ] and an array of strings will be java.lang.String[ ]. Include two sets of brackets for an array of arrays. For example, an array of arrays of longs would be long[ ][ ]. To send the parameter as an analytic event to New Relic One, add an XML attribute to the type element called attributeName. To use a method with no parameters, the parameters node needs to be present to match a \"no arguments\" method. returnType The case sensitive name of a class indicating a return type to match. All methods that return this class type will be matched. Example Here is a sample class and an XML file that could be used to instrument that class. Sample class package test; import java.util.HashMap; import java.util.Map; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; public class SampleTester { private String configName; private Map maxSampleTimes; public SampleTester(String pConfigName) { configName = pConfigName; maxSampleTimes = new HashMap<>(); } public void checkSample(String name, long[] times) { if (times != null) { maxSampleTimes.put(name, getFirst(times)); } else { maxSampleTimes.put(name, (long) getFirst()); } } private Long getFirst(long[] times) { return times[0]; } private int getFirst() { return 0; } public void printMaxRepeat(final long max) throws Exception { Runnable myRunnable = new Runnable() { public void run() { try { printMax(max); } catch (Exception e) { e.printStackTrace(); } } }; ScheduledExecutorService scheduledExecutor = Executors.newScheduledThreadPool(1); scheduledExecutor.scheduleWithFixedDelay(myRunnable, 0, 10000, TimeUnit.MILLISECONDS); } private void printMax(long max) { System.out.println(\"max is \" + max); } } Sample XML instrumentation file and explanation test.SampleTester checkSample java.lang.String long[] getFirst run test.SampleTester printMaxRepeat printMax The first block of the XML file specifies the name and version of the extension. As the XML extension is default enabled, that attribute is not specified. The second block specifies the methods in SampleClass that should be instrumented. A transaction is started at the beginning of the block. It is worth noting that in the example class, there are two methods that share a name (getFirst) but have different signatures. These are instrumented with a single method node. By removing the parameters node, all methods with the same name can be matched under one method node. In the third block, the specified methods do not have a transaction started on them. This is because the transaction has already been started in run. The transaction will not be ignored, and will be included in the transaction trace. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "An overview of common commands you can use with the New Relic One CLI.", + "breadcrumb": "Contents / APM agents / Java agent / Custom instrumentation", + "info": "With New Relic monitoring for Java, you can use XML files to set up custom instrumentation of your Java application.", + "nodeid": 2341, "sections": [ - "New Relic One CLI common commands", - "Command details", - "nr1 help", - "See commands and get details", - "Usage", - "Arguments", - "Examples", - "nr1 update", - "Update your CLI", - "nr1 create", - "Create a new component", - "Options", - "nr1 profiles", - "Manage your profiles keychain", - "Commands", - "nr1 autocomplete", - "See autocomplete installation instructions", - "nr1 nrql", - "Query using NRQL" + "Java agent", + "Getting started", + "Installation", + "Additional installation", + "Heroku", + "Configuration", + "Attributes", + "Features", + "Instrumentation", + "Custom instrumentation", + "API guides", + "Async instrumentation", + "Troubleshooting", + "Java XML instrumentation examples", + "Edit XML file in UI", + "XML file format", + "Example", + "For more help" ], - "title": "New Relic One CLI common commands", + "title": "Java XML instrumentation examples", "popularity": 1, - "external_id": "503e515e1095418f8d19329517344ab209d143a4", + "external_id": "d14a2215072dd950be5807e5cbd2acf0b793c573", + "category_1": "Java agent", + "category_2": "Custom instrumentation", "image": "", - "url": "https://developer.newrelic.com/explore-docs/nr1-common/", - "published_at": "2020-08-17T01:54:01Z", - "updated_at": "2020-08-14T01:48:10Z", + "url": "https://docs.newrelic.com/docs/agents/java-agent/custom-instrumentation/java-xml-instrumentation-examples", + "published_at": "2020-08-18T11:53:43Z", + "updated_at": "2020-08-18T11:53:43Z", + "category_0": "APM agents", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.15531382, + "_score": 0.02058597, "_version": null, "_explanation": null, "sort": null, "highlight": { - "body": " Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies" + "body": " must follow these rules: Public, protected, private, and package methods can all be instrumented. Static and instance methods can be instrumented. Constructors cannot be instrumented. parameters The parameter types of the method specified in order. If the parameters element is not present, then all" }, - "id": "5f28bd6ae7b9d267996ade94" + "id": "5ab28d72827a66324f05caa3" }, { - "body": "Map page views by region in a custom app 30 min New Relic has powerful and flexible tools for building custom apps and populating them with data. This guide shows you how to build a custom app and populate it with page view data using New Relic's Query Language (NRQL - pronounced 'nurkle'). Then you make your data interactive. And last, if you have a little more time and want to install a third-party React library, you can display the page view data you collect on a map of the world. In this guide, you build an app to display page view data in two ways: In a table On a map Please review the Before you begin section to make sure you have everything you need and don't get stuck halfway through. Before you begin In order to get the most out of this guide, you must have: A New Relic developer account, API key, and the command-line tool. If you don't have these yet, see the steps in Setting up your development environment New Relic Browser page view data to populate the app. Without this data, you won't be able to complete this guide. To add your data to a world map in the second half of the guide: npm, which you'll use during this section of the guide to install Leaflet, a third-party JavaScript React library used to build interactive maps. If you're new to React and npm, you can go here to install Node.js and npm. New Relic terminology The following are some terms used in this guide: New Relic application: The finished product where data is rendered in New Relic One. This might look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One that launches your application. Nerdlets: New Relic React components used to build your application. The three default files are index.js, nr1.json, and styles.scss, but you can customize and add your own. Build a custom app with a table chart Step 1 of 8 Query your browser data Use Query builder to write a NRQL query to see your page view data, as follows. On New Relic One, select Query your data (in the top right corner). That puts you in NRQL mode. You'll use NRQL to test your query before dropping the data into your table. Copy and paste this query into a clear query field, and then select Run. FROM PageView SELECT count(*), average(duration) WHERE appName = 'WebPortal' FACET countryCode, regionCode SINCE 1 week ago LIMIT 1000 Copy If you have PageView data, this query shows a week of average page views broken down by country and limited to a thousand items. The table will be full width and use the \"chart\" class defined in the CSS. If you don't have any results at this point, ensure your query doesn't have any errors. If your query is correct, you might not have the Browser agent installed. Step 2 of 8 Create and serve a new Nerdpack To get started, create a new Nerdpack, and serve it up to New Relic from your local development environment: Create a new Nerdpack for this app: nr1 create --type nerdpack --name pageviews-app Copy Serve the project up to New Relic: cd pageviews-app && nr1 nerdpack:serve Copy Step 3 of 8 Review your app files and view your app locally Navigate to your pageviews-app to see how it's structured. It contains a launcher folder, where you can customize the description and icon that will be displayed on the app's launcher in New Relic One. It also contains nerdlets, which each contain three default files: index.js, nr1.json, and styles.scss. You'll edit some of these files as part of this guide. For more information, see Nerdpack file structure. Now in your browser, open https://one.newrelic.com/?nerdpacks=local, and then click Apps to see the pageview-apps Nerdpack that you served up. When you select the launcher, you see a Hello message. Step 4 of 8 Hard code your account ID For the purposes of this exercise and for your convenience, hard code your account ID. In the pageview-app-nerdlet directory, in the index.js file, add this code between the import and export lines. (Read about finding your account ID here). const accountId = [Replace with your account ID]; Copy Step 5 of 8 Import the TableChart component To show your data in a table chart, import the TableChart component from New Relic One. To do so, in index.js, add this code under import React. import { TableChart } from `nr1`; Copy Step 6 of 8 Add a table with a single row To add a table with a single row, in the index.js file, replace this line: return

Hello, pageview-app-nerdlet Nerdlet!

; Copy with this export code: export default class PageViewApp extends React.Component { render() { return (
); } } Copy Step 7 of 8 Customize the look of your table (optional) You can use standard CSS to customize the look of your components. In the styles.scss file, add this CSS. Feel free to customize this CSS to your taste. .container { width: 100%; height: 99vh; display: flex; flex-direction: column; .row { margin: 10px; display: flex; flex-direction: row; } .chart { height: 250px; } } Copy Step 8 of 8 Get your data into that table Now that you've got a table, you can drop a TableChart populated with data from the NRQL query you wrote at the very beginning of this guide. Put this code into the row div. ; Copy Go to New Relic One and click your app to see your data in the table. (You might need to serve your app to New Relic again.) Congratulations! You made your app! Continue on to make it interactive and show your data on a map. Make your app interactive with a text field Once you confirm that data is getting to New Relic from your app, you can start customizing it and making it interactive. To do this, you add a text field to filter your data. Later, you use a third-party library called Leaflet to show that data on a world map. Step 1 of 3 Import the TextField component Like you did with the TableChart component, you need to import a TextField component from New Relic One. import { TextField } from 'nr1'; Copy Step 2 of 3 Add a row for your text field To add a text field filter above the table, put this code above the TableChart div. The text field will have a default value of \"US\".
{ this.setState({ countryCode: event.target.value }); }} />
; Copy Step 3 of 3 Build the text field object Above the render() function, add a constructor to build the text field object. constructor(props) { super(props); this.state = { countryCode: null } } Copy Then, add a constructor to your render() function. Above return, add: const { countryCode } = this.state; Copy Now add countryCode to your table chart query. ; Copy Reload your app to try out the text field. Get your data on a map To create the map, you use npm to install Leaflet. Step 1 of 9 Install Leaflet In your terminal, type: npm install --save leaflet react-leaflet Copy In your nerdlets styles.scss file, import the Leaflet CSS: @import `~leaflet/dist/leaflet.css`; Copy While you're in styles.scss, fix the width and height of your map: .containerMap { width: 100%; z-index: 0; height: 70vh; } Copy Step 2 of 9 Add a webpack config file for Leaflet Add a webpack configuration file .extended-webpackrc.js to the top-level folder in your nerdpack. This supports your use of map tiling information data from Leaflet. module.exports = { module: { rules: [ { test: /\\.(png|jpe?g|gif)$/, use: [ { loader: 'file-loader', options: {}, }, { loader: 'url-loader', options: { limit: 25000 }, }, ], }, ], }, }; Copy Step 3 of 9 Import modules from Leaflet In index.js, import modules from Leaflet. import { Map, CircleMarker, TileLayer } from 'react-leaflet'; Copy Step 4 of 9 Import additional modules from New Relic One You need several more modules from New Relic One to make the Leaflet map work well. Import them with this code: import { NerdGraphQuery, Spinner, Button, BlockText } from 'nr1'; Copy NerdGraphQuery lets you make multiple NRQL queries at once and is what will populate the map with data. Spinner adds a loading spinner. Button gives you button components. BlockText give you block text components. Step 5 of 9 Get data for the map Using latitude and longitude with country codes, you can put New Relic data on a map. mapData() { const { countryCode } = this.state; const query = `{ actor { account(id: 1606862) { mapData: nrql(query: \"SELECT count(*) as x, average(duration) as y, sum(asnLatitude)/count(*) as lat, sum(asnLongitude)/count(*) as lng FROM PageView FACET regionCode, countryCode WHERE appName = 'WebPortal' ${countryCode ? ` WHERE countryCode like '%${countryCode}%' ` : ''} LIMIT 1000 \") { results nrql } } } }`; return query; }; Copy Step 6 of 9 Customize the map marker colors Above the mapData function, add this code to customize the map marker colors. getMarkerColor(measure, apdexTarget = 1.7) { if (measure <= apdexTarget) { return '#11A600'; } else if (measure >= apdexTarget && measure <= apdexTarget * 4) { return '#FFD966'; } else { return '#BF0016'; } }; Copy Feel free to change the HTML color code values to your taste. In this example, #11A600 is green, #FFD966 is sort of yellow, and #BF0016 is red. Step 7 of 9 Set your map's default center point Set a default center point for your map using latitude and longitude. const defaultMapCenter = [10.5731, -7.5898]; Copy Step 8 of 9 Add a row for your map Between the text field row and the table chart row, insert a new row for the map content using NerdGraphQuery.
{({ loading, error, data }) => { if (loading) { return ; } if (error) { return 'Error'; } const { results } = data.actor.account.mapData; console.debug(results); return 'Hello'; }}
; Copy Reload your application in New Relic One to test that it works. Step 9 of 9 Replace \"Hello\" with the Leaflet code Replace return \"Hello\"; with: return ( {results.map((pt, i) => { const center = [pt.lat, pt.lng]; return ( { alert(JSON.stringify(pt)); }} /> ); })} ); Copy This code creates a world map centered on the latitude and longitude you chose using OpenStreetMap data and your marker colors. Reload your app to see the pageview data on the map!", - "type": "developer", - "document_type": "page", - "info": "Build a New Relic app showing page view data on a world map.", + "body": "newrelic_add_custom_tracer(string $function_name) Specify functions or methods for the agent to instrument with custom instrumentation. Requirements Compatible with all agent versions. Description Specify functions or methods for the agent to target for custom instrumentation. This is the API equivalent of the newrelic.transaction_tracer.custom setting. You cannot apply custom tracing to internal PHP functions. Parameters Parameter Description $function_name string Required. The name can be formatted either as function_name for procedural functions, or as \"ClassName::method\" for methods. Both static and instance methods will be instrumented if the method syntax is used, and the class name must be fully qualified: it must include the full namespace if the class was defined within a namespace. Return value(s) Returns true if the tracer was added successfully. Example(s) Instrument a function function example_function() { if (extension_loaded('newrelic')) { // Ensure PHP agent is available newrelic_add_custom_tracer(\"example_function\"); } } Instrument a method within a class class ExampleClass { function example_method() { if (extension_loaded('newrelic')) { // Ensure PHP agent is available newrelic_add_custom_tracer(\"ExampleClass::example_method\"); } } } Instrument a method within a namespaced class namespace Foo\\Bar; class ExampleClass { function example_method() { if (extension_loaded('newrelic')) { // Ensure PHP agent is available newrelic_add_custom_tracer(\"Foo\\\\Bar\\\\ExampleClass::example_method\"); } } } Alternatively, on PHP 5.5 or later, the ::class syntax can be used instead: namespace Foo\\Bar { class ExampleClass { function example_method() { // ... } } } namespace { use Foo\\Bar; if (extension_loaded('newrelic')) { // Ensure PHP agent is available newrelic_add_custom_tracer(Bar::class . \"::example_method\"); } } }", + "type": "docs", + "document_type": "api_doc", + "breadcrumb": "Contents » APM agents / PHP agent / PHP agent API", + "info": "New Relic PHP agent API call to add custom instrumentation to particular methods in your app code. ", + "nodeid": 11821, "sections": [ - "Map page views by region in a custom app", - "Before you begin", - "New Relic terminology", - "Build a custom app with a table chart", - "Query your browser data", - "Create and serve a new Nerdpack", - "Review your app files and view your app locally", - "Hard code your account ID", - "Import the TableChart component", - "Add a table with a single row", - "Customize the look of your table (optional)", - "Get your data into that table", - "Make your app interactive with a text field", - "Import the TextField component", - "Add a row for your text field", - "Build the text field object", - "Get your data on a map", - "Install Leaflet", - "Add a webpack config file for Leaflet", - "Import modules from Leaflet", - "Import additional modules from New Relic One", - "Get data for the map", - "Customize the map marker colors", - "Set your map's default center point", - "Add a row for your map", - "Replace \"Hello\" with the Leaflet code" + "PHP agent", + "Getting started", + "Installation", + "Advanced installation", + "Configuration", + "API guides", + "PHP agent API", + "Attributes", + "Features", + "Frameworks and libraries", + "Troubleshooting", + "newrelic_add_custom_tracer", + "Requirements", + "Description", + "Parameters", + "Return value(s)", + "Example(s)", + "Instrument a function", + "Instrument a method within a class", + "Instrument a method within a namespaced class", + "For more help" ], - "title": "Map page views by region in a custom app", + "title": "newrelic_add_custom_tracer (PHP agent API)", "popularity": 1, - "external_id": "6ff5d696556512bb8d8b33fb31732f22bab455cb", - "image": "https://developer.newrelic.com/static/d87a72e8ee14c52fdfcb91895567d268/0086b/pageview.png", - "url": "https://developer.newrelic.com/build-apps/map-pageviews-by-region/", - "published_at": "2020-08-17T01:58:17Z", - "updated_at": "2020-08-14T01:45:09Z", + "external_id": "12242c1e6fe8cb70e2d42ff670cad04c01e9317e", + "category_1": "PHP agent", + "category_2": "PHP agent API", + "image": "", + "url": "https://docs.newrelic.com/docs/agents/php-agent/php-agent-api/newrelic_add_custom_tracer", + "published_at": "2020-08-18T03:05:13Z", + "updated_at": "2019-09-30T22:55:59Z", + "category_0": "APM agents", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.11996268, + "_score": 0.01595171, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Create and serve a new Nerdpack", - "body": " look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One" + "sections": "Instrument a method within a class", + "info": "New Relic PHP agent API call to add custom instrumentation to particular methods in your app code. ", + "body": " static and instance methods will be instrumented if the method syntax is used, and the class name must be fully qualified: it must include the full namespace if the class was defined within a namespace. Return value(s) Returns true if the tracer was added successfully. Example(s) Instrument" }, - "id": "5efa993c196a67066b766469" - }, + "id": "58ca4191e621f45edd466e7a" + } + ], + "/build-apps/publish-deploy": [ { - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", "type": "developer", "document_type": "page", "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "sections": [ "New Relic One CLI reference", "Installing the New Relic One CLI", + "Tip", "New Relic One CLI Commands", "Get started", "Configure your CLI preferences", @@ -3041,23 +3437,23 @@ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-14T01:47:13Z", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-18T01:50:36Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0793426, + "_score": 0.29266515, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Set up your Nerdpacks", - "tags": "nerdpack commands", - "body": " CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build" + "title": "New Relic One CLI reference", + "sections": "New Relic One CLI reference", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": ". For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet" }, "id": "5efa989e28ccbc535a307dd0" - } - ], - "/collect-data/custom-events": [ + }, { "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", "type": "developer", @@ -3075,11 +3471,11 @@ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", "image": "", "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-08-17T01:54:02Z", + "published_at": "2020-08-18T02:11:50Z", "updated_at": "2020-08-14T01:47:12Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.15446934, + "_score": 0.047144882, "_version": null, "_explanation": null, "sort": null, @@ -3088,52 +3484,10 @@ "sections": "New Relic CLI Reference", "info": "The command line tools for performing tasks against New Relic APIs", "tags": "new relic cli", - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" }, "id": "5efa989ee7b9d2024b7bab97" }, - { - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", - "type": "developer", - "document_type": "page", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "sections": [ - "New Relic One CLI reference", - "Installing the New Relic One CLI", - "New Relic One CLI Commands", - "Get started", - "Configure your CLI preferences", - "Set up your Nerdpacks", - "Manage your Nerdpack subscriptions", - "Install and manage plugins", - "Manage catalog information" - ], - "title": "New Relic One CLI reference", - "popularity": 1, - "tags": [ - "New Relic One app", - "nerdpack commands" - ], - "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", - "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", - "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-14T01:47:13Z", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.116234, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "New Relic One CLI reference", - "sections": "New Relic One CLI reference", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "tags": "New Relic One app", - "body": " your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first "Hello World" app, and serve it locally. New Relic One CLI Commands" - }, - "id": "5efa989e28ccbc535a307dd0" - }, { "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag⁠ (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.", "type": "developer", @@ -3164,123 +3518,119 @@ "external_id": "531f2f3985bf64bb0dc92a642445887095048882", "image": "", "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/", - "published_at": "2020-08-17T01:48:54Z", + "published_at": "2020-08-18T02:06:05Z", "updated_at": "2020-08-08T01:41:47Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.08286073, + "_score": 0.030464739, "_version": null, "_explanation": null, "sort": null, "highlight": { "title": "Get started with the New Relic CLI", - "sections": "Create your New Relic CLI profile", - "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", + "sections": "Create your New Relic CLI profile", + "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", "tags": "New Relic CLI", - "body": ". This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your" + "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow" }, "id": "5efa999c196a67c4e1766461" }, { - "body": "Custom events are useful to explore data for a single event you are interested in, including data from external sources, at a particular moment in time. To track arbitrary event data for apps monitored by your New Relic Go agent, add RecordCustomEvent to the apps. You can then query and visualize the event data. RecordCustomEvent parameters To add RecordCustomEvent to your Go app, use this format: RecordCustomEvent(eventType string, params map[string]interface{}) Parameter Description eventType string Required. The name of the event type to record. Must consist of alphanumeric characters, underscores _, or colons :. Must contain no more than 255 bytes. Must follow New Relic Insights data requirements for names, limits, and restricted characters. params map number, string, or boolean Required. Specify key/value pairs of attributes to annotate the event. Each value in the params map must be a number, string, or boolean. Keys must be less than 255 bytes. The params map must not contain more than 64 attributes. Example Here is an example of a custom event for a Go app: func customEvent(w http.ResponseWriter, r *http.Request) { io.WriteString(w, \"recording a custom event\") app.RecordCustomEvent(\"my_event_type\", map[string]interface{}{ \"myString\": \"hello\", \"myFloat\": 0.603, \"myInt\": 123, \"myBool\": true, }) } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application. In this guide, you are going to build a sample table using various New Relic One components. Before you begin If you haven't already installed the New Relic One CLI, step through the quick start in New Relic One. This process also gets you an API key. In addition, to complete the steps in this guide, you need a GitHub account, and to have Node.js installed on your machine. See [Setting up your development environment](/build-apps/set-up-dev-env) for more info. Clone and set up the example application Step 1 of 4 Clone the nr1-how-to example application from GitHub to your local machine. Then, navigate to the app directory. The example app lets you experiment with tables. git clone https://github.com/newrelic/nr1-how-to.git` cd nr1-how-to/create-a-table/nerdlets/create-a-table-nerdlet` Copy Step 2 of 4 Edit the index.json file and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install dependencies nr1 nerdpack:serve # Serve the demo app locally Copy Step 4 of 4 Open one.newrelic.com/?nerdpacks=local in your browser. Click Apps*, and then in the Other apps section, you should see a Create a table** launcher. That's the demo application you're going to work on. Go ahead and select it. Have a good look at the demo app. There's a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You'll use Table components to add a new table in the second row. Work with table components Step 1 of 10 Navigate to the `nerdlets/create-a-table-nerdlet` subdirectory and open the `index.js` file. Add the following components to the import statement at the top of the file so that it looks like the example: Table TableHeader TableHeaderCell TableRow TableRowCell import { Table, TableHeader, TableHeaderCell, TableRow, TableRowCell, PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart, } from 'nr1'; Copy Step 2 of 10 Add a basic Table component Locate the empty GridItem in index.js: This is where you start building the table. Add the initial component. The items property collects the data by calling _getItems(), which contains sample values.
; Copy Step 3 of 10 Add the header and rows As the Table component renders a fixed number of header cells and rows, your next step is adding header components, as well as a function that returns the required table rows. Inside of the Table component, add the TableHeader and then a TableHeaderCell child for each heading. Since you don't know how many rows you'll need, your best bet is to call a function to build as many TableRows as items returned by _getItems(). Application Size Company Team Commit ; { ({ item }) => ( {item.name} {item.value} {item.company} {item.team} {item.commit} ); } Copy Step 4 of 10 Take a look at the application running in New Relic One: you should see something similar to the screenshot below. Step 5 of 10 Replace standard table cells with smart cells The New Relic One library includes cell components that can automatically format certain data types, like users, metrics, and entity names. The table you've just created contains columns that can benefit from those components: Application (an entity name) and Size (a metric). Before you can use EntityTitleTableRowCell and MetricTableRowCell, you have to add them to the import statement first. import { EntityTitleTableRowCell, MetricTableRowCell, ... /* All previous components */ } from 'nr1'; Copy Step 6 of 10 Update your table rows by replacing the first and second TableRowCells with entity and metric cells. Notice that EntityTitleTableRowCell and MetricTableRowCell are self-closing tags. { ({ item }) => ( {item.company} {item.team} {item.commit} ); } Copy Step 7 of 10 Time to give your table a second look: The cell components you've added take care of properly formatting the data. Step 8 of 10 Add some action to your table! Tables are great, but interactive tables can be better: As a last update, you are going to allow users to act on each data row. Add the _getActions() method to your index.js file, right before _getItems(). As you may have guessed from the code, _getActions() spawns an alert box when you click Team or Commit cells. _getActions() { return [ { label: 'Alert Team', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__ALERT, onClick: (evt, { item, index }) => { alert(`Alert Team: ${item.team}`); }, }, { label: 'Rollback Version', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__UNDO, onClick: (evt, { item, index }) => { alert(`Rollback from: ${item.commit}`); }, }, ]; } Copy Step 9 of 10 Find the TableRow component in your return statement and point the actions property to _getActions(). The TableRow actions property defines a set of actions that appear when the user hovers over a table row. Actions have a mandatory text and an onClick callback, but can also display an icon or be disabled if needed. Copy Step 10 of 10 Go back to your application and try hovering over any of the rows: Notice how the two available actions appear. When you click them, a function triggers with the selected row data as an argument, and an alert displays in your browser. Next steps You've built a table into a New Relic One application, using components to format data automatically and provide contextual actions. Well done! Keep exploring the Table components, their properties, and how to use them, in our SDK documentation.", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / APM agents / Go agent / Features", - "info": "To track arbitrary event data in New Relic Insights for apps monitored by your New Relic Go agent, use RecordCustomEvent.", - "nodeid": 13766, + "info": "Add a table to your New Relic One app.", "sections": [ - "Go agent", - "Get started", - "Installation", - "Configuration", - "Instrumentation", - "API guides", - "Features", - "Troubleshooting", - "Create custom events (Go)", - "RecordCustomEvent parameters", - "Example", - "For more help" + "Add tables to your New Relic One application", + "Before you begin", + "Clone and set up the example application", + "Work with table components", + "Next steps" ], - "title": "Create custom events (Go)", + "title": "Add tables to your New Relic One application", "popularity": 1, - "external_id": "b4d19e4ff9eee2b00a40c4add7119820a5f4d3dc", - "category_1": "Go agent", - "category_2": "Features", - "image": "", - "url": "https://docs.newrelic.com/docs/agents/go-agent/features/create-custom-events-go", - "published_at": "2020-08-18T00:25:15Z", - "updated_at": "2020-08-15T02:23:50Z", - "category_0": "APM agents", + "external_id": "7ff7a8426eb1758a08ec360835d9085fae829936", + "image": "https://developer.newrelic.com/static/e637c7eb75a9dc01740db8fecc4d85bf/1d6ec/table-new-cells.png", + "url": "https://developer.newrelic.com/build-apps/howto-use-nrone-table-components/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-14T01:46:10Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.010033788, + "_score": 0.0036841223, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Create custom events (Go)", - "sections": "Create custom events (Go)", - "info": "To track arbitrary event data in New Relic Insights for apps monitored by your New Relic Go agent, use RecordCustomEvent.", - "body": "Custom events are useful to explore data for a single event you are interested in, including data from external sources, at a particular moment in time. To track arbitrary event data for apps monitored by your New Relic Go agent, add RecordCustomEvent to the apps. You can then query and visualize" + "title": "Add tables to your New Relic One application", + "sections": "Add tables to your New Relic One application", + "info": "Add a table to your New Relic One app.", + "body": "-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update" }, - "id": "5f374736e7b9d2653b909280" + "id": "5efa989ee7b9d2ad567bab51" }, { - "body": "Custom metrics allow you to report any metric that passes through your code. For example, with New Relic's Go monitoring, you can create custom metrics to time a component of your app that may not captured by default. Once you capture a custom metric, you can: Unify your monitoring inside New Relic through the data explorer. Use our REST API to programmatically retrieve and use custom metric data outside of the UI. Create custom metric alert conditions to notify you or your team when your custom metric exceeds specific values. Create a custom metric Instantiate your application by running the following: cfg := newrelic.NewConfig(\"Your App Name\", mustGetEnv(\"NEW_RELIC_LICENSE_KEY\")) cfg.Logger = newrelic.NewDebugLogger(os.Stdout) var err error app, err = newrelic.NewApplication(cfg) After instantiating your app, create a custom metric with the following code: app.RecordCustomMetric( \"CustomMetricName\", //name of your metric 132, //time in ms ); RecordCustomMetric's first parameter is a string that names your custom metric. The RecordCustomMetric method will automatically prepend the string Custom/ to your metric name. This means the above code will generate a metric named Custom/CustomMetricName. RecordCustomMetric's second parameter is the time, in milliseconds, that you want to record for your custom transaction. This means the above code will produce a metric of .132 seconds in New Relic's systems. To use a custom metric as a counter, it can be incremented by making the call as described above, and the count value for that metric will be incremented by 1. The value you use for the second parameter (time in ms) is irrelevant if you are only using the metric as a counter, and thus you can use a static number, such as 0 or 1. To increment a counter by a number greater than 1, call app.RecordCustomMetric multiple times - each call will only increment the metric by 1 no matter what the value of the second parameter is. Name a custom metric Carefully consider how you name your custom metrics. If your program creates too many uniquely-named metrics, you may end up with a metric grouping issue (MGI). MGIs occur when the granularity of metric names is too fine, resulting in hundreds or thousands of different metric names. One common cause of MGIs is relying on the full URL name for metric naming in web transactions. A few major code paths may generate many different full URL paths to unique documents, articles, page, etc. If the unique element of the URL path is included in the metric name, each of these common paths will have its own unique metric name. If metric grouping issues occur, follow the troubleshooting procedures. For more help Additional documentation resources include: New Relic for Go segment documentation on GitHub (more details about instrumenting segments on New Relic GitHub) Instrument Go transactions (how to create New Relic transactions in your Go app) If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "body": "For accounts on our New Relic One pricing plan, this document explains: How to add and manage users User types and user groups This doc is for accounts on our New Relic One pricing plan. If you're on our original product-based pricing plan, see Original user roles. Not sure which you're on? See Overview of pricing and account/user structure. Manage users Here are some important user management tips to remember and share with your team members: Basic users, who are free users, can self-serve to become billable full users. A New Relic user can have a maximum of either three concurrent active sessions, or three unique IP addresses in use at any given time. To manage users: from one.newrelic.com, select Apps from the top navigation, and then select User management. User type For accounts on the New Relic One pricing plan, the user type determines the monitoring and analysis features a user has access to. (Note that this does not control account admin-related permissions; that's determined by the user group.) User types include: Basic user: These users are free and have access to basic features like setting up reporting of data to New Relic, running queries of your data, making custom charts and dashboards, and setting up alert notifications. These users do not have access to Full-Stack Observability features. For details, see the capability table below. Full user: These users have access to Full-Stack Observability features, including our curated UI experiences for APM, infrastructure monitoring, browser monitoring, mobile monitoring, and synthetic monitors. The Standard pricing tier includes one full user. For details, see the capability table below. The number of full users is not the only pricing factor: Learn more about pricing. For details about full user and basic user capabilities, expand this collapser: Capabilities for full users vs. basic users Below are some important differences between basic user and full user capabilities. In short, basic users have access to our Telemetry Data Platform and Applied Intelligence (read-only) features, while full users have access to that plus Full-Stack Observability features. Features Full user Basic user Full-Stack Observability (New Relic-built UI experiences) Application performance monitoring (APM) UI fa-check Infrastructure monitoring UI fa-check Digital Experience Monitoring (Browser, Mobile, Synthetics) UI fa-check Serverless monitoring UI fa-check Logs in context with other UI experiences fa-check Synthetics checks fa-check New Relic Edge with Infinite Tracing (tail-based sampling) fa-check (Pro and Enterprise) Subscribe to New Relic One catalog apps fa-check Applied Intelligence (AI) Proactive Detection fa-check fa-check (read-only) Incident Intelligence fa-check fa-check (read-only) Telemetry Data Platform Data ingest from any source (Metrics, Events, Logs, Traces) fa-check fa-check Alerts and notifications fa-check fa-check Interactive query interface fa-check fa-check Custom charts and dashboards (not New Relic-built) fa-check fa-check Encryption at rest fa-check fa-check Standard data retention fa-check fa-check NerdGraph (GraphQL) API fa-check fa-check Security and compliance fa-check fa-check Integrations fa-check fa-check Data management fa-check fa-check Logs UI fa-check fa-check Build custom New Relic One apps fa-check fa-check User group When full users (not basic users) are added, there are additional choices related to account administration. For the Standard pricing tier, the two user groups available are: Admin: Adding someone to the Admin group gives them configuration and administrative abilities like adding/editing users, editing account and billing settings, and configuring some settings. User: Adding someone to the User group allows them to use and configure features but not manage users or billing. Coming soon: Pro and Enterprise tiers include additional admin functionalities and group-related features. Capability limitations There are some temporary limitations for users on the newer model, mainly around API access. For details, see Limitations. Query usage data See Query usage data. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "type": "docs", "document_type": "page", - "breadcrumb": "Contents / APM agents / Go agent / Instrumentation", - "info": "With New Relic Go monitoring, you can create custom metrics to time a component of your app that may not captured by default.", - "nodeid": 14391, + "breadcrumb": "Contents / New Relic accounts / Accounts and billing / New Relic One pricing and users", + "info": "For New Relic accounts on our New Relic One pricing plan, an explanation of user roles. ", + "nodeid": 39356, "sections": [ - "Go agent", - "Get started", - "Installation", - "Configuration", - "Instrumentation", - "API guides", - "Features", - "Troubleshooting", - "Create custom metrics in Go", - "Create a custom metric", - "Name a custom metric", + "Accounts and billing", + "Account setup", + "Account structure", + "New Relic One pricing and users", + "General account settings", + "Automated user management", + "SAML single sign on", + "Partner install", + "New Relic One users and roles", + "Manage users", + "User type", + "User group", + "Capability limitations", + "Query usage data", "For more help" ], - "title": "Create custom metrics in Go", + "title": "New Relic One users and roles ", "popularity": 1, - "external_id": "4e44ca1f1e3d3608079ea8fb7983670a40c45c0f", - "category_1": "Go agent", - "category_2": "Instrumentation", + "external_id": "6b424e8f440119aa9d9529ef1cf91fac524e2991", + "category_1": "Accounts and billing", + "category_2": "New Relic One pricing and users", "image": "", - "url": "https://docs.newrelic.com/docs/agents/go-agent/instrumentation/create-custom-metrics-go", - "published_at": "2020-08-15T02:41:42Z", - "updated_at": "2020-08-15T02:41:42Z", - "category_0": "APM agents", + "url": "https://docs.newrelic.com/docs/accounts/accounts-billing/new-relic-one-pricing-users/users-roles", + "published_at": "2020-08-18T17:39:18Z", + "updated_at": "2020-08-15T05:13:24Z", + "category_0": "New Relic accounts", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.005339889, + "_score": 0.0031960718, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Create custom metrics in Go", - "sections": "Create custom metrics in Go", - "info": "With New Relic Go monitoring, you can create custom metrics to time a component of your app that may not captured by default.", - "body": "Custom metrics allow you to report any metric that passes through your code. For example, with New Relic's Go monitoring, you can create custom metrics to time a component of your app that may not captured by default. Once you capture a custom metric, you can: Unify your monitoring inside New Relic" + "title": "New Relic One users and roles ", + "sections": "New Relic One pricing and users", + "info": "For New Relic accounts on our New Relic One pricing plan, an explanation of user roles. ", + "category_0": "New Relic accounts", + "category_1": "Accounts and billing", + "category_2": "New Relic One pricing and users", + "body": " Overview of pricing and account/user structure. Manage users Here are some important user management tips to remember and share with your team members: Basic users, who are free users, can self-serve to become billable full users. A New Relic user can have a maximum of either three concurrent active", + "breadcrumb": "Contents / New Relic accounts / Accounts and billing / New Relic One pricing and users" }, - "id": "59fd6b3a8e9c0f376e55564c" + "id": "5f22d159196a67f322b53d0a" } ], - "/explore-docs/nr1-config": [ + "/build-apps/build-hello-world-app": [ { - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", "type": "developer", "document_type": "page", "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "sections": [ "New Relic One CLI reference", "Installing the New Relic One CLI", + "Tip", "New Relic One CLI Commands", "Get started", "Configure your CLI preferences", @@ -3298,23 +3648,59 @@ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-14T01:47:13Z", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-18T01:50:36Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.6171241, + "_score": 1.0103776, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI reference", - "sections": "New Relic One CLI Commands", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "tags": "New Relic One app", - "body": " our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages" + "title": "New Relic One CLI reference", + "sections": "New Relic One CLI reference", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": ". For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet" }, "id": "5efa989e28ccbc535a307dd0" }, + { + "body": "Nerdpack file structure A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. Here we explain: The file structure for a Nerdpack, a Nerdlet, and a launcher How to link a launcher file to a Nerdlet How to link your application with a monitored entity For basic component definitions, see our component reference. Generate Nerdpack components There are two ways to generate a Nerdpack template: Generate a Nerdpack: Use the New Relic One CLI command nr1 create and select Nerdpack to create a Nerdpack template that includes a Nerdlet and a launcher. Generate Nerdlet or launcher individually: Use the New Relic One CLI command nr1 create and choose either Nerdlet or launcher. This can be useful when adding Nerdlets to an existing Nerdpack. For documentation on generating and connecting Nerdpack components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │   └── my-nerdlet-launcher │   ├── icon.png │   └── nr1.json ├── nerdlets │   └── my-nerdlet-nerdlet │   ├── index.js │   ├── nr1.json │   └── styles.scss ├── node_modules │   ├── js-tokens │   ├── loose-envify │   ├── object-assign │   ├── prop-types │   ├── react │   ├── react-dom │   ├── react-is │   └── scheduler ├── nr1.json ├── package-lock.json └── package.json Copy Nerdlet file structure A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files, index.js, nr1.json, and styles.scss. Here is what the default files look like after being generated using the nr1 create command: index.js The JavaScript code of the Nerdlet. import React from 'react'; export default class MyAwesomeNerdpack extends React.Component { render() { return

Hello, my-awesome-nerdpack Nerdlet!

; } } Copy nr1.json The Nerdlet configuration file. { \"schemaType\": \"NERDLET\", \"id\": \"my-awesome-nerdpack-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\" } Copy Besides using the launcher as the access point for your application, you can also associate the application with a monitored entity to get it to appear in the entity explorer. To do this, add two additional fields to the config file of the first-launched Nerdlet: entities and actionCategory. In the following example, the Nerdlet has been associated with all Browser-monitored applications and will appear under the Monitor UI category : { \"schemaType\": \"NERDLET\", \"id\": \"my-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"Custom Data\", \"entities\": [{ \"domain\": \"BROWSER\", \"type\": \"APPLICATION\" }], \"actionCategory\": \"monitor\" } Copy To see this application in the UI, you would go to the entity explorer, select Browser applications, and select a monitored application. styles.scss An empty SCSS file for styling your application. icon.png The launcher icon that appears on the Apps page in New Relic One when an application is deployed. Launcher file structure Launchers have their own file structure. Note that: A launcher is not required; as an alternative to using a launcher, you can associate your application with a monitored entity. An application can have more than one launcher, which might be desired for an application with multiple Nerdlets. After generating a launcher using the nr1 create command, its folder contains two files: nr1.json The configuration file. { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy To connect a launcher to a Nerdlet, the rootNerdletId must match the id in the launched Nerdlet's nr1.json config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet. icon.png The icon displayed on the launcher for the app on the Apps page.", + "type": "developer", + "document_type": "page", + "info": "An overview of the Nerdpack File Structure", + "sections": [ + "Nerdpack file structure", + "Generate Nerdpack components", + "Nerdlet file structure", + "index.js", + "nr1.json", + "styles.scss", + "icon.png", + "Launcher file structure" + ], + "title": "Nerdpack file structure", + "popularity": 1, + "external_id": "c97bcbb0a2b3d32ac93b5b379a1933e7b4e00161", + "image": "", + "url": "https://developer.newrelic.com/explore-docs/nerdpack-file-structure/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-14T01:49:25Z", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 0.7917644, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "Nerdpack file structure", + "sections": "Nerdpack file structure", + "info": "An overview of the Nerdpack File Structure", + "body": " components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │   └── my-nerdlet-launcher │   ├── icon.png" + }, + "id": "5efa989e196a671300766404" + }, { "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", "type": "developer", @@ -3332,421 +3718,366 @@ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", "image": "", "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-08-17T01:54:02Z", + "published_at": "2020-08-18T02:11:50Z", "updated_at": "2020-08-14T01:47:12Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.32497174, + "_score": 0.510402, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic CLI Reference", - "sections": "New Relic CLI commands", - "info": "The command line tools for performing tasks against New Relic APIs", - "tags": "new relic cli", - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" + "title": "New Relic CLI Reference", + "sections": "New Relic CLI Reference", + "tags": "new relic cli", + "body": " - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads" }, "id": "5efa989ee7b9d2024b7bab97" }, { - "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag⁠ (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.", - "type": "developer", + "body": "A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. This document explains: The file structure for a Nerdpack, a Nerdlet and a launcher How to link a launcher file to a Nerdlet How to link your application with a monitored entity For basic component definitions, see our developer site. Generate Nerdpack components There are two ways to generate a Nerdpack template: Generate Nerdpack. Use the CLI command nr1 create and select Nerdpack to create a Nerdpack template that includes a Nerdlet and a launcher. Generate Nerdlet or launcher individually. You can use the CLI command nr1 create and choose to select either a Nerdlet or launcher. This may be useful when adding Nerdlets to an existing Nerdpack. For a lesson on generating and connecting Nerdpack components, see the workshop. Nerdpack file structure When you generate a Nerdpack template using the CLI nr1 create command, it has this file structure: my-nerdlet ├── README.md ├── launchers │ └── my-nerdlet-launcher │ ├── icon.png │ └── nr1.json ├── nerdlets │ └── my-nerdlet-nerdlet │ ├── index.js │ ├── nr1.json │ └── styles.scss ├── node_modules │ ├── js-tokens │ ├── loose-envify │ ├── object-assign │ ├── prop-types │ ├── react │ ├── react-dom │ ├── react-is │ └── scheduler ├── nr1.json ├── package-lock.json └── package.json Nerdlet file structure A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files: index.js The JavaScript code. Here's what the default file looks like when a Nerdlet is generated with the CLI nr1 create: import React from 'react'; export default class MyAwesomeNerdpack extends React.Component { render() { return

Hello, my-awesome-nerdpack Nerdlet!

} } nr1.json Configuration file. Here is the default file generated by the CLI nr1 create command: { \"schemaType\": \"NERDLET\", \"id\": \"my-awesome-nerdpack-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\" } Besides using the launcher as the access point for your application, you can also associate the application with a monitored entity to get it to appear in the New Relic One entity explorer. To do this, add two additional fields to the config file of the first-launched Nerdlet: entities and actionCategory. In the following example, the Nerdlet has been associated with all New Relic Browser-monitored applications and will appear under the Monitor UI category : { \"schemaType\": \"NERDLET\", \"id\": \"my-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"Custom Data\", \"entities\": [{\"domain\": \"BROWSER\", \"type\": \"APPLICATION\"}], \"actionCategory\": \"monitor\" } To see this application in the UI, you would go to the New Relic One entity explorer, select Browser applications, and select a monitored application. styles.scss The file for CSS styles (Sass SCSS syntax). Launcher file structure When an application with a launcher file has been deployed, its launcher is located on the New Relic One home page (one.newrelic.com). A launcher is not required; as an alternative to using a launcher, you can associate your application with a monitored entity. An application can have more than one launcher; this may be desired for an application with multiple Nerdlets. A launcher folder contains two files: nr1.json The configuration file. Here is the default file template created by the nr1 create command: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } To connect a launcher to a Nerdlet, the rootNerdletId must match the id in the launched Nerdlet's nr1.json config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet. icon.png The launcher icon that appears on the one.newrelic.com home page when an application is deployed. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", + "breadcrumb": "Contents / New Relic One / Use New Relic One / Build on New Relic One", + "info": "For building a New Relic One application: an explanation of the Nerdpack/Nerdlet file structure. ", + "nodeid": 36006, "sections": [ - "Get started with the New Relic CLI", - "Before you begin", - "Install the New Relic CLI", - "Linux", - "macOS", - "Windows", - "Create your New Relic CLI profile", - "Get your application details", - "Add a simple tag to your application", - "Bonus step: Create a deployment marker", - "Next steps" + "Use New Relic One", + "Get started", + "Core concepts", + "UI and data", + "Workloads", + "Build on New Relic One", + "Nerdpack file structure", + "Generate Nerdpack components", + "Nerdlet file structure", + "Launcher file structure", + "For more help" ], - "title": "Get started with the New Relic CLI", + "title": "Nerdpack file structure", "popularity": 1, - "tags": [ - "api key", - "New Relic CLI", - "Tags", - "Entity", - "Deployment markers" - ], - "external_id": "531f2f3985bf64bb0dc92a642445887095048882", + "external_id": "6e3788bee17cb65b6dc210862e2a10399f78ff67", + "category_1": "Use New Relic One", + "category_2": "Build on New Relic One", "image": "", - "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/", - "published_at": "2020-08-17T01:48:54Z", - "updated_at": "2020-08-08T01:41:47Z", + "url": "https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/new-relic-one-application-nerdpack-file-structure", + "published_at": "2020-08-18T15:32:31Z", + "updated_at": "2020-07-25T00:32:16Z", + "category_0": "New Relic One", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.16252252, + "_score": 0.44179532, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Get started with the New Relic CLI", - "sections": "Get started with the New Relic CLI", - "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", - "tags": "New Relic CLI", - "body": " that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need" + "title": "Nerdpack file structure", + "sections": "Nerdpack file structure", + "info": "For building a New Relic One application: an explanation of the Nerdpack/Nerdlet file structure. ", + "category_0": "New Relic One", + "category_1": "Use New Relic One", + "category_2": "Build on New Relic One", + "body": " file structure When you generate a Nerdpack template using the CLI nr1 create command, it has this file structure: my-nerdlet ├── README.md ├── launchers │ └── my-nerdlet-launcher │ ├── icon.png │ └── nr1.json ├── nerdlets │ └── my-nerdlet-nerdlet │ ├── index.js │ ├── nr1.json │ └── styles.scss", + "breadcrumb": "Contents / New Relic One / Use New Relic One / Build on New Relic One" }, - "id": "5efa999c196a67c4e1766461" + "id": "5da0e07a64441f1328edf241" }, { - "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", + "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.", "type": "developer", "document_type": "page", - "info": "Build a \"Hello, World!\" app and publish it to New Relic One", + "info": "Intro to New Relic One API components", "sections": [ - "Create a \"Hello, World!\" application", - "Before you begin", - "Create a local version of the \"Hello, World!\" application", - "Publish your application to New Relic", - "Add details to describe your project", - "Subscribe accounts to your application", - "Summary", - "Related information" + "Intro to New Relic One API components", + "Components of the SDK", + "UI components", + "Chart components", + "Query and storage components", + "Platform APIs" ], - "title": "Create a \"Hello, World!\" application", + "title": "Intro to New Relic One API components", "popularity": 1, - "tags": [ - "nr1 cli", - "Nerdpack file structure", - "NR One Catalog", - "Subscribe applications" - ], - "external_id": "aa427030169067481fb69a3560798265b6b52b7c", - "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png", - "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/", - "published_at": "2020-08-17T01:55:14Z", - "updated_at": "2020-08-14T01:45:09Z", + "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2", + "image": "", + "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-14T01:47:12Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.06264714, + "_score": 0.36209166, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Publish your application to New Relic", - "info": "Build a "Hello, World!" app and publish it to New Relic One", - "tags": "nr1 cli", - "body": ", you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already" + "title": "Intro to New Relic One API components", + "sections": "Intro to New Relic One API components", + "info": "Intro to New Relic One API components", + "body": ", and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform" }, - "id": "5efa9973196a67d16d76645c" - }, + "id": "5efa989e28ccbc4071307de5" + } + ], + "/build-apps/set-up-dev-env": [ { - "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", "type": "developer", "document_type": "page", - "info": "An overview of common commands you can use with the New Relic One CLI.", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "sections": [ - "New Relic One CLI common commands", - "Command details", - "nr1 help", - "See commands and get details", - "Usage", - "Arguments", - "Examples", - "nr1 update", - "Update your CLI", - "nr1 create", - "Create a new component", - "Options", - "nr1 profiles", - "Manage your profiles keychain", - "Commands", - "nr1 autocomplete", - "See autocomplete installation instructions", - "nr1 nrql", - "Query using NRQL" + "New Relic One CLI reference", + "Installing the New Relic One CLI", + "Tip", + "New Relic One CLI Commands", + "Get started", + "Configure your CLI preferences", + "Set up your Nerdpacks", + "Manage your Nerdpack subscriptions", + "Install and manage plugins", + "Manage catalog information" ], - "title": "New Relic One CLI common commands", + "title": "New Relic One CLI reference", "popularity": 1, - "external_id": "503e515e1095418f8d19329517344ab209d143a4", - "image": "", - "url": "https://developer.newrelic.com/explore-docs/nr1-common/", - "published_at": "2020-08-17T01:54:01Z", - "updated_at": "2020-08-14T01:48:10Z", + "tags": [ + "New Relic One app", + "nerdpack commands" + ], + "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", + "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", + "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-18T01:50:36Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.020027552, + "_score": 14.765135, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI common commands", - "sections": "New Relic One CLI common commands", - "info": "An overview of common commands you can use with the New Relic One CLI.", - "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1" + "title": "New Relic One CLI reference", + "sections": "New Relic One CLI reference", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use" }, - "id": "5f28bd6ae7b9d267996ade94" - } - ], - "/collect-data/get-started-nerdgraph-api-explorer": [ + "id": "5efa989e28ccbc535a307dd0" + }, { - "body": "New Relic monitoring is built around the concept of the entity. This document explains: What entities are How to find entity data How to organize them into groups for easier analysis What is an entity? From a New Relic product perspective, entity is a broad concept. An entity is anything we can identify that has data you can monitor. \"Entity\" can refer to fundamental data-reporting components like applications, hosts, and database services, but it can also refer to larger groupings of those components. For example, to monitor a data center, you could aggregate those hosts in New Relic to be a workload (a custom grouping of entities). That workload is, itself, also an entity. This conceptual definition of \"entity\" is important because New Relic's goal is to give you practical information about the status of your business-important entities (and not just give you an unhelpfully large stream of assorted metrics and data). Our focus on entities, and the relationships between them, helps us optimize monitoring and troubleshooting of complex, modern systems. Find and explore entities An entity is anything that reports data to New Relic, so you'll find your entities wherever you see your data reporting in New Relic. Some tips for finding and understanding entity data: To find an entity's unique global identifier (GUID): from any list of monitored entities in the entity explorer, hover over a specific entity and click the information icon to see the GUID and other metadata. An entity's GUID is reported as the attribute entityGuid. You can query for an entity using this attribute in the query builder. Use service maps and distributed tracing to see connections between entities. Explore entity data using our NerdGraph GraphiQL explorer (api.newrelic.com/graphiql). Group and organize entities You can place entities into groups that reflect business-important relationships in your organization. For example, you might group all entities related to a specific team or department, or related to a specific service. Or you might group multiple hosts together to reflect their grouping in a data center. To group your entities, see: How to tag entities Create workloads (groups of related entities) For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag⁠ (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / New Relic One / Use New Relic One / Core concepts", - "info": "The definition of 'entity' in New Relic, and how to use and organize entities. ", - "nodeid": 34131, + "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", "sections": [ - "Use New Relic One", - "Get started", - "Core concepts", - "UI and data", - "Workloads", - "Build on New Relic One", - "What is an entity in New Relic?", - "What is an entity?", - "Find and explore entities", - "Group and organize entities", - "For more help" + "Get started with the New Relic CLI", + "Before you begin", + "Install the New Relic CLI", + "Linux", + "macOS", + "Windows", + "Create your New Relic CLI profile", + "Get your application details", + "Add a simple tag to your application", + "Bonus step: Create a deployment marker", + "Next steps" + ], + "title": "Get started with the New Relic CLI", + "popularity": 1, + "tags": [ + "api key", + "New Relic CLI", + "Tags", + "Entity", + "Deployment markers" ], - "title": "What is an entity in New Relic?", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/new-relic-one/use-new-relic-one/core-concepts/what-entity-new-relic", - "popularity": 1, - "external_id": "e37477cb70139a420735f58b6655484bf927ca96", - "category_1": "Use New Relic One", - "category_2": "Core concepts", + "external_id": "531f2f3985bf64bb0dc92a642445887095048882", "image": "", - "url": "https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/what-entity-new-relic", - "published_at": "2020-08-15T05:57:04Z", - "updated_at": "2020-08-06T23:06:23Z", - "category_0": "New Relic One", + "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/", + "published_at": "2020-08-18T02:06:05Z", + "updated_at": "2020-08-08T01:41:47Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.13205299, + "_score": 6.516817, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Find and explore entities", - "info": "The definition of 'entity' in New Relic, and how to use and organize entities. ", - "category_1": "Use New Relic One", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/new-relic-one/use-new-relic-one/core-concepts/what-entity-new-relic", - "body": ". An entity's GUID is reported as the attribute entityGuid. You can query for an entity using this attribute in the query builder. Use service maps and distributed tracing to see connections between entities. Explore entity data using our NerdGraph GraphiQL explorer (api.newrelic.com/graphiql). Group", - "breadcrumb": "Contents / New Relic One / Use New Relic One / Core concepts" + "title": "Get started with the New Relic CLI", + "sections": "Get started with the New Relic CLI", + "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", + "tags": "New Relic CLI", + "body": ". This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your" }, - "id": "5cdc20638e9c0f35676a8106" + "id": "5efa999c196a67c4e1766461" }, { - "body": "You can manage your policies, conditions, and muting rules programmatically using our GraphQL NerdGraph API. This is a powerful alternative to managing them in New Relic One or through the REST API. Alerts features you can manage with NerdGraph Here's what you can do in NerdGraph: Manage policies Use NRQL conditions Muting rules: suppress notifications The easiest way to discover alerts queries and mutations is through the NerdGraph API explorer. NerdGraph API explorer Our NerdGraph API explorer is a GraphiQL editor where you can prototype queries and mutations. Here are some examples showing how to find fields for queries and mutations. For general information about NerdGraph, see Introduction to NerdGraph. Queries To explore the various queries, look for the available queries under the actor.account.alerts namespace in NerdGraph API explorer: Mutations To explore various mutations, look in the alerts dropdown in the NerdGraph API explorer: For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph", - "info": "Read about how you can manage alerts conditions, policies, and muting rules using NerdGraph.", - "nodeid": 37751, + "info": "Build a \"Hello, World!\" app and publish it to New Relic One", "sections": [ - "New Relic Alerts", - "Get started", - "Alert policies", - "Alert conditions", - "Alert violations", - "Alert Incidents", - "Alert notifications", - "Troubleshooting", - "Rules, limits, and glossary", - "Alerts and Nerdgraph", - "REST API alerts", - "NerdGraph API: Examples", - "Alerts features you can manage with NerdGraph", - "NerdGraph API explorer", - "Queries", - "Mutations", - "For more help" + "Create a \"Hello, World!\" application", + "Before you begin", + "Tip", + "Create a local version of the \"Hello, World!\" application", + "Publish your application to New Relic", + "Add details to describe your project", + "Subscribe accounts to your application", + "Summary", + "Related information" ], - "title": "NerdGraph API: Examples ", + "title": "Create a \"Hello, World!\" application", "popularity": 1, - "external_id": "017d6c34d340b9bc035e91483d675915fa5252eb", - "category_1": "New Relic Alerts", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/alerts_query_0.png", - "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alerts-nerdgraph/nerdgraph-api-examples", - "published_at": "2020-08-15T12:05:18Z", - "updated_at": "2020-08-11T04:59:00Z", - "category_0": "Alerts and Applied intelligence", + "tags": [ + "nr1 cli", + "Nerdpack file structure", + "NR One Catalog", + "Subscribe applications" + ], + "external_id": "aa427030169067481fb69a3560798265b6b52b7c", + "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png", + "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/", + "published_at": "2020-08-18T02:09:27Z", + "updated_at": "2020-08-18T01:45:02Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.034334786, + "_score": 1.6688437, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "NerdGraph API: Examples ", - "sections": "NerdGraph API explorer", - "info": "Read about how you can manage alerts conditions, policies, and muting rules using NerdGraph.", - "body": " Use NRQL conditions Muting rules: suppress notifications The easiest way to discover alerts queries and mutations is through the NerdGraph API explorer. NerdGraph API explorer Our NerdGraph API explorer is a GraphiQL editor where you can prototype queries and mutations. Here are some examples showing", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph" + "sections": "Publish your application to New Relic", + "info": "Build a "Hello, World!" app and publish it to New Relic One", + "tags": "nr1 cli", + "body": ", you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already" }, - "id": "5f2dbad864441fd15456a9eb" + "id": "5efa9973196a67d16d76645c" }, { - "body": "To query data with the New Relic NerdGraph, we use the concept of an entity. An entity provides unified access to all the things you monitor with New Relic, including but not limited to: Applications monitored by New Relic (APM) Cloud integrations, services, and hosts monitored by New Relic (Infrastructure monitoring) To view entity details in the New Relic UI, use the entity explorer in New Relic One. Entity definition Each entity has similar traits: A unique entity GUID identifies it. It exists over a span of time, even if it is a short period. It provides a useful entry point for exploring data about specific metrics and events, or for exploring data related to other entities. Requirements You must have a user-specific API key to run NerdGraph queries. If you do not already have one: Generate a new API key in the NerdGraph GraphiQL explorer. OR Create a new API key from your New Relic account settings. Search for entities New Relic searches for entities by their attributes: primarily their name, but also by type of entity and other values. The search returns basic data about entities matching the search criteria. Then, from the basic query results, you can query a specific entity by its GUID. For example, to use NerdGraph to query one or more entities, you can search by attribute or GUID. Search by attribute Go to the NerdGraph GraphiQL explorer at https://api.newrelic.com/graphiql. Run a basic query to find entities that match your search criteria. For example: query($query: String! ) { actor { entitySearch(query: $query) { count results { entities { name entityType guid } } } } } Add the following variables to the Query variables section in NerdGraph: {\"query\": \"name LIKE 'nerd-graph' AND type IN ('APPLICATION')\"} Search by entity GUID Use a specific entity's GUID to query deeper into its related data. For example: query($guids: EntityGuid! ) { actor { entities(guids: $guids) { entityType name } } } Add the following variables to the Query variables section: {\"guids\": \"entity-guid-here\"} Example queries Queries are requests that are intended to only fetch data (no side effects). NerdGraph queries are not static, meaning that you can ask for more or less data depending on your needs. For each query, you can specify exactly what data you want to retrieve, as long as it is supported by the schema. Entities in NerdGraph rely on GraphQL interfaces, a concept that allows objects to share common fields. Interfaces are used to provide data for specific entity types, as you will see in many of these NerdGraph query examples. Get alert information on alertable entities in search results You can fetch the alert severity of any entity that can be monitored by New Relic Alerts. This NerdGraph query will tell you if New Relic is currently receiving data from your application (using the reporting field). If the entity is an alertable type, results will include the alert severity of the entity. If the results include entities that are not alertable, they will not include the AlertableEntityOutline fields. { actor { entitySearch(query: \"name like 'nerdgraph'\") { results { entities { reporting ... on AlertableEntityOutline { alertSeverity } } } } } } Get summary data on APM entities in search results Different entity types have specific data associated with them. The following NerdGraph query example shows a selection of fields available for APM application entities; more summary data can be requested in your query. If entities of other types are returned in your search results, they will not include these fields. { actor { entitySearch(query: \"name like 'nerdgraph'\") { results { entities { name ... on ApmApplicationEntityOutline { apmSummary { errorRate apdexScore webResponseTimeAverage responseTimeAverage } } } } } } } Get data specific to each entity type in search results Different entity types have specific data associated with them. This NerdGraph query example requests the name for all entities regardless of which entity type they are, as well as the error rate for APM, Browser, and Mobile entities. If entities of other types are returned in your search results, they will not include an error rate field. { actor { entitySearch(query: \"name like 'nerdgraph'\") { results { entities { name ... on ApmApplicationEntityOutline { apmSummary { errorRate } } ... on BrowserApplicationEntityOutline { browserSummary { jsErrorRate } } ... on MobileApplicationEntityOutline { mobileSummary { httpErrorRate } } } } } } } Get all tags for each entity in search results This NerdGraph query example fetches tags for every entity returned in the search results. For more information, see the NerdGraph GraphiQL tagging tutorial. { actor { entitySearch(query: \"name like 'nerdgraph'\") { results { entities { name tags { key values } } } } } } Get the nextCursor for paginated search results The NerdGraph GraphiQL explorer paginates results from an entity search. If your search criteria yields more than the API limit and you want to view the rest of the results, you can request nextCursor in your initial request and use its value in another query to retrieve the following \"page\" of results. If there are no more results, nextCursor will be null. { actor { entitySearch(query: \"name like 'nerd-graph'\") { results { nextCursor entities { name } } } } } Use the value of nextCursor in your next search: { actor { entitySearch(query: \"name like 'nerd-graph'\") { results(cursor: \"next_cursor_value\") { nextCursor entities { name } } } } } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / APIs / NerdGraph / Examples", - "info": "Use New Relic's NerdGraph (our GraphQL API) to query your monitored entities (applications, hosts, etc.)", - "nodeid": 19141, + "info": "The command line tools for performing tasks against New Relic APIs", "sections": [ - "NerdGraph", - "Get started", - "Examples", - "NerdGraph entities API tutorial", - "Entity definition", - "Requirements", - "Search for entities", - "Search by attribute", - "Search by entity GUID", - "Example queries", - "For more help" + "New Relic CLI Reference", + "New Relic CLI commands", + "Options", + "Commands" ], - "title": "NerdGraph entities API tutorial", + "title": "New Relic CLI Reference", "popularity": 1, - "external_id": "6dad137791a70630e57cb10aa5f574776c26613f", - "category_1": "NerdGraph", - "category_2": "Examples", + "tags": "new relic cli", + "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", "image": "", - "url": "https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-entities-api-tutorial", - "published_at": "2020-08-15T09:22:02Z", - "updated_at": "2020-08-11T01:39:48Z", - "category_0": "APIs", + "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", + "published_at": "2020-08-18T02:11:50Z", + "updated_at": "2020-08-14T01:47:12Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.025228953, + "_score": 1.5284107, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "NerdGraph entities API tutorial", - "sections": "NerdGraph entities API tutorial", - "info": "Use New Relic's NerdGraph (our GraphQL API) to query your monitored entities (applications, hosts, etc.)", - "category_0": "APIs", - "category_1": "NerdGraph", - "body": " entity by its GUID. For example, to use NerdGraph to query one or more entities, you can search by attribute or GUID. Search by attribute Go to the NerdGraph GraphiQL explorer at https://api.newrelic.com/graphiql. Run a basic query to find entities that match your search criteria. For example: query", - "breadcrumb": "Contents / APIs / NerdGraph / Examples" + "title": "New Relic CLI Reference", + "sections": "New Relic CLI Reference", + "info": "The command line tools for performing tasks against New Relic APIs", + "tags": "new relic cli", + "body": " the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql" }, - "id": "5d8fd87f196a67bba0756f3f" + "id": "5efa989ee7b9d2024b7bab97" }, { - "body": "You can manage your alerts policies using our GraphQL NerdGraph API. Here are some queries and mutations you can develop in our NerdGraph API explorer. See the NerdGraph introduction for help getting started with NerdGraph API explorer. List and filter policies The policiesSearch query allows you to paginate through all of your policies per account. It also allows some filtering functionality on the account policies. Listing all policies for an account Here's an example: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { policiesSearch { policies { id name incidentPreference } } } } } } Paginating through policies with cursor pagination In order to paginate through your policies, you must request the nextCursor field on your initial query. With cursor pagination, you continue to make a request through the result set until the nextCursor that is returned from the response comes back empty. This signifies that you reached the end of your results. Here's an example: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { policiesSearch { nextCursor policies { id name incidentPreference } totalCount } } } } } The code above returns a set of results like this: { \"data\": { \"actor\": { \"account\": { \"alerts\": { \"policiesSearch\": { \"nextCursor\": \"/8o0y2qiR54m6thkdgHgwg==:jZTXDFKbTkhKwvMx+CtsPVM=\", \"policies\": [ { \"id\": \"3455\", \"incidentPreference\": \"PER_POLICY\", \"name\": \"First Policy Name\" }, { \"id\": \"2123\", \"incidentPreference\": \"PER_POLICY\", \"name\": \"Another Policy\" }, // ... more policies here in reality ], \"totalCount\": 745 } } } } } } So, in your subsequent request, provide the cursor like so, until the cursor is empty: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { policiesSearch(cursor: \"/8o0y2qiR54m6thkdgHgwg==:jZTXDFKbTkhKwvMx+CtsPVM=\") { nextCursor policies { id name incidentPreference } totalCount } } } } } Find all policies by selected ids The API allows policy queries by a sub-select of ids. This will only return the information for these policies that you provide. { actor { account(id: YOUR_ACCOUNT_ID) { alerts { policiesSearch(searchCriteria: { ids: [A_POLICY_ID, ANOTHER_POLICY_ID] }) { policies { id name incidentPreference } } } } } } Find policy by id The API lets you query by policy id: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { policy(id: YOUR_POLICY_ID) { id name incidentPreference } } } } } Create a policy In order to create a policy, supply a name and an incidentPreference. The incident preference will configure how incidents get created for each condition created in the policy. For more information, refer to the documentation about choosing your incident preference. mutation { alertsPolicyCreate(accountId: YOUR_ACCOUNT_ID, policy: { name: \"Your Policy Name\" incidentPreference: PER_CONDITION }) { id name incidentPreference } } Update a policy When you update a policy, note that you don't need to supply all of the attributes on the policy. For example, you only need to supply the name if you only intend to update the name: mutation { alertsPolicyUpdate(accountId: YOUR_ACCOUNT_ID, id: YOUR_POLICY_ID, policy: { name: \"Updated Policy Name\" }) { id name incidentPreference } } Delete a policy You can delete policies via the NerdGraph API. Note that only the id may be requested back from a deleted resource: mutation { alertsPolicyDelete(accountId: YOUR_ACCOUNT_ID, id: YOUR_POLICY_ID) { id } } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "New Relic One CLI subscription commands To manage your Nerdpack subscriptions, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Command details nr1 subscription:set Subscribe to a Nerdpack Subscribes your account to a specific Nerdpack and channel. This command can be run with a Nerdpack UUID or within a specific Nerdpack folder. By default, the command uses the Nerdpack ID in package.json and subscribes to the STABLE channel. An account can only be subscribed to one Nerdpack and channel at a time. Usage $ nr1 subscription:set Options -i, --nerdpack-id=NERDPACK_ID Specifies the Nerdpack to subscribe to. By default, the command will use the one in package.json. -c, --channel=DEV/BETA/STABLE Specifies the channel to subscribe to. [default: STABLE] --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. Aliases $ nr1 nerdpack:subscribe nr1 subscription:list See your subscription Lists all the Nerdpacks your account is subscribed to. Your account is linked to your API key. Usage $ nr1 subscription:list Options --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 subscription:unset Unsubscribe from a Nerdpack Unsubscribes your account from a specific Nerdpack. When this command is executed within a Nerdpack folder, the Nerdpack ID from package.json is used by default. Usage $ nr1 subscription:unset Options -i, --nerdpack-id=NERDPACK_ID Specifies the Nerdpack to subscribe to. By default, the command will use the one in package.json. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. Aliases $ nr1 nerdpack:unsubscribe $ nr1 subscription:delete $ nr1 subscription:remove $ nr1 subscription:rm", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph", - "info": "Read about how you can list, create, update, and delete policies using the NerdGraph API.", - "nodeid": 37716, + "info": "An overview of the CLI commands you can use to manage your Nerdpack subscriptions.", "sections": [ - "New Relic Alerts", - "Get started", - "Alert policies", - "Alert conditions", - "Alert violations", - "Alert Incidents", - "Alert notifications", - "Troubleshooting", - "Rules, limits, and glossary", - "Alerts and Nerdgraph", - "REST API alerts", - "NerdGraph API: Alerts policies", - "List and filter policies", - "Create a policy", - "Update a policy", - "Delete a policy", - "For more help" + "New Relic One CLI subscription commands", + "Command details", + "nr1 subscription:set", + "Subscribe to a Nerdpack", + "Usage", + "Options", + "Aliases", + "nr1 subscription:list", + "See your subscription", + "nr1 subscription:unset", + "Unsubscribe from a Nerdpack" ], - "title": "NerdGraph API: Alerts policies ", + "title": "New Relic One CLI subscription commands", "popularity": 1, - "external_id": "cde6b52e96940389d03ae58acbfce482b5d455e6", - "category_1": "New Relic Alerts", + "external_id": "12d2e1b06dede5b1272527f95a14518010aecc58", "image": "", - "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alerts-nerdgraph/nerdgraph-api-alerts-policies", - "published_at": "2020-08-15T12:04:13Z", - "updated_at": "2020-08-11T04:56:49Z", - "category_0": "Alerts and Applied intelligence", + "url": "https://developer.newrelic.com/explore-docs/nr1-subscription/", + "published_at": "2020-08-18T02:11:48Z", + "updated_at": "2020-08-06T01:44:54Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.022625092, + "_score": 0.4754124, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "NerdGraph API: Alerts policies ", - "sections": "NerdGraph API: Alerts policies", - "info": "Read about how you can list, create, update, and delete policies using the NerdGraph API.", - "body": "You can manage your alerts policies using our GraphQL NerdGraph API. Here are some queries and mutations you can develop in our NerdGraph API explorer. See the NerdGraph introduction for help getting started with NerdGraph API explorer. List and filter policies The policiesSearch query allows you", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph" + "title": "New Relic One CLI subscription commands", + "sections": "New Relic One CLI subscription commands", + "info": "An overview of the CLI commands you can use to manage your Nerdpack subscriptions.", + "body": "New Relic One CLI subscription commands To manage your Nerdpack subscriptions, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1" }, - "id": "5f2dee1128ccbc65b688dfc1" - }, + "id": "5f2b6096e7b9d225ebc9de6f" + } + ], + "/explore-docs/nerdpack-file-structure": [ { - "body": "You can manage alerts conditions using our GraphQL NerdGraph API. Here are some conditions queries and mutations you can develop in our NerdGraph API explorer. See the NerdGraph introduction for help getting started with NerdGraph API explorer. This document covers the following: Steps to create a NRQL condition NRQL static condition NRQL baseline condition NRQL outlier condition Update a condition Update mutations List and filter NRQL conditions Singular NRQL condition queries Create a description Delete conditions Steps to create a NRQL condition Follow these steps: Decide which condition type you want to create (see NRQL Condition threshold types). Find your relevant policyID by doing one of the following: Use the NerdGraph policies API. Go to one.newrelic.com, in the top nav click Alerts & AI, then click Policies. Choose a policy. Find the ID under the policy name. Provide the appropriate mutation for your NRQL condition type and the relevant values. The NerdGraph GraphiQL explorer is the best place to find up-to-date documentation about the per-field specifics of the NerdGraph NRQL Conditions API. For example, questions like \"What does the valueFunction field accept?\" are best answered with the inline NerdGraph documentation. NRQL static condition Here's an example of creating a static condition: mutation { alertsNrqlConditionStaticCreate(accountId: YOUR_ACCOUNT_ID, policyId: YOUR_POLICY_ID, condition: { name: \"Low Host Count - Catastrophic\" enabled: true nrql: { query: \"SELECT uniqueCount(host) from Transaction where appName='my-app-name'\" evaluationOffset: 3 } terms: { threshold: 2 thresholdOccurrences: AT_LEAST_ONCE thresholdDuration: 600 operator: BELOW priority: CRITICAL } valueFunction: SINGLE_VALUE violationTimeLimit: TWENTY_FOUR_HOURS }) { id name } } NRQL baseline condition Here's an example of creating a baseline condition: mutation { alertsNrqlConditionBaselineCreate(accountId: YOUR_ACCOUNT_ID, policyId: YOUR_POLICY_ID, condition: { name: \"Baseline Condition\" enabled: true baselineDirection: UPPER_ONLY nrql: { query: \"SELECT average(duration) FROM Transaction\" evaluationOffset: 3 } terms: { threshold: 13 thresholdDuration: 180 thresholdOccurrences: ALL operator: ABOVE priority: CRITICAL } violationTimeLimit: TWENTY_FOUR_HOURS }) { id name baselineDirection } } NRQL outlier condition Here's an example of creating an outlier condition: mutation { alertsNrqlConditionOutlierCreate(accountId: YOUR_ACCOUNT_ID, policyId: YOUR_POLICY_ID, condition: { name: \"Outlier Condition\" enabled: true expectedGroups: 4 openViolationOnGroupOverlap: false nrql: { query: \"SELECT average(duration) FROM Transaction FACET httpResponseCode\" evaluationOffset: 3 } terms: { threshold: 1 thresholdDuration: 300 thresholdOccurrences: ALL operator: ABOVE priority: CRITICAL } violationTimeLimit: TWENTY_FOUR_HOURS }) { id name expectedGroups openViolationOnGroupOverlap } } Update a condition Complete the following: Determine the type of your existing condition by requesting the type field in a nrqlConditionsSearch query like this: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch { nrqlConditions { id type } } } } } } The type returned is what you use for your update mutation. For example, if the type returned is STATIC, use alertsNrqlConditionStaticUpdate. If the type returned is BASELINE, use alertsNrqlConditionBaselineUpdate. If the type returned is OUTLIER, use alertsNrqlConditionOutlierUpdate. Provide the id of your condition to your relevant condition type mutation. Note that you can only update conditions of the relevant type. Only provide update mutations for the fields you want to update. Fields you don't provide in the update are not touched. Update mutations Only fields that you provide in the update are changed. In the following example, baselineDirection returns unchanged, but name is updated. mutation { alertsNrqlConditionBaselineUpdate(id: YOUR_CONDITION_ID, accountId: YOUR_ACCOUNT_ID, condition: { name: \"Your updated name\" }) { id name baselineDirection } } List and filter NRQL conditions To list or filter your NRQL conditions, use the nrqlConditionsSearch query in NerdGraph. Use cursor pagination The basic of list functionality for NRQL conditions allows you to paginate through your NRQL conditions as well as request the total count of conditions per account. The nrqlConditionsSearch query utilizes cursor pagination to paginate through resources. The idea behind cursor pagination is that the client will request a cursor in a programmatic loop until the cursor comes back empty. An initial list response will look something like this: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch { nextCursor nrqlConditions { id name type } totalCount } } } } } This example returns a JSON response like this: { \"data\": { \"actor\": { \"account\": { \"alerts\": { \"nrqlConditionsSearch\": { \"nextCursor\": \"WOwfJ4+TWm9QTFeKMGyg+w==:QqkI8S4+Wwnpno6z+uk8kQ==\", \"nrqlConditions\": [ { \"id\": \"4432\", \"name\": \"Baseline Condition\", \"type\": \"BASELINE\" }, { \"id\": \"443\", \"name\": \"A static condition\", \"type\": \"STATIC\" }, // more conditions here in reality ], \"totalCount\": 435 } } } } }, } In order to paginate through conditions in the response, have the client request the cursor to be returned until the nextCursor returns from the response as null: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch(cursor: \"WOwfJ4+TWm9QTFeKMGyg+w==:QqkI8S4+Wwnpno6z+uk8kQ==\", ) { nextCursor nrqlConditions { id name type } totalCount } } } } } Request type-specific fields Certain fields are only available on specific NRQL condition types. The main reason that mutations are split between the different condition types is because they have minor differences between the fields they accept. For example, valueFunction is only relevant for static NRQL conditions and baselineDirection is only relevant on baseline NRQL conditions. But if these fields are only available on these certain condition types, how do we return them in a list of all of our condition types? The answer is a GraphQL convention known as inline fragments. Inline fragments allow you to access the data on a specific type of NRQL condition: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch { nrqlConditions { id name type ...on AlertsNrqlStaticCondition { valueFunction } ...on AlertsNrqlBaselineCondition { baselineDirection } ...on AlertsNrqlOutlierCondition { expectedGroups } } } } } } } In the previous example query, we are asking GraphQL to do the hard work for us to determine which NRQL conditions are the correct type. So, when the returned type is a static condition, it will return the valueFunction in the object. When the returned type is a baseline condition, it will return baselineDirection instead, and when the type is an outlier condition, it will return expectedGroups. Here is an example response: { \"data\": { \"actor\": { \"account\": { \"alerts\": { \"nrqlConditionsSearch\": { \"nrqlConditions\": [ { \"baselineDirection\": \"UPPER_ONLY\", \"id\": \"342\", \"name\": \"My baseline condition\", \"type\": \"BASELINE\" }, { \"id\": \"553\", \"name\": \"My static condition\", \"type\": \"STATIC\", \"valueFunction\": \"SINGLE_VALUE\" }, { \"expectedGroups\": 4, \"id\": \"802\", \"name\": \"My outlier condition\", \"type\": \"OUTLIER\" } ] } } } } } } Filter NRQL conditions You can filter NRQL conditions with the searchCriteria argument of the nrqlConditionsSearch query: Here's an example of filtering NRQL conditions with matching by name. This query returns NRQL conditions that match the provided name. Note that this match is case insensitive. { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch(searchCriteria: { name: \"Baseline Condition\" }) { nrqlConditions { id name type } } } } } } Singular NRQL condition queries You can use the NRQL condition API to query for a singular condition. Run the nrqlCondition query in the alerts namespace. Similar to type specific fields on the nrqlConditionSearch query, you can also use these inline fragmentsto request fields that are restricted to a NRQL condition type. { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlCondition(id: YOUR_CONDITION_ID) { id name ...on AlertsNrqlStaticCondition { valueFunction } } } } } } Update the description This will walk you through the procedure to create a description for a NRQL alert condition. 1. Get all the conditions for a policy: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditions(policyId: YOUR_POLICY_ID) { nextCursor results { id name description enabled nrql { query sinceValue } policyId runbookUrl terms { duration operator priority timeFunction threshold } type violationTimeLimit } } } } } } 2. Get the details for a single condition: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlCondition(id: \"YOUR_CONDITION_ID\") { description id enabled name nrql { query evaluationOffset } policyId runbookUrl terms { operator priority threshold thresholdDuration thresholdOccurrences } type violationTimeLimit } } } } } 3. Create a mutation with the description. Here's an empty mutation template: mutation { alertsNrqlConditionStaticUpdate(accountId: YOUR_ACCOUNT_ID, id: \"YOUR_CONDITION_ID\", condition: {description: \"\"}) { description } } Here'a an example mutation with an included example description: mutation { alertsNrqlConditionStaticUpdate(accountId: 123456, id: \"123456\", condition: {description: \"timestamp : {{timestamp}} \\n accountId : {{accountId}} \\n type : {{type}} \\n event : {{event}} \\n description : {{description}} \\n policyId : {{policyId}} \\n policyName: {{policyName}} \\n conditionName : {{conditionName}} \\n conditionId : {{conditionId}} \\n product : {{product}} \\n conditionType : {{conditionType}} \\n RunbookUrl : {{runbookUrl}} \\n nrqlQuery : {{nrqlQuery}} \\n nrqlEventType : {{nrqlEventType}} \\n targetID : {{targetId}} \\n targetName : {{targetName}} \\n commandLine : {{tag.commandLine}} \\n entityGuid : {{tag.entityGuid}} \\n entityName : {{tag.entityName}} \\n fullHostname : {{tag.fullHostname}} \\n instanceType : {{tag.instanceType}} \\n processDisplayName : {{tag.processDisplayName}}\"}) { description } } Delete conditions You can use the alertsConditionDelete mutation to delete any type of condition. You can only request the id field on a delete mutation; for example: mutation { alertsConditionDelete(accountId: YOUR_ACCOUNT_ID, id: YOUR_CONDITION_ID) { id } } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph", - "info": "Examples of how to use the NerdGraph API explorer to create alert conditions, queries, and mutations.", - "nodeid": 37711, + "info": "Build a \"Hello, World!\" app and publish it to New Relic One", "sections": [ - "New Relic Alerts", - "Get started", - "Alert policies", - "Alert conditions", - "Alert violations", - "Alert Incidents", - "Alert notifications", - "Troubleshooting", - "Rules, limits, and glossary", - "Alerts and Nerdgraph", - "REST API alerts", - "NerdGraph API: NRQL condition alerts", - "Steps to create a NRQL condition", - "NRQL static condition", - "NRQL baseline condition", - "NRQL outlier condition", - "Update a condition", - "Update mutations", - "List and filter NRQL conditions", - "Singular NRQL condition queries", - "Update the description", - "Delete conditions", - "For more help" + "Create a \"Hello, World!\" application", + "Before you begin", + "Tip", + "Create a local version of the \"Hello, World!\" application", + "Publish your application to New Relic", + "Add details to describe your project", + "Subscribe accounts to your application", + "Summary", + "Related information" ], - "title": "NerdGraph API: NRQL condition alerts ", + "title": "Create a \"Hello, World!\" application", "popularity": 1, - "external_id": "86591bd20017930f1e4eef1b1a76e3806298dbb9", - "category_1": "New Relic Alerts", - "image": "", - "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alerts-nerdgraph/nerdgraph-api-nrql-condition-alerts", - "published_at": "2020-08-15T12:04:13Z", - "updated_at": "2020-08-11T04:56:49Z", - "category_0": "Alerts and Applied intelligence", + "tags": [ + "nr1 cli", + "Nerdpack file structure", + "NR One Catalog", + "Subscribe applications" + ], + "external_id": "aa427030169067481fb69a3560798265b6b52b7c", + "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png", + "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/", + "published_at": "2020-08-18T02:09:27Z", + "updated_at": "2020-08-18T01:45:02Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.019228619, + "_score": 17.529211, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "NerdGraph API: NRQL condition alerts ", - "sections": "NerdGraph API: NRQL condition alerts", - "info": "Examples of how to use the NerdGraph API explorer to create alert conditions, queries, and mutations.", - "body": "You can manage alerts conditions using our GraphQL NerdGraph API. Here are some conditions queries and mutations you can develop in our NerdGraph API explorer. See the NerdGraph introduction for help getting started with NerdGraph API explorer. This document covers the following: Steps to create", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph" + "sections": "Publish your application to New Relic", + "info": "Build a "Hello, World!" app and publish it to New Relic One", + "tags": "Nerdpack file structure", + "body": "!" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit" }, - "id": "5f2dee1128ccbc562e88dfc1" - } - ], - "/explore-docs/nr1-subscription": [ + "id": "5efa9973196a67d16d76645c" + }, { - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", "type": "developer", "document_type": "page", "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "sections": [ "New Relic One CLI reference", "Installing the New Relic One CLI", + "Tip", "New Relic One CLI Commands", "Get started", "Configure your CLI preferences", @@ -3764,20 +4095,20 @@ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-14T01:47:13Z", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-18T01:50:36Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.61639, + "_score": 13.546968, "_version": null, "_explanation": null, "sort": null, "highlight": { "title": "New Relic One CLI reference", - "sections": "New Relic One CLI Commands", + "sections": "New Relic One CLI reference", "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "tags": "New Relic One app", - "body": " our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages" + "body": " CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build" }, "id": "5efa989e28ccbc535a307dd0" }, @@ -3798,111 +4129,70 @@ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", "image": "", "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-08-17T01:54:02Z", + "published_at": "2020-08-18T02:11:50Z", "updated_at": "2020-08-14T01:47:12Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.32235414, + "_score": 1.2413275, "_version": null, "_explanation": null, "sort": null, "highlight": { "title": "New Relic CLI Reference", - "sections": "New Relic CLI commands", - "info": "The command line tools for performing tasks against New Relic APIs", - "tags": "new relic cli", - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" - }, - "id": "5efa989ee7b9d2024b7bab97" - }, - { - "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag⁠ (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.", - "type": "developer", - "document_type": "page", - "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", - "sections": [ - "Get started with the New Relic CLI", - "Before you begin", - "Install the New Relic CLI", - "Linux", - "macOS", - "Windows", - "Create your New Relic CLI profile", - "Get your application details", - "Add a simple tag to your application", - "Bonus step: Create a deployment marker", - "Next steps" - ], - "title": "Get started with the New Relic CLI", - "popularity": 1, - "tags": [ - "api key", - "New Relic CLI", - "Tags", - "Entity", - "Deployment markers" - ], - "external_id": "531f2f3985bf64bb0dc92a642445887095048882", - "image": "", - "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/", - "published_at": "2020-08-17T01:48:54Z", - "updated_at": "2020-08-08T01:41:47Z", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.1622734, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "Get started with the New Relic CLI", - "sections": "Get started with the New Relic CLI", - "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", - "tags": "New Relic CLI", - "body": " that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need" + "sections": "New Relic CLI Reference", + "info": "The command line tools for performing tasks against New Relic APIs", + "tags": "new relic cli", + "body": " - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads" }, - "id": "5efa999c196a67c4e1766461" + "id": "5efa989ee7b9d2024b7bab97" }, { - "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", - "type": "developer", + "body": "A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. This document explains: The file structure for a Nerdpack, a Nerdlet and a launcher How to link a launcher file to a Nerdlet How to link your application with a monitored entity For basic component definitions, see our developer site. Generate Nerdpack components There are two ways to generate a Nerdpack template: Generate Nerdpack. Use the CLI command nr1 create and select Nerdpack to create a Nerdpack template that includes a Nerdlet and a launcher. Generate Nerdlet or launcher individually. You can use the CLI command nr1 create and choose to select either a Nerdlet or launcher. This may be useful when adding Nerdlets to an existing Nerdpack. For a lesson on generating and connecting Nerdpack components, see the workshop. Nerdpack file structure When you generate a Nerdpack template using the CLI nr1 create command, it has this file structure: my-nerdlet ├── README.md ├── launchers │ └── my-nerdlet-launcher │ ├── icon.png │ └── nr1.json ├── nerdlets │ └── my-nerdlet-nerdlet │ ├── index.js │ ├── nr1.json │ └── styles.scss ├── node_modules │ ├── js-tokens │ ├── loose-envify │ ├── object-assign │ ├── prop-types │ ├── react │ ├── react-dom │ ├── react-is │ └── scheduler ├── nr1.json ├── package-lock.json └── package.json Nerdlet file structure A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files: index.js The JavaScript code. Here's what the default file looks like when a Nerdlet is generated with the CLI nr1 create: import React from 'react'; export default class MyAwesomeNerdpack extends React.Component { render() { return

Hello, my-awesome-nerdpack Nerdlet!

} } nr1.json Configuration file. Here is the default file generated by the CLI nr1 create command: { \"schemaType\": \"NERDLET\", \"id\": \"my-awesome-nerdpack-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\" } Besides using the launcher as the access point for your application, you can also associate the application with a monitored entity to get it to appear in the New Relic One entity explorer. To do this, add two additional fields to the config file of the first-launched Nerdlet: entities and actionCategory. In the following example, the Nerdlet has been associated with all New Relic Browser-monitored applications and will appear under the Monitor UI category : { \"schemaType\": \"NERDLET\", \"id\": \"my-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"Custom Data\", \"entities\": [{\"domain\": \"BROWSER\", \"type\": \"APPLICATION\"}], \"actionCategory\": \"monitor\" } To see this application in the UI, you would go to the New Relic One entity explorer, select Browser applications, and select a monitored application. styles.scss The file for CSS styles (Sass SCSS syntax). Launcher file structure When an application with a launcher file has been deployed, its launcher is located on the New Relic One home page (one.newrelic.com). A launcher is not required; as an alternative to using a launcher, you can associate your application with a monitored entity. An application can have more than one launcher; this may be desired for an application with multiple Nerdlets. A launcher folder contains two files: nr1.json The configuration file. Here is the default file template created by the nr1 create command: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } To connect a launcher to a Nerdlet, the rootNerdletId must match the id in the launched Nerdlet's nr1.json config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet. icon.png The launcher icon that appears on the one.newrelic.com home page when an application is deployed. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "Build a \"Hello, World!\" app and publish it to New Relic One", + "breadcrumb": "Contents / New Relic One / Use New Relic One / Build on New Relic One", + "info": "For building a New Relic One application: an explanation of the Nerdpack/Nerdlet file structure. ", + "nodeid": 36006, "sections": [ - "Create a \"Hello, World!\" application", - "Before you begin", - "Create a local version of the \"Hello, World!\" application", - "Publish your application to New Relic", - "Add details to describe your project", - "Subscribe accounts to your application", - "Summary", - "Related information" - ], - "title": "Create a \"Hello, World!\" application", - "popularity": 1, - "tags": [ - "nr1 cli", + "Use New Relic One", + "Get started", + "Core concepts", + "UI and data", + "Workloads", + "Build on New Relic One", "Nerdpack file structure", - "NR One Catalog", - "Subscribe applications" + "Generate Nerdpack components", + "Nerdlet file structure", + "Launcher file structure", + "For more help" ], - "external_id": "aa427030169067481fb69a3560798265b6b52b7c", - "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png", - "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/", - "published_at": "2020-08-17T01:55:14Z", - "updated_at": "2020-08-14T01:45:09Z", + "title": "Nerdpack file structure", + "popularity": 1, + "external_id": "6e3788bee17cb65b6dc210862e2a10399f78ff67", + "category_1": "Use New Relic One", + "category_2": "Build on New Relic One", + "image": "", + "url": "https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/new-relic-one-application-nerdpack-file-structure", + "published_at": "2020-08-18T15:32:31Z", + "updated_at": "2020-07-25T00:32:16Z", + "category_0": "New Relic One", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.062545076, + "_score": 0.94898546, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Publish your application to New Relic", - "info": "Build a "Hello, World!" app and publish it to New Relic One", - "tags": "nr1 cli", - "body": ", you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already" + "title": "Nerdpack file structure", + "sections": "Nerdpack file structure", + "info": "For building a New Relic One application: an explanation of the Nerdpack/Nerdlet file structure. ", + "category_0": "New Relic One", + "category_1": "Use New Relic One", + "category_2": "Build on New Relic One", + "body": "A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. This document explains: The file structure for a Nerdpack, a Nerdlet and a launcher How to link a launcher file to a Nerdlet How to link your", + "breadcrumb": "Contents / New Relic One / Use New Relic One / Build on New Relic One" }, - "id": "5efa9973196a67d16d76645c" + "id": "5da0e07a64441f1328edf241" }, { "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", @@ -3935,32 +4225,33 @@ "external_id": "503e515e1095418f8d19329517344ab209d143a4", "image": "", "url": "https://developer.newrelic.com/explore-docs/nr1-common/", - "published_at": "2020-08-17T01:54:01Z", + "published_at": "2020-08-18T02:06:04Z", "updated_at": "2020-08-14T01:48:10Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.019994922, + "_score": 0.80596286, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI common commands", - "sections": "New Relic One CLI common commands", - "info": "An overview of common commands you can use with the New Relic One CLI.", - "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1" + "title": "New Relic One CLI common commands", + "sections": "New Relic One CLI common commands", + "info": "An overview of common commands you can use with the New Relic One CLI.", + "body": " update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL" }, "id": "5f28bd6ae7b9d267996ade94" } ], "/explore-docs/nr1-catalog": [ { - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", "type": "developer", "document_type": "page", "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "sections": [ "New Relic One CLI reference", "Installing the New Relic One CLI", + "Tip", "New Relic One CLI Commands", "Get started", "Configure your CLI preferences", @@ -3978,11 +4269,11 @@ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-14T01:47:13Z", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-18T01:50:36Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.5926358, + "_score": 0.746022, "_version": null, "_explanation": null, "sort": null, @@ -3991,7 +4282,7 @@ "sections": "New Relic One CLI Commands", "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "tags": "New Relic One app", - "body": " our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages" + "body": " CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build" }, "id": "5efa989e28ccbc535a307dd0" }, @@ -4012,11 +4303,11 @@ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", "image": "", "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-08-17T01:54:02Z", + "published_at": "2020-08-18T02:11:50Z", "updated_at": "2020-08-14T01:47:12Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.30732948, + "_score": 0.30402333, "_version": null, "_explanation": null, "sort": null, @@ -4059,11 +4350,11 @@ "external_id": "531f2f3985bf64bb0dc92a642445887095048882", "image": "", "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/", - "published_at": "2020-08-17T01:48:54Z", + "published_at": "2020-08-18T02:06:05Z", "updated_at": "2020-08-08T01:41:47Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.16020007, + "_score": 0.15999478, "_version": null, "_explanation": null, "sort": null, @@ -4077,13 +4368,14 @@ "id": "5efa999c196a67c4e1766461" }, { - "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", + "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", "type": "developer", "document_type": "page", "info": "Build a \"Hello, World!\" app and publish it to New Relic One", "sections": [ "Create a \"Hello, World!\" application", "Before you begin", + "Tip", "Create a local version of the \"Hello, World!\" application", "Publish your application to New Relic", "Add details to describe your project", @@ -4102,11 +4394,11 @@ "external_id": "aa427030169067481fb69a3560798265b6b52b7c", "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png", "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/", - "published_at": "2020-08-17T01:55:14Z", - "updated_at": "2020-08-14T01:45:09Z", + "published_at": "2020-08-18T02:09:27Z", + "updated_at": "2020-08-18T01:45:02Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.09833782, + "_score": 0.12382183, "_version": null, "_explanation": null, "sort": null, @@ -4149,11 +4441,11 @@ "external_id": "503e515e1095418f8d19329517344ab209d143a4", "image": "", "url": "https://developer.newrelic.com/explore-docs/nr1-common/", - "published_at": "2020-08-17T01:54:01Z", + "published_at": "2020-08-18T02:06:04Z", "updated_at": "2020-08-14T01:48:10Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.022100642, + "_score": 0.019941866, "_version": null, "_explanation": null, "sort": null, @@ -4166,15 +4458,16 @@ "id": "5f28bd6ae7b9d267996ade94" } ], - "/explore-docs/nr1-common": [ + "/explore-docs/nr1-nerdpack": [ { - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", "type": "developer", "document_type": "page", "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "sections": [ "New Relic One CLI reference", "Installing the New Relic One CLI", + "Tip", "New Relic One CLI Commands", "Get started", "Configure your CLI preferences", @@ -4192,11 +4485,11 @@ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-14T01:47:13Z", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-18T01:50:36Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.5803978, + "_score": 0.9420942, "_version": null, "_explanation": null, "sort": null, @@ -4205,7 +4498,7 @@ "sections": "New Relic One CLI Commands", "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "tags": "New Relic One app", - "body": " our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages" + "body": ". For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet" }, "id": "5efa989e28ccbc535a307dd0" }, @@ -4226,11 +4519,11 @@ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", "image": "", "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-08-17T01:54:02Z", + "published_at": "2020-08-18T02:11:50Z", "updated_at": "2020-08-14T01:47:12Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.3037005, + "_score": 0.30665752, "_version": null, "_explanation": null, "sort": null, @@ -4273,11 +4566,11 @@ "external_id": "531f2f3985bf64bb0dc92a642445887095048882", "image": "", "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/", - "published_at": "2020-08-17T01:48:54Z", + "published_at": "2020-08-18T02:06:05Z", "updated_at": "2020-08-08T01:41:47Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.16173977, + "_score": 0.16153151, "_version": null, "_explanation": null, "sort": null, @@ -4286,18 +4579,19 @@ "sections": "Get started with the New Relic CLI", "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", "tags": "New Relic CLI", - "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow" + "body": " that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need" }, "id": "5efa999c196a67c4e1766461" }, { - "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", + "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", "type": "developer", "document_type": "page", "info": "Build a \"Hello, World!\" app and publish it to New Relic One", "sections": [ "Create a \"Hello, World!\" application", "Before you begin", + "Tip", "Create a local version of the \"Hello, World!\" application", "Publish your application to New Relic", "Add details to describe your project", @@ -4316,11 +4610,11 @@ "external_id": "aa427030169067481fb69a3560798265b6b52b7c", "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png", "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/", - "published_at": "2020-08-17T01:55:14Z", - "updated_at": "2020-08-14T01:45:09Z", + "published_at": "2020-08-18T02:09:27Z", + "updated_at": "2020-08-18T01:45:02Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.05879556, + "_score": 0.121671684, "_version": null, "_explanation": null, "sort": null, @@ -4333,313 +4627,63 @@ "id": "5efa9973196a67d16d76645c" }, { - "body": "New Relic One CLI plugin commands To install and manage your plugins, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Command details nr1 plugins:install Install a plugin Installs a plugin into the CLI. You can install plugins from npm or a Git URL. Please note that installing a plugin will override the core plugin. For example, if you have a core plugin that has a 'hello' command, then installing a plugin with a 'hello' command will override the core plugin implementation. This is useful if you want to update the core plugin functionality without patching and updating the whole CLI. Usage $ nr1 plugins:install PLUGIN Arguments PLUGIN: the name, path, or URL of the plugin you want to install. required Options -f, --force Runs yarn install --force. This forces a re-download of all the plugin's packages. -h, --help Shows CLI help. --verbose Adds extra information to the output. Examples $ nr1 plugins:install myplugin $ nr1 plugins:install https://github.com/someuser/someplugin $ nr1 plugins:install someuser/someplugin Aliases $ nr1 plugins:add nr1 plugins:link Link your plugin Links a local plugin into the CLI for development. Please note that linking a plugin will override your user-installed plugin or core plugin. For example, if you have a user-installed or core plugin that has a 'hello' command, linking a plugin with a 'hello' command will override the user-installed or core plugin implementation. This is useful for development work. Usage $ nr1 plugins:link PLUGIN Arguments PLUGIN: the name, path, or URL of the plugin you want to link. required Options -h, --help Shows CLI help. --verbose Adds extra information to the output. Examples $ nr1 plugins:link myplugin $ nr1 plugins:link someuser/someplugin nr1 plugins:update Update your plugins Updates all of your installed plugins. Usage $ nr1 plugins:update Options -h, --help Shows CLI help. --verbose Adds extra information to the output. nr1 plugins:uninstall Uninstall your plugin Removes a plugin from the CLI. Usage $ nr1 plugins:uninstall PLUGIN Arguments PLUGIN: the name of the plugin you want to uninstall. required Options -h, --help Shows CLI help. --verbose Adds extra information to the output. Aliases $ nr1 plugins:unlink $ nr1 plugins:remove", + "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", "type": "developer", "document_type": "page", - "info": "An overview of the CLI commands you can use to install and manage your plugins.", + "info": "An overview of common commands you can use with the New Relic One CLI.", "sections": [ - "New Relic One CLI plugin commands", + "New Relic One CLI common commands", "Command details", - "nr1 plugins:install", - "Install a plugin", + "nr1 help", + "See commands and get details", "Usage", "Arguments", - "Options", "Examples", - "Aliases", - "nr1 plugins:link", - "Link your plugin", - "nr1 plugins:update", - "Update your plugins", - "nr1 plugins:uninstall", - "Uninstall your plugin" - ], - "title": "New Relic One CLI plugin commands", - "popularity": 1, - "external_id": "6e94c2de165c2b01c2b15c9297a7314f1895112e", - "image": "", - "url": "https://developer.newrelic.com/explore-docs/nr1-plugins/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-14T01:50:34Z", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.017750913, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "New Relic One CLI plugin commands", - "sections": "New Relic One CLI plugin commands", - "info": "An overview of the CLI commands you can use to install and manage your plugins.", - "body": "New Relic One CLI plugin commands To install and manage your plugins, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin" - }, - "id": "5f28bd6a196a670ddd19d000" - } - ], - "/build-apps/map-pageviews-by-region": [ - { - "body": "The Map page for New Relic Mobile gives an architectural view of your mobile app and the services it uses, to help find performance problems for the app or its services. This gives you a clear picture of your mobile app's relationships to other services and the influence of each service on the others. If one service fails, you can see at a glance which other services are affected. The Map page is not the same as the Geography page for New Relic Mobile. Geography shows your mobile users' experience as a world view with color-coded response times, network failure rates, active users, network requests per minute, or data transfer size. Viewing the Map page rpm.newrelic.com/mobile > (select an app) > Network > Map: The Map provides a visual representation of how performance issues by your mobile app and its services are related to each other. To view your mobile app and its related services as an architectural map: Go to rpm.newrelic.com/mobile > (select an app) > Network > Map. To view HTTP request details for a service, select its name. To view details for a New Relic app related to the service, select the service's name below the associated hostname. To view throughput details as a chart, select the icon or the cpm bar below the service's name. To view detailed metrics for a service, mouse over the throughput chart. Map drill-down details The Map page helps you quickly identify performance problems between your mobile app and its related services. Map details Comments Lines The map shows your mobile app and its list of services by relative throughput. Straight lines indicate a higher percentage of total throughput than dotted lines. Icons Related services include icons to identify them; for example, New Relic apps, webpages, tools, etc. Color The service's label is color coded to indicate its current health status: Green: Live Yellow: Warning Red: Critical Gray: Inactive Active sessions The Map lists the average number of active users for your mobile app for the selected versions and time period. To change these settings, use the Versions menu and time picker below the New Relic menu bar. Network error rate percentage The Map provides summary percentages for your mobile app and each related service. To view additional details for errors: Go to rpm.newrelic.com/mobile > (select an app) > Mobile > Errors. Average response time The title for each service includes this value. Calls per minute (cpm) This value appears below the service's name. Throughput This appears as a chart below the service's name. For more help Additional documentation resources include: HTTP requests page (detailed information about HTTP requests, response time, transfer size, average throughput, network failures, errors, and other data) Errors page for mobile apps (detailed information about HTTP errors and network failures by host APM Map page (additional details about New Relic APM's Map feature for web applications) If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", - "document_type": "page", - "breadcrumb": "Contents / Mobile / Mobile monitoring UI / Network pages", - "info": "The Map page for New Relic Mobile provides an architectural view, to help find performance problems for the app or its services.", - "nodeid": 3636, - "sections": [ - "Mobile monitoring UI", - "Mobile App pages", - "Network pages", - "Exceptions", - "Usage pages", - "Map page for mobile apps", - "Viewing the Map page", - "Map drill-down details", - "For more help" - ], - "title": "Map page for mobile apps", - "popularity": 1, - "external_id": "c5f7c425bec38ba5a947314c671b6b0ce4d0bf74", - "category_1": "Mobile monitoring UI", - "category_2": "Network pages", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/screen%20mobile%20map_0.png", - "url": "https://docs.newrelic.com/docs/mobile-monitoring/mobile-monitoring-ui/network-pages/map-page-mobile-apps", - "published_at": "2020-08-15T04:29:23Z", - "updated_at": "2020-07-25T00:35:43Z", - "category_0": "Mobile", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0016938536, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "Map page for mobile apps", - "sections": "Map page for mobile apps", - "info": "The Map page for New Relic Mobile provides an architectural view, to help find performance problems for the app or its services.", - "category_2": "Network pages", - "body": "The Map page for New Relic Mobile gives an architectural view of your mobile app and the services it uses, to help find performance problems for the app or its services. This gives you a clear picture of your mobile app's relationships to other services and the influence of each service" - }, - "id": "561c8e27827a6652fc000051" - }, - { - "body": "The Page views page in Browser monitoring provides insight into the performance of your site's pages. Sort options allow you to view details by percentage of page load time, average page load time, or throughput. Detailed information about the top webpages viewed, timing and throughput details, and links to browser traces or session traces also are available as applicable. Browser also offers single-page app (SPA) monitoring. If you have opted in to SPA monitoring, your SPA Page views page will be different. View summary information Browser monitoring lists page views as URLs. This makes it easy to identify specific front-end page views; for example, /browse/plans. In addition: For browser apps that are also monitored by APM, you can view the back-end transactions associated with the page view; for example, ApplicationsController#Show. For URLs that are also monitored by Synthetics, you can use New Relic's comparative charting feature. This provides a direct page load time comparison between real user (Browser) interactions and trends appearing in Synthetics monitors. one.newrelic.com > Browser > (select an app) > Page views: This page provides detailed information about page load time, throughput, top transactions, and traces. To view detailed information about which pages the end users are viewing for your app: Go to one.newrelic.com > Browser > (select an app) > Page views. Select the time period or sort order, or keep the defaults. If available, select the type of view for page load timing information as a chart (default), histogram, or percentile. To view summary information about a specific transaction, mouse over the transaction's name on the list. To compare page load time between real user (Browser) interactions and trends appearing in Synthetic monitors, select a page monitored by Synthetics, then examine additional comparative charting details. Examine timing details for page loads The Browser page load time chart view shows the average page load time broken down into segments. This chart also appears on the Browser Summary page and Browsers detail page. one.newrelic.com > Browser > (select an app) > Page views: The Browser page load time chart shows the average page load time broken down into segments indicating the end users' experience (sometimes referred to as real user monitoring or RUM). The page load timing process shows colored-coded details: Page load timing process Description Request queuing (black) Wait time between the web server and the application code. Large numbers indicate a busy application server. Web application (purple) Time spent in the application code. Network (brown) The network latency, or the time it takes for a request to make a round trip over the Internet. For apps that have been deployed using the copy/paste method, Browser includes web app and queue time in Network time. DOM processing (yellow) In the browser, parsing and interpreting the HTML. Measured by the browser's DOMContent event. Page rendering (blue) In the browser, the time to display the HTML, run the inline JavaScript, and load images. Measured by the browser's Load event. \"Additional\" timing data If you are using the JavaScript API, your \"additional\" timing data appears in this chart. Examine page view details Use any of New Relic's standard user interface functions to drill down into detailed information. In addition, to view details about a specific page view, select its name from the list. To close an individual page view and return to the Page views page, select X (Close). Each page view listed in the list may include links to additional drill-down details: Page view details Comments Page load performance This includes page load timing breakdown data, throughput, session traces, and browser traces (if available). Historical performance This shows response time, Apdex comparisons, and throughput for the last selected time period, yesterday, and last week. AJAX calls Table with links to detailed information about endpoints, as well as sortable columns by endpoint, average response time, throughput, and total calls. APM transactions For Browser apps that are also monitored by APM, this table shows the total call time, average response time, call count, and link to the APM Transactions page. one.newrelic.com > Browser > (select an app) > Page views > (select a transaction): Depending on the app, individual transactions may have links to additional drill-down details, including Page load performance, Historical performance, AJAX calls, and APM transactions. Use additional APM-monitored app options Browser apps that are also monitored by APM may have access to additional functions. To use these functions (if available): From the selected transaction's APM Transactions tab, select an APM transaction from the list. Then select any of these options (from APM): Track as key transaction (create a new key transaction) Key transaction (view existing) Transaction traces > (selected trace) (view) For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", - "document_type": "page", - "breadcrumb": "Contents / Browser monitoring / Browser monitoring / Additional standard features", - "info": "Browser's Page views page provides several sort options to view details about page load, throughput, and traces.", - "nodeid": 1851, - "sections": [ - "Browser monitoring", - "Getting started", - "Guides", - "Installation", - "Configuration", - "Browser agent and SPA API", - "Page load timing resources", - "Browser Pro features", - "Additional standard features", - "Performance quality", - "Troubleshooting", - "Page views: Examine page performance", - "View summary information", - "Examine timing details for page loads", - "Examine page view details", - "Use additional APM-monitored app options", - "For more help" - ], - "title": "Page views: Examine page performance", - "popularity": 1, - "external_id": "b9b4e9453ea02a178584b5e5197ee9dcbc5db76f", - "category_1": "Browser monitoring", - "category_2": "Additional standard features", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/pageview03_transaction.png", - "url": "https://docs.newrelic.com/docs/browser/new-relic-browser/additional-standard-features/page-views-examine-page-performance", - "published_at": "2020-08-15T09:18:05Z", - "updated_at": "2020-08-15T09:18:04Z", - "category_0": "Browser monitoring", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0012853914, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "Page views: Examine page performance", - "sections": "Page views: Examine page performance", - "info": "Browser's Page views page provides several sort options to view details about page load, throughput, and traces.", - "category_2": "Additional standard features", - "body": ", and links to browser traces or session traces also are available as applicable. Browser also offers single-page app (SPA) monitoring. If you have opted in to SPA monitoring, your SPA Page views page will be different. View summary information Browser monitoring lists page views as URLs. This makes" - }, - "id": "59c3519c4bb81c2858bc3879" - }, - { - "body": "Single page applications (SPAs) are web applications that load a single HTML page. The app dynamically updates without requiring a full page reload, in response to user interactions with the app, such as clicking a button or submitting a request. Browser's SPA monitoring provides deeper visibility and actionable insights into real users' experiences with single-page apps. SPA monitoring is also valuable for any app that uses AJAX requests to pull content dynamically and create a fluid user experience. In addition to monitoring route changes out of the box, you can use Browser monitoring's SPA API to monitor virtually anything that executes inside the browser. This allows developers and their team to: Create faster, more responsive, highly interactive apps. Monitor the throughput and performance that real users are experiencing. Troubleshoot and resolve problems within the context of the page load. Query your data to assist with business decisions. Bring better apps to the marketplace more quickly. Enable SPA monitoring Before installing SPA monitoring, read SPA compatibility and requirements. Then, see Add apps to Single Page App monitoring. Analyze throughput and performance data Improving on traditional industry standards for measuring page load timing, we give you a complete picture of the activity, both synchronous and asynchronous, associated with page loads and route changes. one.newrelic.com > Browser > (select an app) > Page views: Use Browser monitoring's SPA monitoring to examine the throughput and performance of your SPA-architecture app. SPA data monitored by Browser monitoring can include: Performance data and throughput for page loads and route changes AJAX request data JavaScript activity, both synchronous and asynchronous Dynamic page updates, monitored using the SPA API With this data, you will gain a clear understanding of how your users experience your app's page loads and route changes, and be able to solve bottlenecks and troubleshoot errors. For more about how New Relic handles SPA data, see Understand SPA data collection. Browser SPA features Here is a summary of SPA monitoring features: Single-page app monitoring Take advantage of these features Robust views in Browser's UI When a user initiates a page load or route change, New Relic begins to monitor all subsequent JavaScript, and ends the timing once all AJAX events are complete. This provides a more accurate view of when a page is actually ready for a user compared to the traditional method of ending the timing when the window load event is fired. When SPA monitoring is enabled, the Page views page in Browser shows event-driven data about application usage levels (throughput) and user experience (performance), including: Charts with drill-down details about initial page load performance, route changes, and historical performance Sort, search, and filter options, including custom attributes Additional AJAX breakdown data for all initial page loads and route changes For an explanation of how SPA monitoring will impact your existing Browser account's data usage, see SPA and Browser data usage. Data analysis with data explorer The data explorer supports three SPA-specific event types: BrowserInteraction, AjaxRequest, and BrowserTiming. You can query these events in the query builder to analyze your app's performance and make business decisions. Customized data from API Use SPA API to obtain the specific data you need, such as custom naming, custom timing, finishline API, or other custom attributes. For more help Additional documentation resources include: SPA compatibility and requirements (see technical requirements for getting single-page app monitoring from New Relic) View SPA data in Browser monitoring (understand how Browser displays your data in the UI) Understand SPA data collection (learn how we collect and save your SPA data) If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", - "document_type": "page", - "breadcrumb": "Contents / Browser monitoring / Single page app monitoring / Get started", - "info": "Browser's SPA monitoring examines your users' experience with the front-end logic for single-page apps or any apps that pull content dynamically.", - "nodeid": 9936, - "sections": [ - "Single page app monitoring", - "Get started", - "Use SPA data", - "Troubleshooting", - "Introduction to Single Page App monitoring", - "Enable SPA monitoring", - "Analyze throughput and performance data", - "Browser SPA features", - "For more help" - ], - "title": "Introduction to Single Page App monitoring", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/browser/single-page-app-monitoring/get-started/introduction-single-page-app-monitoring", - "popularity": 1, - "external_id": "d801e09896a13add1f690a431a2d4180b5b7c51c", - "category_1": "Single page app monitoring", - "category_2": "Get started", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/browser_SPA.png", - "url": "https://docs.newrelic.com/docs/browser/single-page-app-monitoring/get-started/introduction-single-page-app-monitoring", - "published_at": "2020-08-15T14:30:40Z", - "updated_at": "2020-08-10T18:59:09Z", - "category_0": "Browser monitoring", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0009462895, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "Introduction to Single Page App monitoring", - "sections": "Introduction to Single Page App monitoring", - "info": "Browser's SPA monitoring examines your users' experience with the front-end logic for single-page apps or any apps that pull content dynamically.", - "category_1": "Single page app monitoring", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/browser/single-page-app-monitoring/get-started/introduction-single-page-app-monitoring", - "body": " Improving on traditional industry standards for measuring page load timing, we give you a complete picture of the activity, both synchronous and asynchronous, associated with page loads and route changes. one.newrelic.com > Browser > (select an app) > Page views: Use Browser monitoring's SPA", - "breadcrumb": "Contents / Browser monitoring / Single page app monitoring / Get started" - }, - "id": "58a29f174bb81c5f5330d6d6" - }, - { - "body": "The New Relic Java agent API lets you set up custom instrumentation for your Java application. This document shows an example of using custom instrumentation with annotation in an imaginary application. For best results when using the API, ensure you have the latest Java agent release. Complete example app using API Below is an example of an imaginary store app's servlet using the Java agent API. If you copy and paste example code, be sure to use appropriate spacing on your command lines. Complete API call example package test; import java.io.IOException; import java.io.PrintWriter; import java.util.Random; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; // Java agent API imports import com.newrelic.api.agent.NewRelic; import com.newrelic.api.agent.Trace; public class TestServlet extends HttpServlet { // instrumentation via annotation @Trace(dispatcher = true) protected void processRequest(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { saveNewRelicInfo(req); doRequestWork(req); writeResponse(resp); } private void saveNewRelicInfo(HttpServletRequest req) { String storeId = req.getParameter(\"storeId\"); if (storeId != null) { // set the name of the Transaction NewRelic.setTransactionName(null, \"/store\"); if (storeId.equals(\"betaStore\")) { // prevent the method from contributing to the Apdex score NewRelic.ignoreApdex(); } } String userId = req.getParameter(\"userId\"); if (userId != null) { // set the user name to associate with the RUM JavaScript footer // for the current web transaction NewRelic.setUserName(userId); // add a key/value pair to the current transaction NewRelic.addCustomParameter(\"userId\", userId); } String promotionId = req.getParameter(\"promotionId\"); if (promotionId != null) { // increment the metric counter for the given name NewRelic.incrementCounter(\"Custom/Promotion\"); } } protected void doRequestWork(HttpServletRequest req) { try { long millisToSleep = new Random().nextInt(5000); Thread.sleep(millisToSleep); // record a response time in milliseconds for the given metric name NewRelic.recordResponseTimeMetric(\"Custom/RandomSleep\", millisToSleep); } catch (InterruptedException e) { // report a handled exception NewRelic.noticeError(e, false); } } protected void writeResponse(HttpServletResponse resp) throws IOException { resp.setContentType(\"text/html;charset=UTF-8\"); PrintWriter out = resp.getWriter(); out.println(\"\"); out.println(\"\"); // get the RUM JavaScript header for the current web transaction out.println(NewRelic.getBrowserTimingHeader()); out.println(\"NewRelic API example servlet\"); out.println(\"\"); out.println(\"\"); out.println(\"

API example

\"); // get the RUM JavaScript footer for the current web transaction out.println(NewRelic.getBrowserTimingFooter()); out.println(\"\"); out.println(\"\"); out.close(); } protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { processRequest(req, resp); } protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { processRequest(req, resp); } } How the example uses the API Here is the same example app divided into sections that describe how the API is used: Import the needed packages This part of the example shows the imports needed for the example application and Java agent API. package test; import java.io.IOException; import java.io.PrintWriter; import java.util.Random; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; // Java agent API imports import com.newrelic.api.agent.NewRelic; import com.newrelic.api.agent.Trace; Set @Trace for transaction traces This part of the API call provides instructions to instrument this call using New Relic's trace annotation @Trace. Any requests that hit processRequest will now show a segment in APM's Transaction trace call chart. public class TestServlet extends HttpServlet { // instrumentation via annotation @Trace(dispatcher = true) protected void processRequest(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { saveNewRelicInfo(req); doRequestWork(req); writeResponse(resp); } Create custom names for web transactions This part of the API call instructs web transactions containing a storeId value to appear in APM's Transactions page with the custom transaction name you set. A request to any one store will appear under the same, aggregate name. private void saveNewRelicInfo(HttpServletRequest req) { String storeId = req.getParameter(\"storeId\"); if (storeId != null) { // set the name of the Transaction NewRelic.setTransactionName(null, \"/store\"); } } Bypass Apdex when collecting non-public data This part of the API call excludes the non-public beta storeID from affecting the Apdex score. if (storeId.equals(\"betaStore\")) { // prevent the method from contributing to the Apdex score NewRelic.ignoreApdex(); } Record the user ID This part of the API call inserts additional metadata into the page load timing request so that browser traces can be tied with the userId. It also records the userId as a custom parameter on the transaction so that it appears in the parameter details of a transaction trace. (Page load timing sometimes is referred to as real user monitoring or RUM.) String userId = req.getParameter(\"userId\"); if (userId != null) { // set the user name to associate with the RUM JavaScript footer // for the current web transaction NewRelic.setUserName(userId); // add a key/value pair to the current transaction NewRelic.addCustomParameter(\"userId\", userId); } Collect promotion data This part of the API call records the number of times a promotion was viewed so that the metrics can appear on a custom dashboard. For metrics you want to graph in custom dashboards, be sure to prepend Custom/ to the metric name; for example, Custom/Promotion. String promotionId = req.getParameter(\"promotionId\"); if (promotionId != null) { // increment the metric counter for the given name NewRelic.incrementCounter(\"Custom/Promotion\"); } Send instructions to the handler This part of the API call sends a set of instructions to the handler for processing requests and handling exceptions. protected void doRequestWork(HttpServletRequest req) { try { long millisToSleep = new Random().nextInt(5000); Thread.sleep(millisToSleep); // record a response time in milliseconds for the given metric name NewRelic.recordResponseTimeMetric(\"Custom/RandomSleep\", millisToSleep); } catch (InterruptedException e) { // report a handled exception NewRelic.noticeError(e, false); } } protected void writeResponse(HttpServletResponse resp) throws IOException { Include page load timing code in the HTTP response This part of the API call defines what to include in the HttpServletResponse. For manual instrumentation of Browser monitoring to monitor page load timing (sometimes referred to as real user monitoring or RUM): Set the header after the tag. Set the footer at the end of tag. resp.setContentType(\"text/html;charset=UTF-8\"); PrintWriter out = resp.getWriter(); out.println(\"\"); out.println(\"\"); // get the RUM JavaScript header for the current web transaction out.println(NewRelic.getBrowserTimingHeader()); out.println(\"NewRelic API example servlet\"); out.println(\"\"); out.println(\"\"); out.println(\"

API example

\"); // get the RUM JavaScript footer for the current web transaction out.println(NewRelic.getBrowserTimingFooter()); out.println(\"\"); out.println(\"\"); out.close(); } Complete the HTTP response This part of the API call defines the remaining information to include in the HttpServletResponse response. protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { processRequest(req, resp); } protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { processRequest(req, resp); } } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", - "document_type": "page", - "breadcrumb": "Contents / APM agents / Java agent / API guides", - "info": "An example Java app that uses the New Relic Java agent API.", - "nodeid": 2541, - "sections": [ - "Java agent", - "Getting started", - "Installation", - "Additional installation", - "Heroku", - "Configuration", - "Attributes", - "Features", - "Instrumentation", - "Custom instrumentation", - "API guides", - "Async instrumentation", - "Troubleshooting", - "Java agent API: Custom instrumentation with annotation of an example app", - "Complete example app using API", - "How the example uses the API", - "For more help" + "nr1 update", + "Update your CLI", + "nr1 create", + "Create a new component", + "Options", + "nr1 profiles", + "Manage your profiles keychain", + "Commands", + "nr1 autocomplete", + "See autocomplete installation instructions", + "nr1 nrql", + "Query using NRQL" ], - "title": "Java agent API: Custom instrumentation with annotation of an example app", + "title": "New Relic One CLI common commands", "popularity": 1, - "external_id": "faf85719be7fdf8a14279937b210d807a122192d", - "category_1": "Java agent", - "category_2": "API guides", + "external_id": "503e515e1095418f8d19329517344ab209d143a4", "image": "", - "url": "https://docs.newrelic.com/docs/agents/java-agent/api-guides/java-agent-api-custom-instrumentation-annotation-example-app", - "published_at": "2020-08-15T03:51:11Z", - "updated_at": "2020-08-15T03:51:10Z", - "category_0": "APM agents", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.00089638034, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "Java agent API: Custom instrumentation with annotation of an example app", - "sections": "Java agent API: Custom instrumentation with annotation of an example app", - "info": "An example Java app that uses the New Relic Java agent API.", - "category_0": "APM agents", - "category_1": "Java agent", - "category_2": "API guides", - "body": " call instructs web transactions containing a storeId value to appear in APM's Transactions page with the custom transaction name you set. A request to any one store will appear under the same, aggregate name. private void saveNewRelicInfo(HttpServletRequest req) { String storeId = req.getParameter" - }, - "id": "5f375baf28ccbccdf4e24031" - }, - { - "body": "You can use New Relic's Java agent to collect and view additional metrics provided by the most common application servers via JMX. The collected metrics vary by app server and include measurements of thread pools, HTTP sessions, and transactions. View JVM metrics Application servers collect and report different metrics, which appear on APM's JVMs page. (For applications using New Relic via Heroku, the JVMs page is named Instances.) At a minimum, each app server collects and reports metric data on memory. For instructions on enabling JMX metrics, refer to your app server's documentation. To view JVM metrics: Go to one.newrelic.com > APM > (select an app) > Monitoring > JVMs > (select a JVM). From the selected JVM's Memory page, use any of New Relic's standard user interface functions to drill down into detailed information. To view other metrics, select any available tab. Optional: To use the thread profiler to look for bottlenecks in data on executing threads, select Profile this JVM. one.newrelic.com > APM > (select an app) > Monitoring > JVMs: Depending on the metrics your app server is reporting, one or more tabs appear on your JVM page. Tabs available by app server This table lists which tabs appear on the JVM page for app servers. If your app server does not report a particular type of metric data, the tab does not appear on your JVM page. App server Memory Thread pools HTTP sessions App server transactions Data sources Glassfish [check icon] [check icon] [check icon] [check icon] JBoss 5AS [check icon] [check icon] [check icon] [check icon] JBoss 6AS [check icon] [check icon] [check icon] [check icon] JBoss 6EAP [check icon] [check icon] [check icon] JBoss 7AS [check icon] [check icon] [check icon] Jetty [check icon] [check icon] Resin 3 [check icon] [check icon] [check icon] [check icon] Resin 4 [check icon] [check icon] [check icon] [check icon] [check icon] Tomcat [check icon] [check icon] [check icon] [check icon] TomEE [check icon] [check icon] [check icon] WebLogic [check icon] [check icon] [check icon] Websphere Liberty [check icon] [check icon] [check icon] [check icon] Websphere Traditional [check icon] [check icon] [check icon] WildFly [check icon] [check icon] [check icon] Metrics available by tab Here is a summary of the metrics available from the JVM page. If the app server does not support a particular metric, that tab does not appear on your JVM page. JMX Metric charts Memory Heap memory usage: Each chart shows the used and committed heap space in MB for a given heap. Non-heap memory pool usage for the JVM: The used code cache and used CMS Perm Gen in MB. Garbage collection: The garbage collection CPU time. Class count: The loaded and unloaded class count for the JVM. Threads Thread count: The current number of active threads in the JVM. Thread pool: The active and idle thread count for the pool. On supported app servers, a chart shows each thread pool present in the app server, as well as the ratio of active to maximum thread count for each thread pool. HTTP sessions Session: The active, invalidated by timeout, and invalidated HTTP session counts for the application. On supported app servers, a chart shows each application present in the app server. App server transactions Active transaction: The number of active transactions within the app server's transaction manager. Created transaction: The change in the total number of created transactions per app server. Some app servers separate top level transactions and nested transactions. Finished transaction: The change in the total number of finished transactions per app server. Some app servers separate them by aborted and committed completed transactions. Data sources The metrics for the data source tab vary by app server. For more details, see Data source metrics by app server. For details on WebLogic's data source metrics, see WebLogic JMX metrics. Data source metrics by app server For supported app servers, the agent collects JMX data source metrics. You can view these metrics at one.newrelic.com > APM > (select an app) > Monitoring > JVMs > Data sources. To see these metrics, ensure that your data source has been properly configured for JMX monitoring for your app server. App server Metrics Tomcat Max connections: The maximum connections available for a data source. This is generally a configurable parameter. Active connections: The current number of active connections in a data source. Idle connections: The current number of idle connections in a data source. WebSphere Liberty Max connections: The maximum connections available for a data source. This is generally a configurable parameter. Active connections: The current number of active connections in a data source. Idle connections: The current number of idle connections in a data source. Wait time: The average amount of time a connections needs to wait before being handled. Destroyed connections: The number of destroyed connections. Resin Max connections: The maximum connections available for a data source. This is generally a configurable parameter. Active connections: The current number of active connections in a data source. Idle connections: The current number of idle connections in a data source. Created connections: The number of created connections. Enable for Spring Boot 2.2 and higher with Tomcat To enable New Relic to access Tomcat JMX metrics when running with Spring Boot 2.2 and higher, the system property server.tomcat.mbeanregistry.enabled must be set to true. See the Spring Boot 2.2 release notes. Enable WebSphere PMI metrics To enable New Relic to access WebSphere PMI metrics, you will need to configure WebSphere to monitor the necessary statistic sets. Enable all statistic sets (recommended) The simplest approach is to enable the collection of all statistic sets: If you are using Java 2 Security, ensure you have granted New Relic proper permissions. From the WebSphere admin console, select Monitoring and Tuning > Performance Monitoring Infrastructure (PMI) > (your server name). Select the Enable Performance Monitoring Infrastructure (PMI) checkbox. In the Currently monitored statistic set section, select All, then save your changes. Enable custom statistic sets (advanced) You can also collect only the PMI metrics that New Relic monitors by default. To collect only some PMI metrics: If you are using Java 2 Security, ensure you have granted New Relic proper permissions. From the WebSphere admin console, select Monitoring and Tuning > Performance Monitoring Infrastructure (PMI) > (selected app server). Select the Enable Performance Monitoring Infrastructure (PMI) checkbox. Select Custom. From the custom statistic set list, enable the following metrics: In the ThreadPool category, select the ActiveCount and PoolSize checkboxes. In the Servlet Session Manager category, select the ActiveCount and LiveCount checkboxes. In the Transaction Manager category, select the CommittedCount, RolledbackCount, and GlobalTimeoutCount checkboxes. From the Messages panel, select Save directly to the master configuration. Collected WebSphere PMI metrics When enabled, New Relic collects the following WebSphere PMI metrics. If you want other PMI metrics besides these to be collected and displayed in New Relic custom dashboards, use JMX instrumentation. stats.ActiveCount WebSphere PMI metrics Details Attribute stats.ActiveCount Object name pattern WebSphere:type=ThreadPool,name=*,process=*,platform=*,node=*,* New Relic metric JmxBuiltIn/ThreadPool/WebContainer/Active Type Simple maximumSize WebSphere PMI metrics Details Attribute maximumSize Object name pattern WebSphere:type=ThreadPool,name=*,process=*,platform=*,node=*,* New Relic metric JmxBuiltIn/ThreadPool/WebContainer/Max Type Simple stats.CommittedCount WebSphere PMI metrics Details Attribute stats.CommittedCount Object name pattern WebSphere:j2eeType=JTAResource,type=TransactionService,name=*,process=*,platform=*,node=*,* New Relic metric JmxBuiltIn/JTA/TransactionService/Committed Type Simple stats.RolledbackCount WebSphere PMI metrics Details Attribute stats.RolledbackCount Object name pattern WebSphere:j2eeType=JTAResource,type=TransactionService,name=*,process=*,platform=*,node=*,* New Relic metric JmxBuiltIn/JTA/TransactionService/Rolled Back Type Simple stats.GlobalTimeoutCount WebSphere PMI metrics Details Attribute stats.GlobalTimeoutCount Object name pattern WebSphere:j2eeType=JTAResource,type=TransactionService,name=*,process=*,platform=*,node=*,* New Relic metric JmxBuiltIn/JTA/TransactionService/Timed Out Type Simple stats.LiveCount WebSphere PMI metrics Details Attribute stats.GlobalTimeoutCount Object name pattern WebSphere:type=SessionManager,name=*,process=*,platform=*,node=*,* New Relic metric JmxBuiltIn/Session/DefaultApplication#DefaultWebApplication.war/Active Type Simple WebLogic JMX metrics In WebLogic, JMX is enabled by default. New Relic collects the following mbeans metrics. To collect additional JMX metrics, use a custom YAML file. ThreadCount WebLogic JMX metrics Details Attribute ThreadCount Object name pattern java.lang:type=Threading New Relic metric JmxBuiltIn/Threads/Thread Count Type Simple TotalStartedThreadCount WebLogic JMX metrics Details Attribute TotalStartedThreadCount Object name pattern java.lang:type=Threading New Relic metric JmxBuiltIn/Threads/TotalStartedCount Type Simple LoadedClassCount WebLogic JMX metrics Details Attribute LoadedClassCount Object name pattern java.lang:type=ClassLoading New Relic metric JmxBuiltIn/Classes/Loaded Type Simple UnloadedClassCount WebLogic JMX metrics Details Attribute UnloadedClassCount Object name pattern java.lang:type=ClassLoading New Relic metric JmxBuiltIn/Classes/Unloaded Type Simple HoggingThreadCount WebLogic JMX metrics Details Attribute HoggingThreadCount Object name pattern com.bea:ServerRuntime=*,Name=ThreadPoolRuntime,Type=ThreadPoolRuntime New Relic metric JmxBuiltIn/ThreadPool/{Name}/Active Type Simple ExecuteThreadIdleCount WebLogic JMX metrics Details Attribute ExecuteThreadIdleCount Object name pattern com.bea:ServerRuntime=*,Name=ThreadPoolRuntime,Type=ThreadPoolRuntime New Relic metric JmxBuiltIn/ThreadPool/{Name}/Idle Type Simple StandbyThreadCount WebLogic JMX metrics Details Attribute StandbyThreadCount Object name pattern com.bea:ServerRuntime=*,Name=ThreadPoolRuntime,Type=ThreadPoolRuntime New Relic metric JmxBuiltIn/ThreadPool/{Name}/Standby Type Simple TransactionTotalCount WebLogic JMX metrics Details Attribute TransactionTotalCount Object name pattern com.bea:ServerRuntime=*,Name=JTARuntime,Type=JTARuntime New Relic metric JmxBuiltIn/JTA/{Name}/Count Type Monotonic TransactionCommittedTotalCount WebLogic JMX metrics Details Attribute TransactionCommittedTotalCount Object name pattern com.bea:ServerRuntime=*,Name=JTARuntime,Type=JTARuntime New Relic metric JmxBuiltIn/JTA/{Name}/Committed Type Monotonic TransactionRolledBackTotalCount WebLogic JMX metrics Details Attribute TransactionRolledBackTotalCount Object name pattern com.bea:ServerRuntime=*,Name=JTARuntime,Type=JTARuntime New Relic metric JmxBuiltIn/JTA/{Name}/Rolled Back Type Monotonic TransactionAbandonedTotalCount WebLogic JMX metrics Details Attribute TransactionAbandonedTotalCount Object name pattern com.bea:ServerRuntime=*,Name=JTARuntime,Type=JTARuntime New Relic metric JmxBuiltIn/JTA/{Name}/Abandoned Type Monotonic NumAvailable WebLogic JMX metrics Details Attribute NumAvailable Object name pattern com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime New Relic metric JmxBuiltIn/DataSources/{Name}/Connections/Available Type Simple CurrCapacity WebLogic JMX metrics Details Attribute CurrCapacity Object name pattern com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime New Relic metric JmxBuiltIn/DataSources/{Name}/Connections/PoolSize Type Simple ConnectionsTotalCount WebLogic JMX metrics Details Attribute ConnectionsTotalCount Object name pattern com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime New Relic metric JmxBuiltIn/DataSources/{Name}/Connections/Created Type Monotonic ActiveConnectionsCurrentCount WebLogic JMX metrics Details Attribute ActiveConnectionsCurrentCount Object name pattern com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime New Relic metric JmxBuiltIn/DataSources/{Name}/Connections/Active Type Simple LeakedConnectionCount WebLogic JMX metrics Details Attribute LeakedConnectionCount Object name pattern com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime New Relic metric JmxBuiltIn/DataSources/{Name}/Connections/Leaked Type Monotonic PrepStmtCacheCurrentSize WebLogic JMX metrics Details Attribute PrepStmtCacheCurrentSize Object name pattern com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime New Relic metric JmxBuiltIn/DataSources/{Name}/Statement Cache/Size Type Simple WaitingForConnectionCurrentCount WebLogic JMX metrics Details Attribute WaitingForConnectionCurrentCount Object name pattern com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime New Relic metric JmxBuiltIn/DataSources/{Name}/Requests/Currently Waiting Type Simple WaitingForConnectionTotal WebLogic JMX metrics Details Attribute WaitingForConnectionTotal Object name pattern com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime New Relic metric JmxBuiltIn/DataSources/{Name}/Requests/Count Type Monotonic WaitingForConnectionSuccessTotal WebLogic JMX metrics Details Attribute WaitingForConnectionSuccessTotal Object name pattern com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime New Relic metric JmxBuiltIn/DataSources/{Name}/Requests/Successful Type Monotonic WaitingForConnectionFailureTotal WebLogic JMX metrics Details Attribute WaitingForConnectionFailureTotal Object name pattern com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime New Relic metric JmxBuiltIn/DataSources/{Name}/Requests/Failed Type Monotonic AccessTotalCount - MissTotalCount WebLogic JMX metrics Details Attribute AccessTotalCount - MissTotalCount Object name pattern com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBPoolRuntime,EJBComponentRuntime=*,* New Relic metric JmxBuiltIn/EJB/Pool/Bean/{ApplicationRuntime}/{EJBComponentRuntime}/{Name}/Attempts/Successful Type Monotonic MissTotalCount WebLogic JMX metrics Details Attribute MissTotalCount Object name pattern com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBPoolRuntime,EJBComponentRuntime=*,* New Relic metric JmxBuiltIn/EJB/Pool/Bean/{ApplicationRuntime}/{EJBComponentRuntime}/{Name}/Attempts/Failed Type Monotonic WaiterCurrentCount WebLogic JMX metrics Details Attribute WaiterCurrentCount Object name pattern com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBPoolRuntime,EJBComponentRuntime=*,*> New Relic metric JmxBuiltIn/EJB/Pool/Bean/{ApplicationRuntime}/{EJBComponentRuntime}/{Name}/Threads/Waiting Type Simple DestroyedTotalCount WebLogic JMX metrics Details Attribute DestroyedTotalCount Object name pattern com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBPoolRuntime,EJBComponentRuntime=*,* New Relic metric JmxBuiltIn/EJB/Pool/Bean/{ApplicationRuntime}/{EJBComponentRuntime}/{Name}/Beans/Destroyed Type Monotonic BeansInUseCurrentCount WebLogic JMX metrics Details Attribute BeansInUseCurrentCount Object name pattern com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBPoolRuntime,EJBComponentRuntime=*,* New Relic metric JmxBuiltIn/EJB/Pool/Bean/{ApplicationRuntime}/{EJBComponentRuntime}/{Name}/Beans/Active Type Simple PooledBeansCurrentCount WebLogic JMX metrics Details Attribute PooledBeansCurrentCount Object name pattern com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBPoolRuntime,EJBComponentRuntime=*,* New Relic metric JmxBuiltIn/EJB/Pool/Bean/{ApplicationRuntime}/{EJBComponentRuntime}/{Name}/Beans/Available Type Simple TransactionsCommittedTotalCount +TransactionsRolledBackTotalCount +TransactionsTimedOutTotalCount WebLogic JMX metrics Details Attribute TransactionsCommittedTotalCount +TransactionsRolledBackTotalCount +TransactionsTimedOutTotalCount Object name pattern com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBTransactionRuntime,EJBComponentRuntime=*,* New Relic metric JmxBuiltIn/EJB/Transactions/Application/{ApplicationRuntime}/Count Type Monotonic TransactionsCommittedTotalCount WebLogic JMX metrics Details Attribute TransactionsCommittedTotalCount Object name pattern com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBTransactionRuntime,EJBComponentRuntime=*,* New Relic metric JmxBuiltIn/EJB/Transactions/Application/{ApplicationRuntime}/Committed Type Monotonic TransactionsRolledBackTotalCount WebLogic JMX metrics Details Attribute TransactionsRolledBackTotalCount Object name pattern com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBTransactionRuntime,EJBComponentRuntime=*,* New Relic metric JmxBuiltIn/EJB/Transactions/Application/{ApplicationRuntime}/Rolled Back Type Monotonic TransactionsTimedOutTotalCount WebLogic JMX metrics Details Attribute TransactionsTimedOutTotalCount Object name pattern com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBTransactionRuntime,EJBComponentRuntime=*,* New Relic metric JmxBuiltIn/EJB/Transactions/Application/{ApplicationRuntime}/Timed Out Type Monotonic For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", - "document_type": "page", - "breadcrumb": "Contents / APM agents / Java agent / Features", - "info": "APM's JVM page for Java: Thread pools, HTTP sessions, and transactions; WebSphere PMI and WebLogic JMX metrics.", - "nodeid": 3051, - "sections": [ - "Java agent", - "Getting started", - "Installation", - "Additional installation", - "Heroku", - "Configuration", - "Attributes", - "Features", - "Instrumentation", - "Custom instrumentation", - "API guides", - "Async instrumentation", - "Troubleshooting", - "JVMs page (Java): View app server metrics from JMX", - "View JVM metrics", - "Tabs available by app server", - "Metrics available by tab", - "Data source metrics by app server", - "Enable for Spring Boot 2.2 and higher with Tomcat", - "Enable WebSphere PMI metrics", - "Collected WebSphere PMI metrics", - "WebLogic JMX metrics", - "For more help" - ], - "title": "JVMs page (Java): View app server metrics from JMX", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/agents/java-agent/features/jvms-page-java-view-app-server-metrics-jmx", - "popularity": 1, - "external_id": "e16c910d29c02e86806128c1d858806f1488ca9f", - "category_1": "Java agent", - "category_2": "Features", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/apm_jvm.png", - "url": "https://docs.newrelic.com/docs/agents/java-agent/features/jvms-page-java-view-app-server-metrics-jmx", - "published_at": "2020-08-15T05:44:28Z", - "updated_at": "2020-08-15T05:44:28Z", - "category_0": "APM agents", + "url": "https://developer.newrelic.com/explore-docs/nr1-common/", + "published_at": "2020-08-18T02:06:04Z", + "updated_at": "2020-08-14T01:48:10Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0008705073, + "_score": 0.092428446, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "JVMs page (Java): View app server metrics from JMX", - "sections": "JVMs page (Java): View app server metrics from JMX", - "info": "APM's JVM page for Java: Thread pools, HTTP sessions, and transactions; WebSphere PMI and WebLogic JMX metrics.", - "category_0": "APM agents", - "category_1": "Java agent", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/agents/java-agent/features/jvms-page-java-view-app-server-metrics-jmx", - "body": ". To view JVM metrics: Go to one.newrelic.com > APM > (select an app) > Monitoring > JVMs > (select a JVM). From the selected JVM's Memory page, use any of New Relic's standard user interface functions to drill down into detailed information. To view other metrics, select any available tab. Optional" + "title": "New Relic One CLI common commands", + "sections": "New Relic One CLI common commands", + "info": "An overview of common commands you can use with the New Relic One CLI.", + "body": " (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command" }, - "id": "5d0cc4704bb81c5bd3fc43e3" + "id": "5f28bd6ae7b9d267996ade94" } ], - "/build-apps/publish-deploy": [ + "/explore-docs/nr1-plugins": [ { - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", "type": "developer", "document_type": "page", "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "sections": [ "New Relic One CLI reference", "Installing the New Relic One CLI", + "Tip", "New Relic One CLI Commands", "Get started", "Configure your CLI preferences", @@ -4657,20 +4701,20 @@ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-14T01:47:13Z", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-18T01:50:36Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.24461772, + "_score": 0.7391757, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI reference", - "sections": "New Relic One CLI reference", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "tags": "New Relic One app", - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use" + "title": "New Relic One CLI reference", + "sections": "New Relic One CLI Commands", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": " extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions" }, "id": "5efa989e28ccbc535a307dd0" }, @@ -4691,20 +4735,20 @@ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", "image": "", "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-08-17T01:54:02Z", + "published_at": "2020-08-18T02:11:50Z", "updated_at": "2020-08-14T01:47:12Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.05032166, + "_score": 0.30295157, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic CLI Reference", - "sections": "New Relic CLI Reference", - "info": "The command line tools for performing tasks against New Relic APIs", - "tags": "new relic cli", - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" + "title": "New Relic CLI Reference", + "sections": "New Relic CLI commands", + "info": "The command line tools for performing tasks against New Relic APIs", + "tags": "new relic cli", + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" }, "id": "5efa989ee7b9d2024b7bab97" }, @@ -4738,118 +4782,124 @@ "external_id": "531f2f3985bf64bb0dc92a642445887095048882", "image": "", "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/", - "published_at": "2020-08-17T01:48:54Z", + "published_at": "2020-08-18T02:06:05Z", "updated_at": "2020-08-08T01:41:47Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.030473813, + "_score": 0.16104315, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Get started with the New Relic CLI", - "sections": "Create your New Relic CLI profile", - "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", - "tags": "New Relic CLI", - "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow" + "title": "Get started with the New Relic CLI", + "sections": "Get started with the New Relic CLI", + "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", + "tags": "New Relic CLI", + "body": " that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need" }, "id": "5efa999c196a67c4e1766461" }, { - "body": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application. In this guide, you are going to build a sample table using various New Relic One components. Before you begin If you haven't already installed the New Relic One CLI, step through the quick start in New Relic One. This process also gets you an API key. In addition, to complete the steps in this guide, you need a GitHub account, and to have Node.js installed on your machine. See [Setting up your development environment](/build-apps/set-up-dev-env) for more info. Clone and set up the example application Step 1 of 4 Clone the nr1-how-to example application from GitHub to your local machine. Then, navigate to the app directory. The example app lets you experiment with tables. git clone https://github.com/newrelic/nr1-how-to.git` cd nr1-how-to/create-a-table/nerdlets/create-a-table-nerdlet` Copy Step 2 of 4 Edit the index.json file and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install dependencies nr1 nerdpack:serve # Serve the demo app locally Copy Step 4 of 4 Open one.newrelic.com/?nerdpacks=local in your browser. Click Apps*, and then in the Other apps section, you should see a Create a table** launcher. That's the demo application you're going to work on. Go ahead and select it. Have a good look at the demo app. There's a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You'll use Table components to add a new table in the second row. Work with table components Step 1 of 10 Navigate to the `nerdlets/create-a-table-nerdlet` subdirectory and open the `index.js` file. Add the following components to the import statement at the top of the file so that it looks like the example: Table TableHeader TableHeaderCell TableRow TableRowCell import { Table, TableHeader, TableHeaderCell, TableRow, TableRowCell, PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart, } from 'nr1'; Copy Step 2 of 10 Add a basic Table component Locate the empty GridItem in index.js: This is where you start building the table. Add the initial component. The items property collects the data by calling _getItems(), which contains sample values.
; Copy Step 3 of 10 Add the header and rows As the Table component renders a fixed number of header cells and rows, your next step is adding header components, as well as a function that returns the required table rows. Inside of the Table component, add the TableHeader and then a TableHeaderCell child for each heading. Since you don't know how many rows you'll need, your best bet is to call a function to build as many TableRows as items returned by _getItems(). Application Size Company Team Commit ; { ({ item }) => ( {item.name} {item.value} {item.company} {item.team} {item.commit} ); } Copy Step 4 of 10 Take a look at the application running in New Relic One: you should see something similar to the screenshot below. Step 5 of 10 Replace standard table cells with smart cells The New Relic One library includes cell components that can automatically format certain data types, like users, metrics, and entity names. The table you've just created contains columns that can benefit from those components: Application (an entity name) and Size (a metric). Before you can use EntityTitleTableRowCell and MetricTableRowCell, you have to add them to the import statement first. import { EntityTitleTableRowCell, MetricTableRowCell, ... /* All previous components */ } from 'nr1'; Copy Step 6 of 10 Update your table rows by replacing the first and second TableRowCells with entity and metric cells. Notice that EntityTitleTableRowCell and MetricTableRowCell are self-closing tags. { ({ item }) => ( {item.company} {item.team} {item.commit} ); } Copy Step 7 of 10 Time to give your table a second look: The cell components you've added take care of properly formatting the data. Step 8 of 10 Add some action to your table! Tables are great, but interactive tables can be better: As a last update, you are going to allow users to act on each data row. Add the _getActions() method to your index.js file, right before _getItems(). As you may have guessed from the code, _getActions() spawns an alert box when you click Team or Commit cells. _getActions() { return [ { label: 'Alert Team', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__ALERT, onClick: (evt, { item, index }) => { alert(`Alert Team: ${item.team}`); }, }, { label: 'Rollback Version', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__UNDO, onClick: (evt, { item, index }) => { alert(`Rollback from: ${item.commit}`); }, }, ]; } Copy Step 9 of 10 Find the TableRow component in your return statement and point the actions property to _getActions(). The TableRow actions property defines a set of actions that appear when the user hovers over a table row. Actions have a mandatory text and an onClick callback, but can also display an icon or be disabled if needed. Copy Step 10 of 10 Go back to your application and try hovering over any of the rows: Notice how the two available actions appear. When you click them, a function triggers with the selected row data as an argument, and an alert displays in your browser. Next steps You've built a table into a New Relic One application, using components to format data automatically and provide contextual actions. Well done! Keep exploring the Table components, their properties, and how to use them, in our SDK documentation.", + "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", "type": "developer", "document_type": "page", - "info": "Add a table to your New Relic One app.", + "info": "Build a \"Hello, World!\" app and publish it to New Relic One", "sections": [ - "Add tables to your New Relic One application", + "Create a \"Hello, World!\" application", "Before you begin", - "Clone and set up the example application", - "Work with table components", - "Next steps" + "Tip", + "Create a local version of the \"Hello, World!\" application", + "Publish your application to New Relic", + "Add details to describe your project", + "Subscribe accounts to your application", + "Summary", + "Related information" ], - "title": "Add tables to your New Relic One application", + "title": "Create a \"Hello, World!\" application", "popularity": 1, - "external_id": "7ff7a8426eb1758a08ec360835d9085fae829936", - "image": "https://developer.newrelic.com/static/e637c7eb75a9dc01740db8fecc4d85bf/1d6ec/table-new-cells.png", - "url": "https://developer.newrelic.com/build-apps/howto-use-nrone-table-components/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-14T01:46:10Z", + "tags": [ + "nr1 cli", + "Nerdpack file structure", + "NR One Catalog", + "Subscribe applications" + ], + "external_id": "aa427030169067481fb69a3560798265b6b52b7c", + "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png", + "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/", + "published_at": "2020-08-18T02:09:27Z", + "updated_at": "2020-08-18T01:45:02Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.003915376, + "_score": 0.075089455, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Add tables to your New Relic One application", - "sections": "Add tables to your New Relic One application", - "info": "Add a table to your New Relic One app.", - "body": "-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update" + "sections": "Publish your application to New Relic", + "info": "Build a "Hello, World!" app and publish it to New Relic One", + "tags": "nr1 cli", + "body": ", you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already" }, - "id": "5efa989ee7b9d2ad567bab51" + "id": "5efa9973196a67d16d76645c" }, { - "body": "For accounts on our New Relic One pricing plan, this document explains: How to add and manage users User types and user groups This doc is for accounts on our New Relic One pricing plan. If you're on our original product-based pricing plan, see Original user roles. Not sure which you're on? See Overview of pricing and account/user structure. Manage users Here are some important user management tips to remember and share with your team members: Basic users, who are free users, can self-serve to become billable full users. A New Relic user can have a maximum of either three concurrent active sessions, or three unique IP addresses in use at any given time. To manage users: from one.newrelic.com, select Apps from the top navigation, and then select User management. User type For accounts on the New Relic One pricing plan, the user type determines the monitoring and analysis features a user has access to. (Note that this does not control account admin-related permissions; that's determined by the user group.) User types include: Basic user: These users are free and have access to basic features like setting up reporting of data to New Relic, running queries of your data, making custom charts and dashboards, and setting up alert notifications. These users do not have access to Full-Stack Observability features. For details, see the capability table below. Full user: These users have access to Full-Stack Observability features, including our curated UI experiences for APM, infrastructure monitoring, browser monitoring, mobile monitoring, and synthetic monitors. The Standard pricing tier includes one full user. For details, see the capability table below. The number of full users is not the only pricing factor: Learn more about pricing. For details about full user and basic user capabilities, expand this collapser: Capabilities for full users vs. basic users Below are some important differences between basic user and full user capabilities. In short, basic users have access to our Telemetry Data Platform and Applied Intelligence (read-only) features, while full users have access to that plus Full-Stack Observability features. Features Full user Basic user Full-Stack Observability (New Relic-built UI experiences) Application performance monitoring (APM) UI fa-check Infrastructure monitoring UI fa-check Digital Experience Monitoring (Browser, Mobile, Synthetics) UI fa-check Serverless monitoring UI fa-check Logs in context with other UI experiences fa-check Synthetics checks fa-check New Relic Edge with Infinite Tracing (tail-based sampling) fa-check (Pro and Enterprise) Subscribe to New Relic One catalog apps fa-check Applied Intelligence (AI) Proactive Detection fa-check fa-check (read-only) Incident Intelligence fa-check fa-check (read-only) Telemetry Data Platform Data ingest from any source (Metrics, Events, Logs, Traces) fa-check fa-check Alerts and notifications fa-check fa-check Interactive query interface fa-check fa-check Custom charts and dashboards (not New Relic-built) fa-check fa-check Encryption at rest fa-check fa-check Standard data retention fa-check fa-check NerdGraph (GraphQL) API fa-check fa-check Security and compliance fa-check fa-check Integrations fa-check fa-check Data management fa-check fa-check Logs UI fa-check fa-check Build custom New Relic One apps fa-check fa-check User group When full users (not basic users) are added, there are additional choices related to account administration. For the Standard pricing tier, the two user groups available are: Admin: Adding someone to the Admin group gives them configuration and administrative abilities like adding/editing users, editing account and billing settings, and configuring some settings. User: Adding someone to the User group allows them to use and configure features but not manage users or billing. Coming soon: Pro and Enterprise tiers include additional admin functionalities and group-related features. Capability limitations There are some temporary limitations for users on the newer model, mainly around API access. For details, see Limitations. Query usage data See Query usage data. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / New Relic accounts / Accounts and billing / New Relic One pricing and users", - "info": "For New Relic accounts on our New Relic One pricing plan, an explanation of user roles. ", - "nodeid": 39356, + "info": "An overview of common commands you can use with the New Relic One CLI.", "sections": [ - "Accounts and billing", - "Account setup", - "Account structure", - "New Relic One pricing and users", - "General account settings", - "Automated user management", - "SAML single sign on", - "Partner install", - "New Relic One users and roles", - "Manage users", - "User type", - "User group", - "Capability limitations", - "Query usage data", - "For more help" + "New Relic One CLI common commands", + "Command details", + "nr1 help", + "See commands and get details", + "Usage", + "Arguments", + "Examples", + "nr1 update", + "Update your CLI", + "nr1 create", + "Create a new component", + "Options", + "nr1 profiles", + "Manage your profiles keychain", + "Commands", + "nr1 autocomplete", + "See autocomplete installation instructions", + "nr1 nrql", + "Query using NRQL" ], - "title": "New Relic One users and roles ", + "title": "New Relic One CLI common commands", "popularity": 1, - "external_id": "6b424e8f440119aa9d9529ef1cf91fac524e2991", - "category_1": "Accounts and billing", - "category_2": "New Relic One pricing and users", + "external_id": "503e515e1095418f8d19329517344ab209d143a4", "image": "", - "url": "https://docs.newrelic.com/docs/accounts/accounts-billing/new-relic-one-pricing-users/users-roles", - "published_at": "2020-08-15T05:13:24Z", - "updated_at": "2020-08-15T05:13:24Z", - "category_0": "New Relic accounts", + "url": "https://developer.newrelic.com/explore-docs/nr1-common/", + "published_at": "2020-08-18T02:06:04Z", + "updated_at": "2020-08-14T01:48:10Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0035070367, + "_score": 0.018434381, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One users and roles ", - "sections": "New Relic One pricing and users", - "info": "For New Relic accounts on our New Relic One pricing plan, an explanation of user roles. ", - "category_0": "New Relic accounts", - "category_1": "Accounts and billing", - "category_2": "New Relic One pricing and users", - "body": " Overview of pricing and account/user structure. Manage users Here are some important user management tips to remember and share with your team members: Basic users, who are free users, can self-serve to become billable full users. A New Relic user can have a maximum of either three concurrent active", - "breadcrumb": "Contents / New Relic accounts / Accounts and billing / New Relic One pricing and users" + "title": "New Relic One CLI common commands", + "sections": "New Relic One CLI common commands", + "info": "An overview of common commands you can use with the New Relic One CLI.", + "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1" }, - "id": "5f22d159196a67f322b53d0a" + "id": "5f28bd6ae7b9d267996ade94" } ], - "/build-apps/howto-use-nrone-table-components": [ + "/explore-docs/nr1-common": [ { - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", "type": "developer", "document_type": "page", "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "sections": [ "New Relic One CLI reference", "Installing the New Relic One CLI", + "Tip", "New Relic One CLI Commands", "Get started", "Configure your CLI preferences", @@ -4867,20 +4917,20 @@ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-14T01:47:13Z", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-18T01:50:36Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.2861644, + "_score": 0.73570365, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI reference", - "sections": "New Relic One CLI reference", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "title": "New Relic One CLI reference", + "sections": "New Relic One CLI Commands", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "tags": "New Relic One app", - "body": " your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first "Hello World" app, and serve it locally. New Relic One CLI Commands" + "body": " extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions" }, "id": "5efa989e28ccbc535a307dd0" }, @@ -4901,20 +4951,20 @@ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", "image": "", "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-08-17T01:54:02Z", + "published_at": "2020-08-18T02:11:50Z", "updated_at": "2020-08-14T01:47:12Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.065418236, + "_score": 0.3024054, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic CLI Reference", - "sections": "New Relic CLI Reference", - "info": "The command line tools for performing tasks against New Relic APIs", - "tags": "new relic cli", - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" + "title": "New Relic CLI Reference", + "sections": "New Relic CLI commands", + "info": "The command line tools for performing tasks against New Relic APIs", + "tags": "new relic cli", + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" }, "id": "5efa989ee7b9d2024b7bab97" }, @@ -4948,31 +4998,32 @@ "external_id": "531f2f3985bf64bb0dc92a642445887095048882", "image": "", "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/", - "published_at": "2020-08-17T01:48:54Z", + "published_at": "2020-08-18T02:06:05Z", "updated_at": "2020-08-08T01:41:47Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.033431657, + "_score": 0.16154054, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Get started with the New Relic CLI", - "sections": "Add a simple tag to your application", - "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", - "tags": "New Relic CLI", - "body": " of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied" + "title": "Get started with the New Relic CLI", + "sections": "Get started with the New Relic CLI", + "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", + "tags": "New Relic CLI", + "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow" }, "id": "5efa999c196a67c4e1766461" }, { - "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", + "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", "type": "developer", "document_type": "page", "info": "Build a \"Hello, World!\" app and publish it to New Relic One", "sections": [ "Create a \"Hello, World!\" application", "Before you begin", + "Tip", "Create a local version of the \"Hello, World!\" application", "Publish your application to New Relic", "Add details to describe your project", @@ -4991,291 +5042,292 @@ "external_id": "aa427030169067481fb69a3560798265b6b52b7c", "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png", "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/", - "published_at": "2020-08-17T01:55:14Z", - "updated_at": "2020-08-14T01:45:09Z", + "published_at": "2020-08-18T02:09:27Z", + "updated_at": "2020-08-18T01:45:02Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.020947356, + "_score": 0.074954085, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Create a "Hello, World!" application", - "sections": "Publish your application to New Relic", - "info": "Build a "Hello, World!" app and publish it to New Relic One", - "tags": "Subscribe applications", - "body": " information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project" + "sections": "Publish your application to New Relic", + "info": "Build a "Hello, World!" app and publish it to New Relic One", + "tags": "nr1 cli", + "body": ", you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already" }, "id": "5efa9973196a67d16d76645c" }, { - "body": "Serve, publish, and deploy your New Relic One app 20 min When you build a New Relic One app, chances are you'll want to share it with others in your organization. You might even want to share it through our open source channel. But first, you probably want to try it out locally to make sure it's working properly. The following sections describe how to serve your app locally, add it to New Relic One, and then share it with coworkers. Serve it locally: During development, you can serve it locally to test it out. Publish it: When your application is ready for the world, you can publish and deploy it, and subscribe accounts to it. Before you begin This guide requires the following: A New Relic One app or Nerdpack New Relic One CLI The Nerdpack manager role for publishing, deploying, and subscribing apps. About permissions The Nerdpack manager role is a New Relic add-on role. When you create a Nerdpack, you have the Nerdpack manager role for handling that Nerdpack. New Relic account administrators or owners have the Nerdpack manager role automatically, and can subscribe their accounts to Nerdpacks available to that acount. You can learn about permissions related to managing applications in the product documentation. About versions New Relic One requires that only one version (following semantic versioning) of a Nerdpack can be published. Thus, the nr1 nerdpack:publish command requires the following: The Nerdpack manager role A unique version as specified in the version attribute found in the app's package.json. Step 1 of 4 Serve your app locally While developing your application, you can locally serve the Nerdpack, which will display it in New Relic One. In the parent root folder of your Nerdpack, run nr1 nerdpack:serve. Go to one.newrelic.com/?nerdpacks=local. The ?nerdpacks=local URL suffix will load any locally served Nerdpacks that are available. When you make a change to a locally served Nerdpack, New Relic One will automatically reload it. Step 2 of 4 Publish Publishing places your Nerdpack in New Relic One. To publish or deploy, you must be a Nerdpack manager. To publish your Nerdpack, run nr1 nerdpack:publish. Step 3 of 4 Deploy Deploying is applying a Nerdpack version to a specific channel (for example, BETA, or STABLE). A channel can only have one Nerdpack version deployed to it at one time. If a channel has an existing Nerdpack associated with it, deploying a new Nerdpack version to that channel will undeploy the previous one. Channels are meant to be an easier way to control application version access than having to be concerned with many specific version numbers. To deploy an application, run nr1 nerdpack:deploy. Step 4 of 4 Subscribe You provide access to the Nerdpacks you create (or manage) by subscribing accounts to them. When you publish and deploy your application, it’s available to you in the New Relic One catalog. Use the catalog to manage the information that you want to share about your application, as well as how it appears on the Apps page. Subscribe accounts to your applications with the catalog too. For information about subscribing, see Discover and manage applications with New Relic One catalog.", + "body": "New Relic One CLI plugin commands To install and manage your plugins, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Command details nr1 plugins:install Install a plugin Installs a plugin into the CLI. You can install plugins from npm or a Git URL. Please note that installing a plugin will override the core plugin. For example, if you have a core plugin that has a 'hello' command, then installing a plugin with a 'hello' command will override the core plugin implementation. This is useful if you want to update the core plugin functionality without patching and updating the whole CLI. Usage $ nr1 plugins:install PLUGIN Arguments PLUGIN: the name, path, or URL of the plugin you want to install. required Options -f, --force Runs yarn install --force. This forces a re-download of all the plugin's packages. -h, --help Shows CLI help. --verbose Adds extra information to the output. Examples $ nr1 plugins:install myplugin $ nr1 plugins:install https://github.com/someuser/someplugin $ nr1 plugins:install someuser/someplugin Aliases $ nr1 plugins:add nr1 plugins:link Link your plugin Links a local plugin into the CLI for development. Please note that linking a plugin will override your user-installed plugin or core plugin. For example, if you have a user-installed or core plugin that has a 'hello' command, linking a plugin with a 'hello' command will override the user-installed or core plugin implementation. This is useful for development work. Usage $ nr1 plugins:link PLUGIN Arguments PLUGIN: the name, path, or URL of the plugin you want to link. required Options -h, --help Shows CLI help. --verbose Adds extra information to the output. Examples $ nr1 plugins:link myplugin $ nr1 plugins:link someuser/someplugin nr1 plugins:update Update your plugins Updates all of your installed plugins. Usage $ nr1 plugins:update Options -h, --help Shows CLI help. --verbose Adds extra information to the output. nr1 plugins:uninstall Uninstall your plugin Removes a plugin from the CLI. Usage $ nr1 plugins:uninstall PLUGIN Arguments PLUGIN: the name of the plugin you want to uninstall. required Options -h, --help Shows CLI help. --verbose Adds extra information to the output. Aliases $ nr1 plugins:unlink $ nr1 plugins:remove", "type": "developer", "document_type": "page", - "info": "Start sharing and using the custom New Relic One apps you build.", + "info": "An overview of the CLI commands you can use to install and manage your plugins.", "sections": [ - "Serve, publish, and deploy your New Relic One app", - "Before you begin", - "About permissions", - "About versions", - "Serve your app locally", - "Publish", - "Deploy", - "Subscribe" + "New Relic One CLI plugin commands", + "Command details", + "nr1 plugins:install", + "Install a plugin", + "Usage", + "Arguments", + "Options", + "Examples", + "Aliases", + "nr1 plugins:link", + "Link your plugin", + "nr1 plugins:update", + "Update your plugins", + "nr1 plugins:uninstall", + "Uninstall your plugin" ], - "title": "Serve, publish, and deploy your New Relic One app", + "title": "New Relic One CLI plugin commands", "popularity": 1, - "external_id": "63283ee8efdfa419b6a69cb8bd135d4bc2188d2c", + "external_id": "6e94c2de165c2b01c2b15c9297a7314f1895112e", "image": "", - "url": "https://developer.newrelic.com/build-apps/publish-deploy/", - "published_at": "2020-08-17T01:48:54Z", - "updated_at": "2020-08-14T01:46:11Z", + "url": "https://developer.newrelic.com/explore-docs/nr1-plugins/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-14T01:50:34Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0045969947, + "_score": 0.016611477, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Serve, publish, and deploy your New Relic One app", - "sections": "Serve, publish, and deploy your New Relic One app", - "info": "Start sharing and using the custom New Relic One apps you build.", - "body": " working properly. The following sections describe how to serve your app locally, add it to New Relic One, and then share it with coworkers. Serve it locally: During development, you can serve it locally to test it out. Publish it: When your application is ready for the world, you can publish" + "title": "New Relic One CLI plugin commands", + "sections": "New Relic One CLI plugin commands", + "info": "An overview of the CLI commands you can use to install and manage your plugins.", + "body": "New Relic One CLI plugin commands To install and manage your plugins, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin" }, - "id": "5efa999de7b9d283e67bab8f" + "id": "5f28bd6a196a670ddd19d000" } ], - "/explore-docs/query-and-store-data": [ + "/explore-docs/nr1-config": [ { - "body": "Query data with NRQL 10 min With NRQL, you can query any of the default event data being reported by New Relic, plus any custom events and attributes you’ve added. Step 1 of 4 NRQL syntax is comparable to ANSI SQL. Learn more about NRQL syntax SELECT function(attribute) [AS 'label'][, ...] FROM event [WHERE attribute [comparison] [AND|OR ...]][AS 'label'][, ...] [FACET attribute | function(attribute)] [LIMIT number] [SINCE time] [UNTIL time] [WITH TIMEZONE timezone] [COMPARE WITH time] [TIMESERIES time] Copy Step 2 of 4 NRQL queries can be as simple as fetching rows of data in a raw tabular form to inspect individual events. Learn what events open source agents provide out of the box -- Fetch a list of Browser PageView events SELECT * FROM PageView Copy Step 3 of 4 NRQL queries can also do extremely powerful calculations before the data is presented to you, such as crafting funnels based on the way people actually use your website. Learn more about NRQL funnels -- See how many users visit, signup, browse and purchase from your site as a funnel SELECT funnel(session, WHERE pageUrl='http://www.demotron.com/' AS 'Visited Homepage', WHERE pageUrl='http://www.demotron.com/signup' AS 'Signed Up', WHERE pageUrl='http://www.demotron.com/browse' AS 'Browsed Items', WHERE pageUrl='http://www.demotron.com/checkout' AS 'Made Purchase') FROM PageView SINCE 12 hours ago Copy Step 4 of 4 Using NRQL, you can customize your New Relic experience by crafting diverse dashboards that show your data from multiple angles. You can share these dashboards with technical and non-technical stakeholders alike. Learn more and start building Documentation For an overview of NRQL syntax, see Introduction to NRQL. For a detailed description of all available functions, see NRQL syntax, components, and functions. NRU Tutorials To learn how to query and narrow a large data store by a specific parameter, watch the tutorial on Filtering queries with NRQL. Community forum Connect with other developers in the our Explorers Hub. GitHub For examples of integrations and other technologies, check us out on GitHub.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", "type": "developer", "document_type": "page", - "info": "Query default event data as well as custom events and attributes with our powerful, SQL-like query language. Start querying now.", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "sections": [ - "Query data with NRQL", - "Learn more and start building", - "Documentation", - "NRU Tutorials", - "Community forum", - "GitHub" + "New Relic One CLI reference", + "Installing the New Relic One CLI", + "Tip", + "New Relic One CLI Commands", + "Get started", + "Configure your CLI preferences", + "Set up your Nerdpacks", + "Manage your Nerdpack subscriptions", + "Install and manage plugins", + "Manage catalog information" ], - "title": "Query data with NRQL", + "title": "New Relic One CLI reference", "popularity": 1, - "external_id": "7bb23b086badd7a572964357aad776116f5bfbbe", - "image": "https://developer.newrelic.com/static/eb2adf50e7680e8ba5b7daaf06c203d1/757a2/nr1-dashboard.png", - "url": "https://developer.newrelic.com/collect-data/query-data-nrql/", - "published_at": "2020-08-17T01:48:54Z", - "updated_at": "2020-08-14T01:46:10Z", + "tags": [ + "New Relic One app", + "nerdpack commands" + ], + "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", + "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", + "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-18T01:50:36Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.053592846, + "_score": 0.7390982, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Query data with NRQL", - "sections": "Query data with NRQL", - "info": "Query default event data as well as custom events and attributes with our powerful, SQL-like query language. Start querying now.", - "body": ", and functions. NRU Tutorials To learn how to query and narrow a large data store by a specific parameter, watch the tutorial on Filtering queries with NRQL. Community forum Connect with other developers in the our Explorers Hub. GitHub For examples of integrations and other technologies, check us out on GitHub." + "title": "New Relic One CLI reference", + "sections": "New Relic One CLI Commands", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": " extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions" }, - "id": "5efa999ce7b9d29f377bab69" + "id": "5efa989e28ccbc535a307dd0" }, { - "body": "Add, query, and mutate data using NerdStorage 45 min NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. Using NerdStorage, you can create individual documents of up to 64kb in size, create different collections of documents, and store data by entity, account, or user level. This guide explains how to add data and documents to NerdStorage. For an introduction to what NerdStorage is and how it works, see Intro to NerdStorage. Before you begin This guide requires that you have an API key and the New Relic One CLI as described in Set up your development environment. Get started First, get the NerdStorage app running successfully inside New Relic One. Step 1 of 3 Clone the example applications from the GitHub repo. Step 2 of 3 Use the New Relic One CLI to update the application UUID and run the application locally. In the terminal, switch to the /nr1-how-to/use-nerdstorage directory: cd / nr1 - how - to / use - nerdstorage; Copy Update the UUID and serve the application: nr1 nerdpack:uuid -gf nr1 nerdpack:serve Copy Step 3 of 3 Once the app is successfully served, your terminal will return the URL to view your running application on New Relic One. Load the URL. Click Apps and under Other apps you'll see the Use Nerdstorage app listed. Click to launch the app. Add data to NerdStorage Once the app is up and running on New Relic One, you can prepare the app and start adding data. On the How To Use NerdStorage app screen, there's a Saved to NerdStorage pane with a field for adding data. However, if you type something you'll get an error message. This is because you need to be set up to store data at the User level. You can do this with the help of the UserStorageMutation component. Step 1 of 3 Open the application’s ./nerdlets/use-nerdstorage-nerdlet/index.js file in the text editor of your choice and find the code for the TextField and Button used to enter data. The Button onClick prop makes a call to a helper method called _addToNerdStorage, and you need to update it to add UserStorageMutation The UserStorage NerdStorage components require a collection and documentId. In the constructor method in the application’s index.js file, you can see the variables being provided. In the .js file, it will look something like this: constructor(props) { super(props) this.collectionId = 'mycollection'; this.documentId = 'learning-nerdstorage'; this.state = { isOpen: true, storage: [], text: '', }; this._addToNerdStorage = this._addToNerdStorage.bind(this); this._removeFromNerdStorage = this._removeFromNerdStorage.bind(this); this._deleteDocument = this._deleteDocument.bind(this); } Copy Step 2 of 3 Import the UserStorageMutation by adding it to your import statement at the top of the index.js file: import { UserStorageMutation } from 'nr1'; Copy Then update the helper with this code beginning with _addToNerdStorage: _addToNerdStorage(){ const { text, storage } = this.state; storage.push(text); this.setState({storage}, () => { UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.WRITE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, document: { storage }, }) .then((res) => { this.setState({text: ''}); Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.NORMAL }); }) .catch((err) => console.log(err)); }); } Copy Step 3 of 3 Return to your running How To Use NerdStorage app screen on New Relic One and reload the page. Add some text in the text entry field and click the check button. This will update NerdStorage and trigger a Toast notification inside the app. You should then see the text you typed displayed as a table row below the text entry field. Query data from NerdStorage Once you get data storage working as described in the section above, you also need to get the app properly reading data from NerdStorage, or the app will reload with an empty state every time you navigate away from the app page and back. To do this, add the UserStorageQuery component and update the componentDidMount method. Step 1 of 3 Import the UserStorageQuery by adding it to the import statement in the application’s ./nerdlets/use-nerdstorage-nerdlet/index.js file. import { UserStorageMutation, UserStorageQuery } from 'nr1'; Copy Step 2 of 3 Then, add the following componentDidMount method to your application: componentDidMount(){ UserStorageQuery.query({ collection: this.collectionId, documentId: this.documentId, }) .then(({ data }) => { if(data !== null) { this.setState({storage: data.storage}); } }) .catch(err => console.log(err)); } Copy Step 3 of 3 Back inside the NerdStorage app, test your changes by adding a few more rows using the text entry field. Then exit and relaunch the application. The application should load and show all the data you entered before you navigated away. Mutate data in NerdStorage Each NerdStorage entry displayed in the table inside the app has a trash button that can be used to update a specific entry. The trash button works by making a call to the _removeFromNerdStorage helper method. Step 1 of 1 To get this process working, update the code in _removeFromNerdStorage: _removeFromNerdStorage(index, data){ const { storage } = this.state; storage.pop(data); this.setState({storage}, () => { UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.WRITE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, document: { storage }, }) .then((res) => { Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.NORMAL }); }) .catch((err) => console.log(err)); }); } Copy Once you do this, clicking the trash button removes the item it's associated with, and the app updates to show the change. Delete collection from NerdStorage While the trash button is a good method for removing specific entries one at a time, you may also want the ability to delete a whole NerdStorage document at once. You can do this by adding the Delete Document button to your app. Step 1 of 2 Add a new GridItem to the application immediately before the closing Grid tag. In the new GridItem add the following code to display your new button: ; Copy Step 2 of 2 Because the new Delete Document button will be calling the _deleteDocument helper method, you'll need to update that using this code: _deleteDocument(){ this.setState({storage: []}); UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.DELETE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, }); Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.CRITICAL }); } Copy Back inside the application, you should now see both the individual trash buttons and the newly added Delete Document button. Next steps Now that you’ve successfully implemented NerdStorage into a New Relic One application, you can store and mutate data connected to your User. For more information on the various NerdStorage components, please visit the New Relic developer website API documentation.", + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", "type": "developer", "document_type": "page", - "info": "NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next.", + "info": "The command line tools for performing tasks against New Relic APIs", "sections": [ - "Add, query, and mutate data using NerdStorage", - "Before you begin", - "Get started", - "Add data to NerdStorage", - "Query data from NerdStorage", - "Mutate data in NerdStorage", - "Delete collection from NerdStorage", - "Next steps" + "New Relic CLI Reference", + "New Relic CLI commands", + "Options", + "Commands" ], - "title": "Add, query, and mutate data using NerdStorage", + "title": "New Relic CLI Reference", "popularity": 1, - "external_id": "97cc9637edea35ecd68683f1010f67a5f8c79038", - "image": "https://developer.newrelic.com/static/e03456a7ed8556f83bd3329ea38b261d/8f217/add-data-NerdStorage.png", - "url": "https://developer.newrelic.com/build-apps/add-query-mutate-data-nerdstorage/", - "published_at": "2020-08-17T01:48:54Z", - "updated_at": "2020-08-14T01:50:34Z", + "tags": "new relic cli", + "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", + "image": "", + "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", + "published_at": "2020-08-18T02:11:50Z", + "updated_at": "2020-08-14T01:47:12Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.009609592, + "_score": 0.30471438, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Add, query, and mutate data using NerdStorage", - "sections": "Add, query, and mutate data using NerdStorage", - "info": "NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next.", - "body": "Add, query, and mutate data using NerdStorage 45 min NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. Using NerdStorage, you can create individual documents of up to 64kb in size, create different" + "title": "New Relic CLI Reference", + "sections": "New Relic CLI commands", + "info": "The command line tools for performing tasks against New Relic APIs", + "tags": "new relic cli", + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" }, - "id": "5efa98d4e7b9d26d6b7bab74" + "id": "5efa989ee7b9d2024b7bab97" }, { - "body": "APM reports metric data in the form of metric timeslice data, and you can use NRQL to query and facet this type of data. Why query metric timeslice data? We report metrics in several ways. One variety of metric data we call metric timeslice data; this is the type of data used to generate many of the charts in APM, Mobile, and Browser (for more details, see metric timeslice data). Historically, this type of data couldn't be queried via our query language, NRQL. But now we are converting popular APM metrics from metric timeslice data to more-detailed dimensional metric data, which opens them up for querying via NRQL and via our NerdGraph API. This capability allows you to create powerful, in-depth custom visualizations of these important APM metrics. And this includes being able to query your custom metrics. Where to query? We recommend querying APM metric timeslice data using New Relic One query builder in advanced mode. This experience offers full NRQL functionality, and also gives helpful auto-complete suggestions and feedback on query errors. You can also incorporate NRQL queries in our NerdGraph (GraphQL) API. How to construct a query In APM, some charts have the option to view the NRQL query that generated that chart. This can be a good option for understanding how to query metrics. The NRQL query examined below is slightly modified from the error rate chart on the APM summary page. FROM Metric SELECT count(apm.service.error.count) / count(apm.service.transaction.duration) WHERE (entity.guid = 'AN_ENTITY_GUID') AND (transactionType = 'Web') SINCE 1 day ago TIMESERIES Here is a breakdown of how the parts of this query work: Query segment What does it do? FROM Metric Metric is one of our core data types, and metric timeslice data is stored as this data type. For general tips on querying Metric data, see Metric query examples. SELECT count(apm.service.error.count) / count(apm.service.transaction.duration) This math generates a count of errors out of a total count of transaction metrics. This query uses the converted metric names. Note that you can use other aggregator functions. WHERE (entity.guid = 'AN_ENTITY_GUID') You must specify at least one data source. You can select a single entity's GUID, as shown here, or you can select multiple sources. This query uses entity.guid, but you can also use appId or appName. AND (transactionType = 'Web') Sets the transaction type to web, meaning that background/non-web transactions won't be counted. SINCE 1 day ago Selecting a time range. TIMESERIES This optional clause displays the results in a time-based chart. For general information on NRQL syntax, including FROM, FACET, and TIMESERIES, see Intro to NRQL. For more queries, see Query examples. How metric timeslice data is converted The conversion of original APM metric timeslice metrics into dimensional metrics that are available for querying is an ongoing process and isn't complete. If you don't see a metric you're looking for in this section, see Generic queries. Here are how the original APM metric timeslice metrics are converted into dimensional metrics: Metric timeslice structure Dimensional metric structure APM metric names are represented as single strings of segments separated by forward slashes. For example, the “Datastore/statement/MySQL/users/select” metric represents the time spent in a select database operation on the users table. A single dimensional metric named apm.service.datastore.operation.duration represents the entire group of datastore metrics. This metric has three attributes representing the data values encoded into the metric name, datastoreType, table and operation: datastoreType = ‘MySQL’ table = ‘users’ operation = ‘select’ Some of the APM metrics made available as dimensional metrics: Metric name Description Attributes apm.service.cpu.usertime.utilization Time spent in user-mode code percentage apm.service.datastore.operation.duration Response time for database calls broken out by table operations datastoreType, table, operation apm.service.error.count Summary error count metrics transactionType apm.service.external.host.duration Response time for external calls broken out by external host name external.host apm.service.instance.count Count of the number of agent instances apm.service.memory.physical Process memory in MB apm.service.transaction.apdex Apdex scores per transaction transactionName, transactionType apm.service.transaction.duration Response time per transaction keyTransactionName, transactionName, transactionType apm.service.transaction.error.count Error counts per transaction keyTransactionName, transactionName, transactionType apm.service.transaction.external.duration External call response time by transaction type transactionType To understand more about the general structure of metric timeslice data, including some common examples, see Metric timeslice data. Attributes These attributes are available in addition to the metric-specific attributes listed in the APM dimensional metrics table above. Name Description appName The name of the application. appId The ID of the application. entity.guid The GUID of the application. host The host of the monitored process. host.bootId The ID of the boot of the host, if available. host.displayName The display_name of the host, if it was set in the agent. instanceName For Java APM agents, host : port metricName The name of the dimensional metric. metricTimesliceName The timeslice name of the legacy metric. Generic queries with the newrelic.timeslice.value metric For metrics that haven't been converted to dimensional metrics, or for your own custom metrics, we have a dimensional metric named newrelic.timeslice.value. We recommend using the dimensional metrics from the table above when possible. When to use newrelic.timeslice.value? Given a metric timeslice name, you can query to see if it has a converted dimensional metric equivalent with this syntax: from Metric SELECT uniques(metricName) where metricTimesliceName = 'Datastore/statement/MySQL/test/select' If the only metric name returned is newrelic.timeslice.value, you'll need to query your data using this general approach. Facet on a wildcarded metric name segment Some metric timeslice names include attribute values as segments of the metric name. For example, our APM agents report metrics by tracking the duration of external calls using this format: External/{externalHost}/all Here, {externalHost} represents the host name for the outbound network call. Here's an example of a generic newrelic.timeslice.value query of a custom metric that facets on a wildcarded metric segment: FROM Metric SELECT count(newrelic.timeslice.value) WHERE appName = 'MY APP' WITH METRIC_FORMAT 'Custom/Labels/{action}' TIMESERIES FACET action In this query, {action} creates a temporary attribute, action, which is then used by FACET action. You can use any name you want, because it's only an attribute that exists for the duration of the query. You should choose a name that does not conflict with an existing attribute name. Here's another example of a faceted wildcard query: This shows a NRQL query of metric timeslice data that facets the rate of Flask functions by the wildcarded process name. Recommended aggregator functions Recommended NRQL aggregator functions include: apdex average sum count rate uniques Query examples Some examples of querying metric timeslice data: Facet by multiple app names This query uses WHERE… IN to specify two applications and then facet by them: FROM Metric SELECT rate(count(apm.service.transaction.duration), 1 minute) as 'Web throughput' WHERE appName IN ('MY_APPLICATION', 'MY_OTHER_APPLICATION') AND (transactionType = 'Web') FACET appName TIMESERIES Throughput-per-minute rate This query displays requests-per-minute chart using the rate function: FROM Metric SELECT rate(count(apm.service.transaction.duration), 1 minute) as 'HttpDispatcher requests_per_minute' WHERE appName = 'MY_APPLICATION' AND (transactionType = 'Web') TIMESERIES SINCE 3 days ago Facet by host-related attributes This query displays a requests-per-minute chart faceted by host name: FROM Metric SELECT count(apm.service.transaction.duration) as 'HttpDispatcher requests_per_minute' WHERE appName = 'MY_APPLICATION' AND (transactionType = 'Web') TIMESERIES SINCE 3 hours ago FACET host LIMIT 20 Instead of using host, you can facet by other host-related attributes, like host.bootId. Query of average duration of a metric This queries the average duration for a metric using average: FROM Metric SELECT average(apm.service.transaction.duration) as 'HttpDispatcher average duration' WHERE appName = 'MY_APPLICATION' AND (transactionType = 'Web') TIMESERIES SINCE 3 days ago For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag⁠ (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / NRQL query tutorials", - "info": "In New Relic, you can query metric timeslice data from APM using NRQL. ", - "nodeid": 36916, + "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", "sections": [ - "NRQL: New Relic Query Language", - "Get started", - "NRQL query tools", - "NRQL query tutorials", - "Query APM metric timeslice data with NRQL", - "Why query metric timeslice data?", - "Where to query?", - "How to construct a query", - "How metric timeslice data is converted", - "Attributes", - "Generic queries with the newrelic.timeslice.value metric", - "When to use newrelic.timeslice.value?", - "Facet on a wildcarded metric name segment", - "Recommended aggregator functions", - "Query examples", - "For more help" + "Get started with the New Relic CLI", + "Before you begin", + "Install the New Relic CLI", + "Linux", + "macOS", + "Windows", + "Create your New Relic CLI profile", + "Get your application details", + "Add a simple tag to your application", + "Bonus step: Create a deployment marker", + "Next steps" ], - "title": "Query APM metric timeslice data with NRQL", + "title": "Get started with the New Relic CLI", "popularity": 1, - "external_id": "f536406572d7d2aafd2df6acd5da36a035ef82c3", - "category_1": "NRQL: New Relic Query Language", - "category_2": "NRQL query tutorials", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-one-nrql-query-metric-timeslice-data.png", - "url": "https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/nrql-query-tutorials/query-apm-metric-timeslice-data-nrql", - "published_at": "2020-08-15T03:15:39Z", - "updated_at": "2020-08-15T03:15:39Z", - "category_0": "Query your data", + "tags": [ + "api key", + "New Relic CLI", + "Tags", + "Entity", + "Deployment markers" + ], + "external_id": "531f2f3985bf64bb0dc92a642445887095048882", + "image": "", + "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/", + "published_at": "2020-08-18T02:06:05Z", + "updated_at": "2020-08-08T01:41:47Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.008607807, + "_score": 0.16224013, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Query APM metric timeslice data with NRQL", - "sections": "Query APM metric timeslice data with NRQL", - "info": "In New Relic, you can query metric timeslice data from APM using NRQL. ", - "category_0": "Query your data", - "category_1": "NRQL: New Relic Query Language", - "category_2": "NRQL query tutorials", - "body": "APM reports metric data in the form of metric timeslice data, and you can use NRQL to query and facet this type of data. Why query metric timeslice data? We report metrics in several ways. One variety of metric data we call metric timeslice data; this is the type of data used to generate many", - "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / NRQL query tutorials" + "title": "Get started with the New Relic CLI", + "sections": "Get started with the New Relic CLI", + "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", + "tags": "New Relic CLI", + "body": " that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need" }, - "id": "5f2b1349196a67379343fbcf" + "id": "5efa999c196a67c4e1766461" }, { - "body": "When metrics are reported to New Relic via the Metric API (including from integrations that use that API), the data is reported as the Metric data type and is available for querying. This document contains: How to view and query your metrics Example metric queries How to query multiple metrics with wildcards How to explore metric data Query APM metric timeslice data New Relic APM reports a specific type of data that we call metric timeslice data. For how to query that, see Query metric timeslice data. For information about other types of metrics, see Metric data types. View and query your metrics You can use NRQL to query your metric data in the New Relic One query builder or using our NerdGraph API. To query a metric, use the following query format: FROM Metric SELECT function(metric_name) WHERE attribute=value FACET attribute TIMESERIES Below are the functions supported for each metric type: Metric type Supported functions Summary count, sum, min, max, and average Count sum Gauge count, sum, min, max, average, and latest Add the names of the metrics you want to chart with the appropriate value functions in the SELECT clause. The WHERE and FACET clauses can be used with attribute values. Remember to include the keyword TIMESERIES if you want to chart the data. This example demonstrates how you could chart the CPU usage in seconds for cluster foo . This query breaks down CPU usage by container, given a count metric named container_cpu_usage_seconds_total with the attributes containerName and clusterName: FROM Metric select sum(container_cpu_usage_seconds_total) WHERE clusterName = 'foo' FACET containerName TIMESERIES If you want the CPU usage per minute (the rate of change), then you can add the rate function to the query above. FROM Metric select rate(sum(container_cpu_usage_seconds_total), 1 minute) WHERE clusterName = 'foo' FACET containerName TIMESERIES View example metric queries The previous examples demonstrate basic forms of metric queries, but NRQL can also be used to chart, explore, and analyze metric data. Chart multiple metrics Chart multiple metrics using a single query by providing a comma-separated list of metrics in the SELECT clause. For example, to chart the memory usage for a container along with the memory limit metric, use the following query: FROM Metric SELECT latest(container_memory_usage_bytes), latest(container_spec_memory_limit_bytes) WHERE containerName = 'inventory' TIMESERIES You can also do this using wildcards, as explained below. Perform mathematical operations on metric data Perform math operations on one or more metrics to compute a new, derived metric. To monitor available memory, you can calculate the percentage of available memory from the two metrics used in the previous example: FROM Metric SELECT (latest(container_spec_memory_limit_bytes) - latest(container_memory_usage_bytes)) / latest(container_spec_memory_limit_bytes) * 100 AS '% Memory Available' WHERE containerName = 'inventory' TIMESERIES You can also do this using wildcards, as explained below. Use filters to select specific time series In addition to using a WHERE clause which applies to everything in SELECT, NRQL provides another aggregation function called filter which can be used to select a specific time series to be charted or operated on. The following example charts a memory usage metric labeled \"Total (k8s)\" which is computed by adding together the memory usage of two specific containers within a pod: FROM Metric SELECT filter( latest( container_memory_usage_bytes), WHERE containerName = 'discovery') + filter( latest( container_memory_usage_bytes), WHERE containerName = 'istio-proxy') AS 'Total (k8s)' WHERE clusterName = 'my-cluster' AND podName LIKE 'istio-pilot-%' TIMESERIES View the raw metric data points When querying metric data using FROM Metric, New Relic automatically selects the specific aggregate to use in the query, depending on the length of the query window and any bucket size specified as an argument to the TIMESERIES keyword. This ensures efficient querying and chart resolution. If you want to override this behavior to view or operate on the raw metric data points, use the optional RAW keyword in your query. When querying these raw metric data points, there is a query time window limit of 48 hours. Any query attempting to access more than 48 hours of raw metric data will result in a query error. This example shows how to list the last 20 data points received for a particular metric: FROM Metric SELECT * WHERE metricName = 'container_fs_usage_bytes' LIMIT 20 RAW Query multiple metrics with wildcards Wildcards are represented in NRQL by the % character. If you want to query multiple metrics that use a standard naming convention, you can use the wildcard feature to return results for all of them without having to specify each metric name individually. Wildcards can help you: Aggregate metrics together and chart the results​ FACET results by metric name in a chart Find and chart all metrics matching a given naming convention Wildcards are particularly helpful if you later add new metrics matching an existing naming convention. By using % instead of writing out each metric name in your query, you won't have to rewrite the query when you add new metrics. Let's say you have multiple algorithms that perform a similar task. You can define the following metrics, which show the duration of the different algorithms: myNeatProcess.algorithm1.duration myNeatProcess.algorithm2.duration myNeatProcess.algorithm3.duration If used in a query, myNeatProcess.%.duration will return results for all three of the algorithms above. If you later create new algorithms named algorithm4, algorithm5, and algorithm6, the same query will return results for all six algorithms. Chart multiple metrics with wildcards You can chart multiple metrics using a single query by using wildcards (%) in the SELECT clause. For example, to query all the algorithms in the example above and plot a line on the chart for each algorithm's average duration, use the following query: FROM Metric SELECT average(myNeatProcess.%.duration) FACET metricName TIMESERIES Perform mathematical operations on metric data with wildcards You can also use wildcards to perform math operations on multiple metrics and compute a new metric. You can calculate the mean duration for all algorithms listed in the example above: FROM Metric SELECT average(myNeatProcess.%.duration) TIMESERIES You can calculate what percentage of overall runtime a single algorithm takes: FROM Metric SELECT myNeatProcess.algorithm1.duration / sum(myNeatProcess.%.duration) TIMESERIES Explore metric data The NRQL keyset and uniques functions can be used together with the metricName attribute (available on all metrics) to perform tasks like listing all the available metrics in your account or discovering the attributes available on a particular metric. List all metric names in an account FROM Metric SELECT uniques(metricName) List all metric names for a particular host FROM Metric SELECT uniques(metricName) WHERE hostname = 'host1.mycompany.com' Show the attribute keys for a specific metric FROM Metric SELECT keyset() WHERE metricName = METRIC_NAME For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / NRQL query tutorials", - "info": "How to query New Relic's Metric data type, which is reported by our Metric API and the integrations that use it. ", - "nodeid": 35956, + "info": "Build a \"Hello, World!\" app and publish it to New Relic One", "sections": [ - "NRQL: New Relic Query Language", - "Get started", - "NRQL query tools", - "NRQL query tutorials", - "Query the Metric data type", - "Query APM metric timeslice data", - "View and query your metrics", - "View example metric queries", - "Query multiple metrics with wildcards", - "Explore metric data", - "For more help" + "Create a \"Hello, World!\" application", + "Before you begin", + "Tip", + "Create a local version of the \"Hello, World!\" application", + "Publish your application to New Relic", + "Add details to describe your project", + "Subscribe accounts to your application", + "Summary", + "Related information" ], - "title": "Query the Metric data type", + "title": "Create a \"Hello, World!\" application", "popularity": 1, - "external_id": "da71db0251b27d1c4d2c9d4b8154e2a4e0c9e0c3", - "category_1": "NRQL: New Relic Query Language", - "category_2": "NRQL query tutorials", - "image": "", - "url": "https://docs.newrelic.com/docs/telemetry-data-platform/get-data/apis/query-metric-data-type", - "published_at": "2020-08-15T06:27:35Z", - "updated_at": "2020-08-03T13:34:47Z", - "category_0": "Query your data", + "tags": [ + "nr1 cli", + "Nerdpack file structure", + "NR One Catalog", + "Subscribe applications" + ], + "external_id": "aa427030169067481fb69a3560798265b6b52b7c", + "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png", + "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/", + "published_at": "2020-08-18T02:09:27Z", + "updated_at": "2020-08-18T01:45:02Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.00751458, + "_score": 0.07506929, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Query the Metric data type", - "sections": "Query the Metric data type", - "info": "How to query New Relic's Metric data type, which is reported by our Metric API and the integrations that use it. ", - "category_0": "Query your data", - "category_1": "NRQL: New Relic Query Language", - "category_2": "NRQL query tutorials", - "body": "When metrics are reported to New Relic via the Metric API (including from integrations that use that API), the data is reported as the Metric data type and is available for querying. This document contains: How to view and query your metrics Example metric queries How to query multiple metrics", - "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / NRQL query tutorials" + "sections": "Publish your application to New Relic", + "info": "Build a "Hello, World!" app and publish it to New Relic One", + "tags": "nr1 cli", + "body": ", you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already" }, - "id": "5efdd99528ccbc94fa307dca" + "id": "5efa9973196a67d16d76645c" }, { - "body": "For accounts on our New Relic One pricing plan, we provide a UI for understanding your New Relic usage and managing your data. Additionally, you can: Query your usage data to get more detail than is available in the UI Set up NRQL alert conditions to get notifications about changes in your usage. Note that account hierarchy may affect queried data. See Account structure. Data types Usage data is attached to two events: NrConsumption records usage every hour, and is the equivalent of \"real-time\" usage. Use this event to observe usage trends over time. NrMTDConsumption generates aggregate values from the NrConsumption event. Use this event to see usage or estimated cost for a billing period. Query examples Here are some examples of NRQL queries you can use to understand your month-to-date usage and potential cost beyond what you can learn from the usage UI. For attribute definitions, see Attributes. Daily usage in GBs This query totals your billable ingested data, and displays a daily value for the past three months: FROM NrConsumption SELECT sum(GigabytesIngested) WHERE productLine = 'DataPlatform' SINCE 3 months ago TIMESERIES 1 day Daily usage by source This query totals your billable ingested data, and displays a daily value for the past three months faceted by the source: FROM NrConsumption SELECT sum(GigabytesIngested) WHERE productLine = 'DataPlatform' SINCE 3 months ago FACET usageMetric TIMESERIES 1 day Month-to-date usage in GBs This query shows the amount of billable ingested data to date: FROM NrMTDConsumption SELECT latest(GigabytesIngested) WHERE productLine = 'DataPlatform' SINCE this month Month-to-date estimated cost This query shows the estimated cost of your ingested data: FROM NrMTDConsumption SELECT latest(estimatedCost) WHERE productLine = 'DataPlatform' SINCE this month Set usage alerts To help manage your billable data, you can set alerts to notify you of unexpected increases in usage. To learn about how to create alerts, see Alert workflow. When creating alert conditions, we recommend 20 minutes for the alert window value and the evaluation offset value. This will ensure it won't alert on normal gaps between usage event generation. Here are some NRQL alert condition examples. For attribute definitions, see Attributes. GigabytesIngested exceeds a fixed value This query will create an alert when your hourly usage exceeds a fixed value: FROM NrConsumption SELECT sum(GigabytesIngested) WHERE productLine = 'DataPlatform' If you have multiple sub-accounts, you may want to set threshold alerts for a specific subaccount: FROM NrConsumption SELECT sum(GigabytesIngested) WHERE productLine = 'DataPlatform' AND consumingAccountId = YOUR_SUB-ACCOUNT_ID Usage exceeds fixed threshold for GBs This query will create an alert when your usage exceeds fixed monthly threshold for GBs: FROM NrMTDConsumption SELECT latest(GigabytesIngested) WHERE productLine = 'DataPlatform' Usage exceeds fixed threshold for estimated cost This query will create an alert when your usage exceeds fixed threshold for estimated cost: FROM NrMTDConsumption SELECT latest(estimatedCost) WHERE productLine = 'DataPlatform' SINCE this month General attributes These attributes are attached to the NrMTDConsumption and NrConsumption events. Attribute Description productLine The category of usage. There are four options: DataPlatform, FullStackObservability, IncidentIntelligence, or ProactiveDetection. For more details about these categories, see New Relic platform. metric Consolidates multiple categories of usage into a single metric. Helpful when faceting by productLine. consumingAccountId ID of the New Relic account that is directly responsible for the stored events, as determined from the license key used. estimatedCost Calculates a cost estimate based on usage and metric cost. This is an estimate of costs to date, not your monthly invoice. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / New Relic accounts / Accounts and billing / New Relic One pricing and users", - "info": "How to create queries and alerts for your New Relic billing-related usage. ", - "nodeid": 39496, + "info": "An overview of common commands you can use with the New Relic One CLI.", "sections": [ - "Accounts and billing", - "Account setup", - "Account structure", - "New Relic One pricing and users", - "General account settings", - "Automated user management", - "SAML single sign on", - "Partner install", - "Query and alert on usage data", - "Data types", - "Query examples", - "Set usage alerts", - "General attributes", - "For more help" + "New Relic One CLI common commands", + "Command details", + "nr1 help", + "See commands and get details", + "Usage", + "Arguments", + "Examples", + "nr1 update", + "Update your CLI", + "nr1 create", + "Create a new component", + "Options", + "nr1 profiles", + "Manage your profiles keychain", + "Commands", + "nr1 autocomplete", + "See autocomplete installation instructions", + "nr1 nrql", + "Query using NRQL" ], - "title": "Query and alert on usage data", + "title": "New Relic One CLI common commands", "popularity": 1, - "external_id": "94429d3c0366a8dee43d771c143fc6dacf4c4e31", - "category_1": "Accounts and billing", - "category_2": "New Relic One pricing and users", + "external_id": "503e515e1095418f8d19329517344ab209d143a4", "image": "", - "url": "https://docs.newrelic.com/docs/accounts/accounts-billing/new-relic-one-pricing-users/usage-queries-alerts", - "published_at": "2020-08-15T05:15:48Z", - "updated_at": "2020-07-30T16:30:53Z", - "category_0": "New Relic accounts", + "url": "https://developer.newrelic.com/explore-docs/nr1-common/", + "published_at": "2020-08-18T02:06:04Z", + "updated_at": "2020-08-14T01:48:10Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0073477346, + "_score": 0.018429406, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Query and alert on usage data", - "sections": "Query and alert on usage data", - "info": "How to create queries and alerts for your New Relic billing-related usage. ", - "category_1": "Accounts and billing", - "category_2": "New Relic One pricing and users", - "body": "For accounts on our New Relic One pricing plan, we provide a UI for understanding your New Relic usage and managing your data. Additionally, you can: Query your usage data to get more detail than is available in the UI Set up NRQL alert conditions to get notifications about changes in your usage" + "title": "New Relic One CLI common commands", + "sections": "New Relic One CLI common commands", + "info": "An overview of common commands you can use with the New Relic One CLI.", + "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1" }, - "id": "5f22f5bd64441f0c9e2a48ea" + "id": "5f28bd6ae7b9d267996ade94" } ], - "/explore-docs/intro-to-sdk": [ + "/explore-docs/nerdstorage": [ { - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", "type": "developer", "document_type": "page", "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "sections": [ "New Relic One CLI reference", "Installing the New Relic One CLI", + "Tip", "New Relic One CLI Commands", "Get started", "Configure your CLI preferences", @@ -5293,20 +5345,20 @@ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-14T01:47:13Z", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-18T01:50:36Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.3673318, + "_score": 18.007029, "_version": null, "_explanation": null, "sort": null, "highlight": { "title": "New Relic One CLI reference", "sections": "New Relic One CLI reference", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "tags": "New Relic One app", - "body": " your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first "Hello World" app, and serve it locally. New Relic One CLI Commands" + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use" }, "id": "5efa989e28ccbc535a307dd0" }, @@ -5327,78 +5379,68 @@ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", "image": "", "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-08-17T01:54:02Z", + "published_at": "2020-08-18T02:11:50Z", "updated_at": "2020-08-14T01:47:12Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.12810501, + "_score": 1.9044049, "_version": null, "_explanation": null, "sort": null, "highlight": { "title": "New Relic CLI Reference", "sections": "New Relic CLI Reference", - "info": "The command line tools for performing tasks against New Relic APIs", + "info": "The command line tools for performing tasks against New Relic APIs", "tags": "new relic cli", - "body": " the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql" + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" }, "id": "5efa989ee7b9d2024b7bab97" }, { - "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag⁠ (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.", + "body": "Add, query, and mutate data using NerdStorage 45 min NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. Using NerdStorage, you can create individual documents of up to 64kb in size, create different collections of documents, and store data by entity, account, or user level. This guide explains how to add data and documents to NerdStorage. For an introduction to what NerdStorage is and how it works, see Intro to NerdStorage. Before you begin This guide requires that you have an API key and the New Relic One CLI as described in Set up your development environment. Get started First, get the NerdStorage app running successfully inside New Relic One. Step 1 of 3 Clone the example applications from the GitHub repo. Step 2 of 3 Use the New Relic One CLI to update the application UUID and run the application locally. In the terminal, switch to the /nr1-how-to/use-nerdstorage directory: cd / nr1 - how - to / use - nerdstorage; Copy Update the UUID and serve the application: nr1 nerdpack:uuid -gf nr1 nerdpack:serve Copy Step 3 of 3 Once the app is successfully served, your terminal will return the URL to view your running application on New Relic One. Load the URL. Click Apps and under Other apps you'll see the Use Nerdstorage app listed. Click to launch the app. Add data to NerdStorage Once the app is up and running on New Relic One, you can prepare the app and start adding data. On the How To Use NerdStorage app screen, there's a Saved to NerdStorage pane with a field for adding data. However, if you type something you'll get an error message. This is because you need to be set up to store data at the User level. You can do this with the help of the UserStorageMutation component. Step 1 of 3 Open the application’s ./nerdlets/use-nerdstorage-nerdlet/index.js file in the text editor of your choice and find the code for the TextField and Button used to enter data. The Button onClick prop makes a call to a helper method called _addToNerdStorage, and you need to update it to add UserStorageMutation The UserStorage NerdStorage components require a collection and documentId. In the constructor method in the application’s index.js file, you can see the variables being provided. In the .js file, it will look something like this: constructor(props) { super(props) this.collectionId = 'mycollection'; this.documentId = 'learning-nerdstorage'; this.state = { isOpen: true, storage: [], text: '', }; this._addToNerdStorage = this._addToNerdStorage.bind(this); this._removeFromNerdStorage = this._removeFromNerdStorage.bind(this); this._deleteDocument = this._deleteDocument.bind(this); } Copy Step 2 of 3 Import the UserStorageMutation by adding it to your import statement at the top of the index.js file: import { UserStorageMutation } from 'nr1'; Copy Then update the helper with this code beginning with _addToNerdStorage: _addToNerdStorage(){ const { text, storage } = this.state; storage.push(text); this.setState({storage}, () => { UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.WRITE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, document: { storage }, }) .then((res) => { this.setState({text: ''}); Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.NORMAL }); }) .catch((err) => console.log(err)); }); } Copy Step 3 of 3 Return to your running How To Use NerdStorage app screen on New Relic One and reload the page. Add some text in the text entry field and click the check button. This will update NerdStorage and trigger a Toast notification inside the app. You should then see the text you typed displayed as a table row below the text entry field. Query data from NerdStorage Once you get data storage working as described in the section above, you also need to get the app properly reading data from NerdStorage, or the app will reload with an empty state every time you navigate away from the app page and back. To do this, add the UserStorageQuery component and update the componentDidMount method. Step 1 of 3 Import the UserStorageQuery by adding it to the import statement in the application’s ./nerdlets/use-nerdstorage-nerdlet/index.js file. import { UserStorageMutation, UserStorageQuery } from 'nr1'; Copy Step 2 of 3 Then, add the following componentDidMount method to your application: componentDidMount(){ UserStorageQuery.query({ collection: this.collectionId, documentId: this.documentId, }) .then(({ data }) => { if(data !== null) { this.setState({storage: data.storage}); } }) .catch(err => console.log(err)); } Copy Step 3 of 3 Back inside the NerdStorage app, test your changes by adding a few more rows using the text entry field. Then exit and relaunch the application. The application should load and show all the data you entered before you navigated away. Mutate data in NerdStorage Each NerdStorage entry displayed in the table inside the app has a trash button that can be used to update a specific entry. The trash button works by making a call to the _removeFromNerdStorage helper method. Step 1 of 1 To get this process working, update the code in _removeFromNerdStorage: _removeFromNerdStorage(index, data){ const { storage } = this.state; storage.pop(data); this.setState({storage}, () => { UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.WRITE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, document: { storage }, }) .then((res) => { Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.NORMAL }); }) .catch((err) => console.log(err)); }); } Copy Once you do this, clicking the trash button removes the item it's associated with, and the app updates to show the change. Delete collection from NerdStorage While the trash button is a good method for removing specific entries one at a time, you may also want the ability to delete a whole NerdStorage document at once. You can do this by adding the Delete Document button to your app. Step 1 of 2 Add a new GridItem to the application immediately before the closing Grid tag. In the new GridItem add the following code to display your new button: ; Copy Step 2 of 2 Because the new Delete Document button will be calling the _deleteDocument helper method, you'll need to update that using this code: _deleteDocument(){ this.setState({storage: []}); UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.DELETE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, }); Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.CRITICAL }); } Copy Back inside the application, you should now see both the individual trash buttons and the newly added Delete Document button. Next steps Now that you’ve successfully implemented NerdStorage into a New Relic One application, you can store and mutate data connected to your User. For more information on the various NerdStorage components, please visit the New Relic developer website API documentation.", "type": "developer", "document_type": "page", - "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", + "info": "NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next.", "sections": [ - "Get started with the New Relic CLI", + "Add, query, and mutate data using NerdStorage", "Before you begin", - "Install the New Relic CLI", - "Linux", - "macOS", - "Windows", - "Create your New Relic CLI profile", - "Get your application details", - "Add a simple tag to your application", - "Bonus step: Create a deployment marker", + "Get started", + "Add data to NerdStorage", + "Query data from NerdStorage", + "Mutate data in NerdStorage", + "Delete collection from NerdStorage", "Next steps" ], - "title": "Get started with the New Relic CLI", + "title": "Add, query, and mutate data using NerdStorage", "popularity": 1, - "tags": [ - "api key", - "New Relic CLI", - "Tags", - "Entity", - "Deployment markers" - ], - "external_id": "531f2f3985bf64bb0dc92a642445887095048882", - "image": "", - "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/", - "published_at": "2020-08-17T01:48:54Z", - "updated_at": "2020-08-08T01:41:47Z", + "external_id": "97cc9637edea35ecd68683f1010f67a5f8c79038", + "image": "https://developer.newrelic.com/static/e03456a7ed8556f83bd3329ea38b261d/8f217/add-data-NerdStorage.png", + "url": "https://developer.newrelic.com/build-apps/add-query-mutate-data-nerdstorage/", + "published_at": "2020-08-18T02:11:50Z", + "updated_at": "2020-08-14T01:50:34Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.11855291, + "_score": 0.78831506, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Get started with the New Relic CLI", - "sections": "Get started with the New Relic CLI", - "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", - "tags": "New Relic CLI", - "body": ". This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your" + "title": "Add, query, and mutate data using NerdStorage", + "sections": "Add, query, and mutate data using NerdStorage", + "info": "NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next.", + "body": " will return the URL to view your running application on New Relic One. Load the URL. Click Apps and under Other apps you'll see the Use Nerdstorage app listed. Click to launch the app. Add data to NerdStorage Once the app is up and running on New Relic One, you can prepare the app and start adding data" }, - "id": "5efa999c196a67c4e1766461" + "id": "5efa98d4e7b9d26d6b7bab74" }, { - "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", + "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", "type": "developer", "document_type": "page", "info": "Build a \"Hello, World!\" app and publish it to New Relic One", "sections": [ "Create a \"Hello, World!\" application", "Before you begin", + "Tip", "Create a local version of the \"Hello, World!\" application", "Publish your application to New Relic", "Add details to describe your project", @@ -5417,83 +5459,71 @@ "external_id": "aa427030169067481fb69a3560798265b6b52b7c", "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png", "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/", - "published_at": "2020-08-17T01:55:14Z", - "updated_at": "2020-08-14T01:45:09Z", + "published_at": "2020-08-18T02:09:27Z", + "updated_at": "2020-08-18T01:45:02Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.025474299, + "_score": 0.3596391, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Publish your application to New Relic", - "info": "Build a "Hello, World!" app and publish it to New Relic One", + "title": "Create a "Hello, World!" application", + "sections": "Publish your application to New Relic", + "info": "Build a "Hello, World!" app and publish it to New Relic One", "tags": "NR One Catalog", - "body": "Create a "Hello, World!" application 15 min Here's how you can quickly build a "Hello, World!" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others" + "body": " the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice" }, "id": "5efa9973196a67d16d76645c" }, { - "body": "For accounts on our New Relic One pricing plan, this document explains: How to add and manage users User types and user groups This doc is for accounts on our New Relic One pricing plan. If you're on our original product-based pricing plan, see Original user roles. Not sure which you're on? See Overview of pricing and account/user structure. Manage users Here are some important user management tips to remember and share with your team members: Basic users, who are free users, can self-serve to become billable full users. A New Relic user can have a maximum of either three concurrent active sessions, or three unique IP addresses in use at any given time. To manage users: from one.newrelic.com, select Apps from the top navigation, and then select User management. User type For accounts on the New Relic One pricing plan, the user type determines the monitoring and analysis features a user has access to. (Note that this does not control account admin-related permissions; that's determined by the user group.) User types include: Basic user: These users are free and have access to basic features like setting up reporting of data to New Relic, running queries of your data, making custom charts and dashboards, and setting up alert notifications. These users do not have access to Full-Stack Observability features. For details, see the capability table below. Full user: These users have access to Full-Stack Observability features, including our curated UI experiences for APM, infrastructure monitoring, browser monitoring, mobile monitoring, and synthetic monitors. The Standard pricing tier includes one full user. For details, see the capability table below. The number of full users is not the only pricing factor: Learn more about pricing. For details about full user and basic user capabilities, expand this collapser: Capabilities for full users vs. basic users Below are some important differences between basic user and full user capabilities. In short, basic users have access to our Telemetry Data Platform and Applied Intelligence (read-only) features, while full users have access to that plus Full-Stack Observability features. Features Full user Basic user Full-Stack Observability (New Relic-built UI experiences) Application performance monitoring (APM) UI fa-check Infrastructure monitoring UI fa-check Digital Experience Monitoring (Browser, Mobile, Synthetics) UI fa-check Serverless monitoring UI fa-check Logs in context with other UI experiences fa-check Synthetics checks fa-check New Relic Edge with Infinite Tracing (tail-based sampling) fa-check (Pro and Enterprise) Subscribe to New Relic One catalog apps fa-check Applied Intelligence (AI) Proactive Detection fa-check fa-check (read-only) Incident Intelligence fa-check fa-check (read-only) Telemetry Data Platform Data ingest from any source (Metrics, Events, Logs, Traces) fa-check fa-check Alerts and notifications fa-check fa-check Interactive query interface fa-check fa-check Custom charts and dashboards (not New Relic-built) fa-check fa-check Encryption at rest fa-check fa-check Standard data retention fa-check fa-check NerdGraph (GraphQL) API fa-check fa-check Security and compliance fa-check fa-check Integrations fa-check fa-check Data management fa-check fa-check Logs UI fa-check fa-check Build custom New Relic One apps fa-check fa-check User group When full users (not basic users) are added, there are additional choices related to account administration. For the Standard pricing tier, the two user groups available are: Admin: Adding someone to the Admin group gives them configuration and administrative abilities like adding/editing users, editing account and billing settings, and configuring some settings. User: Adding someone to the User group allows them to use and configure features but not manage users or billing. Coming soon: Pro and Enterprise tiers include additional admin functionalities and group-related features. Capability limitations There are some temporary limitations for users on the newer model, mainly around API access. For details, see Limitations. Query usage data See Query usage data. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "type": "docs", + "body": "Build apps You know better than anyone what information is crucial to your business, and how best to visualize it. Sometimes, this means going beyond dashboards to creating your own app. With React and GraphQL, you can create custom views tailored to your business. These guides are designed to help you start building apps, and dive into our library of components. We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a \"Hello, World!\" application Build a \"Hello, World!\" app and publish it to New Relic One 20 min Publish and deploy apps Start sharing the apps you build 20 min Set up your development environment Prepare to build apps and contribute to this site 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 30 min Add a table to your app Add a table to your New Relic One app 30 min Create a custom map view Build an app to show page view data on a map", + "type": "developer", "document_type": "page", - "breadcrumb": "Contents / New Relic accounts / Accounts and billing / New Relic One pricing and users", - "info": "For New Relic accounts on our New Relic One pricing plan, an explanation of user roles. ", - "nodeid": 39356, + "info": "", "sections": [ - "Accounts and billing", - "Account setup", - "Account structure", - "New Relic One pricing and users", - "General account settings", - "Automated user management", - "SAML single sign on", - "Partner install", - "New Relic One users and roles", - "Manage users", - "User type", - "User group", - "Capability limitations", - "Query usage data", - "For more help" + "Build apps", + "Guides to build apps", + "Create a \"Hello, World!\" application", + "Publish and deploy apps", + "Set up your development environment", + "Add the NerdGraphQuery component to an application", + "Add a time picker to your app", + "Add, query, and mutate data using NerdStorage", + "Add a table to your app", + "Create a custom map view" ], - "title": "New Relic One users and roles ", + "title": "Build apps", "popularity": 1, - "external_id": "6b424e8f440119aa9d9529ef1cf91fac524e2991", - "category_1": "Accounts and billing", - "category_2": "New Relic One pricing and users", + "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", "image": "", - "url": "https://docs.newrelic.com/docs/accounts/accounts-billing/new-relic-one-pricing-users/users-roles", - "published_at": "2020-08-15T05:13:24Z", - "updated_at": "2020-08-15T05:13:24Z", - "category_0": "New Relic accounts", + "url": "https://developer.newrelic.com/build-apps/", + "published_at": "2020-08-18T02:08:12Z", + "updated_at": "2020-08-18T01:45:02Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.006270064, + "_score": 0.30304605, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One users and roles ", - "sections": "New Relic One pricing and users", - "info": "For New Relic accounts on our New Relic One pricing plan, an explanation of user roles. ", - "category_0": "New Relic accounts", - "category_2": "New Relic One pricing and users", - "body": "For accounts on our New Relic One pricing plan, this document explains: How to add and manage users User types and user groups This doc is for accounts on our New Relic One pricing plan. If you're on our original product-based pricing plan, see Original user roles. Not sure which you're on? See", - "breadcrumb": "Contents / New Relic accounts / Accounts and billing / New Relic One pricing and users" + "title": "Build apps", + "sections": "Add, query, and mutate data using NerdStorage", + "body": " you start building apps, and dive into our library of components. We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a "Hello, World!" application Build a "Hello, World!" app and publish it to New Relic One 20" }, - "id": "5f22d159196a67f322b53d0a" + "id": "5efa999d64441fc0f75f7e21" } ], - "/explore-docs/nr1-plugins": [ + "/explore-docs/intro-to-sdk": [ { - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", "type": "developer", "document_type": "page", "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", "sections": [ "New Relic One CLI reference", "Installing the New Relic One CLI", + "Tip", "New Relic One CLI Commands", "Get started", "Configure your CLI preferences", @@ -5511,195 +5541,212 @@ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-14T01:47:13Z", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-18T01:50:36Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.58309776, + "_score": 3.5731812, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI reference", - "sections": "New Relic One CLI Commands", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "tags": "New Relic One app", - "body": " our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages" + "title": "New Relic One CLI reference", + "sections": "New Relic One CLI reference", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use" }, "id": "5efa989e28ccbc535a307dd0" }, { - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", + "body": "Add the NerdGraphQuery component to an application 20 minutes This guide steps you through the process of adding the NerdGraphQuery component to a sample transaction overview application. This allows you to query data from your New Relic account and add it to a dropdown menu. NerdGraph is our GraphQL implementation. GraphQL has some key differences when compared to REST: The client, not the server, determines what data is returned. You can easily collect data from multiple sources. For example, in a single query, you can get account information, infrastructure data, and issue a NRQL request. Note Before completing this exercise, you can experiment with GraphQL queries in our NerdGraph API explorer. We also have a 14-minute video that covers the steps below. Before you begin To develop projects, you need our New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete steps 1–4 of our CLI quick start, and be sure to make a copy of your account ID from step 1 because you’ll need it later. Note If you've already installed the New Relic One CLI, but you can't remember your account ID, start the CLI quick start again, and then click the Get your API key down arrow. The account ID is the number preceding your account name. For additional details, see Set up your development environment. Prepare the sample code To get started, complete these steps to update the application UUID (unique ID) and run the sample application locally: Step 1 of 7 If you haven't already done so, clone the example applications from our how-to GitHub repo. Here's an example using HTTPS: git clone https://github.com/newrelic/nr1-how-to.git Copy Step 2 of 7 Change to the directory use-nerdgraph-nerdlet: cd nr1-how-to/use-nerdgraph/nerdlets/use-nerdgraph-nerdlet Copy Step 3 of 7 In your preferred text editor, open index.js. Step 4 of 7 Replace with your account id: Note Your account ID is available in the CLI quick start (see Before you begin). this.accountId = ; Copy Step 5 of 7 Change to the /nr1-howto/use-nerdgraph directory: cd ../.. Copy Step 6 of 7 Execute these commands to update the UUID and serve the sample application: nr1 nerdpack:uuid -gf nr1 nerdpack:serve Copy Step 7 of 7 Once the sample application is successfully served, go to the local New Relic One homepage (https://one.newrelic.com/?nerdpacks=local), click Apps, and then click Use NerdGraph. After launching the Use NerdGraph application, you see a dashboard that gives an overview of the transactions in your account: Add the NerdGraphQuery component Now you can create a dropdown menu for changing the account the application is viewing. The first step is to import the NerdGraphQuery component into the application's index.js file. Note If you need more details about our example below, see the APIs and components page on https://developer.newrelic.com Step 1 of 3 Add the NerdGraphQuery component into the first StackItem inside of the return in the index.js file: {({ loading, error, data }) => { console.log({ loading, error, data }); if (loading) { return ; } if (error) { return 'Error!'; } return null; }} ; Copy Step 2 of 3 The NerdGraphQuery component takes a query object that states the source you want to access and the data you want returned. Add the following code to your index.js file in the render method: Note In the browser console, you can see the data from your query returned in an object that follows the same structure of the object in the initial query. const query = ` query($id: Int!) { actor { account(id: $id) { name } } } `; Copy Step 3 of 3 To take the data returned by the NerdGraph query and display it in the application, replace the return null in the current NerdGraphQuery component with this return statement: return {data.actor.account.name} Apps:; Copy When you go back to the browser and view your application, you see a new headline showing the name of your account returned from NerdGraph: How to use NerdGraphQuery.query At this point, you have implemented the NerdGraphQuery component with the application's render method and displayed the return data within the transaction overview application. Here's what you need to do next: Query NerdGraph inside of the componentDidMount lifecycle method. Save the returned data for later use in the application. Step 1 of 2 This code takes the response from NerdGraph and makes sure the results are processed, stored into the application state, and logged to the browser console for viewing. Add this code into the index.js file just under the constructor: componentDidMount() { const accountId = this.state; const gql = `{ actor { accounts { id name } } }`; const accounts = NerdGraphQuery.query({query: gql}) //The NerdGraphQuery.query method called with the query object to get your account data is stored in the accounts variable. accounts.then(results => { console.log('Nerdgraph Response:', results); const accounts = results.data.actor.accounts.map(account => { return account; }); const account = accounts.length > 0 && accounts[0]; this.setState({ selectedAccount: account, accounts }); }).catch((error) => { console.log('Nerdgraph Error:', error); }) } Copy Step 2 of 2 After the data is stored into state, display a selection so users can change accounts and update the application. To do this, add this code to index.js for the second StackItem in the return statement: { accounts && ( ); } Copy Review the results of the NerdGraph query After you complete these steps, look at the application in your browser, and note the following: The dropdown menu now displays the data returned from the NerdGraphQuery.query and allows you to select an account. After you select a new account, the application shows data from the new selection. The final index.js file should have code similar to the code below. This completed sample is in your nerdlet final.js. import React from 'react'; import { PlatformStateContext, NerdGraphQuery, Spinner, HeadingText, Grid, GridItem, Stack, StackItem, Select, SelectItem, AreaChart, TableChart, PieChart } from 'nr1' import { timeRangeToNrql } from '@newrelic/nr1-community'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class UseNerdgraphNerdletNerdlet extends React.Component { constructor(props){ super(props) this.state = { accountId: , accounts: null, selectedAccount: null, } } componentDidMount() { const accountId = this.state; const gql = `{ actor { accounts { id name } } }`; const accounts = NerdGraphQuery.query({ query: gql }) accounts.then(results => { console.log('Nerdgraph Response:', results); const accounts = results.data.actor.accounts.map(account => { return account; }); const account = accounts.length > 0 && accounts[0]; this.setState({ selectedAccount: account, accounts }); }).catch((error) => { console.log('Nerdgraph Error:', error); }) } selectAccount(option) { this.setState({ accountId: option.id, selectedAccount: option }); } render() { const { accountId, accounts, selectedAccount } = this.state; console.log({ accountId, accounts, selectedAccount }); const query = ` query($id: Int!) { actor { account(id: $id) { name } } } `; const variables = { id: accountId, }; const avgResTime = `SELECT average(duration) FROM Transaction FACET appName TIMESERIES AUTO `; const trxOverview = `FROM Transaction SELECT count(*) as 'Transactions', apdex(duration) as 'apdex', percentile(duration, 99, 95) FACET appName `; const errCount = `FROM TransactionError SELECT count(*) as 'Transaction Errors' FACET error.message `; const responseCodes = `SELECT count(*) as 'Response Code' FROM Transaction FACET httpResponseCode `; return ( {({loading, error, data}) => { if (loading) { return ; } if (error) { return 'Error!'; } return {data.actor.account.name} Apps:; }} {accounts && }
{(PlatformState) => { /* Taking a peek at the PlatformState */ const since = timeRangeToNrql(PlatformState); return ( <>
Transaction Overview
Average Response Time
Response Code
Transaction Errors
); }}
) } } Copy Summary Now that you've completed all the steps in this example, you've successfully queried data from your account using the NerdGraphQuery component in two methods: Using the NerdGraphQuery component inside the application's render method and then passing the returned data into the children's components. Using the NerdGraphQuery.query method to query data before the application renders.", "type": "developer", "document_type": "page", - "info": "The command line tools for performing tasks against New Relic APIs", + "info": "The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application", "sections": [ - "New Relic CLI Reference", - "New Relic CLI commands", - "Options", - "Commands" + "Add the NerdGraphQuery component to an application", + "Note", + "Before you begin", + "Prepare the sample code", + "Add the NerdGraphQuery component", + "How to use NerdGraphQuery.query", + "Review the results of the NerdGraph query", + "Summary" ], - "title": "New Relic CLI Reference", + "title": "Add the NerdGraphQuery component to an application", "popularity": 1, - "tags": "new relic cli", - "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", - "image": "", - "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-08-17T01:54:02Z", - "updated_at": "2020-08-14T01:47:12Z", + "external_id": "6bd6c8a72eab352a3e8f4332570e286c7831ba84", + "image": "https://developer.newrelic.com/static/5dcf6e45874c1fa40bb6f21151af0c24/b01d9/no-name.png", + "url": "https://developer.newrelic.com/build-apps/add-nerdgraphquery-guide/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-14T01:49:25Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.30409414, + "_score": 1.1957614, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic CLI Reference", - "sections": "New Relic CLI commands", - "info": "The command line tools for performing tasks against New Relic APIs", - "tags": "new relic cli", - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" + "title": "Add the NerdGraphQuery component to an application", + "sections": "Add the NerdGraphQuery component to an application", + "info": "The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application", + "body": " { PlatformStateContext, NerdGraphQuery, Spinner, HeadingText, Grid, GridItem, Stack, StackItem, Select, SelectItem, AreaChart, TableChart, PieChart } from 'nr1' import { timeRangeToNrql } from '@newrelic/nr1-community'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction" }, - "id": "5efa989ee7b9d2024b7bab97" + "id": "5efa993c64441ff4865f7e32" }, { - "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag⁠ (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.", + "body": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application. In this guide, you are going to build a sample table using various New Relic One components. Before you begin If you haven't already installed the New Relic One CLI, step through the quick start in New Relic One. This process also gets you an API key. In addition, to complete the steps in this guide, you need a GitHub account, and to have Node.js installed on your machine. See [Setting up your development environment](/build-apps/set-up-dev-env) for more info. Clone and set up the example application Step 1 of 4 Clone the nr1-how-to example application from GitHub to your local machine. Then, navigate to the app directory. The example app lets you experiment with tables. git clone https://github.com/newrelic/nr1-how-to.git` cd nr1-how-to/create-a-table/nerdlets/create-a-table-nerdlet` Copy Step 2 of 4 Edit the index.json file and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install dependencies nr1 nerdpack:serve # Serve the demo app locally Copy Step 4 of 4 Open one.newrelic.com/?nerdpacks=local in your browser. Click Apps*, and then in the Other apps section, you should see a Create a table** launcher. That's the demo application you're going to work on. Go ahead and select it. Have a good look at the demo app. There's a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You'll use Table components to add a new table in the second row. Work with table components Step 1 of 10 Navigate to the `nerdlets/create-a-table-nerdlet` subdirectory and open the `index.js` file. Add the following components to the import statement at the top of the file so that it looks like the example: Table TableHeader TableHeaderCell TableRow TableRowCell import { Table, TableHeader, TableHeaderCell, TableRow, TableRowCell, PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart, } from 'nr1'; Copy Step 2 of 10 Add a basic Table component Locate the empty GridItem in index.js: This is where you start building the table. Add the initial component. The items property collects the data by calling _getItems(), which contains sample values.
; Copy Step 3 of 10 Add the header and rows As the Table component renders a fixed number of header cells and rows, your next step is adding header components, as well as a function that returns the required table rows. Inside of the Table component, add the TableHeader and then a TableHeaderCell child for each heading. Since you don't know how many rows you'll need, your best bet is to call a function to build as many TableRows as items returned by _getItems(). Application Size Company Team Commit ; { ({ item }) => ( {item.name} {item.value} {item.company} {item.team} {item.commit} ); } Copy Step 4 of 10 Take a look at the application running in New Relic One: you should see something similar to the screenshot below. Step 5 of 10 Replace standard table cells with smart cells The New Relic One library includes cell components that can automatically format certain data types, like users, metrics, and entity names. The table you've just created contains columns that can benefit from those components: Application (an entity name) and Size (a metric). Before you can use EntityTitleTableRowCell and MetricTableRowCell, you have to add them to the import statement first. import { EntityTitleTableRowCell, MetricTableRowCell, ... /* All previous components */ } from 'nr1'; Copy Step 6 of 10 Update your table rows by replacing the first and second TableRowCells with entity and metric cells. Notice that EntityTitleTableRowCell and MetricTableRowCell are self-closing tags. { ({ item }) => ( {item.company} {item.team} {item.commit} ); } Copy Step 7 of 10 Time to give your table a second look: The cell components you've added take care of properly formatting the data. Step 8 of 10 Add some action to your table! Tables are great, but interactive tables can be better: As a last update, you are going to allow users to act on each data row. Add the _getActions() method to your index.js file, right before _getItems(). As you may have guessed from the code, _getActions() spawns an alert box when you click Team or Commit cells. _getActions() { return [ { label: 'Alert Team', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__ALERT, onClick: (evt, { item, index }) => { alert(`Alert Team: ${item.team}`); }, }, { label: 'Rollback Version', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__UNDO, onClick: (evt, { item, index }) => { alert(`Rollback from: ${item.commit}`); }, }, ]; } Copy Step 9 of 10 Find the TableRow component in your return statement and point the actions property to _getActions(). The TableRow actions property defines a set of actions that appear when the user hovers over a table row. Actions have a mandatory text and an onClick callback, but can also display an icon or be disabled if needed. Copy Step 10 of 10 Go back to your application and try hovering over any of the rows: Notice how the two available actions appear. When you click them, a function triggers with the selected row data as an argument, and an alert displays in your browser. Next steps You've built a table into a New Relic One application, using components to format data automatically and provide contextual actions. Well done! Keep exploring the Table components, their properties, and how to use them, in our SDK documentation.", "type": "developer", "document_type": "page", - "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", + "info": "Add a table to your New Relic One app.", "sections": [ - "Get started with the New Relic CLI", + "Add tables to your New Relic One application", "Before you begin", - "Install the New Relic CLI", - "Linux", - "macOS", - "Windows", - "Create your New Relic CLI profile", - "Get your application details", - "Add a simple tag to your application", - "Bonus step: Create a deployment marker", + "Clone and set up the example application", + "Work with table components", "Next steps" ], - "title": "Get started with the New Relic CLI", + "title": "Add tables to your New Relic One application", "popularity": 1, - "tags": [ - "api key", - "New Relic CLI", - "Tags", - "Entity", - "Deployment markers" - ], - "external_id": "531f2f3985bf64bb0dc92a642445887095048882", - "image": "", - "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/", - "published_at": "2020-08-17T01:48:54Z", - "updated_at": "2020-08-08T01:41:47Z", + "external_id": "7ff7a8426eb1758a08ec360835d9085fae829936", + "image": "https://developer.newrelic.com/static/e637c7eb75a9dc01740db8fecc4d85bf/1d6ec/table-new-cells.png", + "url": "https://developer.newrelic.com/build-apps/howto-use-nrone-table-components/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-14T01:46:10Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.16122334, + "_score": 0.7044865, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Get started with the New Relic CLI", - "sections": "Get started with the New Relic CLI", - "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", - "tags": "New Relic CLI", - "body": " that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need" + "title": "Add tables to your New Relic One application", + "sections": "Add tables to your New Relic One application", + "info": "Add a table to your New Relic One app.", + "body": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can" }, - "id": "5efa999c196a67c4e1766461" + "id": "5efa989ee7b9d2ad567bab51" }, { - "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", + "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,000 documents, plus storage type. Each document can have a maximum length of 64 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.", "type": "developer", "document_type": "page", - "info": "Build a \"Hello, World!\" app and publish it to New Relic One", + "info": "Intro to NerdStorage on New Relic One", "sections": [ - "Create a \"Hello, World!\" application", - "Before you begin", - "Create a local version of the \"Hello, World!\" application", - "Publish your application to New Relic", - "Add details to describe your project", - "Subscribe accounts to your application", - "Summary", - "Related information" + "Intro to NerdStorage", + "Use NerdStorage in your apps", + "Data model", + "Limits", + "Data access", + "Permissions for working with NerdStorage" ], - "title": "Create a \"Hello, World!\" application", + "title": "Intro to NerdStorage", "popularity": 1, - "tags": [ - "nr1 cli", - "Nerdpack file structure", - "NR One Catalog", - "Subscribe applications" - ], - "external_id": "aa427030169067481fb69a3560798265b6b52b7c", - "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png", - "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/", - "published_at": "2020-08-17T01:55:14Z", - "updated_at": "2020-08-14T01:45:09Z", + "external_id": "709e06c25376d98b2191ca369b4d139e5084bd62", + "image": "", + "url": "https://developer.newrelic.com/explore-docs/nerdstorage/", + "published_at": "2020-08-18T02:11:48Z", + "updated_at": "2020-08-14T01:50:34Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.05887177, + "_score": 0.6584254, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Publish your application to New Relic", - "info": "Build a "Hello, World!" app and publish it to New Relic One", - "tags": "nr1 cli", - "body": ", you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already" + "sections": "Use NerdStorage in your apps", + "info": "Intro to NerdStorage on New Relic One", + "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's" }, - "id": "5efa9973196a67d16d76645c" + "id": "5efa989ee7b9d2048e7bab92" }, { - "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", - "type": "developer", + "body": "For an even better experience than plugins, go to: newrelic.com/integrations: Integrate the on-host and cloud systems you already use with New Relic, so you can filter and analyze data, create dashboards, and set alerts within a single platform. developer.newrelic.com: Use developer tools to collect data from any source, automate workflows, build apps, and use our APIs. Each plugin in Plugin Central includes procedures for how to install, use, troubleshoot, and uninstall it. After you install a plugin, it starts to receive data, usually within five minutes. The plugin automatically appears with a short name and icon on your Plugins menu in New Relic One. You do not need to select it from Plugin Central. Plugins in Plugin Central are not supported with accounts that host data in the EU region data center. View plugin dashboard details The amount and types of information on the plugin's summary page and dashboards depend on the specific plugin. For example, a plugin may have one or more components (instances) and one or more dashboards. To view summary and dashboard details about the plugin: Go to one.newrelic.com > More > Plugins, and select your plugin. From the plugin's summary page, review the list of components or instances, summary metrics, and list of Recent Events. To view dashboard details about any component or instance, select its name. Plugin summary Depending on the plugin, the summary includes: One or more components or instances (what the plugin agent is monitoring, typically a host/port pair) Zero to five summary metrics for the past three minutes (values such as average, total, minimum, maximum, standard deviation, rate, or count) with optional alerts Recent events list, including deployments, notifications, and alerts Other information about alert violations, events, and activity If your plugin has 100 or more components or instances, you can search for a specific component instance. Here is a summary of additional standard features. If you want to... Do this... View version information for a component's or instance's agent Mouse over the component's name. Change the sort order On the title row of the plugin's summary page, select the up or down arrow for a component (instance) or a summary metric's label. Show or hide items on the events and activity list Select an event icon, or select All. View details about an event On the events and activity list, select the link. View page details for a component or instance Select the name or a summary metric for the component (instance). Plugin dashboards Depending on the plugin, it may have one or more dashboards, and each dashboard may present data as a chart or a table. You can use any of New Relic's standard dashboard features to drill down into detailed information. The customized dashboards that show plugin data are part of the plugin. Users cannot add or remove these dashboards. This must be done by the author or publisher as part of a plugin update. Plugin alerts If the plugin publisher set Critical (red) or Caution (yellow) alert conditions for your plugin's components or instances, you can view details direct in the user interface. For example, you can: Select and view alert details. Change the existing thresholds. Set your alert notification options; for example, to receive email notifications for Critical events. Delete a plugin Each plugin in Plugin Central includes procedures for how to uninstall it. When you select the plugin's Download or Continue button, the plugin should include a README file or refer to other documentation resources. Remove plugin components (instances) At a minimum, your plugin must stop reporting data before you start uninstalling it. Make sure the health status for your plugin's components (instances) are gray. Depending on the plugin, there may be other dependencies before disabling or uninstalling it. For example, plugins from SaaS providers may have different requirements. Be sure to review the instructions that the plugin's publisher provides. Then, to remove individual components from your plugin, click the settings settings icon for each component (instance). Delete the plugin After you remove each component (instance) for the plugin, the plugin icon will automatically disappear from your Plugins menu in the New Relic UI. You do not need to do anything else to delete the plugin. If you are the plugin's publisher and need to delete the plugin from Plugin Central, go to support.newrelic.com. For more help If you need more help, check out these support and learning resources: Review the documentation provided by the plugin publisher, or contact the publisher's support resources (identified in the plugin's Get support link). Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "An overview of common commands you can use with the New Relic One CLI.", + "breadcrumb": "Contents / Plugins / Plugins for New Relic / Install plugins", + "info": "How to navigate the user interface for plugins you install from Plugin Central in New Relic One.", + "nodeid": 3276, "sections": [ - "New Relic One CLI common commands", - "Command details", - "nr1 help", - "See commands and get details", - "Usage", - "Arguments", - "Examples", - "nr1 update", - "Update your CLI", - "nr1 create", - "Create a new component", - "Options", - "nr1 profiles", - "Manage your profiles keychain", - "Commands", - "nr1 autocomplete", - "See autocomplete installation instructions", - "nr1 nrql", - "Query using NRQL" + "Plugins for New Relic", + "Get started", + "Install plugins", + "Custom dashboards and custom views", + "Use a Plugin Central plugin", + "View plugin dashboard details", + "Delete a plugin", + "For more help" ], - "title": "New Relic One CLI common commands", + "title": "Use a Plugin Central plugin", "popularity": 1, - "external_id": "503e515e1095418f8d19329517344ab209d143a4", + "external_id": "2d4076c0d593e21391ca034868b87042328d8a61", + "category_1": "Plugins for New Relic", + "category_2": "Install plugins", "image": "", - "url": "https://developer.newrelic.com/explore-docs/nr1-common/", - "published_at": "2020-08-17T01:54:01Z", - "updated_at": "2020-08-14T01:48:10Z", + "url": "https://docs.newrelic.com/docs/plugins/plugins-new-relic/installing-plugins/use-plugin-central-plugin", + "published_at": "2020-08-18T14:35:58Z", + "updated_at": "2020-08-18T14:35:58Z", + "category_0": "Plugins", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.020335037, + "_score": 0.59509915, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI common commands", - "sections": "New Relic One CLI common commands", - "info": "An overview of common commands you can use with the New Relic One CLI.", - "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1" + "sections": "Plugins for New Relic", + "info": "How to navigate the user interface for plugins you install from Plugin Central in New Relic One.", + "category_1": "Plugins for New Relic", + "body": "For an even better experience than plugins, go to: newrelic.com/integrations: Integrate the on-host and cloud systems you already use with New Relic, so you can filter and analyze data, create dashboards, and set alerts within a single platform. developer.newrelic.com: Use developer tools", + "breadcrumb": "Contents / Plugins / Plugins for New Relic / Install plugins" }, - "id": "5f28bd6ae7b9d267996ade94" + "id": "5f2ef9b3196a67c2a0fbd721" } ], - "/explore-docs/nr1-cli": [ + "/explore-docs/nr1-subscription": [ + { + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", + "type": "developer", + "document_type": "page", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "sections": [ + "New Relic One CLI reference", + "Installing the New Relic One CLI", + "Tip", + "New Relic One CLI Commands", + "Get started", + "Configure your CLI preferences", + "Set up your Nerdpacks", + "Manage your Nerdpack subscriptions", + "Install and manage plugins", + "Manage catalog information" + ], + "title": "New Relic One CLI reference", + "popularity": 1, + "tags": [ + "New Relic One app", + "nerdpack commands" + ], + "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", + "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", + "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", + "published_at": "2020-08-18T02:07:10Z", + "updated_at": "2020-08-18T01:50:36Z", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 0.7381426, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "New Relic One CLI reference", + "sections": "New Relic One CLI Commands", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": " extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions" + }, + "id": "5efa989e28ccbc535a307dd0" + }, { "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", "type": "developer", @@ -5717,20 +5764,20 @@ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", "image": "", "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-08-17T01:54:02Z", + "published_at": "2020-08-18T02:11:50Z", "updated_at": "2020-08-14T01:47:12Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 1.1494672, + "_score": 0.30232108, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic CLI Reference", - "sections": "New Relic CLI commands", + "title": "New Relic CLI Reference", + "sections": "New Relic CLI commands", "info": "The command line tools for performing tasks against New Relic APIs", - "tags": "new relic cli", - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" + "tags": "new relic cli", + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" }, "id": "5efa989ee7b9d2024b7bab97" }, @@ -5764,75 +5811,32 @@ "external_id": "531f2f3985bf64bb0dc92a642445887095048882", "image": "", "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/", - "published_at": "2020-08-17T01:48:54Z", + "published_at": "2020-08-18T02:06:05Z", "updated_at": "2020-08-08T01:41:47Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.5658734, + "_score": 0.16199563, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Get started with the New Relic CLI", - "sections": "Get started with the New Relic CLI", - "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", - "tags": "New Relic CLI", - "body": " that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need" + "title": "Get started with the New Relic CLI", + "sections": "Get started with the New Relic CLI", + "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", + "tags": "New Relic CLI", + "body": " that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need" }, "id": "5efa999c196a67c4e1766461" }, { - "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:clone Clones a Nerdpack from a git repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Command details nr1 nerdpack:clone Clone an existing Nerdpack Duplicates an existing Nerdpack onto your local computer. You can clone an open source Nerdpack from our Open Source GitHub repositories. After choosing a git repository, this command performs the following actions so that you can start using the Nerdpack: Clones the repository. Sets the repository as remote upstream. Installs all of its dependencies (using npm). Generates a new UUID using your profile, and commits it. Usage $ nr1 nerdpack:clone OPTION Options -r, --repo=REPO Repository location (either an HTTPS or SSH path). (Required) -p, --path=PATH Determines the directory to clone to (defaults to the repository name). -f, --force Replaces destination folder if it exists. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 nerdpack:serve Serve your Nerdpack locally Launches a server with your Nerdpack locally on the New Relic One platform, where it can be tested live. To learn more about working with apps locally, see our guide on how to serve, publish, and deploy documentation. Usage $ nr1 nerdpack:serve Options --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 nerdpack:uuid Get your Nerdpack's UUID Prints the UUID (Universal Unique ID) of your Nerdpack, by default. The UUID determines what data the Nerdpack can access and who can subscribe to the Nerdpack. To deploy a Nerdpack you didn't make, you'll have to assign it a new UUID by using the -g or --generate option. For more details, see our GitHub workshop on GitHub. Usage $ nr1 nerdpack:uuid Options --profile=PROFILE The authentication profile you want to use. -f, --force If present, it will override the existing UUID without asking. -g, --generate Generates a new UUID if not available. --verbose Adds extra information to the output. nr1 nerdpack:publish Publish your Nerdpack Publishes your Nerdpack to New Relic. Please note: If no additional parameters are passed in, this command will automatically deploy the Nerdpack onto the DEV channel. If you want to specify your own list of deploy channels, add the --channel option. For example, $ nr1 nerdpack:publish --channel BETA --channel STABLE. If you want to disable this behavior, add -D or --skip-deploy to the command. Then, you can use nr1 nerdpack:deploy to perform a deploy manually. For more on publishing and deploying, see Deploy to New Relic One. Usage $ nr1 nerdpack:publish Options -B, --skip-build Skips the previous build process. -D, --skip-deploy Skips the following deploy process. -c, --channel=DEV/BETA/STABLE Specifies the channel to deploys to. [default: STABLE] -f, --force Forces the publish, overriding any existing version in the registry. --dry-run Undergoes publishing process without actually publishing anything. --extra-metadata-path=extra-metadata-path Specifies a json file .path with extra metadata. [default: extra-metadata.json] --prerelease=STRING The value you enter will be appended to the current version of generated files. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 nerdpack:deploy Deploy your Nerdpack to a channel Deploys a Nerdpack version to a specific channel (DEV, BETA, or STABLE). A channel can only have one Nerdpack version deployed to it at one time. If a channel has an existing Nerdpack associated with it, deploying a new Nerdpack version to that channel will undeploy the previous one. For more on publishing and deploying, see Deploy to New Relic One. Usage $ nr1 nerdpack:deploy OPTION Options -c, --channel=DEV/BETA/STABLE Specifies the channel to deploy to. (required) -i, --nerdpack-id=NERDPACK_ID Specifies the Nerdpack to deploy. By default, the command will use the one in package.json. --from-version=VERSION Specifies which version to deploy. By default, the command will use the one in package.json. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 nerdpack:undeploy Undeploy your Nerdpack Undeploys a Nerdpack version from a specific channel (for example, DEV, BETA, or STABLE). Usage $ nr1 nerdpack:undeploy OPTION Options -c, --channel=DEV/BETA/STABLE Specifies the channel to undeploy from. (required) -i, --nerdpack-id=NERDPACK_ID Specifies the Nerdpack to deploy. By default, the command will use the one in package.json. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", - "type": "developer", - "document_type": "page", - "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.", - "sections": [ - "New Relic One CLI Nerdpack commands", - "Command details", - "nr1 nerdpack:clone", - "Clone an existing Nerdpack", - "Usage", - "Options", - "nr1 nerdpack:serve", - "Serve your Nerdpack locally", - "nr1 nerdpack:uuid", - "Get your Nerdpack's UUID", - "nr1 nerdpack:publish", - "Publish your Nerdpack", - "nr1 nerdpack:deploy", - "Deploy your Nerdpack to a channel", - "nr1 nerdpack:undeploy", - "Undeploy your Nerdpack" - ], - "title": "New Relic One CLI Nerdpack commands", - "popularity": 1, - "external_id": "7c1050a6a8624664b90c15111f7c72e96b2fbe17", - "image": "", - "url": "https://developer.newrelic.com/explore-docs/nr1-nerdpack/", - "published_at": "2020-08-17T01:55:14Z", - "updated_at": "2020-08-04T01:44:10Z", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.50333226, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "New Relic One CLI Nerdpack commands", - "sections": "New Relic One CLI Nerdpack commands", - "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.", - "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:clone Clones a Nerdpack from a git repository. nr1 nerdpack:serve Serves your Nerdpack" - }, - "id": "5f28bd6a64441f9817b11a38" - }, - { - "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", + "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", "type": "developer", "document_type": "page", "info": "Build a \"Hello, World!\" app and publish it to New Relic One", "sections": [ "Create a \"Hello, World!\" application", "Before you begin", + "Tip", "Create a local version of the \"Hello, World!\" application", "Publish your application to New Relic", "Add details to describe your project", @@ -5851,20 +5855,19 @@ "external_id": "aa427030169067481fb69a3560798265b6b52b7c", "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png", "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/", - "published_at": "2020-08-17T01:55:14Z", - "updated_at": "2020-08-14T01:45:09Z", + "published_at": "2020-08-18T02:09:27Z", + "updated_at": "2020-08-18T01:45:02Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.46004272, + "_score": 0.07493319, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Create a "Hello, World!" application", - "sections": "Publish your application to New Relic", - "info": "Build a "Hello, World!" app and publish it to New Relic One", - "tags": "Nerdpack file structure", - "body": ", you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already" + "sections": "Publish your application to New Relic", + "info": "Build a "Hello, World!" app and publish it to New Relic One", + "tags": "nr1 cli", + "body": ", you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already" }, "id": "5efa9973196a67d16d76645c" }, @@ -5899,66 +5902,24 @@ "external_id": "503e515e1095418f8d19329517344ab209d143a4", "image": "", "url": "https://developer.newrelic.com/explore-docs/nr1-common/", - "published_at": "2020-08-17T01:54:01Z", + "published_at": "2020-08-18T02:06:04Z", "updated_at": "2020-08-14T01:48:10Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.17899902, + "_score": 0.018395994, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI common commands", - "sections": "New Relic One CLI common commands", - "info": "An overview of common commands you can use with the New Relic One CLI.", - "body": " (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command" + "title": "New Relic One CLI common commands", + "sections": "New Relic One CLI common commands", + "info": "An overview of common commands you can use with the New Relic One CLI.", + "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1" }, "id": "5f28bd6ae7b9d267996ade94" } ], - "/explore-docs/nr1-nerdpack": [ - { - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", - "type": "developer", - "document_type": "page", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "sections": [ - "New Relic One CLI reference", - "Installing the New Relic One CLI", - "New Relic One CLI Commands", - "Get started", - "Configure your CLI preferences", - "Set up your Nerdpacks", - "Manage your Nerdpack subscriptions", - "Install and manage plugins", - "Manage catalog information" - ], - "title": "New Relic One CLI reference", - "popularity": 1, - "tags": [ - "New Relic One app", - "nerdpack commands" - ], - "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b", - "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png", - "url": "https://developer.newrelic.com/explore-docs/nr1-cli/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-14T01:47:13Z", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.7864367, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "New Relic One CLI reference", - "sections": "New Relic One CLI Commands", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "tags": "New Relic One app", - "body": " our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages" - }, - "id": "5efa989e28ccbc535a307dd0" - }, + "/explore-docs/nr1-cli": [ { "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", "type": "developer", @@ -5976,20 +5937,20 @@ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", "image": "", "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-08-17T01:54:02Z", + "published_at": "2020-08-18T02:11:50Z", "updated_at": "2020-08-14T01:47:12Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.3268025, + "_score": 1.0787585, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic CLI Reference", - "sections": "New Relic CLI commands", + "title": "New Relic CLI Reference", + "sections": "New Relic CLI commands", "info": "The command line tools for performing tasks against New Relic APIs", - "tags": "new relic cli", - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" + "tags": "new relic cli", + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" }, "id": "5efa989ee7b9d2024b7bab97" }, @@ -6023,31 +5984,32 @@ "external_id": "531f2f3985bf64bb0dc92a642445887095048882", "image": "", "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/", - "published_at": "2020-08-17T01:48:54Z", + "published_at": "2020-08-18T02:06:05Z", "updated_at": "2020-08-08T01:41:47Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.16180077, + "_score": 0.5655756, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Get started with the New Relic CLI", - "sections": "Get started with the New Relic CLI", - "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", - "tags": "New Relic CLI", - "body": " that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need" + "title": "Get started with the New Relic CLI", + "sections": "Get started with the New Relic CLI", + "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", + "tags": "New Relic CLI", + "body": " that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need" }, "id": "5efa999c196a67c4e1766461" }, { - "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", + "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", "type": "developer", "document_type": "page", "info": "Build a \"Hello, World!\" app and publish it to New Relic One", "sections": [ "Create a \"Hello, World!\" application", "Before you begin", + "Tip", "Create a local version of the \"Hello, World!\" application", "Publish your application to New Relic", "Add details to describe your project", @@ -6066,22 +6028,67 @@ "external_id": "aa427030169067481fb69a3560798265b6b52b7c", "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png", "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/", - "published_at": "2020-08-17T01:55:14Z", - "updated_at": "2020-08-14T01:45:09Z", + "published_at": "2020-08-18T02:09:27Z", + "updated_at": "2020-08-18T01:45:02Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.10158259, + "_score": 0.55214196, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Publish your application to New Relic", - "info": "Build a "Hello, World!" app and publish it to New Relic One", - "tags": "nr1 cli", - "body": ", you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already" + "title": "Create a "Hello, World!" application", + "sections": "Publish your application to New Relic", + "info": "Build a "Hello, World!" app and publish it to New Relic One", + "tags": "Nerdpack file structure", + "body": ", you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already" }, "id": "5efa9973196a67d16d76645c" }, + { + "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:clone Clones a Nerdpack from a git repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Command details nr1 nerdpack:clone Clone an existing Nerdpack Duplicates an existing Nerdpack onto your local computer. You can clone an open source Nerdpack from our Open Source GitHub repositories. After choosing a git repository, this command performs the following actions so that you can start using the Nerdpack: Clones the repository. Sets the repository as remote upstream. Installs all of its dependencies (using npm). Generates a new UUID using your profile, and commits it. Usage $ nr1 nerdpack:clone OPTION Options -r, --repo=REPO Repository location (either an HTTPS or SSH path). (Required) -p, --path=PATH Determines the directory to clone to (defaults to the repository name). -f, --force Replaces destination folder if it exists. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 nerdpack:serve Serve your Nerdpack locally Launches a server with your Nerdpack locally on the New Relic One platform, where it can be tested live. To learn more about working with apps locally, see our guide on how to serve, publish, and deploy documentation. Usage $ nr1 nerdpack:serve Options --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 nerdpack:uuid Get your Nerdpack's UUID Prints the UUID (Universal Unique ID) of your Nerdpack, by default. The UUID determines what data the Nerdpack can access and who can subscribe to the Nerdpack. To deploy a Nerdpack you didn't make, you'll have to assign it a new UUID by using the -g or --generate option. For more details, see our GitHub workshop on GitHub. Usage $ nr1 nerdpack:uuid Options --profile=PROFILE The authentication profile you want to use. -f, --force If present, it will override the existing UUID without asking. -g, --generate Generates a new UUID if not available. --verbose Adds extra information to the output. nr1 nerdpack:publish Publish your Nerdpack Publishes your Nerdpack to New Relic. Please note: If no additional parameters are passed in, this command will automatically deploy the Nerdpack onto the DEV channel. If you want to specify your own list of deploy channels, add the --channel option. For example, $ nr1 nerdpack:publish --channel BETA --channel STABLE. If you want to disable this behavior, add -D or --skip-deploy to the command. Then, you can use nr1 nerdpack:deploy to perform a deploy manually. For more on publishing and deploying, see Deploy to New Relic One. Usage $ nr1 nerdpack:publish Options -B, --skip-build Skips the previous build process. -D, --skip-deploy Skips the following deploy process. -c, --channel=DEV/BETA/STABLE Specifies the channel to deploys to. [default: STABLE] -f, --force Forces the publish, overriding any existing version in the registry. --dry-run Undergoes publishing process without actually publishing anything. --extra-metadata-path=extra-metadata-path Specifies a json file .path with extra metadata. [default: extra-metadata.json] --prerelease=STRING The value you enter will be appended to the current version of generated files. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 nerdpack:deploy Deploy your Nerdpack to a channel Deploys a Nerdpack version to a specific channel (DEV, BETA, or STABLE). A channel can only have one Nerdpack version deployed to it at one time. If a channel has an existing Nerdpack associated with it, deploying a new Nerdpack version to that channel will undeploy the previous one. For more on publishing and deploying, see Deploy to New Relic One. Usage $ nr1 nerdpack:deploy OPTION Options -c, --channel=DEV/BETA/STABLE Specifies the channel to deploy to. (required) -i, --nerdpack-id=NERDPACK_ID Specifies the Nerdpack to deploy. By default, the command will use the one in package.json. --from-version=VERSION Specifies which version to deploy. By default, the command will use the one in package.json. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 nerdpack:undeploy Undeploy your Nerdpack Undeploys a Nerdpack version from a specific channel (for example, DEV, BETA, or STABLE). Usage $ nr1 nerdpack:undeploy OPTION Options -c, --channel=DEV/BETA/STABLE Specifies the channel to undeploy from. (required) -i, --nerdpack-id=NERDPACK_ID Specifies the Nerdpack to deploy. By default, the command will use the one in package.json. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", + "type": "developer", + "document_type": "page", + "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.", + "sections": [ + "New Relic One CLI Nerdpack commands", + "Command details", + "nr1 nerdpack:clone", + "Clone an existing Nerdpack", + "Usage", + "Options", + "nr1 nerdpack:serve", + "Serve your Nerdpack locally", + "nr1 nerdpack:uuid", + "Get your Nerdpack's UUID", + "nr1 nerdpack:publish", + "Publish your Nerdpack", + "nr1 nerdpack:deploy", + "Deploy your Nerdpack to a channel", + "nr1 nerdpack:undeploy", + "Undeploy your Nerdpack" + ], + "title": "New Relic One CLI Nerdpack commands", + "popularity": 1, + "external_id": "7c1050a6a8624664b90c15111f7c72e96b2fbe17", + "image": "", + "url": "https://developer.newrelic.com/explore-docs/nr1-nerdpack/", + "published_at": "2020-08-18T02:11:48Z", + "updated_at": "2020-08-04T01:44:10Z", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 0.47135732, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "New Relic One CLI Nerdpack commands", + "sections": "New Relic One CLI Nerdpack commands", + "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.", + "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:clone Clones a Nerdpack from a git repository. nr1 nerdpack:serve Serves your Nerdpack" + }, + "id": "5f28bd6a64441f9817b11a38" + }, { "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", "type": "developer", @@ -6113,244 +6120,260 @@ "external_id": "503e515e1095418f8d19329517344ab209d143a4", "image": "", "url": "https://developer.newrelic.com/explore-docs/nr1-common/", - "published_at": "2020-08-17T01:54:01Z", + "published_at": "2020-08-18T02:06:04Z", "updated_at": "2020-08-14T01:48:10Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.10126272, + "_score": 0.16341951, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI common commands", - "sections": "New Relic One CLI common commands", - "info": "An overview of common commands you can use with the New Relic One CLI.", - "body": " (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command" + "title": "New Relic One CLI common commands", + "sections": "New Relic One CLI common commands", + "info": "An overview of common commands you can use with the New Relic One CLI.", + "body": " (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command" }, "id": "5f28bd6ae7b9d267996ade94" } ], - "/automate-workflows/get-started-kubernetes": [ + "/collect-data/query-data-nrql": [ { - "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform", + "body": "Add custom attributes to your New Relic data There are countless filters and pivots you might want to apply to your data. By adding custom attributes to your data, you can see beyond your code and analyze your business in-depth. A common pattern when using custom attributes is to capture user information, e.g. name, id, email, etc. This allows you to 'link' your operational data with your business data. For example, if you have the user information, you tie together your service desk and CRM data with the operational data in New Relic. Step 1 of 2 You can add a userid custom attribute to your APM-reported data (Transaction and TransactionError events) with the opensource Java APM agent's API. NewRelic.addCustomParameter('userid', userId); Copy Step 2 of 2 Once added, you can run a NRQL query that uses the 'userid' custom attribute. Once you have added a custom attribute like 'userid', you can use it to filter and facet your NRQL queries. -- Get a count of errors experienced by a single filtered userid faceted by date and error message SELECT count(*) FROM TransactionError WHERE userid = '1401961100' FACET dateOf(timestamp), `error.message` SINCE 1 week ago Copy", "type": "developer", "document_type": "page", - "info": "", + "info": "Add metadata for more detailed analysis", "sections": [ - "Automate workflows", - "Guides to automate workflows", - "Quickly tag resources", - "Automate common tasks", - "Set up New Relic using the Kubernetes operator", - "Set up New Relic using Terraform" + "Add custom attributes to your New Relic data" ], - "title": "Automate workflows", + "title": "Add custom attributes to your New Relic data", "popularity": 1, - "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871", - "image": "", - "url": "https://developer.newrelic.com/automate-workflows/", - "published_at": "2020-08-17T01:55:15Z", - "updated_at": "2020-08-17T01:55:15Z", + "tags": [ + "Custom Attributes", + "NRQL" + ], + "external_id": "b7c3eb72c1c275d97df9c6232d50bd675ac2e39a", + "image": "https://developer.newrelic.com/static/2dd8a32b57677b2e8d2497147d8ebc26/2663f/custom-attribute-query.png", + "url": "https://developer.newrelic.com/collect-data/custom-attributes/", + "published_at": "2020-08-18T02:08:12Z", + "updated_at": "2020-08-04T01:39:41Z", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.1530586, + "_score": 0.7941898, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Set up New Relic using the Kubernetes operator", - "body": " solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform" + "title": "Add custom attributes to your New Relic data", + "sections": "Add custom attributes to your New Relic data", + "tags": "NRQL", + "body": " APM-reported data (Transaction and TransactionError events) with the opensource Java APM agent's API. NewRelic.addCustomParameter('userid', userId); Copy Step 2 of 2 Once added, you can run a NRQL query that uses the 'userid' custom attribute. Once you have added a custom attribute like 'userid" }, - "id": "5efa999c196a67dfb4766445" + "id": "5efa999de7b9d2985d7bab67" }, { - "body": "Set up New Relic using Terraform 20 min Terraform is a popular infrastructure as code software tool by HashiCorp. You can use it to provision all kind of infrastructure and services, including New Relic entities. In this guide you'll learn how to set up New Relic for the first time with Terraform. More specifically, you are going to provision an alert policy with notifications in your New Relic account using Terraform. Before you begin To use this guide, you should have some basic knowledge of both New Relic and Terraform. If you haven't deployed a New Relic open source agent yet, install New Relic for your application. Install Terraform CLI. Step 1 of 8 Bootstrap your provider configuration Our Terraform Provider detects the environment variables above when running Terraform commands. You can set the environment variables in your .bash_profile or .bashrc file. Set the following environment variables: Set your New Relic Personal API key with the NEW_RELIC_API_KEY environment variable. Most Personal API keys begin with the prefix NRAK-. Set your New Relic Admin API key with the NEW_RELIC_ADMIN_API_KEY environment variable. Most Admin API keys begin with the prefix NRAA-. Set your New Relic Account ID with the NEW_RELIC_ACCOUNT_ID environment variable. Set your New Relic region with the NEW_RELIC_REGION environment variable. Your region is US if your account settings page is located at rpm.newrelic.com, and EU if your account is located at rpm.eu.newrelic.com. # Add this to your .bash_profile export NEW_RELIC_API_KEY=NRAK-... export NEW_RELIC_ADMIN_API_KEY=NRAA-... export NEW_RELIC_ACCOUNT_ID=12345 export NEW_RELIC_REGION=US # Or set it inline when running `terraform plan` or `terraform apply`: $ NEW_RELIC_API_KEY=NRAK-... terraform apply Copy Step 2 of 8 Start with a provider configuration To connect Terraform with New Relic, you need to set New Relic as a provider in your Terraform configuration file, so that Terraform can create and manage New Relic resources in your account. To set New Relic as a provider, create a Terraform configuration file (main.tf). This code sets newrelic as the Terraform provider and provisions an empty alert policy as the resource. provider \"newrelic\" {} resource \"newrelic_alert_policy\" \"alert_policy_name\" { name = \"My Alert Policy Name\" } Copy Step 3 of 8 Initialize and test your setup After adding New Relic as a provider, initialize the working directory from the command line using terraform init. Once you've successfully initialized the working directory, test Terraform's execution plan using terraform plan to confirm that you've the right setup. # Initialize the working directory $ terraform init # Test the Terraform plan $ terraform plan Copy plan performs a dry run of your Terraform configuration, so nothing is actually provisioned. Always run plan to test your configuration before applying it. Step 4 of 8 Add a data source The alert policy you defined in main.tf does not contain any alert condition. You are going to add an alert condition linked to your application. To store your application's information, you need to add a data source. provider \"newrelic\" {} # Data Source data \"newrelic_entity\" \"app_name\" { name = \"my-app\" # This must be an exact match of your app name in New Relic (case sensitive) domain = \"APM\" type = \"APPLICATION\" } resource \"newrelic_alert_policy\" \"alert_policy_name\" { name = \"My Alert Policy Name\" } Copy Step 5 of 8 Add an alert condition to the alert policy Now you can add the alert condition. For example, you can create a critical alert condition that is triggered when the Apdex of your application falls below 0.75 for five minutes. provider \"newrelic\" {} data \"newrelic_entity\" \"app_name\" { name = \"my-app\" domain = \"APM\" type = \"APPLICATION\" } resource \"newrelic_alert_policy\" \"alert_policy_name\" { name = \"My Alert Policy Name\" } # Alert condition resource \"newrelic_alert_condition\" \"alert_condition_name\" { policy_id = newrelic_alert_policy.alert_policy_name.id name = \"My Alert Condition Name\" type = \"apm_app_metric\" entities = [data.newrelic_entity.app_name.application_id] metric = \"apdex\" runbook_url = \"https://www.example.com\" condition_scope = \"application\" term { duration = 5 operator = \"below\" priority = \"critical\" threshold = \"0.75\" time_function = \"all\" } } Copy Step 6 of 8 Add a notification channel Alert policies use notification channels to inform you about incidents and active alerts. To add a notification channel to your alert policy, add the following snippet to your configuration file. When the alert condition is triggered, the notification channel sends an email to the specified recipients. You can send notifications using different tools and channels, such as Slack, by changing the type of your alert channel. # Notification channel resource \"newrelic_alert_channel\" \"alert_notification_email\" { name = \"paul@example.com\" type = \"email\" config { recipients = \"fab@example.com\" include_json_attachment = \"1\" } } # Link the above notification channel to your policy resource \"newrelic_alert_policy_channel\" \"alert_policy_email\" { policy_id = newrelic_alert_policy.alert_policy_name.id channel_ids = [ newrelic_alert_channel.alert_notification_email.id ] } Copy Step 7 of 8 Apply your Terraform configuration The last step is provisioning the resources you've configured in main.tf, so that the alert policy is enabled in your New Relic account for your application. To apply the Terraform configuration and provision the resources in your New Relic account, run terraform apply. Answer yes when prompted to apply the changes. Once the apply process is complete, you should see the new alert policy you've provisioned using Terraform, and its alert conditions, in your New Relic account. You can run terraform apply every time you need to make changes to your configuration. To eliminate the resources you've provisioned, run terraform destroy. Step 8 of 8 Optional: Use the apm module for faster configuration In the Terraform Registry you can find our apm module, which simplifies Terraform's configuration. apm creates an alert policy, a Synthetics monitor, and several alert conditions for a given application reporting data into New Relic. To use our apm module with Terraform: Set newrelic/apm/newrelic as the module source. Add your account_id and application_name. Define your application_url (if any). Here is a configuration example with overridden default values. Initialize the working directory using terraform initto download and enable the module. Tip The apm module doesn't create a notification channel, so you would still have to define one. data \"newrelic_alert_channel\" \"pager\" { name = \"Page Developer Toolkit Team\" } module \"dummy-app-monitor\" { source = \"newrelic/apm/newrelic\" account_id = 2520528 application_name = \"Dummy App\" # An Apdex alert condition will be created with sensible defaults without the use of these attributes. apdex_warning_threshold = 0.9 apdex_critical_threshold = 0.8 # An error rate alert condition will be created with sensible defaults without the use of these attributes. error_rate_warning_threshold = 5 error_rate_critical_threshold = 10 # Specifying an application URL will provision a Synthetic monitor and associated alert condition. application_url = \"https://www.dummyapp.com\" synthetics_monitor_verify_ssl = true # Response time alert condition will not be provisioned unless a critical violation threshold is specified. response_time_critical_threshold = 3 channel_ids = [data.newrelic_alert_channel.pager.id] } Copy Tip: Avoid resources being marked as \"sensitive\" When API results are deemed to be secret and are obfuscated, Terraform may be unable to detect the state of a resource, marking it as changed. Consider this example: resource \"newrelic_alert_channel\" \"slack\" { name = \"slack\" type = \"slack\" config { channel = \"test\" url = \"https://hooks.slack.com/services/xxxx/xxxxx\" } } Copy Running terraform plan yields the following: -/+ newrelic_alert_channel.slack (new resource required) id: \"2344397\" => (forces new resource) config.%: \"1\" => \"2\" (forces new resource) config.channel: => (attribute changed) config.url: => (forces new resource) name: \"slack\" => \"slack\" type: \"slack\" => \"slack\" Copy To prevent Terraform from wrongly marking a resource as changed, add an ignore_changes directive: resource \"newrelic_alert_channel\" \"slack\" { ... lifecycle { ignore_changes = [\"config\"] } } ... Copy This avoids changes to resources caused by obfuscated items.", - "type": "developer", + "body": "NRQL is a query language you can use to query the New Relic database. This document explains NRQL syntax, clauses, components, and functions. Syntax This document is a reference for the functions and clauses used in a NRQL query. Other resources for understanding NRQL: Intro to NRQL: explains what NRQL is used for, what data you can query with it, and basic NRQL syntax Examine NRQL queries used to build New Relic charts Simulate SQL JOIN functions Use funnels to evaluate a series of related data Format NRQL for querying with the Event API Query components Every NRQL query will begin with a SELECT statement or a FROM clause. All other clauses are optional. The clause definitions below also contain example NRQL queries. Required: SELECT statement SELECT attribute ... SELECT function(attribute) ... The SELECT specifies what portion of a data type you want to query by specifying an attribute or a function. It's followed by one or more arguments separated by commas. In each argument you can: Get the values of all available attributes by using * as a wildcard. For example: SELECT * from Transaction. Get values associated with a specified attribute or multiple attributes specified in a comma separated list. Get aggregated values from specified attributes by selecting an aggregator function. Label the results returned in each argument with the AS clause. You can also use SELECT with basic math functions. Avg response time since last week This query returns the average response time since last week. SELECT average(duration) FROM PageView SINCE 1 week ago Required: FROM clause SELECT ... FROM data type ... Use the FROM clause to specify the data type you wish to query. You can start your query with FROM or with SELECT. You can merge values for the same attributes across multiple data types in a comma separated list. Query one data type This query returns the count of all APM transactions over the last three days: SELECT count(*) FROM Transaction SINCE 3 days ago Query multiple data types This query returns the count of all APM transactions and Browser events over the last three days: SELECT count(*) FROM Transaction, PageView SINCE 3 days ago SHOW EVENT TYPES clause SHOW EVENT TYPES... SHOW EVENT TYPES will return a list of all the data types present in your account for a specific time range. It is used as the first clause in a query instead of SELECT. In this context, \"event types\" refers to the data types you can access with a NRQL query. Data types in the last day This query will return all the data types present over the past day: SHOW EVENT TYPES SINCE 1 day ago WHERE clause Use the WHERE clause to filter results. NRQL returns the results that fulfill the condition(s) you specify in the clause. SELECT function(attribute) ... WHERE attribute [operator 'value' | IN ('value' [, 'value]) | IS [NOT] NULL ] [AND|OR ...] ... If you specify more than one condition, separate the conditions by the operators AND or OR. If you want to simulate a SQL join, use custom attributes in a WHERE or FACET clause. Operators that the WHERE clause accepts Description =, !=, <, <=, >, >= NRQL accepts standard comparison operators. Example: state = 'WA' AND Used to define an intersection of two conditions. OR Used to define a union of two conditions. IS NULL Determines if an attribute has a null value. IS NOT NULL Determines if an attribute does not have a null value. IN Determines if the string value of an attribute is in a specified set. Using this method yields better performance than stringing together multiple WHERE clauses. Example: animalType IN ('cat', 'dog', 'fish') NOT IN Determines if the string value of an attribute is not in a specified set. Using this method yields better performance than stringing together multiple WHERE clauses. Values must be in parentheses, separated by commas. For example: SELECT * FROM PageView WHERE countryCode NOT IN ('CA', 'WA') LIKE Determines if an attribute contains a specified sub-string. The string argument for the LIKE operator accepts the percent sign (%) as a wildcard anywhere in the string. If the substring does not begin or end the string you are matching against, the wildcard must begin or end the string. Examples: userAgentName LIKE 'IE%' IE IE Mobile userAgentName LIKE 'o%a%' Opera Opera Mini userAgentName LIKE 'o%a' Opera userAgentName LIKE '%o%a%' Opera Opera Mini Mozilla Gecko NOT LIKE Determines if an attribute does not contain a specified sub-string. RLIKE Determines if an attribute contains a specified Regex sub-string. Uses RE2 syntax. Examples: appName RLIKE 'z.*|q.*'' z-app q-app hostname RLIKE 'ip-10-351-[0-2]?[0-9]-.*' ip-10-351-19-237 ip-10-351-2-41 ip-10-351-24-238 ip-10-351-14-15 Note: Slashes must be escaped in the Regex pattern. For example, \\d must be \\\\d. Regex defaults to full-string matching, therefore ^ and $ are implicit and you do not need to add them. If the Regex pattern contains a capture group, the group will be ignored. That is, the group will not be captured for use later in the query. NOT RLIKE Determines if an attribute does not contain a specified Regex sub-string. Uses RE2 syntax. Example query with three conditions This query returns the browser response time for pages with checkout in the URL for Safari users in the United States and Canada over the past 24 hours. SELECT histogram(duration, 50, 20) FROM PageView WHERE countryCode IN ('CA', 'US') AND userAgentName='Safari' AND pageUrl LIKE '%checkout%' SINCE 1 day ago AS clause SELECT ... AS 'label' ... Use the AS clause to label an attribute, aggregator, step in a funnel, or the result of a math function with a string delimited by single quotes. The label is used in the resulting chart. Query using math function and AS This query returns the number of page views per session: SELECT count(*)/uniqueCount(session) AS 'Pageviews per Session' FROM PageView Query using funnel and AS This query returns a count of people who have visited both the main page and the careers page of a site over the past week: SELECT funnel(SESSION, WHERE name='Controller/about/main' AS 'Step 1', WHERE name = 'Controller/about/careers' AS 'Step 2') FROM PageView SINCE 1 week ago FACET clause SELECT ... FACET attribute ... Use FACET to separate and group your results by attribute values. For example, you could FACET your PageView data by deviceType to figure out what percentage of your traffic comes from mobile, tablet, and desktop devices. Use the LIMIT clause to specify how many facets appear (default is 10). For more complex grouping, use FACET CASES. FACET clauses support up to five attributes, separated by commas. The facets are sorted in descending order by the first field you provide in the SELECT clause. If you are faceting on attributes with more than 1,000 unique values, a subset of facet values is selected and sorted according to the query type. When selecting min(), max(), or count(), FACET uses those functions to determine how facets are picked and sorted. When selecting any other function, FACET uses the frequency of the attribute you are faceting on to determine how facets are picked and sorted. For more on faceting on multiple attributes, with some real-world examples, see this New Relic blog post. Faceted query using count() This query shows cities with the highest pageview counts. This query uses the total number of pageviews per city to determine how facets are picked and ordered. SELECT count(*) FROM PageView FACET city Faceted query using uniqueCount() This query shows the cities that access the highest number of unique URLs. This query uses the total number of times a particular city appears in the results to determine how facets are picked and ordered. SELECT uniqueCount(pageUrl) FROM PageView FACET city Grouping results across time Advanced segmentation and cohort analysis allow you to facet on bucket functions to more effectively break out your data. Cohort analysis is a way to group results together based on timestamps. You can separate them into buckets that cover a specified range of dates and times. FACET CASES clause SELECT ... FACET CASES ( WHERE attribute operator value, WHERE attribute operator value, ... ) ... Use FACET CASES to break out your data by more complex conditions than possible with FACET. Separate multiple conditions with a comma ,. For example, you could query your PageView data and FACET CASES into categories like less than 1 second, from 1 to 10 seconds, and greater than 10 seconds. You can combine multiple attributes within your cases, and label the cases with the AS selector. Data points will be added to at most one facet case, the first facet case that they match. You may also use a time function with your attribute. Basic usage with WHERE SELECT count(*) FROM PageView FACET CASES (WHERE duration < 1, WHERE duration > 1 and duration < 10, WHERE duration > 10) Group based on multiple attributes This example groups results into one bucket where the transaction name contains login, and another where the URL contains login and a custom attribute indicates that the user was a paid user: SELECT count(*) FROM Transaction FACET CASES (WHERE name LIKE '%login%', WHERE name LIKE '%feature%' AND customer_type='Paid') Label groups with AS This example uses the AS selector to give your results a human-readable name: SELECT count(*) FROM Transaction FACET CASES (WHERE name LIKE '%login%' AS 'Total Logins', WHERE name LIKE '%feature%' AND customer_type='Paid' AS 'Feature Visits from Paid Users') LIMIT clause SELECT ... LIMIT count ... Use the LIMIT clause to control the maximum number of facet values returned by FACET queries or the maximum number of items returned by SELECT * queries. This clause takes a single integer value as an argument. If the LIMIT clause is not specified, or no value is provided, the limit defaults to 10 for FACET queries and 100 in the case of SELECT * queries. The maximum allowed value for the LIMIT clause is 2,000. Query using LIMIT This query shows the top 20 countries by session count and provides 95th percentile of response time for each country for Windows users only. SELECT uniqueCount(session), percentile(duration, 95) FROM PageView WHERE userAgentOS = 'Windows' FACET countryCode LIMIT 20 SINCE YESTERDAY OFFSET clause SELECT ... LIMIT count OFFSET count ... Use the OFFSET clause with LIMIT to control the portion of rows returned by SELECT * or SELECT column queries. Like the LIMIT clause, OFFSET takes a single integer value as an argument. OFFSET sets the number of rows to be skipped before the selected rows of your query are returned. This is constrained by LIMIT. OFFSET rows are skipped starting from the most recent record. For example, the query SELECT interestingValue FROM Minute_Report LIMIT 5 OFFSET 1 returns the last 5 values from Minute_Report except for the most recent one. SINCE clause SELECT ... SINCE [numerical units AGO | phrase] ... The default value is 1 hour ago. Use the SINCE clause to define the beginning of a time range for the returned data. When using NRQL, you can set a UTC timestamp or relative time range. You can specify a timezone for the query but not for the results. NRQL results are based on your system time. See Set time range on dashboards and charts for detailed information and examples. UNTIL clause SELECT ... UNTIL integer units AGO ... The default value is NOW. Only use UNTIL to specify an end point other than the default. Use the UNTIL clause to define the end of a time range across which to return data. Once a time range has been specified, the data will be preserved and can be reviewed after the time range has ended. You can specify a UTC timestamp or relative time range. You can specify a time zone for the query but not for the results. The returned results are based on your system time. See Set time range on dashboards and charts for detailed information and examples. WITH TIMEZONE clause SELECT ... WITH TIMEZONE (selected zone) ... By default, query results are displayed in the timezone of the browser you're using. Use the WITH TIMEZONE clause to select a time zone for a date or time in the query that hasn't already had a time zone specified for it. For example, the query clause SINCE Monday UNTIL Tuesday WITH TIMEZONE 'America/New_York' will return data recorded from Monday at midnight, Eastern Standard Time, until midnight Tuesday, Eastern Standard Time. Available Time Zone Selections Africa/Abidjan Africa/Addis_Ababa Africa/Algiers Africa/Blantyre Africa/Cairo Africa/Windhoek America/Adak America/Anchorage America/Araguaina America/Argentina/Buenos_Aires America/Belize America/Bogota America/Campo_Grande America/Cancun America/Caracas America/Chicago America/Chihuahua America/Dawson_Creek America/Denver America/Ensenada America/Glace_Bay America/Godthab America/Goose_Bay America/Havana America/La_Paz America/Los_Angeles America/Miquelon America/Montevideo America/New_York America/Noronha America/Santiago America/Sao_Paulo America/St_Johns Asia/Anadyr Asia/Bangkok Asia/Beirut Asia/Damascus Asia/Dhaka Asia/Dubai Asia/Gaza Asia/Hong_Kong Asia/Irkutsk Asia/Jerusalem Asia/Kabul Asia/Katmandu Asia/Kolkata Asia/Krasnoyarsk Asia/Magadan Asia/Novosibirsk Asia/Rangoon Asia/Seoul Asia/Tashkent Asia/Tehran Asia/Tokyo Asia/Vladivostok Asia/Yakutsk Asia/Yekaterinburg Asia/Yerevan Atlantic/Azores Atlantic/Cape_Verde Atlantic/Stanley Australia/Adelaide Australia/Brisbane Australia/Darwin Australia/Eucla Australia/Hobart Australia/Lord_Howe Australia/Perth Chile/EasterIsland Etc/GMT+10 Etc/GMT+8 Etc/GMT-11 Etc/GMT-12 Europe/Amsterdam Europe/Belfast Europe/Belgrade Europe/Brussels Europe/Dublin Europe/Lisbon Europe/London Europe/Minsk Europe/Moscow Pacific/Auckland Pacific/Chatham Pacific/Gambier Pacific/Kiritimati Pacific/Marquesas Pacific/Midway Pacific/Norfolk Pacific/Tongatapu UTC   See Set time range on dashboards and charts for detailed information and examples. WITH METRIC_FORMAT clause For information on querying metric data, see Query metrics. COMPARE WITH clause SELECT ... (SINCE or UNTIL) (integer units) AGO COMPARE WITH (integer units) AGO ... Use the COMPARE WITH clause to compare the values for two different time ranges. COMPARE WITH requires a SINCE or UNTIL statement. The time specified by COMPARE WITH is relative to the time specified by SINCE or UNTIL. For example, SINCE 1 day ago COMPARE WITH 1 day ago compares yesterday with the day before. The time range for theCOMPARE WITH value is always the same as that specified by SINCE or UNTIL. For example, SINCE 2 hours ago COMPARE WITH 4 hours ago might compare 3:00pm through 5:00pm against 1:00 through 3:00pm. COMPARE WITH can be formatted as either a line chart or a billboard: With TIMESERIES, COMPARE WITH creates a line chart with the comparison mapped over time. Without TIMESERIES, COMPARE WITH generates a billboard with the current value and the percent change from the COMPARE WITH value. Example: This query returns data as a line chart showing the 95th percentile for the past hour compared to the same range one week ago. First as a single value, then as a line chart. SELECT percentile(duration) FROM PageView SINCE 1 week ago COMPARE WITH 1 week AGO SELECT percentile(duration) FROM PageView SINCE 1 week ago COMPARE WITH 1 week AGO TIMESERIES AUTO TIMESERIES clause SELECT ... TIMESERIES integer units ... Use the TIMESERIES clause to return data as a time series broken out by a specified period of time. Since TIMESERIES is used to trigger certain charts, there is no default value. To indicate the time range, use integer units. For example: TIMESERIES 1 minute TIMESERIES 30 minutes TIMESERIES 1 hour TIMESERIES 30 seconds Use a set interval The value provided indicates the units used to break out the graph. For example, to present a one-day graph showing 30 minute increments: SELECT ... SINCE 1 day AGO TIMESERIES 30 minutes Use automatically set interval TIMESERIES can also be set to AUTO, which will divide your graph into a reasonable number of divisions. For example, a daily chart will be divided into 30 minute intervals and a weekly chart will be divided into 6 hour intervals. This query returns data as a line chart showing the 50th and 90th percentile of client-side transaction time for one week with a data point every 6 hours. SELECT average(duration), percentile(duration, 50, 90) FROM PageView SINCE 1 week AGO TIMESERIES AUTO Use max interval You can set TIMESERIES to MAX, which will automatically adjust your time window to the maximum number of intervals allowed for a given time period. This allows you to update your time windows without having to manually update your TIMESERIES buckets and ensures your time window is being split into the peak number of intervals allowed. The maximum number of TIMESERIES buckets that will be returned is 366. For example, the following query creates 4-minute intervals, which is the ceiling for a daily chart. SELECT average(duration) FROM Transaction since 1 day ago TIMESERIES MAX For functions such as average( ) or percentile( ), a large interval can have a significant smoothing effect on outliers. EXTRAPOLATE clause You can use this clause with these data types: Transaction TransactionError Custom events reported via APM agent APIs The purpose of EXTRAPOLATE is to mathematically compensate for the effects of APM agent sampling of event data so that query results more closely represent the total activity in your system. This clause will be useful when a New Relic APM agent reports so many events that it often passes its harvest cycle reporting limits. When that occurs, the agent begins to sample events. When EXTRAPOLATE is used in a NRQL query that supports its use, the ratio between the reported events and the total events is used to extrapolate a close approximation of the total unsampled data. When it is used in a NRQL query that doesn’t support its use or that hasn’t used sampled data, it has no effect. Note that EXTRAPOLATE is most useful for homogenous data (like throughput or error rate). It's not effective when attempting to extrapolate a count of distinct things (like uniqueCount() or uniques()). This clause works only with NRQL queries that use one of the following aggregator functions: apdex average count histogram sum percentage (if function it takes as an argument supports EXTRAPOLATE) rate (if function it takes as an argument supports EXTRAPOLATE) stddev Example of extrapolating throughput A query that will show the extrapolated throughput of a service named interestingApplication. SELECT count(*) FROM Transaction WHERE appName='interestingApplication' SINCE 60 minutes ago EXTRAPOLATE Example of extrapolating throughput as a time series A query that will show the extrapolated throughput of a service named interestingApplication by transaction name, displayed as a time series. SELECT count(*) FROM Transaction WHERE appName='interestingApplication' SINCE 60 minutes ago FACET name TIMESERIES 1 minute EXTRAPOLATE Query metric data There are several ways to query metric data using NRQL: Query metric timeslice data, which is reported by New Relic APM, Mobile, Browser Query the Metric data type, which is reported by some of our integrations and Telemetry SDKs For more on understanding metrics in New Relic, see Metric data types. Aggregator functions Use aggregator functions to filter and aggregate data in a NRQL query. Some helpful information about using aggregator functions: See the New Relic University tutorials for Filter queries, Apdex queries, and Percentile queries. Or, go to the full online course Writing NRQL queries. Data type \"coercion\" is not supported. Read about available type conversion functions. Cohort analysis functions appear on the New Relic Insights Cohort analysis page. The cohort functions aggregate transactions into time segments. Here are the available aggregator functions. The definitions below contain example NRQL queries. Examples: SELECT histogram(duration, 10, 20) FROM PageView SINCE 1 week ago apdex(attribute, t: ) Use the apdex function to return an Apdex score for a single transaction or for all your transactions. The attribute can be any attribute based on response time, such as duration or backendDuration. The t: argument defines an Apdex T threshold in seconds. The Apdex score returned by the apdex( ) function is based only on execution time. It does not account for APM errors. If a transaction includes an error but completes in Apdex T or less, that transaction will be rated satisfying by the apdex ( ) function. Get Apdex for specific customers If you have defined custom attributes, you can filter based on those attributes. For example, you could monitor the Apdex for a particularly important customer: SELECT apdex(duration, t: 0.4) FROM Transaction WHERE customerName='ReallyImportantCustomer' SINCE 1 day ago Get Apdex for specific transaction Use the name attribute to return a score for a specific transaction, or return an overall Apdex by omitting name. This query returns an Apdex score for the Controller/notes/index transaction over the last hour: SELECT apdex(duration, t: 0.5) from Transaction WHERE name='Controller/notes/index' SINCE 1 hour ago The apdex function returns an Apdex score that measures user satisfaction with your site. Arguments are a response time attribute and an Apdex T threshold in seconds. Get overall Apdex for your app This example query returns an overall Apdex for the application over the last three weeks: SELECT apdex(duration, t: 0.08) FROM Transaction SINCE 3 week ago average(attribute) Use the average( ) function to return the average value for an attribute. It takes a single attribute name as an argument. If a value of the attribute is not numeric, it will be ignored when aggregating. If data matching the query's conditions is not found, or there are no numeric values returned by the query, it will return a value of null. buckets(attribute, ceiling [,number of buckets]) Use the buckets() function to aggregate data split up by a FACET clause into buckets based on ranges. You can bucket by any attribute that is stored as a numerical value in the New Relic database. It takes three arguments: Attribute name Maximum value of the sample range. Any outliers will appear in the final bucket. Total number of buckets For more information and examples, see Split your data into buckets. bucketPercentile(attribute) The bucketPercentile( ) function is the NRQL equivalent of the histogram_quantile function in Prometheus. It is intended to be used with dimensional metric data. Instead of the quantile, New Relic returns the percentile, which is the quantile * 100. Use the bucketPercentile( ) function to calculate the quantile from the histogram data in a Prometheus format. It takes the bucket name as an argument and reports percentiles along the bucket's boundaries: SELECT bucketPercentile(duration_bucket) FROM Metric SINCE 1 day ago Optionally, you can add percentile specifications as an argument: SELECT bucketPercentile(duration_bucket, 50, 75, 90) FROM Metric SINCE 1 day ago Because multiple metrics are used to make up Prometheus histogram data, you must query for specific Prometheus metrics in terms of the associated . For example, to compute percentiles from a Prometheus histogram, with the prometheus_http_request_duration_seconds using NRQL, use bucketPercentile(prometheus_http_request_duration_seconds_bucket, 50). Note how _bucket is added to the end of the as a suffix. See the Prometheus.io documentation for more information. cardinality(attribute) Use the cardinality( ) function to obtain the number of combinations of all the dimensions (attributes) on a metric. It takes three arguments, all optional: Metric name: if present, cardinality( ) only computes the metric specified. Include: if present, the include list restricts the cardinality computation to those attributes. Exclude: if present, the exclude list causes those attributes to be ignored in the cardinality computation. SELECT cardinality(metric_name, include:{attribute_list}, exclude:{attribute_list}) count(*) Use the count( ) function to return a count of available records. It takes a single argument; either *, an attribute, or a constant value. Currently, it follows typical SQL behavior and counts all records that have values for its argument. Since count(*) does not name a specific attribute, the results will be formatted in the default \"humanize\" format. derivative(attribute [,time interval]) derivative() finds the rate of change for a given dataset. The rate of change is calculated using a least-squares regression to approximate the derivative. The time interval is the period for which the rate of change is calculated. For example, derivative(attributeName, 1 minute) will return the rate of change per minute. dimensions(include: {attributes}, exclude: {attributes}) Use the dimensions( ) function to return all the dimensional values on a data type. You can explicitly include or exclude specific attributes using the optional arguments: Include: if present, the include list limits dimensions( ) to those attributes. Exclude: if present, the dimensions( ) calculation ignores those attributes. FROM Metric SELECT count(node_filesystem_size) TIMESERIES FACET dimensions() When used with a FACET clause, dimensions( ) produces a unique timeseries for all facets available on the event type, similar to how Prometheus behaves with non-aggregated queries. earliest(attribute) Use the earliest( ) function to return the earliest value for an attribute over the specified time range. It takes a single argument. Arguments after the first will be ignored. If used in conjunction with a FACET it will return the most recent value for an attribute for each of the resulting facets. Get earliest country per user agent from PageView This query returns the earliest country code per each user agent from the PageView event. SELECT earliest(countryCode) FROM PageView FACET userAgentName eventType() ...WHERE eventType() = 'EventNameHere'... ...FACET eventType()... Use the eventType() function in a FACET clause to break out results by the selected data type or in a WHERE clause to filter results to a specific data type. This is particularly useful for targeting specific data types with the filter() and percentage() functions. In this context, \"event type\" refers to the types of data you can access with a NRQL query. Use eventType() in filter() function This query returns the percentage of total TransactionError results out of the total Transaction results. You can use the eventType() function to target specific types of data with the filter() function. SELECT 100 * filter(count(*), where eventType() = 'TransactionError') / filter(count(*), where eventType() = 'Transaction') FROM Transaction, TransactionError WHERE appName = 'App.Prod' TIMESERIES 2 Minutes SINCE 6 hours ago Use eventType() with FACET This query displays a count of how many records each data type (Transaction and TransactionError) returns. SELECT count(*) FROM Transaction, TransactionError FACET eventType() TIMESERIES filter(function(attribute), WHERE condition) Use the filter( ) function to limit the results for one of the aggregator functions in your SELECT statement. You can use filter() in conjunction with FACET or TIMESERIES. Analyze purchases that used offer codes You could use filter() to compare the items bought in a set of transactions for those using an offer code versus those who aren't: Use the filter( ) function to limit the results for one of the aggregator functions in your SELECT statement. funnel(attribute, steps) Use the funnel() function to generate a funnel chart. It takes an attribute as its first argument. You then specify steps as WHERE clauses (with optional AS clauses for labels) separated by commas. For details and examples, see the funnels documentation. getField(attribute, field) Use the getField() function to extract a field from complex metrics. It takes the following arguments: Metric type Supported fields summary count, total, max, min gauge count, total, max, min, latest distribution count, total, max, min counter count Examples: SELECT max(getField(mySummary, count)) from Metric SELECT sum(mySummary) from Metric where getField(mySummary, count) > 10 histogram(attribute, ceiling [,number of buckets]) Use the histogram( ) function to generate histograms. It takes three arguments: Attribute name Maximum value of the sample range Total number of buckets Histogram of response times from PageView events This query results in a histogram of response times ranging up to 10 seconds over 20 buckets. SELECT histogram(duration, 10, 20) FROM PageView SINCE 1 week ago Prometheus histogram buckets histogram( ) accepts Prometheus histogram buckets: SELECT histogram(duration_bucket, 10, 20) FROM Metric SINCE 1 week ago New Relic distribution metric histogram( ) accepts Distribution metric as an input: SELECT histogram(myDistributionMetric, 10, 20) FROM Metric SINCE 1 week ago keyset() Using keyset() will allow you to see all of the attributes for a given data type over a given time range. It takes no arguments. It returns a JSON structure containing groups of string-typed keys, numeric-typed keys, boolean-typed keys, and all keys. See all attributes for a data type This query returns the attributes found for PageView events from the last day: SELECT keyset() FROM PageView SINCE 1 day ago latest(attribute) Use the latest( ) function to return the most recent value for an attribute over a specified time range. It takes a single argument. Arguments after the first will be ignored. If used in conjunction with a FACET it will return the most recent value for an attribute for each of the resulting facets. Get most recent country per user agent from PageView This query returns the most recent country code per each user agent from the PageView event. SELECT latest(countryCode) FROM PageView FACET userAgentName max(attribute) Use the max( ) function to return the maximum recorded value of a numeric attribute over the time range specified. It takes a single attribute name as an argument. If a value of the attribute is not numeric, it will be ignored when aggregating. If data matching the query's conditions is not found, or there are no numeric values returned by the query, it will return a value of null. median(attribute) Use the median( ) function to return an attribute's median, or 50th percentile. For more information about percentile queries, see percentile(). The median( ) query is only available when using the query builder. Median query This query will generate a line chart for the median value. SELECT median(duration) FROM PageView TIMESERIES AUTO min(attribute) Use the min( ) function to return the minimum recorded value of a numeric attribute over the time range specified. It takes a single attribute name as an argument. If a value of the attribute is not numeric, it will be ignored when aggregating. If data matching the query's conditions is not found, or there are no numeric values returned by the query, it will return a value of null. percentage(function(attribute), WHERE condition) Use the percentage( ) function to return the percentage of a target data set that matches some condition. The first argument requires an aggregator function against the desired attribute. Use exactly two arguments (arguments after the first two will be ignored). If the attribute is not numeric, this function returns a value of 100%. percentile(attribute [, percentile [, ...]]) Use the percentile( ) function to return an attribute's approximate value at a given percentile. It requires an attribute and can take any number of arguments representing percentile points. The percentile() function enables percentiles to displays with up to three digits after the decimal point, providing greater precision. Percentile thresholds may be specified as decimal values, but be aware that for most data sets, percentiles closer than 0.1 from each other will not be resolved. Percentile display examples Use TIMESERIES to generate a line chart with percentiles mapped over time. Omit TIMESERIES to generate a billboard and attribute sheet showing aggregate values for the percentiles. If no percentiles are listed, the default is the 95th percentile. To return only the 50th percentile value, the median, you can also use median(). Basic percentile query This query will generate a line chart with lines for the 5th, 50th, and 95th percentile. SELECT percentile(duration, 5, 50, 95) FROM PageView TIMESERIES AUTO predictLinear(attribute, [,time interval]) predictLinear() is an extension of the derivative() function. It uses a similar method of least-squares linear regression to predict the future values for a dataset. The time interval is how far the query will look into the future. For example, predictLinear(attributeName, 1 hour) is a linear prediction 1 hour into the future of the query time window. Generally, predictLinear() is helpful for continuously growing values like disk space, or predictions on large trends. Since predictLinear() is a linear regression, familiarity with the dataset being queried helps to ensure accurate long-term predictions. Any dataset which grows exponentially, logarithmically, or by other nonlinear means will likely only be successful in very short-term predictions. New Relic recommends against using predictLinear in TIMESERIES queries. This is because each bucket will be making an individual prediction based on its relative timeframe within the query, meaning that such queries will not show predictions from the end of the timeseries forward. rate(function(attribute) [,time interval]) Use the rate( ) function to visualize the frequency or rate of a given query per time interval. For example, you might want to know the number of pageviews per minute over an hour-long period or the count of unique sessions on your site per hour over a day-long period. Use TIMESERIES to generate a line chart with rates mapped over time. Omit TIMESERIES to generate a billboard showing a single rate value averaged over time. Basic rate query This query will generate a line chart showing the rate of throughput for APM transactions per 10 minutes over the past 6 hours. SELECT rate(count(*), 10 minute) FROM Transaction SINCE 6 hours ago TIMESERIES round(attribute) Use the round( ) function to return the rounded value of an attribute. Optionally round( ) can take a second argument, to_nearest, to round the first argument to the closest multiple of the second one. to_nearest can be fractional. SELECT round(n [, to_nearest]) stddev(attribute) Use the stddev( ) function to return one standard deviation for a numeric attribute over the time range specified. It takes a single argument. If the attribute is not numeric, it will return a value of zero. stdvar(attribute) Use the stdvar( ) function to return the standard variance for a numeric attribute over the time range specified. It takes a single argument. If the attribute is not numeric, it will return a value of zero. sum(attribute) Use the sum( ) function to return the sum recorded values of a numeric attribute over the time range specified. It takes a single argument. Arguments after the first will be ignored. If the attribute is not numeric, it will return a value of zero. uniqueCount(attribute) Use the uniqueCount( ) function to return the number of unique values recorded for an attribute over the time range specified. To optimize query performance, this function returns approximate results for queries that inspect more than 256 unique values. uniques(attribute [,limit]​) Use the uniques( ) function to return a list of unique values recorded for an attribute over the time range specified. When used along with the facet clause, a list of unique attribute values will be returned per each facet value. The limit parameter is optional. When it is not provided, the default limit of 1,000 unique attribute values per facet is applied. You may specify a different limit value, up to a maximum of 10,000. The uniques( ) function will return the first set of unique attribute values discovered, until the limit is reached. Therefore, if you have 5,000 unique attribute values in your data set, and the limit is set to 1,000, the operator will return the first 1,000 unique values that it discovers, regardless of their frequency. The maximum number of values that can be returned in a query result is the product of the uniques( ) limit times the facet limit. In the following query, the theoretical maximum number of values that can be returned is 5 million (5,000 x 1,000). From Transaction SELECT uniques(host,5000) FACET appName LIMIT 1000 However, depending on the data set being queried, and the complexity of the query, memory protection limits may prevent a very large query from being executed. Type conversion NRQL does not support \"coercion.\" This means that a float stored as a string is treated as a string and cannot be operated on by functions expecting float values. You can convert a string with a numeric value or a boolean with a string value to their numeric and boolean types with these functions: Use the numeric() function to convert a number with a string format to a numeric function. The function can be built into a query that uses math functions on query results or NRQL aggregator functions, such as average(). Use the boolean() function to convert a string value of \"true\" or \"false\" to the corresponding boolean value. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", "document_type": "page", - "info": "Learn how to provision New Relic resources using [Terraform](https://www.terraform.io/).", + "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started", + "info": "New Relic Query Language (NRQL) dictionary of clauses and aggregator functions. ", + "nodeid": 1136, "sections": [ - "Set up New Relic using Terraform", - "Before you begin", - "Bootstrap your provider configuration", - "Start with a provider configuration", - "Initialize and test your setup", - "Add a data source", - "Add an alert condition to the alert policy", - "Add a notification channel", - "Apply your Terraform configuration", - "Optional: Use the apm module for faster configuration", - "Tip", - "Tip: Avoid resources being marked as \"sensitive\"" + "NRQL: New Relic Query Language", + "Get started", + "NRQL query tools", + "NRQL query tutorials", + "NRQL syntax, clauses, and functions", + "Syntax", + "Query components", + "Query metric data", + "Aggregator functions", + "Type conversion", + "For more help" ], - "title": "Set up New Relic using Terraform", + "title": "NRQL syntax, clauses, and functions", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/nrql-syntax-clauses-functions", "popularity": 1, - "tags": [ - "notification channel", - "Synthetics monitors" - ], - "external_id": "a8e6eb8132628da407bf24eeeca752931f4a09df", - "image": "", - "url": "https://developer.newrelic.com/automate-workflows/get-started-terraform/", - "published_at": "2020-08-17T01:50:24Z", - "updated_at": "2020-08-14T01:48:10Z", + "external_id": "a748f594f32d72e0cbd0bca97e4cedc4e398dbab", + "category_1": "NRQL: New Relic Query Language", + "category_2": "Get started", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/percentile_0.png", + "url": "https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/nrql-syntax-clauses-functions", + "published_at": "2020-08-18T06:37:42Z", + "updated_at": "2020-08-15T03:21:31Z", + "category_0": "Query your data", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0041006245, + "_score": 0.6758109, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Set up New Relic using Terraform", - "sections": "Set up New Relic using Terraform", - "info": "Learn how to provision New Relic resources using [Terraform](https://www.terraform.io/).", - "body": "Set up New Relic using Terraform 20 min Terraform is a popular infrastructure as code software tool by HashiCorp. You can use it to provision all kind of infrastructure and services, including New Relic entities. In this guide you'll learn how to set up New Relic for the first time with Terraform" + "title": "NRQL syntax, clauses, and functions", + "sections": "NRQL syntax, clauses, and functions", + "info": "New Relic Query Language (NRQL) dictionary of clauses and aggregator functions. ", + "category_0": "Query your data", + "category_1": "NRQL: New Relic Query Language", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/nrql-syntax-clauses-functions", + "body": " NRQL is used for, what data you can query with it, and basic NRQL syntax Examine NRQL queries used to build New Relic charts Simulate SQL JOIN functions Use funnels to evaluate a series of related data Format NRQL for querying with the Event API Query components Every NRQL query will begin", + "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started" }, - "id": "5efa999d196a67300c766404" + "id": "5f2abcef28ccbcb0ee0c3aed" }, { - "body": "logo-newrelic Search Products Pricing Solutions Help Center About New Relic for iOS or Android    New Relic Insights App for iOS Search icon Sign Up Log In Products New Relic One Platform Overview Telemetry Data Platform Full-Stack Observability Applied Intelligence Solutions By Topic DevOps Cloud Adoption Cloud Native Digital Customer Experience By Industry E-commerce and Retail Media Public Sector By Technology Amazon Web Services Pivotal Cloud Foundry Microsoft Azure Google Cloud Platform Kubernetes Help Center Learn Docs Build on New Relic Explore open source projects Training Get help Community forum Global technical support Expert services About Our Customers Over 17,000 customers love New Relic, from Fortune 500 enterprises to small businesses around the globe. Our Blog The latest news, tips, and insights from the world of New Relic and digital intelligence. Our Company About Us Leadership Meetups and Events Resources   Investor Relations Newsroom Partner Program Contact Us logo-newrelic Want to use our logo? There's a page for that, including instructions and different styles and formats. Sorry about grabbing your right-click. Just trying to be helpful. You can also go home. Back to top icon Case Study CarRentals.com Drives Operational Excellence Through Continuous Measurement Using New Relic Contact sales INDUSTRY Travel LOCATION Bellevue, Wash. USE CASE System-wide monitoring of application and infrastructure performance, with analysis of long- and short-term trends PRODUCTS USED Insights Synthetics Infrastructure APM Browser WHY NEW RELIC Provides full-stack monitoring combined with powerful UI, visualization, and integration capabilities HIGHLIGHTS Achieved major savings by lowering costs associated with managing multiple monitoring tools Freed up three to four full-time employees to focus on strategic tasks Improved customer satisfaction and minimized revenue lost through customer abandonment Links Download PDF At its core, CarRentals.com is a technology brand within the Expedia Group. And it definitely takes a considerable amount of technological prowess to deliver the services that this online car rental booking company promises to customers and partners, features such as 60-second bookings and constantly updated inventory and pricing. To provide this consistently high level of service and innovation, CarRentals.com relies on Amazon Web Services (AWS) to deliver its modernized cloud-based IT infrastructure, and on New Relic monitoring to achieve the full-stack visibility it needs to support scalable, reliable application delivery on top of that infrastructure.  Cultivating a culture of measurement One way that CarRentals.com’s IT organization has helped the company succeed in its goals has been by making operational excellence a part of its charter. Explains Craig Vandeputte, CarRentals.com’s director of DevOps, “To achieve operational excellence, we measure everything. Only in that way can we manage and improve everything.”  This kind of measurement is necessary to answer important questions about the effectiveness of its DevOps approach: Should there be a problem with an application, is the company the first to know about an issue rather than being alerted to it by customers? How quick is the team to fix those problems, and how fast can CarRentals.com get value to its customers? And while measuring everything is one thing, realizing the full value of all that measurement is quite another. With disparate monitoring tools, the organization lacked a unified way to visualize the performance of all its applications and infrastructure, limiting the IT team at CarRentals.com in extracting the full value of its software.  Like the Expedia Group overall, CarRentals.com has grown through acquisition. As a result, the company today supports two brands in addition to the flagship CarRentals.com: CarDelMar in Germany and the Netherlands, and Autoescape in France. Until recently, each brand was running a different monitoring solution. Each brand also had its own user interface (UI) supported by a common PHP-based monolithic backend. Recently, however, CarRentals.com started breaking up that backend into a set of microservices and moving those separate UIs to a common codebase. As the company began to consolidate its codebases, it also began looking to consolidate its monitoring tools with a solution that could be used across all three brands, and hook into Expedia Group’s Event Management Framework for incident management. A single tool for system-wide monitoring CarRentals.com found its solution in the New Relic platform. With CarDelMar already employing New Relic, the CarRentals.com IT team took a closer look at the monitoring solution and realized it provided precisely what the company needed. Says CarRentals.com brand CTO Garrett Vargas, “When we considered New Relic’s ability to surface problems not just at the UI layer but throughout our entire technology stack—as well as its tight integration with many of our development tools—it didn’t take long for us to agree on it as our one-stack solution.” Vandeputte joined the CarRentals.com team shortly after New Relic had been deployed, and he was pleasantly surprised by what he found. “In previous roles I’ve used a variety of home-grown, open-source solutions for monitoring,” he says. “When I was introduced to New Relic, I thought, holy cow, you have everything you need in one solution: synthetics to simulate user flows and behaviors, a beautiful UI, visualization mechanisms that are far more mature than anything I’d seen, and more.”  “When I was introduced to New Relic, I thought, holy cow, you have everything you need in one solution: synthetics to simulate user flows and behaviors, a beautiful UI, visualization mechanisms that are far more mature than anything I’d seen, and more.” Craig Vandeputte Director of DevOps for CarRentals.com The key to DevOps success By transitioning to microservices and delivering its IT infrastructure using AWS, CarRentals.com had already accelerated application development and gained the ability to scale globally. The addition of New Relic across all its brands has enabled CarRentals.com to raise the bar even higher. For the DevOps team, this has meant working with engineers from the company’s other three IT teams to identify key performance indicators (such as transactions per second, error rate, error count, success rate, and latencies) for each feature or update they’re working on. “Once the team has established what to measure and when to send out alerts, New Relic does the rest,” says Vandeputte. “As soon as an incident occurs—or an established threshold has been violated—an alert is sent to Expedia Group’s Event Management Framework, which escalates it to the correct team.”  Not surprisingly, this is invaluable to the DevOps team, which is able to deploy more quickly—and more confidently—as a result. Case in point: When a code change to the “Expedia Suggests Service” (which tries to resolve a user’s destination as they are typing it in) unintentionally transformed an optional field into a required one on the CarRentals.com site, New Relic sent out an alert, and within 20 minutes the Hamburg team had pushed out two releases and fixed the problem. It’s this kind of capability that helps CarRentals.com address those key performance questions mentioned earlier. In this instance, the company was the first to know there was an issue before its customers ever discovered it. Not only was the team able to fix the problem quickly, they now have the confidence to experiment with new features more often because they know they can spot and resolve issues immediately should they occur.   Instant insight into wide-ranging performance data While CTO Vargas appreciates the enormous value of this type of quick issue identification and resolution, what he likes best about having a unified monitoring platform is the New Relic Insights-created dashboards that enable him to analyze long- and short-term trends to his heart’s content. “Whether I want to look at site speed, purchase success rates, or any other metric we’ve deemed important, I can look at a dashboard that shows me day-by-day or hour-by-hour if performance is improving or degrading,” Vargas says. “This is hugely helpful.” Easing management, lowering costs, and delighting customers By deploying a suite of New Relic SaaS-based monitoring tools (including New Relic APM, New Relic Infrastructure, New Relic Synthetics, New Relic Browser, and New Relic Insights), CarRentals.com has not only gained a system-wide view of application and infrastructure performance, it has also achieved significant savings by lowering management costs. Vandeputte estimates that New Relic has enabled CarRentals.com to free up three to four full-time employees to focus on more strategic tasks. “In the past, I’ve seen teams spend 25% of their time either maintaining our monitoring solutions or developing new tools to monitor different areas,” Vandeputte says. “That work alone involved myriad subject matter experts working on a variety of platforms, which was hugely distracting and very expensive. With New Relic’s SaaS approach, we’re able to offload all of that burden.”  And it’s not just the IT team at CarRentals.com that’s benefiting from New Relic monitoring. Explains Vargas, “Even though we’re still in the early stages of integrating our New Relic dashboards into the Expedia Group network operations center, we’ve spent a considerable amount of time going over how we can better visualize the state of health across all of Expedia Group using New Relic. So far, people are very excited about what they’re seeing. New Relic dashboards are a welcome addition to our monitoring wall because they’re easier to read, everything is on one page, and they’re just a lot more mature than what is currently being used.” \"New Relic dashboards are a welcome addition to our monitoring wall because they’re easier to read, everything is on one page, and they’re just a lot more mature than what is currently being used.” Garrett Vargas CTO of CarRentals.com Most important, CarRentals.com is now able to constantly improve the digital customer experience. Says Vargas, “When customers aren’t able to retrieve or complete a booking, for example, we hear about it. So the faster we’re able to resolve an incident—or avoid an incident completely—the better feedback we get from customers.\"  Thus, with incidents being resolved significantly faster due to increased application health visibility, and error rates on the decline, customers are happier and the revenue lost through customer abandonment has dropped sharply. “With New Relic, we’re now able to dig deeper, so that when an incident does occur, we can usually pinpoint something that’s either not being measured or that needs better measurement, or identify new dependencies,” says Vargas. “As a result, we’re able to achieve our goal of being first to know of a problem, quick to fix it, and always improving—and that adds up to operational excellence.” Related Resources Case Study Phlexglobal Uses New Relic to Gain Visibility into Performance of Electronic Trial Master File Platform on Azure Cloud Solution Sheet Optimice su Eficiencia con Desarrollo Centrado en Datos Solution Sheet Otimize sua Eficiência com o Desenvolvimento Centrado em Dados White Paper Modernizing with AWS: Refactoring eBook The Enterprise Guide to Continuous Application Modernization Solution Sheet Mit datengestütztem DevOps schneller zum Erfolg Solution Sheet Allez plus vite avec une approche DevOps axée sur les données Solution Sheet Move Faster With Data-Driven DevOps COMPANY Careers and Culture Partner Program Investor Relations NewRelic.org Suppliers Portal CONNECT Contact Us Request Demo Events international newrelic.co.jp (Japanese) newrelic.fr (French) newrelic.de (German) Terms of Service DMCA Policy Privacy Policy Cookie Policy UK Slavery Act of 2015 ©2008-20 New Relic, Inc. All rights reserved", - "type": "storefront", - "info": "", + "body": "You can create alert conditions using NRQL queries. Create NRQL alert condition To create a NRQL condition: When you start to create a condition, where it prompts you to Select a product, click NRQL. Tips on creating a NRQL condition: NRQL conditions Tips Condition types NRQL condition types include static, baseline, and outlier. Create a description For some condition types, you can create a Description. Query results Queries must return a number. The condition works by evaluating that returned number against the thresholds you set. Time period As with all alert conditions, NRQL conditions evaluate one single minute at a time. The implicit SINCE ... UNTIL clause specifying which minute to evaluate is controlled by your Evaluation offset setting. Since very recent data may be incomplete, you may want to query data from 3 minutes ago or longer, especially for: Applications that run on multiple hosts. SyntheticCheck data: Timeouts can take 3 minutes, so 5 minutes or more is recommended. Also, if a query will generate intermittent data, consider using the sum of query results option. Condition settings Use the Condition settings to: Configure whether and how open violations are force-closed. Adjust the evaluation offset. Create a concise and descriptive condition name. (NerdGraph API Only) Provide a text description for the condition that will be included in violations and notifications. Troubleshooting procedures Optional: To include your organization's procedures for handling the incident, add the runbook URL to the condition. Limits on conditions See the maximum values. Examples For more information, see: Expected NRQL syntax Examples of NRQL condition queries Alert threshold types When you create a NRQL alert, you can choose from different types of thresholds: NRQL alert threshold types Description Static This is the simplest type of NRQL threshold. It allows you to create a condition based on a NRQL query that returns a numeric value. Optional: Include a FACET clause. Baseline Uses a self-adjusting condition based on the past behavior of the monitored values. Uses the same NRQL query form as the static type, except you cannot use a FACET clause. Outlier Looks for group behavior and values that are outliers from those groups. Uses the same NRQL query form as the static type, but requires a FACET clause. NRQL alert syntax Here is the basic syntax for creating all NRQL alert conditions. Depending on the threshold type, also include a FACET clause as applicable. SELECT function(attribute) FROM Event WHERE attribute [comparison] [AND|OR ...] Clause Notes SELECT function(attribute) Required Supported functions that return numbers include: apdex average count latest max min percentage percentile sum uniqueCount If you use the percentile aggregator in a faceted alert condition with many facets, this may cause the following error to appear: An error occurred while fetching chart data. If you see this error, use average instead. FROM data type Required Only one data type can be targeted. Supported data types: Event Metric (RAW data points will be returned) WHERE attribute [comparison] [AND|OR ...] Optional Use the WHERE clause to specify a series of one or more conditions. All the operators are supported. FACET attribute Static: Optional Baseline: Not allowed Outlier: Required Including a FACET clause in your NRQL syntax depends on the threshold type: static, baseline, or outlier. Use the FACET clause to separate your results by attribute and alert on each attribute independently. Faceted queries can return a maximum of 5000 values for static conditions and a maximum of 500 values for outlier conditions. If the query returns more than this number of values, the alert condition cannot be created. If you create the condition and the query returns more than this number later, the alert will fail. Sum of query results (limited or intermittent data) Available only for static (basic) threshold types. If a query returns intermittent or limited data, it may be difficult to set a meaningful threshold. Missing or limited data will sometimes generate false positives or false negatives. To avoid this problem when using the static threshold type, you can set the selector to sum of query results. This lets you set the alert on an aggregated sum instead of a value from a single harvest cycle. Up to two hours of the one-minute data checks can be aggregated. The duration you select determines the width of the rolling sum, and the preview chart will update accordingly. Offset the query time window Every minute, we evaluate the NRQL query in one-minute time windows. The start time depends on the value you select in the NRQL condition's Advanced settings > Evaluation offset. Example: Using the default time window to evaluate violations With the Evaluation offset at the default setting of three minutes, the NRQL time window applied to your query will be: SINCE 3 minutes ago UNTIL 2 minutes ago If the event type is sourced from an APM language agent and aggregated from many app instances (for example, Transactions, TransactionErrors, etc.), we recommend evaluating data from three minutes ago or longer. An offset of less than 3 minutes will trigger violations sooner, but you might see more false positives and negatives due to data latency. For cloud data, such as AWS integrations, you may need an offset longer than 3 minutes. Check our AWS polling intervals documentation to determine your best setting. NRQL alert threshold examples Here are some common use cases for NRQL alert conditions. These queries will work for static and baseline threshold types. The outlier threshold type will require additional FACET clauses. Alert on specific segments of your data Create constrained alerts that target a specific segment of your data, such as a few key customers or a range of data. Use the WHERE clause to define those conditions. SELECT average(duration) FROM Transaction WHERE account_id in (91290, 102021, 20230) SELECT percentile(duration, 95) FROM Transaction WHERE name LIKE 'Controller/checkout/%' Alert on Nth percentile of your data Create alerts when an Nth percentile of your data hits a specified threshold; for example, maintaining SLA service levels. Since we evaluate the NRQL query in one-minute time windows, percentiles will be calculated for each minute separately. SELECT percentile(duration, 95) FROM Transaction SELECT percentile(databaseDuration, 75) FROM Transaction Alert on max, min, avg of your data Create alerts when your data hits a certain maximum, minimum, or average; for example, ensuring that a duration or response time does not pass a certain threshold. SELECT max(duration) FROM Transaction SELECT average(duration) FROM Transaction Alert on a percentage of your data Create alerts when a proportion of your data goes above or below a certain threshold. SELECT percentage(count(*), WHERE duration > 2) FROM Transaction SELECT percentage(count(*), WHERE httpResponseCode = '500') FROM Transaction Alert on Apdex with any T-value Create alerts on Apdex, applying your own T-value for certain transactions. For example, get an alert notification when your Apdex for a T-value of 500ms on transactions for production apps goes below 0.8. SELECT apdex(duration, t:0.5) FROM Transaction WHERE appName like '%prod%' Create a description You can define a description that passes useful information downstream for better violation responses or for use by downstream systems. For details, see Description. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", + "document_type": "page", + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert conditions", + "info": "How to define thresholds that trigger alert notifications based on your NRQL queries.", + "nodeid": 9231, "sections": [ - "INDUSTRY", - "LOCATION", - "USE CASE", - "PRODUCTS USED", - "WHY NEW RELIC", - "HIGHLIGHTS", - "Links", - "Cultivating a culture of measurement", - "A single tool for system-wide monitoring", - "The key to DevOps success", - "Instant insight into wide-ranging performance data", - "Easing management, lowering costs, and delighting customers", - "Related Resources", - "COMPANY", - "CONNECT", - "international" + "New Relic Alerts", + "Get started", + "Alert policies", + "Alert conditions", + "Alert violations", + "Alert Incidents", + "Alert notifications", + "Troubleshooting", + "Rules, limits, and glossary", + "Alerts and Nerdgraph", + "REST API alerts", + "Create NRQL alert conditions", + "Create NRQL alert condition", + "Alert threshold types", + "NRQL alert syntax", + "Sum of query results (limited or intermittent data)", + "Offset the query time window", + "NRQL alert threshold examples", + "Create a description", + "For more help" ], - "title": "CarRentals.com Drives Operational Excellence Through Continuous Measurement Using New Relic", + "title": "Create NRQL alert conditions", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions", "popularity": 1, - "external_id": "9f0169b9677c4f86696f46baa2bef58129a7304d", - "image": "https://newrelic.com/content/dam/newrelic/documents/image/embeds/f40ffc868-4d98-4981-8473-b65a3a67d0a1_carrentals2.jpg", - "url": "https://newrelic.com/resources/case-studies/carrentals-com", - "published_at": "2020-08-17T17:20:38Z", - "updated_at": "2020-08-15T02:37:52Z", + "external_id": "956a7a0b84d2afac5e6236df3143085ebc4f7459", + "category_1": "New Relic Alerts", + "category_2": "Alert conditions", + "image": "", + "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions", + "published_at": "2020-08-18T21:58:59Z", + "updated_at": "2020-08-15T23:05:02Z", + "category_0": "Alerts and Applied intelligence", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0013245479, + "_score": 0.170984, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "CarRentals.com Drives Operational Excellence Through Continuous Measurement Using New Relic", - "sections": "WHY NEW RELIC", - "body": " home. Back to top icon Case Study CarRentals.com Drives Operational Excellence Through Continuous Measurement Using New Relic Contact sales INDUSTRY Travel LOCATION Bellevue, Wash. USE CASE System-wide monitoring of application and infrastructure performance, with analysis of long- and short-term" + "title": "Create NRQL alert conditions", + "sections": "NRQL alert syntax", + "info": "How to define thresholds that trigger alert notifications based on your NRQL queries.", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions", + "body": " the incident, add the runbook URL to the condition. Limits on conditions See the maximum values. Examples For more information, see: Expected NRQL syntax Examples of NRQL condition queries Alert threshold types When you create a NRQL alert, you can choose from different types of thresholds: NRQL" }, - "id": "5ece9457e7b9d28b91c70749" + "id": "5f2d992528ccbc489d88dfc1" }, { - "body": "[RSS] Released on:  August 13, 2020 Notes Follow standard procedures to install or update the New Relic integration for Kubernetes. Changelog Added: Support for OpenShift 4.5 and Kubernetes versions 1.18.X Changed: Upgraded Docker base image newrelic/infrastructure-bundle to v1.4.2. For more information on the release please see the New Relic Infrastructure Bundle release notes. Changed: When querying the summary endpoint from Kubelet to get the Node or Pod network metrics, if the default network interface is not eth0 then summary endpoint for Kubelet doesn't return the metrics as we expect them. We rely on them being a direct member of the \"network\" object. See rxBytes, txBytes and rxErrors in the following example metrics: \"network\": { \"time\": \"2020-06-04T10:01:15Z\", \"name\": \"eth0\", \"rxBytes\": 207909096, \"rxErrors\": 0, \"txBytes\": 8970981, \"txErrors\": 0, \"interfaces\": [ { \"name\": \"eth0\", \"rxBytes\": 207909096, \"rxErrors\": 0, \"txBytes\": 8970981, \"txErrors\": 0 }, { \"name\": \"ip6tnl0\", \"rxBytes\": 0, \"rxErrors\": 0, \"txBytes\": 0, \"txErrors\": 0 }, { \"name\": \"tunl0\", \"rxBytes\": 0, \"rxErrors\": 0, \"txBytes\": 0, \"txErrors\": 0 } ] } This scenario only happens when the default interface is eth0. Kubernetes source code has it hardcoded that eth0 is the default. In the following example you can see that we only have network metrics inside the interfaces list, in this case there is no eth0 on the and the default interface is ens5: \"network\": { \"time\": \"2020-06-04T10:01:15Z\", \"name\": \"\", \"interfaces\": [ { \"name\": \"ens5\", \"rxBytes\": 207909096, \"rxErrors\": 42, \"txBytes\": 8970981, \"txErrors\": 24 }, { \"name\": \"ip6tnl0\", \"rxBytes\": 0, \"rxErrors\": 0, \"txBytes\": 0, \"txErrors\": 0 }, { \"name\": \"tunl0\", \"rxBytes\": 0, \"rxErrors\": 0, \"txBytes\": 0, \"txErrors\": 0 } ] In cases like this, the integration will look for the default interface inside the interfaces list and use those values. The default interface name is retrieved from the network route file (default /proc/net/route). When running the unprivileged version of the integration we don't have access to the route file, the integration won't be able to get the default interface name and won't send network metrics for the unless there's a network interface called eth0. For Pods, this issue is mainly present when using hostNetwok since they shared the same network interfaces with the Node.", + "body": "APM reports metric data in the form of metric timeslice data, and you can use NRQL to query and facet this type of data. Why query metric timeslice data? We report metrics in several ways. One variety of metric data we call metric timeslice data; this is the type of data used to generate many of the charts in APM, Mobile, and Browser (for more details, see metric timeslice data). Historically, this type of data couldn't be queried via our query language, NRQL. But now we are converting popular APM metrics from metric timeslice data to more-detailed dimensional metric data, which opens them up for querying via NRQL and via our NerdGraph API. This capability allows you to create powerful, in-depth custom visualizations of these important APM metrics. And this includes being able to query your custom metrics. Where to query? We recommend querying APM metric timeslice data using New Relic One query builder in advanced mode. This experience offers full NRQL functionality, and also gives helpful auto-complete suggestions and feedback on query errors. You can also incorporate NRQL queries in our NerdGraph (GraphQL) API. How to construct a query In APM, some charts have the option to view the NRQL query that generated that chart. This can be a good option for understanding how to query metrics. The NRQL query examined below is slightly modified from the error rate chart on the APM summary page. FROM Metric SELECT count(apm.service.error.count) / count(apm.service.transaction.duration) WHERE (entity.guid = 'AN_ENTITY_GUID') AND (transactionType = 'Web') SINCE 1 day ago TIMESERIES Here is a breakdown of how the parts of this query work: Query segment What does it do? FROM Metric Metric is one of our core data types, and metric timeslice data is stored as this data type. For general tips on querying Metric data, see Metric query examples. SELECT count(apm.service.error.count) / count(apm.service.transaction.duration) This math generates a count of errors out of a total count of transaction metrics. This query uses the converted metric names. Note that you can use other aggregator functions. WHERE (entity.guid = 'AN_ENTITY_GUID') You must specify at least one data source. You can select a single entity's GUID, as shown here, or you can select multiple sources. This query uses entity.guid, but you can also use appId or appName. AND (transactionType = 'Web') Sets the transaction type to web, meaning that background/non-web transactions won't be counted. SINCE 1 day ago Selecting a time range. TIMESERIES This optional clause displays the results in a time-based chart. For general information on NRQL syntax, including FROM, FACET, and TIMESERIES, see Intro to NRQL. For more queries, see Query examples. How metric timeslice data is converted The conversion of original APM metric timeslice metrics into dimensional metrics that are available for querying is an ongoing process and isn't complete. If you don't see a metric you're looking for in this section, see Generic queries. Here are how the original APM metric timeslice metrics are converted into dimensional metrics: Metric timeslice structure Dimensional metric structure APM metric names are represented as single strings of segments separated by forward slashes. For example, the “Datastore/statement/MySQL/users/select” metric represents the time spent in a select database operation on the users table. A single dimensional metric named apm.service.datastore.operation.duration represents the entire group of datastore metrics. This metric has three attributes representing the data values encoded into the metric name, datastoreType, table and operation: datastoreType = ‘MySQL’ table = ‘users’ operation = ‘select’ Some of the APM metrics made available as dimensional metrics: Metric name Description Attributes apm.service.cpu.usertime.utilization Time spent in user-mode code percentage apm.service.datastore.operation.duration Response time for database calls broken out by table operations datastoreType, table, operation apm.service.error.count Summary error count metrics transactionType apm.service.external.host.duration Response time for external calls broken out by external host name external.host apm.service.instance.count Count of the number of agent instances apm.service.memory.physical Process memory in MB apm.service.transaction.apdex Apdex scores per transaction transactionName, transactionType apm.service.transaction.duration Response time per transaction keyTransactionName, transactionName, transactionType apm.service.transaction.error.count Error counts per transaction keyTransactionName, transactionName, transactionType apm.service.transaction.external.duration External call response time by transaction type transactionType To understand more about the general structure of metric timeslice data, including some common examples, see Metric timeslice data. Attributes These attributes are available in addition to the metric-specific attributes listed in the APM dimensional metrics table above. Name Description appName The name of the application. appId The ID of the application. entity.guid The GUID of the application. host The host of the monitored process. host.bootId The ID of the boot of the host, if available. host.displayName The display_name of the host, if it was set in the agent. instanceName For Java APM agents, host : port metricName The name of the dimensional metric. metricTimesliceName The timeslice name of the legacy metric. Generic queries with the newrelic.timeslice.value metric For metrics that haven't been converted to dimensional metrics, or for your own custom metrics, we have a dimensional metric named newrelic.timeslice.value. We recommend using the dimensional metrics from the table above when possible. When to use newrelic.timeslice.value? Given a metric timeslice name, you can query to see if it has a converted dimensional metric equivalent with this syntax: from Metric SELECT uniques(metricName) where metricTimesliceName = 'Datastore/statement/MySQL/test/select' If the only metric name returned is newrelic.timeslice.value, you'll need to query your data using this general approach. Facet on a wildcarded metric name segment Some metric timeslice names include attribute values as segments of the metric name. For example, our APM agents report metrics by tracking the duration of external calls using this format: External/{externalHost}/all Here, {externalHost} represents the host name for the outbound network call. Here's an example of a generic newrelic.timeslice.value query of a custom metric that facets on a wildcarded metric segment: FROM Metric SELECT count(newrelic.timeslice.value) WHERE appName = 'MY APP' WITH METRIC_FORMAT 'Custom/Labels/{action}' TIMESERIES FACET action In this query, {action} creates a temporary attribute, action, which is then used by FACET action. You can use any name you want, because it's only an attribute that exists for the duration of the query. You should choose a name that does not conflict with an existing attribute name. Here's another example of a faceted wildcard query: This shows a NRQL query of metric timeslice data that facets the rate of Flask functions by the wildcarded process name. Recommended aggregator functions Recommended NRQL aggregator functions include: apdex average sum count rate uniques Query examples Some examples of querying metric timeslice data: Facet by multiple app names This query uses WHERE… IN to specify two applications and then facet by them: FROM Metric SELECT rate(count(apm.service.transaction.duration), 1 minute) as 'Web throughput' WHERE appName IN ('MY_APPLICATION', 'MY_OTHER_APPLICATION') AND (transactionType = 'Web') FACET appName TIMESERIES Throughput-per-minute rate This query displays requests-per-minute chart using the rate function: FROM Metric SELECT rate(count(apm.service.transaction.duration), 1 minute) as 'HttpDispatcher requests_per_minute' WHERE appName = 'MY_APPLICATION' AND (transactionType = 'Web') TIMESERIES SINCE 3 days ago Facet by host-related attributes This query displays a requests-per-minute chart faceted by host name: FROM Metric SELECT count(apm.service.transaction.duration) as 'HttpDispatcher requests_per_minute' WHERE appName = 'MY_APPLICATION' AND (transactionType = 'Web') TIMESERIES SINCE 3 hours ago FACET host LIMIT 20 Instead of using host, you can facet by other host-related attributes, like host.bootId. Query of average duration of a metric This queries the average duration for a metric using average: FROM Metric SELECT average(apm.service.transaction.duration) as 'HttpDispatcher average duration' WHERE appName = 'MY_APPLICATION' AND (transactionType = 'Web') TIMESERIES SINCE 3 days ago For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "type": "docs", - "document_type": "release_notes_platform", - "breadcrumb": "Contents / New Relic Platform Release Notes / Kubernetes integration release notes", - "info": "", - "nodeid": 39886, - "sections": [ - "New Relic Platform release notes", - "Alerts release notes", - "APM release notes", - "Cloud Integrations release notes", - "Diagnostics release notes", - "Mobile release notes", - "Kubernetes integration release notes", - "New Relic integration for Kubernetes 1.26.0", - "Notes", - "Changelog" - ], - "title": "New Relic integration for Kubernetes 1.26.0", - "popularity": 1, - "external_id": "62ff51e3742f8d49da578e7cdddb436c449afda0", - "category_1": "New Relic Platform release notes", - "category_2": "Kubernetes integration release notes", - "image": "", - "url": "https://docs.newrelic.com/docs/release-notes/platform-release-notes/kubernetes-integration-release-notes/new-relic-integration-kubernetes-1260", - "published_at": "2020-08-15T05:20:55Z", - "updated_at": "2020-08-15T05:20:55Z", - "category_0": "Release notes", + "document_type": "page", + "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / NRQL query tutorials", + "info": "In New Relic, you can query metric timeslice data from APM using NRQL. ", + "nodeid": 36916, + "sections": [ + "NRQL: New Relic Query Language", + "Get started", + "NRQL query tools", + "NRQL query tutorials", + "Query APM metric timeslice data with NRQL", + "Why query metric timeslice data?", + "Where to query?", + "How to construct a query", + "How metric timeslice data is converted", + "Attributes", + "Generic queries with the newrelic.timeslice.value metric", + "When to use newrelic.timeslice.value?", + "Facet on a wildcarded metric name segment", + "Recommended aggregator functions", + "Query examples", + "For more help" + ], + "title": "Query APM metric timeslice data with NRQL", + "popularity": 1, + "external_id": "f536406572d7d2aafd2df6acd5da36a035ef82c3", + "category_1": "NRQL: New Relic Query Language", + "category_2": "NRQL query tutorials", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-one-nrql-query-metric-timeslice-data.png", + "url": "https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/nrql-query-tutorials/query-apm-metric-timeslice-data-nrql", + "published_at": "2020-08-18T08:51:56Z", + "updated_at": "2020-08-15T03:15:39Z", + "category_0": "Query your data", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0012303824, + "_score": 0.10769665, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic integration for Kubernetes 1.26.0", - "sections": "New Relic integration for Kubernetes 1.26.0", - "category_1": "New Relic Platform release notes", - "category_2": "Kubernetes integration release notes", - "body": "[RSS] Released on:  August 13, 2020 Notes Follow standard procedures to install or update the New Relic integration for Kubernetes. Changelog Added: Support for OpenShift 4.5 and Kubernetes versions 1.18.X Changed: Upgraded Docker base image newrelic/infrastructure-bundle to v1.4.2. For more", - "breadcrumb": "Contents / New Relic Platform Release Notes / Kubernetes integration release notes" + "title": "Query APM metric timeslice data with NRQL", + "sections": "Query APM metric timeslice data with NRQL", + "info": "In New Relic, you can query metric timeslice data from APM using NRQL. ", + "category_0": "Query your data", + "category_1": "NRQL: New Relic Query Language", + "category_2": "NRQL query tutorials", + "body": "APM reports metric data in the form of metric timeslice data, and you can use NRQL to query and facet this type of data. Why query metric timeslice data? We report metrics in several ways. One variety of metric data we call metric timeslice data; this is the type of data used to generate many", + "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / NRQL query tutorials" }, - "id": "5f3770b728ccbccef3e24061" + "id": "5f2b1349196a67379343fbcf" }, { - "body": "logo-newrelic Search Products Pricing Solutions Help Center About New Relic for iOS or Android    New Relic Insights App for iOS Search icon Sign Up Log In Products New Relic One Platform Overview Telemetry Data Platform Full-Stack Observability Applied Intelligence Solutions By Topic DevOps Cloud Adoption Cloud Native Digital Customer Experience By Industry E-commerce and Retail Media Public Sector By Technology Amazon Web Services Pivotal Cloud Foundry Microsoft Azure Google Cloud Platform Kubernetes Help Center Learn Docs Build on New Relic Explore open source projects Training Get help Community forum Global technical support Expert services About Our Customers Over 17,000 customers love New Relic, from Fortune 500 enterprises to small businesses around the globe. Our Blog The latest news, tips, and insights from the world of New Relic and digital intelligence. Our Company About Us Leadership Meetups and Events Resources   Investor Relations Newsroom Partner Program Contact Us logo-newrelic Want to use our logo? There's a page for that, including instructions and different styles and formats. Sorry about grabbing your right-click. Just trying to be helpful. You can also go home. Back to top icon A Complete Introduction to Monitoring Kubernetes with New Relic The fundamentals you need to know to effectively monitor Kubernetes deployments Download PDF Introduction Monitoring Kubernetes with New Relic Kubernetes observability Scaling Kubernetes with success: A real-world example Introduction Before Kubernetes took over the world, cluster administrators, DevOps engineers, application developers, and operations teams had to perform many manual tasks in order to schedule, deploy, and manage their containerized applications. The rise of the Kubernetes container orchestration platform has altered many of these responsibilities. Kubernetes makes it easy to deploy and operate applications in a microservice architecture. It does so by creating an abstraction layer on top of a group of hosts, so that development teams can deploy their applications and let Kubernetes manage: Controlling resource consumption by application or team Evenly spreading application load across a host infrastructure Automatically load balancing requests across the different instances of an application Monitoring resource consumption and resource limits to automatically stop applications from consuming too many resources and restarting the applications again Moving an application instance from one host to another if there is a shortage of resources in a host, or if the host dies Automatically leveraging additional resources made available when a new host is added to the cluster Easily performing canary deployments and rollback But such capabilities also give teams new things to worry about. For example: There are a lot more layers to monitor. The ephemeral and dynamic nature of Kubernetes makes it a lot more complex to troubleshoot. Automatic scheduling of pods can cause capacity issues, especially if you’re not monitoring resource availability. In effect, while Kubernetes solves old problems, it can also create new ones. Specifically, adopting containers and container orchestration requires teams to rethink and adapt their monitoring strategies to account for the new infrastructure layers introduced in a distributed Kubernetes environment.  With that in mind, we designed this guide to highlight the fundamentals of what you need to know to effectively monitor Kubernetes deployments with New Relic. This guide outlines some best practices for monitoring Kubernetes in general, and provides detailed advice for how to do so with the New Relic platform.  Whether you're a cluster admin, an application developer, an infrastructure engineer, or DevOps practitioner working on the Kubernetes platform, by the end of this guide, you should be able to use New Relic to monitor the health and capacity of Kubernetes components and resources, correlate events in Kubernetes with contextual insights to help you troubleshoot issues, understand how to monitor applications running in your cluster, and know how to track end-user experience from those apps.  Monitoring Kubernetes with New Relic In addition to providing visibility into operational data—such as the number of resources used and namespaces per cluster and per pod—an important part of monitoring Kubernetes is having the ability to see the relationships between objects in a cluster using Kubernetes’ built-in labeling system. New Relic integrates with Kubernetes in a number of ways: Amazon Elastic Container Service for Kubernetes (Amazon EKS): Amazon EKS provides Kubernetes as a managed service on AWS. It helps make it easier to deploy, manage, and scale containerized applications on Kubernetes.  Google Kubernetes Engine (GKE): GKE provides an environment for deploying, managing, and scaling your containerized applications using Google-supplied infrastructure. Microsoft Azure Kubernetes Service (AKS): AKS manages your hosted Kubernetes environment, making it easier to deploy and manage containerized applications without container orchestration expertise. It also eliminates the burden of ongoing operations and maintenance by provisioning, upgrading, and scaling resources on demand, without taking your applications offline. Red Hat OpenShift: OpenShift provides developers with an integrated development environment (IDE) for building and deploying Docker-formatted containers, and then managing them with Kubernetes. Pivotal Container Service (PKS): Available as part of Pivotal Cloud Foundry or as a standalone product, PKS provides the infrastructure and resources to reliably deploy and run containerized workloads across private and public clouds. Getting started To get started monitoring Kubernetes with New Relic, you’ll need to activate the Kubernetes integration by deploying the newrelic-infra agent onto your Kubernetes cluster. The New Relic Kubernetes integration brings in system-level metrics, allowing you to view, troubleshoot, and alert on the most important parts of your cluster. Use the integration’s out-of-the-box dashboard to inspect a single container, or scale up to see large, multi-cluster deployments across different Kubernetes entities, including nodes, pods, namespaces, and containers. New Relic uses kube-state-metrics—a simple service that listens to the Kubernetes API server and generates metrics—to gather information about the state of Kubernetes objects. Install kube-state-metrics in your cluster: curl -o kube-state-metrics-1.7.2.zip https://codeload.github.com/kubernetes/kube-state-metrics/zip/release-1.7.2 && unzip kube-state-metrics-1.7.2.zip && oc apply -f kube-state-metrics-release-1.7.2/kubernetes Download the Kubernetes integration configuration file: curl -O https://download.newrelic.com/infrastructure_agent/integrations/kubernetes/newrelic-infrastructure-k8s-latest.yaml In the configuration file, add your New Relic license key and a cluster name to identify your Kubernetes cluster. Both values are required. Be sure to update with your license key and with the name of your cluster. env:      - name: NRIA_LICENSE_KEY     value: - name: CLUSTER_NAME   value: Add any additional configuration, as documented in the Kubernetes integration instructions. To confirm that kube-state-metrics is installed, run this command: kubectl get pods --all-namespaces | grep kube-state-metrics To create the DaemonSet, run this command: kubectl create -f newrelic-infrastructure-k8s-latest.yaml Confirm that the DaemonSet has been created successfully by looking for newrelic-infra in the results generated by this command: kubectl get daemonsets Go to one.newrelic.com, and select the Kubernetes cluster explorer launcher. Exploring clusters with the Kubernetes cluster explorer New Relic’s Kubernetes cluster explorer provides a multi-dimensional representation of a Kubernetes cluster from which you can explore your namespaces, deployments, nodes, pods, containers, and applications. With the cluster explorer, you will be able to easily retrieve the data and metadata of these elements, and understand how they are related. Video Kubernetes cluster explorer   From the Kubernetes cluster explorer, you can: Select the cluster you want to explore Filter by namespace or deployment Select specific pods or nodes for status details The cluster explorer has two main parts: A visual display of the status of a cluster, up to 24 nodes. Within the visual display, the cluster explorer shows the nodes that have the most issues in a series of four concentric rings: The outer ring shows the nodes of the cluster, with each node displaying CPU, memory, and storage performance metrics. The next innermost ring displays the distribution and status of the non-alerting pods associated with that node. The third innermost ring displays the pods on alert and that may have health issues even if they are still running. Finally, the innermost ring displays pods that are pending or that Kubernetes is unable to run. You can select any pod to see its details, such as its namespace, deployment, containers, alert status, CPU usage, memory usage, and more. The cluster explorer node table displays all the nodes of the selected cluster/namespace/deployment, and can be sorted according to node name, node status, pod, pod status, container, CPU% vs. Limit and MEM% vs. Limit. Benefits of monitoring with the cluster explorer The cluster explorer expands the Kubernetes monitoring capabilities already built into the New Relic platform. Use the cluster explorer’s advanced capabilities to filter, sort, and search for Kubernetes entities, so you can better understand the relationships and dependencies within an environment. The default data visualizations of your cluster provides a fast and intuitive path to getting answers and understanding their Kubernetes environments, so you can contain the complexity associated with running Kubernetes at scale. When your team adopts cluster explorer, you can expect improved performance and consistency and quicker resolutions when troubleshooting errors. New Relic can help ensure that your clusters are running as expected and quickly detect performance issues within your cluster—even before they have a noticeable impact on your customers. Kubernetes observability We recommend that Kubernetes observability begins with these five practices: Visualizing services Monitoring health and capacity Correlating Kubernetes events Understanding APM correlation Investigating end-user experience Visualizing services When working in a Kubernetes environment, it can be difficult to untangle the dependencies between applications and infrastructure, and navigate all of the entities—containers, pods, nodes, deployments, namespaces, and so on—that may be involved in a troubleshooting effort. You need to observe performance and dependencies across the entire Kubernetes environment. You should be able to visualize key parts of your services, including: The structure of your application and its dependencies  The interactions between various microservices, even those that are intermingled across your machine cluster How New Relic helps The cluster explorer provides a multi-dimensional representation of a Kubernetes cluster that allows teams to drill down into Kubernetes data and metadata in a high-fidelity, curated UI that simplifies complex environments. Teams can use cluster explorer to more quickly troubleshoot failures, bottlenecks, and other abnormal behavior across their Kubernetes environments. Suggested alerting When deploying the New Relic Kubernetes integration for the first time in an account, a default set of alert conditions is deployed to the account. The alert policy is configured without a notification channel to avoid unwanted alerts. You can customize the alert conditions' thresholds to your environment and update the alert policy to send notifications. For more, see the New Relic Infrastructure alerts documentation. Monitoring cluster health and capacity Kubernetes environments vary from deployment to deployment, but they have all a handful of key components, resources, and potential errors in common. The following sections introduce best practices, including tips for how to use New Relic and alerts, for monitoring the health and capacity of any Kubernetes environment:  Track cluster resource usage Monitor node resource consumption Monitor for missing pods Find pods that aren’t running Troubleshoot container restarts Track container resource usage Monitor storage volumes Monitor the control plane: etcd, the API server, the scheduler, and the controller manager   Track cluster resource usage When you administer clusters, you need enough usable resources in your cluster to avoid running into issues when scheduling pods or deploying containers. If you don’t have enough capacity to meet the minimum resource requirements of all your containers, scale up your nodes’ capacity or add more nodes to distribute the workload. You should know: What percentage of cluster resources you’re using at any given time  If your clusters are over- or under-provisioned  How much demand have you’ve placed on your systems How New Relic helps Our Kubernetes integration monitors and tracks aggregated core and memory usage across all nodes in your cluster. This allows you to meet resource requirements for optimal application performance.   Suggested alerting Set alerts on the cores and memory usage of the hosts in your cluster. Monitor node resource consumption Beyond simply keeping track of nodes in your cluster, you need to monitor the CPU, memory, and disk usage for Kubernetes nodes (workers and masters) to ensure all nodes in your cluster are healthy. Use this data to ensure:  You have enough nodes in your cluster The resource allocations to existing nodes is sufficient for deployed applications  You’re not hitting any resource limits How New Relic helps  New Relic tracks resource consumption (used cores and memory) for each Kubernetes node. That lets you track the number of network requests sent across containers on different nodes within a distributed service. You can also track resource metrics for all containers on a specific node—regardless of which service they belong to. Always ensure your current deployment has sufficient resources to scale. You don’t want new node deployments blocked by a lack of resources. Suggested alerting Set alerts so you’ll be notified if hosts stop reporting or if a node’s CPU or memory usage drops below a desired threshold. Monitor for missing pods From time to time, you may find your cluster is missing a pod. A pod can go missing if the engineers did not provide sufficient resources when they scheduled it. The pod may have never started; it’s in a restart loop; or it went missing because of an error in its configuration. To make sure Kubernetes does its job properly, you need to confirm the health and availability of pod deployments. A pod deployment defines the number of instances that need to be present for each pod, including backup instances. (In Kubernetes, this is referred to as a ReplicaSet). Sometimes the number of active pods is not specified in the Replicas field on each deployment. Even if they are, Kubernetes may determine if it can run another instance based on resources the administrator has defined.  How New Relic helps New Relic makes it easier to avoid this issue by knowing the resource limitations of the cluster.  If you don’t have enough resources to schedule a pod, add more container instances to the cluster or exchange a container instance for one with the appropriate amount of resources. In general, you can use the New Relic Kubernetes integration to monitor for missing pods and immediately identify deployments that require attention. This often creates an opportunity to resolve resource or configuration issues before they affect application availability or performance.   Suggested alerting Set an alert for when a deployment’s missing pods value rises above a certain threshold for a certain period. If the number of available pods for a deployment falls below the number of pods you specified when you created the deployment, the alert will trigger. The alert will be applied to each deployment that matches the filters you set. Find pods that aren’t running Kubernetes dynamically schedules pods into the cluster, but if you have resource issues or configuration errors, scheduling will likely fail. If a pod isn’t running or even scheduled, that means there’s an issue with either the pod or the cluster, or with your entire Kubernetes deployment. When you see that pods aren’t running, you’ll want to know:  If there are any pods in a restart loop How often are requests failing If there are resource issues or configuration errors How New Relic helps As noted, if you have resource issues or configuration errors, Kubernetes may not be able to schedule the pods. In such cases, you want to check the health of your deployments, and identify configuration errors or resource issues. With the New Relic Infrastructure Kubernetes integration, you can use default deployment data to discover and track pods that may not be running and sort them by cluster and namespace. Additionally, you can analyze further root causes of terminated pods, with the terminated pods metric. For example, if a pod is terminated because its application memory has reached the memory limit set on the containers, it will be killed by the out of memory (OOM) killer. In such cases, New Relic will expose the reason for pod termination. Suggested alerting Set alerts on the status of your pods. Alerts should trigger when a pod has a status of “Failed,” ”Pending,” or “Unknown” for the period of time you specify.   Troubleshoot container restarts In normal conditions, containers should not restart. Container restarts are a sign that you’re likely hitting a memory limit in your containers. Restarts can also indicate an issue with either the container itself or its host. Additionally, because of the way Kubernetes schedules containers, it can be difficult to troubleshoot container resource issues since Kubernetes will restart—or kill—containers when they hit their limits. Monitoring container restarts helps you understand: If any containers are in a restart loop How many container restarts occured in X amount of time Why containers are restarting How New Relic helps A running count of container restarts is part of the default container data New Relic gathers with the Kubernetes integration.   Suggested alerting This an optional alerting scenario. Kubernetes automatically restarts containers, and setting up an alert will give you an immediate, useful notification, but don’t let container restarts interrupt your sleep.   Track container resource usage Monitoring container resource usage helps you ensure that their containers and applications remain healthy. For example, if a container hits its limit for memory usage, the kubelet agent might kill it. When monitoring container resource usage, you’ll want to know: If your containers are hitting resource limits and affecting the performance of their applications If there are spikes in resource consumption  If there is a pattern to the distribution of errors per container How New Relic helps First, identify the minimum amount of CPU and memory a container requires to run—which needs to be guaranteed by the cluster—and monitor those resources with New Relic. Second, monitor container resource limits. These are the maximum amounts of resources that the container will be allowed to consume. In Kubernetes, resource limits are unbounded by default. This type of monitoring can help proactively resolve resource usage issues before they affect your application. Suggested alerting Set alerts on container CPU and memory usage and on limits for those metrics. Monitor storage volumes One thing you definitely want to avoid when running applications on Kubernetes is data loss or application crashes because you’ve run out of space on your storage volumes.  In Kubernetes, storage volumes are allocated to pods and possess the same lifecycle as the pod; in other words, if a container is restarted, the volume is unaffected, but if a pod is terminated, the volume is destroyed with the pod. This works well for stateless applications or batch processing where the data doesn’t outlive a transaction. Persistent volumes, on the other hand, are used for stateful applications and when data must be preserved beyond the lifespan of a pod. Persistent volumes are well suited for database instances or messaging queues. To monitor Kubernetes volumes, you’ll want to:  Ensure your application has enough disk space so pods don’t run out of space View volume usage and adjust either the amount of data generated by the application or the size of the volume according to usage Identify persistent volumes and apply a different alert threshold or notification for these volumes, which likely hold important application data  How New Relic Helps You'll want to monitor and alert on disk volume issues, especially in the context of persistent volumes where data must be made available to stateful applications persistently, so that it’s not destroyed if a specific pod is rescheduled or recreated—like when a container image is updated to a new version, for example.   With Kubernetes volume monitoring in New Relic, you can monitor your volumes, and set alerts on them so that you get informed as soon as a volume reaches a certain threshold—a proactive approach to limiting issues with application performance or availability.   Suggested alerting Set alerts on available bytes, capacity, and node usage in your cluster.   Monitor etcd This is where the current and desired state of your cluster is stored, including information about all pods, deployments, services, secrets, etc. This is the only place where Kubernetes stores its information. To monitor etcd, you’ll want to track: Leader existence and change rate Committed, applied, pending, and failed proposals gRPC performance Suggested alerting Set alerts to be notified if pending or failed proposals reach inappropriate thresholds.  Monitor the API server The central RESTful HTTP API handles all requests coming from users, nodes, control plane components, and automation. The API server handles authentication, authorization, validation of all objects, and is responsible for storing said objects in etcd. It’s the only component that talks with etcd. To monitor the API server, you’ll want to track: Rate and number of HTTP requests Rate and number of apiserver requests Suggested alerting Set alerts to trigger if the rate or number of HTTP requests crosses a desired threshold.  Monitor the scheduler The scheduler is responsible for assigning newly created pods to worker nodes capable of running said pods. To do so, the scheduler updates pod definitions through the API server. The scheduler takes several factors into consideration when selecting a worker node, such as requested CPU/memory vs. what’s available on the node.  To monitor the scheduler, you’ll want to track: Rate, number, and latency of HTTP requests Scheduling latency Scheduling attempts by result End-to-end scheduling latency (sum of scheduling)  Suggested alerting Set alerts to trigger if the rate or number of HTTP requests crosses a desired threshold.    Monitor the controller manager This is where all the controllers run. Controllers, like the scheduler, use the watch capabilities of the API server to be notified of state changes. When notified, they work to get the actual cluster state to the desired state. For example, if we create a new object that creates X number of pods, the associated controller is the one in charge of bringing the current cluster state of X pods to Y number of pods. To monitor the scheduler, you’ll want to track: The depth of the work queue The number of retries handled by the work queue Suggested alerting Set alerts to trigger if requests to the work queue exceed a maximum threshold. Correlating Kubernetes events with cluster health To speed troubleshooting and issue resolution, you can correlate the health status of your cluster and other objects with Kubernetes events. If you run complex Kubernetes environments or don't have command-line access to your cluster, Kubernetes events provide the insights you need to understand what’s happening inside your cluster. For example, let’s say you have a pod that doesn’t get properly scheduled and won’t start because the node it’s assigned to wasn't allocated enough memory. In this case, the node can’t accommodate the pod, so the pod stays in pending status, but no other metrics or metadata provide deeper insight into the issue. With Kubernetes events, you’d get a clear message: FailedScheduling [...]  0 nodes are available: Insufficient memory If you’re managing a Kubernetes deployment, or developing on top of one, you need: Visibility into the Kubernetes events for a cluster Visibility into the Kubernetes events related to a specific object, such as a pod or a node Alerting on Kubernetes events How New Relic helps As shown in the example, Kubernetes events provide additional contextual information that is not provided by metrics and metadata. When using Kubernetes events alongside the cluster explorer, you get a holistic view of the health of your platform. When troubleshooting an issue in a pod, Kubernetes events more readily point toward root causes with useful context. New Relic also layers each event with useful details, so you can determine if an event affects several pods or nodes in cluster, such as when a ReplicaSet is scaled or when a StatefulSet creates a new pod.    You can query Kubernetes events with New Relic chart builder, or view them from the cluster explorer. Suggested alerting Set alerts for specific types of events on objects and resources in your cluster. For example, New Relic can send alerts if an expected autoscaling action doesn’t occur.    Integrating with APM data A key benefit of Kubernetes is that it decouples your application and its business logic from the specific details of its runtime environment. That means if you ever have to shift the underlying infrastructure to a new Linux version, for example, you won’t have to completely rewrite the application code.  When you're monitoring applications that are managed by an orchestration layer, being able to relate an application error trace, for instance, to the container, pod, or the host it’s running in can be very useful for debugging or troubleshooting.  At the application layer, you need to monitor the performance and availability of applications running inside your Kubernetes cluster. You do that by tracking such metrics as request rate, throughput, and error rate. New Relic APM lets you add custom attributes, and that metadata is available in transaction traces gathered from your application. You can create custom attributes to collect information about the exact Kubernetes node, pod, or namespace where a transaction occurred.  To get started monitoring applications running in Kubernetes, you will need to instrument your application with the Kubernetes Downward API. We’ve created a sample app to demonstrate how this works in a Node.js application—fork this repo for your own use. (Our Monitoring Application Performance in Kubernetes blog post explains how to add this type of Kubernetes metadata to APM-monitored application transactions.) The following sections introduce key parts of your Kubernetes-hosted applications to monitor: Application health Prevent errors   Monitor application health When you run applications in Kubernetes, the containers the apps run in often move around throughout your cluster as instances scale up or down. This scheduling happens automatically in Kubernetes but could affect your application’s performance or availability. If you’re an application developer, being able to correlate Kubernetes objects to applications is important for debugging and troubleshooting. You'll want to know: What applications are associated with which cluster How many transactions are happening within a given pod What's the service latency or throughput for a production application running in a pod How New Relic helps To monitor transaction traces in Kubernetes, you need a code-centric view of your applications. You need to correlate applications with the container, pod, or host it’s running in. You also need to identify pod-specific performance issues for any application’s workload. Knowing the names of the pod and node where the error occurred can speed your troubleshooting. Visibility into transaction traces will quickly highlights any abnormalities in your Kubernetes-hosted application. Additionally, distributed tracing allows you to inspect the distributed traces captured for any application running in your cluster. If you click on an individual span in a distributed trace, you can quickly see the relevant Kubernetes attributes for that application; for example, you can find out which pod, cluster, and deployment an individual span belongs to. New Relic distributed tracing provides automated anomaly detection to identify slow spans and bottlenecks. You should also set alerts on key transactions and communications with third-party APIs. To learn about how to gain visibility into transaction traces in Kubernetes, see the blog post, Monitoring Application Performance in Kubernetes. Suggested alerting You’ll want to set up alerts for all applications running in production. Specifically, you’ll want to alert on API service requests, transactions, service latencies, uptime, and throughput, sending alerts when any of these metrics fall below the thresholds you define. Prevent errors If a single pod or particular pod IP starts failing or throwing errors, you need to troubleshoot before those errors harm your cluster or application. When something goes wrong, zero in on root causes as quickly as possible. You’ll want to know: In which namespace/host/pod did a transaction fail If your app is performing as expected in all pods The performance of application X running on pod Y How New Relic helps With New Relic, you can get a code-centric view of the applications running inside your cluster, monitor your Kubernetes-hosted applications for performance outliers, and track down any individual errors. The Monitoring Application Performance in Kubernetes blog post can help you pinpoint applications that might be causing performance issues in your cluster.  Suggested alerting Set alerts to track error rates for any applications running in production environments in Kubernetes. Integrating with Prometheus metrics Prometheus is an open-source toolkit that provides monitoring and alerting for services and applications running in containers, and it’s widely used to collect metrics data from Kubernetes environments. In fact, Prometheus’ scheme for exposing metrics has become the de facto standard for Kubernetes. Prometheus uses a pull-based system to pull multidimensional timeseries metrics from services over HTTP endpoints, instead of relying on services to push metrics out. Because of this pull-based system, third-parties, like New Relic, can build integrations that work with Prometheus’ metric exporters to gather that valuable data for storage and visualization. How New Relic helps The New Relic Prometheus OpenMetrics integration collects telemetry data from the many services (such as Traefik, Envoy, and etcd) that expose metrics in a format compatible with Prometheus. In fact, with this integration you’ll be able to monitor key aspects of your Kubernetes environments, such as, etcd performance and health metrics, Kubernetes Horizontal Pod Autoscaler (HPA) capacity, and node readiness. The integration supports both Docker and Kubernetes, using Prometheus version 2.  Installing the Prometheus OpenMetrics integration within a Kubernetes cluster is as easy as changing two variables in a manifest and deploying it in the cluster: 1. Download the integration manifest YAML file: curl -O https://download.newrelic.com/infrastructure_agent/integrations/kubernetes/nri-prometheus-latest.yaml 2. Edit the nri-prometheus-latest.yaml manifest file, and add a cluster name to identify your Kubernetes cluster (required) and your New Relice license key (required). env: - name: LICENSE_KEY   value: \"\"   [...]   config.yaml: |     cluster_name: \"\" 3. Deploy the integration in your Kubernetes cluster: kubectl apply -f nri-prometheus-latest.yaml Once you’ve installed the integration for Docker or Kubernetes, you can begin building queries to track and visualize your Prometheus data in New Relic. When troubleshooting issues in your Kubernetes clusters, the metrics collected by this integration are accessible alongside those gathered from New Relic APM and New Relic Infrastructure. See the New Relic docs for more on compatibility and requirements, installation options, data limits, configuration, metric queries, troubleshooting, metric transformation, and more. Using Prometheus data in New Relic There are any number of ways to use Prometheus data in New Relic, but consider the following use cases:   Monitoring etcd Etcd is a key-value data store that’s essential for running Kubernetes clusters. Prometheus pulls metrics from etcd, so to ensure your clusters are healthy, you can use the Prometheus OpenMetrics Integration to monitor etcd server, disk, and network metrics such as: etcd_server_has_leader etcd_server_proposals_failed_total etcd_network_peer_sent_bytes_total etcd_disk_wal_fsync_duration_seconds   Kubernetes Horizontal Pod Autoscaler (HPA) HPA automatically scales up a Kubernetes deployment based on user-configured limits. After installing the Prometheus OpenMetrics Integration, you can use the following query in the New Relic One chart builder (or New Relic Insights) to build a dashboard widget and monitor the remaining HPA capacity.   FROM Metric select latest(kube_hpa_status_current_replicas),latest(kube_hpa_spec_max_replicas) where clusterName = ''  facet hpa   Node readiness Set alerts to track error rates for any applications running in production environments in Kubernetes. In Kubernetes, a node is marked ready when it can accept workloads (pods). If a node is having issues, Kubernetes will label it as \"not ready.\" To create an alert condition for this, using the integration, use the following query: FROM Metric select latest(kube_node_status_condition) where condition='Ready' and status = 'true' and clusterName = '' facet nodeName Monitoring logs in context With New Relic Logs, you can bring all your Kubernetes data together into one view. Available in the Kubernetes cluster explorer, logs provides a near-instant search with full contextual log information. And when you configure logs in context, you can correlate those log messages with application, infrastructure, Kubernetes, and event data. For example, you can easily correlate application log messages with a related distributed trace in New Relic APM. New Relic appends trace IDs to the corresponding application logs and automatically filters these logs from the distributed trace UIs. Bringing all of this data together in a single tool, you’ll more quickly get to the root cause of issues—narrowing down from all of your logs, to finding the exact log lines that you need to identify and resolve a problem. This gives you end-to-end visibility, as well as a level of depth and detail that simply isn’t available when you work with siloed sources of log data. How New Relic helps New Relic offers a Fluent Bit output plugin to enable New Relic Logs for Kubernetes to collect cluster log data. After downloading the plugin, you can deploy it as a Helm chart or deploy it manually via the command line.  Here's how to deploy the plugin manually: 1. Clone or download the New Relic kubernetes-logging project from GitHub. 2. In the new-relic-fluent-plugin.yml, edit the env: section to replace the placeholder value with your New Relic license key. - name:LICENSE_KEY   value: 3. Load the logging plugin into your k8s environment: kubectl apply -f . 4. Go to one.newrelic.com, and select the Logs launcher. 5. In the query field, add the following: plugin source \"kubernetes\" Investigating end-user experience If you order an item from a delivery service, and it arrives at your house broken or late, do you really care what part of the delivery process failed? Whether it was the fault of the manufacturer, distributor, or the delivery service, the end result is equally frustrating.  The same logic applies to companies hosting apps in Kubernetes: If a customer navigates to their website and a page doesn't load or takes too long, the customer isn’t interested in the technical reasons why. That’s why it’s not enough to track your own systems’ performance—it’s also essential to monitor the front-end performance of your applications to understand what your customers are actually experiencing.  Even though your application is running in Kubernetes, you can still identify and track the key indicators of customer experience, and clarify how the mobile or browser performance of their application is affecting business. How New Relic Helps For example, when developers first migrate to Kubernetes, they can set up a pre-migration baseline to compare their front-end application’s average load time before and after the migration. Developers can use the same strategies detailed in the Monitoring Application Performance in Kubernetes blog post to gain insight into key indicators such as response time and errors for mobile application and browser performance. It’s also imperative to monitor load time and availability to ensure customer satisfaction. New Relic Browser and New Relic Mobile are built to give you that crucial view into your users’ experiences.   Additionally, developers and operators both need to understand the availability of any Kubernetes-hosted service, often from locations all around the world. That's why New Relic Synthetics is designed to track application availability and performance from a wide variety of locations. New Relic brings together business-level information and performance data into a single pane of glass. That helps customers from development, operations, product, and customer support teams identify potential areas of improvement in the product and find better ways to debug errors that may be affecting specific customers. Suggested alerting New Relic Mobile Alerts: Mobile network error rate and response time  New Relic Browser Alerts: Browser session count drop to indicate availability issues Browser javascript error rate or error count Browser interaction duration New Relic Synthetics Alerts: Synethetics error rate or error count Synthetics response times Synthetics ping checks Scaling Kubernetes with success: A real-world example As you begin your Kubernetes journey, it may help to understand how another organization’s approach to monitoring enabled them to be successful.    Since its inception in 1997, Phlexglobal has been helping life sciences companies streamline clinical trials by enabling them to take charge of their trial master file (TMF)—i.e., the data repository for all documentation related to a clinical trial. Challenges Scaling, monitoring and managing the performance of Phlexglobal's trial master file (TMF) platform while migrating workloads onto Kubernetes. Ensuring this platform is well maintained is critical not only to prove key compliance with industry and government regulations, but also to facilitate and improve collaboration among a clinical trial’s many partners. Solution The team was searching for a tool to facilitate an agile organization with specific needs from the development and IT operations teams, so Phlexglobal looked to New Relic to get a system-wide view into performance that would enable proactive monitoring. Explore their full monitoring story to appreciate the impact and results. More Perfect Software Try New Relic One today and start building better, more resilient software experiences. Learn More Article Telemetry Data 101 Tutorial Documentation: Kubernetes Cluster Explorer Article The Age of Observability Tutorial Introduction to the Kubernetes Integration COMPANY Careers and Culture Partner Program Investor Relations NewRelic.org Suppliers Portal CONNECT Contact Us Request Demo Events international newrelic.co.jp (Japanese) newrelic.fr (French) newrelic.de (German) Terms of Service DMCA Policy Privacy Policy Cookie Policy UK Slavery Act of 2015 ©2008-20 New Relic, Inc. All rights reserved", - "type": "", - "info": "", + "body": "New Relic Insights' Query page is one place you can run NRQL queries of your data. To get started: Go to insights.newrelic.com > Query, then use any of the available NRQL syntax and functions. Use the Query page to: Create and run queries of your data. View your query history. View favorite queries. Use the NRQL query to create, view, organize, and share Insights dashboards. For a library of educational videos about how to use New Relic Insights, visit learn.newrelic.com. Use NRQL query history To view up to twenty of your most recent queries, select the History tab directly below the query command line interface. Use the query history to adjust and improve recent queries. If you want to... Do this... Run recent queries Select a recent query from the history list. The query will appear on the command line, where it can be edited. Delete queries Mouse over a query in the history list so the delete [trash] icon appears. The query history only retains the twenty most recent queries, so it can be useful to delete unwanted queries to make room for queries you like. Favorite queries Mouse over a query in the history list and the favorite star icon appears. Then, to view and use your favorite queries, select the Favorites tab. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "type": "docs", + "document_type": "page", + "breadcrumb": "Contents / Insights / Use Insights UI / Explore data", + "info": "Use the New Relic Insights Query page to create and edit NRQL queries, favorite them for later use, and add query results to dashboards. ", + "nodeid": 1131, "sections": [ - "Introduction", - "Monitoring Kubernetes with New Relic", + "Use Insights UI", "Getting started", - "Exploring clusters with the Kubernetes cluster explorer", - "Benefits of monitoring with the cluster explorer", - "Kubernetes observability", - "Visualizing services", - "Monitoring cluster health and capacity", - "Track cluster resource usage", - "Monitor node resource consumption", - "Monitor for missing pods", - "Find pods that aren’t running", - "Troubleshoot container restarts", - "Track container resource usage", - "Monitor storage volumes", - "Monitor etcd", - "Monitor the API server", - "Monitor the scheduler", - "Monitor the controller manager", - "Correlating Kubernetes events with cluster health", - "Integrating with APM data", - "Monitor application health", - "Prevent errors", - "Integrating with Prometheus metrics", - "Using Prometheus data in New Relic", - "Monitoring logs in context", - "Investigating end-user experience", - "Scaling Kubernetes with success: A real-world example", - "More Perfect Software", - "COMPANY", - "CONNECT", - "international" + "Explore data", + "Guides", + "Manage account data", + "Manage dashboards", + "Time settings", + "Export data", + "Troubleshooting", + "Query page: Create and edit NRQL queries", + "Use NRQL query history", + "For more help" ], - "title": "A Complete Introduction to Monitoring Kubernetes with New Relic", + "title": "Query page: Create and edit NRQL queries", "popularity": 1, - "external_id": "7c2d79350cf2c443b3b07b3b5cc14dbb428aedf3", - "image": "https://newrelic.com/content/dam/component-assets/long-form/kubernetes/infrastructure-kubernetes-cluster.png", - "url": "https://newrelic.com/platform/kubernetes/monitoring-guide", - "published_at": "2020-08-17T17:19:36Z", - "updated_at": "2020-08-12T02:28:44Z", + "external_id": "e00d2b865680d15c361b4058e22270fe5103aa8e", + "category_1": "Use Insights UI", + "category_2": "Explore data", + "image": "", + "url": "https://docs.newrelic.com/docs/insights/use-insights-ui/manage-account-data/query-page-create-edit-nrql-queries", + "published_at": "2020-08-18T10:41:24Z", + "updated_at": "2020-07-26T08:08:39Z", + "category_0": "Insights", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 0.0011486087, + "_score": 0.09991312, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "A Complete Introduction to Monitoring Kubernetes with New Relic", - "sections": "Monitoring Kubernetes with New Relic", - "body": " Relic Helps For example, when developers first migrate to Kubernetes, they can set up a pre-migration baseline to compare their front-end application’s average load time before and after the migration. Developers can use the same strategies detailed in the Monitoring Application Performance" + "title": "Query page: Create and edit NRQL queries", + "sections": "Explore data", + "info": "Use the New Relic Insights Query page to create and edit NRQL queries, favorite them for later use, and add query results to dashboards. ", + "category_2": "Explore data", + "body": "New Relic Insights' Query page is one place you can run NRQL queries of your data. To get started: Go to insights.newrelic.com > Query, then use any of the available NRQL syntax and functions. Use the Query page to: Create and run queries of your data. View your query history. View favorite queries", + "breadcrumb": "Contents / Insights / Use Insights UI / Explore data" }, - "id": "5d3a5cd2196a67b8641a499d" + "id": "59425a3c8e9c0f6937f1cda9" } ] } \ No newline at end of file