; } } 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 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 New Relic One Catalog launcher. Step 4 of 4 Under Your company applications, 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 on the New Relic One homepage, 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 access to save your selections. When you return to the New Relic One homepage, 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 custom application: 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",
+ "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"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "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-13T01:45:06Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.004416125,
+ "_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": " 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"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
+ {
+ "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-howto/use-nerdstorage directory: cd / nr1 - howto / 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. Under Your applications 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 this is done, clicking the trash button will remove the item it's associated with, and the app will update 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 As the new Delete Document button will be calling the _deleteDocument helper method, you'll need to update that using the code below: _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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:40:44Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.0030026042,
+ "_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 tothe next.",
+ "body": "Storage, 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 UserStorageQuerycomponent and update the componentDidMount method. Step 1 of 3 Import the UserStorageQuery by adding it to the import statement in the application’s ./nerdlets"
+ },
+ "id": "5efa98d4e7b9d26d6b7bab74"
+ },
+ {
+ "body": "Intro to New Relic One API components To help you build a New Relic One application 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 data (New Relic or third-party). Components of the New Relic 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 New Relic One 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 of the New Relic One SDK contains components for fetching and storing New Relic data. The main way to fetch New Relic 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 New Relic One 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": "Intro to New Relic One API components",
+ "sections": [
+ "Intro to New Relic One API components",
+ "Components of the New Relic SDK",
+ "UI components",
+ "Chart components",
+ "Query and storage components",
+ "Platform APIs"
+ ],
+ "title": "Intro to New Relic One API components",
+ "popularity": 1,
+ "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/",
+ "published_at": "2020-08-13T01:49:29Z",
+ "updated_at": "2020-08-08T01:40:45Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.0027073764,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Intro to New Relic One API components",
+ "sections": "Queryand storage components",
+ "info": "Intro to New Relic One API components",
+ "body": " Relic data. The main way to fetch New Relic 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"
+ },
+ "id": "5efa989e28ccbc4071307de5"
+ }
+ ],
+ "/automate-workflows/get-started-terraform": [
+ {
+ "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. 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,
+ "sections": [
+ "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": "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": "b69353439d3cc180ca46c64bef5e8470cdda1636",
+ "category_1": "Synthetic monitoring",
+ "category_2": "Using monitors",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/synthetics/synthetic-monitoring/using-monitors/alerts-synthetic-monitoring",
+ "published_at": "2020-08-10T21:03:10Z",
+ "updated_at": "2020-08-10T21:03:10Z",
+ "category_0": "Synthetic monitoring",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.64520276,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Alerts for syntheticmonitoring",
+ "sections": "Mute (disable) monitor's alert notifications",
+ "info": "New Relic can use alerts to notify you about syntheticmonitors's failures.",
+ "category_0": "Syntheticmonitoring",
+ "category_1": "Syntheticmonitoring",
+ "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": "5f31b60e196a6742d2fbd6c8"
+ },
+ {
+ "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",
+ "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 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": "Update alert notification channels",
+ "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-11T06:42:27Z",
+ "updated_at": "2020-08-11T06:42:27Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.6147996,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Update alert notificationchannels",
+ "sections": "Update alert notificationchannels",
+ "info": "Read about how to update alerts notificationchannels. ",
+ "category_2": "Alert notifications",
+ "body": " to a notificationchannel: 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": "5f2dbad928ccbcb8ca88dfed"
+ },
+ {
+ "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 alerts.newrelic.com > Notification channels. 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",
+ "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 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"
+ ],
+ "title": "Delete alert notification channels",
+ "popularity": 1,
+ "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-11T04:16:54Z",
+ "updated_at": "2020-08-11T04:16:54Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.61065197,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Delete alert notificationchannels",
+ "sections": "Delete alert notificationchannels",
+ "info": "You can delete alerts notificationchannels 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 notificationchannel, you can remove it from any associated policy. Delete a channel To delete a channel permanently: Go to alerts.newrelic.com > Notification channels. Go to one.newrelic.com, in the top nav click Alerts & AI"
+ },
+ "id": "5f2dbb3628ccbc65c788dfcb"
+ },
+ {
+ "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 / 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": [
+ "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",
+ "Test alert notification channels",
+ "Request the test",
+ "Troubleshoot the test results",
+ "For more help"
+ ],
+ "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/alerts-applied-intelligence/new-relic-alerts/alert-notifications/test-alert-notification-channels",
+ "published_at": "2020-08-11T04:16:54Z",
+ "updated_at": "2020-08-11T04:16:54Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.61065197,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Test alert notificationchannels",
+ "sections": "Test alert notificationchannels",
+ "info": "Be sure to save your alerts notificationchannels before testing them to make sure they're working properly.",
+ "category_2": "Alert notifications",
+ "body": "You must save a new notificationchannel or any changes to an existing notificationchannel before testing it. Alerts will then send a test message to your chosen destination. Request the test To test a notificationchannel: Go to one.newrelic.com, in the top nav click Alerts & AI, then click"
+ },
+ "id": "5f2dbb3664441fd3a556a97c"
+ },
+ {
+ "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. alerts.newrelic.com > Alert policies > (selected policy) > Notification channels > Add notification channels > User: To receive push notifications on your mobile device, select your username from the list. 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",
+ "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": [
+ "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": "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": "65878aca7993877ee748776c87e9225c90687e3f",
+ "category_1": "New Relic Alerts",
+ "category_2": "Alert notifications",
+ "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/screen-user-notification-channel.png",
+ "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/notification-channels-control-where-send-alerts",
+ "published_at": "2020-08-11T06:39:29Z",
+ "updated_at": "2020-08-11T06:39:29Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.4610356,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Notificationchannels: Control where to send alerts",
+ "sections": "Notificationchannels: Control where to send alerts",
+ "info": "Read about how to set up alerts notificationchannels 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 notificationchannel: On the Notification channels, click New notificationchannel. Select the type of channel and complete other required steps"
+ },
+ "id": "5f2dbad864441fb7d256a9db"
+ }
+ ],
+ "/collect-data/custom-attributes": [
+ {
+ "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 / 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": [
+ "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": "Collect custom attributes",
+ "popularity": 1,
+ "external_id": "5a43638e8ef969ce9f0b16fedf433317e67bb4a6",
+ "category_1": "Cross-product functions",
+ "category_2": "Install and configure",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/using-new-relic/data/customize-data/collect-custom-attributes",
+ "published_at": "2020-08-11T00:28:22Z",
+ "updated_at": "2020-08-11T00:28:22Z",
+ "category_0": "Using New Relic",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 1.0364168,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Collect customattributes",
+ "sections": "Collect customattributes",
+ "info": "How to add customattributes to data reported from some New Relic products. ",
+ "body": ". APM: Record customattributes Review the list of reserved terms used by NRQL. Using reserved terms can cause issues. To enable and use customattributes for APM, follow the procedure for your APM agent: C SDK To add customattributes to applications monitored by the C SDK, call one of the attribute"
+ },
+ "id": "5e9a9d9728ccbc90cdd949ca"
+ },
+ {
+ "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 in New Relic Insights. View and use attributes Both default APM attributes and custom attributes for your C application appear in: New Relic APM transaction traces and error analytics APM events in Insights C-specific attributes Before creating custom attributes, review New Relic's list of reserved terms used by NRQL and Insights. 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": [
+ "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": "Use default or custom attributes (C SDK)",
+ "popularity": 1,
+ "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-10T23:02:11Z",
+ "updated_at": "2020-07-26T11:55:10Z",
+ "category_0": "APM agents",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.5006659,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Use default or customattributes (C SDK)",
+ "sections": "Use default or customattributes (C SDK)",
+ "info": "You can create customattributes for your C app to supplement the New Relic event data that automatically includes default APM attributes.",
+ "body": " and customattributes for your C application appear in: New Relic APM transaction traces and error analytics APM events in Insights C-specific attributes Before creating customattributes, review New Relic's list of reserved terms used by NRQL and Insights. Otherwise unexpected results may occur"
+ },
+ "id": "5cd8abf7e621f45d85a089a9"
+ },
+ {
+ "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 New Relic implementation, or in apps you build. The opportunities are endless. Guides to collect data 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 15 min Collect data - any source APIs, agents, OS emitters - get any data Add custom attributes Use custom attributes for deeper analysis 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",
+ "type": "developer",
+ "document_type": "page",
+ "info": "",
+ "sections": [
+ "Collect data",
+ "Guides to collect data",
+ "Create custom events",
+ "Collect data - any source",
+ "Add custom attributes",
+ "Build queries with NerdGraph",
+ "Query data with NRQL"
+ ],
+ "title": "Collect data",
+ "popularity": 1,
+ "external_id": "fb5d6f75b61858b09e3e8c63f3b2af97813f47b6",
+ "image": "",
+ "url": "https://developer.newrelic.com/collect-data/",
+ "published_at": "2020-08-13T01:45:06Z",
+ "updated_at": "2020-08-12T01:50:25Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.47421402,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Add customattributes",
+ "body": " to collect data 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 15 min Collect data - any source APIs, agents, OS emitters - get any data Add customattributes Use customattributes for deeper analysis 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"
+ },
+ "id": "5efa997328ccbc768c307de2"
+ },
+ {
+ "body": "NRQL does not have an equivalent SQL-like JOIN function. Also, there is no equivalent for nested queries or subqueries. You can simulate a JOIN by using custom attributes in a query's WHERE or FACET clause. Simulate SQL JOIN with custom attributes To gain more in-depth data, you can add custom attributes to some data types. For example, you want to know which browser types are experiencing the highest web duration for a specific product purchase. You could add a custom attribute named Product to your application's purchase transaction method. Then you could run this NRQL query: SELECT max(duration), average(duration), max(backendDuration), average(backendDuration) FROM PageView WHERE Product = 'Hat' FACET userAgentName SINCE 7 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": "page",
+ "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / NRQL query tutorials",
+ "info": "New Relic NRQL: simulating SQL-like JOIN functions using custom attributes.",
+ "nodeid": 11451,
+ "sections": [
+ "NRQL: New Relic Query Language",
+ "Get started",
+ "NRQL query tools",
+ "NRQL query tutorials",
+ "Simulate SQL JOIN functions in Insights",
+ "Simulate SQL JOIN with custom attributes",
+ "For more help"
+ ],
+ "title": "Simulate SQL JOIN functions in Insights",
+ "popularity": 1,
+ "external_id": "9ace89658c3020db08f87be5f031a1eadc742b27",
+ "category_1": "NRQL: New Relic Query Language",
+ "category_2": "NRQL query tutorials",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/nrql-query-tutorials/simulate-sql-join-functions-insights",
+ "published_at": "2020-08-10T21:13:52Z",
+ "updated_at": "2020-08-05T14:08:06Z",
+ "category_0": "Query your data",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.33339083,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Simulate SQL JOIN with customattributes",
+ "info": "New Relic NRQL: simulating SQL-like JOIN functions using customattributes.",
+ "category_1": "NRQL: New Relic Query Language",
+ "category_2": "NRQL query tutorials",
+ "body": "NRQL does not have an equivalent SQL-like JOIN function. Also, there is no equivalent for nested queries or subqueries. You can simulate a JOIN by using customattributes in a query's WHERE or FACET clause. Simulate SQL JOIN with customattributes To gain more in-depth data, you can add custom",
+ "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / NRQL query tutorials"
+ },
+ "id": "5f306fd3196a67d6a4fbd6d1"
+ },
+ {
+ "body": "New Relic's $util.insights is a set of tools to set and manipulate events reported from synthetic monitoring. Custom data is added as custom attributes, with prefix custom, to the SyntheticCheck event. These attributes are in addition to that event's default attributes. $util.insights includes the word Insights because Insights was historically how New Relic saved queryable event data. Compatibility This functionality is available for monitor versions 0.2.0 or later. Functions Function Return value $util.insights.set(key: string, value: ?) Sets a key/value pair. void $util.insights.get(key: string) Returns the value for the provided key. object $util.insights.getKeys() Returns an array of keys currently set. object $util.insights.has(key: string) Returns true if the key exists in the data. boolean $util.insights.unset(key: string) Removes the key/value pair. void $util.insights.unsetAll() Removes all custom data. void Example The example obtains the latest incident from New Relic's RSS status feed and saves the details for this event. var parseString = require('xml2js').parseString; // Get the New Relic status RSS feed $http.get('https://status.newrelic.com/history.rss', function(err, response, body) { parseString(body, function(err, result){ // Parse the RSS, and get the latest incident var latestIncident = result.rss.channel[0].item[0]; // Push the incident details to New Relic $util.insights.set('Incident', latestIncident.title[0]); $util.insights.set('Description', latestIncident.description[0]); $util.insights.set('Date', latestIncident.pubDate[0]); }); }); To view the incident data sent to New Relic in this example, use this query: FROM SyntheticCheck SELECT latest(custom.Date), latest(custom.Incident), latest(custom.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 / Synthetic monitoring / Synthetic monitoring / Monitor scripting",
+ "info": "$util.insights is a set of tools to set and manipulate synthetic event data.",
+ "nodeid": 7541,
+ "sections": [
+ "Synthetic monitoring",
+ "Getting started",
+ "Guides",
+ "Using monitors",
+ "Monitor scripting",
+ "Administration",
+ "Private locations",
+ "UI pages",
+ "Synthetics API",
+ "Troubleshooting",
+ "Add custom attributes to synthetic monitoring data",
+ "Compatibility",
+ "Functions",
+ "Example",
+ "For more help"
+ ],
+ "title": "Add custom attributes to synthetic monitoring data",
+ "popularity": 1,
+ "external_id": "9cd1e8cdf69e1ff209d108b1d27022279b418d10",
+ "category_1": "Synthetic monitoring",
+ "category_2": "Monitor scripting",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/synthetics/synthetic-monitoring/scripting-monitors/add-custom-attributes-synthetic-monitoring-data",
+ "published_at": "2020-08-10T17:49:32Z",
+ "updated_at": "2020-08-10T17:49:31Z",
+ "category_0": "Synthetic monitoring",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.32797116,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Add customattributes to synthetic monitoring data",
+ "sections": "Add customattributes to synthetic monitoring data",
+ "body": "New Relic's $util.insights is a set of tools to set and manipulate events reported from synthetic monitoring. Custom data is added as customattributes, with prefix custom, to the SyntheticCheck event. These attributes are in addition to that event's default attributes. $util.insights includes"
+ },
+ "id": "5f3188ac64441fab2156a99e"
+ }
+ ],
+ "/build-apps/add-time-picker-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 Set up your development environment Prepare to build apps and contribute to this site 20 min Publish and deploy apps Start sharing the New Relic 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 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",
+ "Set up your development environment",
+ "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",
+ "Create a custom map view"
+ ],
+ "title": "Build apps",
+ "popularity": 1,
+ "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d",
+ "image": "",
+ "url": "https://developer.newrelic.com/build-apps/",
+ "published_at": "2020-08-13T01:45:07Z",
+ "updated_at": "2020-08-12T01:57:08Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.1869086,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Build apps",
+ "sections": "Addatimepicker to your app",
+ "body": " 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 timepicker to your app Add a time"
+ },
+ "id": "5efa999d64441fc0f75f7e21"
+ },
+ {
+ "body": "Observability for every developer Whether you're new to New Relic or already a data nerd, you can start building right now. For free. Create an account and start using New Relic One as your foundation to instrument everything. Ready to dive even deeper? Create custom observability apps to better visualize your data to answer your engineering problems. Let's start building. 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": [
+ "Observability for every developer",
+ "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-13T01:44:01Z",
+ "updated_at": "2020-08-04T01:37:15Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.12366746,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Addatimepicker to your app",
+ "body": ", 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 timepicker to your app Add a timepicker to a sample application Add custom attributes"
+ },
+ "id": "5d6fe49a64441f8d6100a50f"
+ },
+ {
+ "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 chart 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 components of the NR1 library. Before you begin Follow the instructions in New Relic One to create an API key and download and configure your NR1 CLI profile. This guide requires that you have Git and node.js installed on your machine. Step 1 of 14 Clone the example application In this guide you are going to experiment with tables. To do that, you need a New Relic One application you can modify and test on your computer. There's a demo application for you in the nr1-how-to repository. Start by cloning the repository from GitHub to your local machine. Then, navigate to the app directory. 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 14 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 14 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 NR1 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 14 Open one.newrelic.com/?nerdpacks=local in your browser. You should see a Create a table button in your launcher: That's the demo application you are going to work on. Go ahead and select it. Have a good look at the demo app: There is a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You are going to use Table components to add a new table in the second row. Step 5 of 14 Import the Table components 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 6 of 14 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.
); } // 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": "Reference guide for SDK query components using NerdGraph",
+ "sections": [
+ "Query and store data",
+ "Components overview",
+ "Query components",
+ "Mutation components",
+ "Static methods",
+ "NrqlQuery"
+ ],
+ "title": "Query and store data",
+ "popularity": 1,
+ "external_id": "cbbf363393edeefbc4c08f9754b43d38fd911026",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/query-and-store-data/",
+ "published_at": "2020-08-13T01:50:34Z",
+ "updated_at": "2020-08-01T01:42:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.0026203436,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Queryand store data",
+ "sections": "Queryand store data",
+ "info": "Reference guide for SDK query components usingNerdGraph",
+ "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": "5efa989e28ccbc2f15307deb"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables 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",
+ "sections": [
+ "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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:40:44Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.00085564225,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "body": " 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"
+ },
+ "id": "5efa989ee7b9d2024b7bab97"
+ },
+ {
+ "body": "You can query New Relic data in several ways, including in the UI or via API. To understand your New Relic-stored data better, see Data types. Query data in the UI Reasons to query your data from the New Relic UI: To answer a specific question To create a custom chart or dashboard To access and navigate your data in a quick, visual way There are two ways to query data in the New Relic UI: using query languages (New Relic query language, or PromQL), or using simpler query interfaces that don't require knowledge of how to write a query. Query with NRQL or PromQL in the UI There are two ways to write your own queries to retrieve data and build charts: Query builder - NRQL mode: query using New Relic query language (NRQL), the same language we use to build most of our UI experiences. Query builder - PromQL mode: write basic queries in PromQL. You can also use New Relic Insights to query in NRQL. Query using simple UI interfaces New Relic One offers several experiences that don't require knowledge of NRQL: Data explorer: an intuitive data navigator to create visualizations for events and metrics. Query builder (basic mode): a simple, query-less, chart-building experience. Distributed tracing query: a specialized UI for querying traces. Logs query: a specialized UI for querying New Relic Logs data. Query data via API There are several APIs for retrieving and querying New Relic data. You can run NRQL (our query language) queries with NerdGraph (our GraphQL API). For more on New Relic APIs, see Intro to New Relic 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.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Understand data",
+ "info": "An introduction to querying your New Relic data in our UI or via our APIs.",
+ "nodeid": 35616,
+ "sections": [
+ "Ingest and manage data",
+ "Get started",
+ "Understand data",
+ "Manage data",
+ "Ingest APIs",
+ "Introduction to querying New Relic data",
+ "Query data in the UI",
+ "Query with NRQL or PromQL in the UI",
+ "Query using simple UI interfaces",
+ "Query data via API",
+ "For more help"
+ ],
+ "title": "Introduction to querying New Relic data",
+ "popularity": 1,
+ "external_id": "4b100d1c3eb477844b083a5c1baaf83b156808a2",
+ "category_1": "Ingest and manage data",
+ "category_2": "Understand data",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/query-your-data/explore-query-data/explore-data/introduction-querying-new-relic-data",
+ "published_at": "2020-08-12T01:27:14Z",
+ "updated_at": "2020-08-12T01:27:14Z",
+ "category_0": "Telemetry Data Platform",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.00052036217,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Introduction to querying New Relic data",
+ "sections": "Introduction to querying New Relic data",
+ "info": "An introduction to querying your New Relic data in our UI or via our APIs.",
+ "category_0": "Telemetry Data Platform",
+ "category_1": "Ingest and manage data",
+ "category_2": "Understand data",
+ "body": " to write your own queries to retrieve data and build charts: Query builder - NRQL mode: queryusing New Relic query language (NRQL), the same language we use to build most of our UI experiences. Query builder - PromQL mode: write basic queries in PromQL. You can also use New Relic Insights",
+ "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Understand data"
+ },
+ "id": "5f334572196a6794eafbd716"
+ }
+ ],
+ "/collect-data/collect-data-from-any-source": [
+ {
+ "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",
+ "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": [
+ "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": "Telemetry SDKs: Report custom telemetry data",
+ "popularity": 1,
+ "external_id": "47a4c8f38c1b1674504ea302d865fd499e90ea39",
+ "category_1": "Ingest and manage data",
+ "category_2": "Ingest APIs",
+ "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-11T01:15:35Z",
+ "updated_at": "2020-08-11T01:15:34Z",
+ "category_0": "Telemetry Data Platform",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.25023857,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "TelemetrySDKs: Report custom telemetry data",
+ "sections": "TelemetrySDKs: Report custom telemetry data",
+ "info": "Report custom telemetry data with New Relic's open-source TelemetrySDKs.",
+ "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 MetricAPI Traces: see the TraceAPI Write your own TelemetrySDK or contribute to an existing one If you need a TelemetrySDK",
+ "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs"
+ },
+ "id": "5d89fefbe7b9d2537ed30dc1"
+ },
+ {
+ "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",
+ "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": [
+ "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": "Get data into New Relic",
+ "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-10T23:16:40Z",
+ "updated_at": "2020-08-10T23:16:39Z",
+ "category_0": "Telemetry Data Platform",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.18667682,
+ "_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: TraceAPIEventAPIMetricAPI 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": "5f24aa60196a67ede394f5f3"
+ },
+ {
+ "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",
+ "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": [
+ "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": "Report custom event data",
+ "popularity": 1,
+ "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-10T19:35:12Z",
+ "updated_at": "2020-07-26T05:52:23Z",
+ "category_0": "Insights",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.13249277,
+ "_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 agentAPI 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: MetricAPI Logs Trace",
+ "breadcrumb": "Contents / Insights / Event data sources / Custom events"
+ },
+ "id": "5e8e7f9de7b9d2aa122cf0f6"
+ },
+ {
+ "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",
+ "breadcrumb": "Contents / APIs / Get started / Intro to APIs",
+ "info": "An introduction to all of the available New Relic APIs. ",
+ "nodeid": 15691,
+ "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"
+ ],
+ "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,
+ "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-10T17:47:27Z",
+ "updated_at": "2020-08-10T01:40:52Z",
+ "category_0": "APIs",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.13043898,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Introduction to New Relic APIs",
+ "sections": "TelemetryAPIs 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 TraceAPI Send distributed tracing data to New Relic. EventAPI Send event data to New"
+ },
+ "id": "5d4ae71be7b9d211b4d535a4"
+ },
+ {
+ "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",
+ "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,
+ "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"
+ ],
+ "title": "Trace API general requirements and limits ",
+ "popularity": 1,
+ "external_id": "9558eae24905dbe37b40d6e428ce551721bc188f",
+ "category_1": "Distributed tracing",
+ "category_2": "Trace API",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/trace-api/trace-api-general-requirements-limits",
+ "published_at": "2020-08-11T01:10:53Z",
+ "updated_at": "2020-07-31T01:48:53Z",
+ "category_0": "Understand dependencies",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.1131265,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "TraceAPI general requirements and limits ",
+ "sections": "TraceAPI",
+ "info": "For New Relic TraceAPI: requirements, rules, max limits, and validation rules and responses. ",
+ "category_1": "Distributed tracing",
+ "category_2": "TraceAPI",
+ "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 TraceAPI requires the EventAPI 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 / TraceAPI"
+ },
+ "id": "5d8a2ac764441f19066f6f4d"
+ }
+ ],
+ "/build-apps/set-up-dev-env": [
+ {
+ "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, we'll show you how to 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. We also have a 5-minute video that covers the steps below. Before you begin To get started, make sure you have accounts in GitHub and New Relic. 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 all the steps in our CLI wizard. 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 wizard, 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 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 New Relic One Catalog launcher. Step 4 of 4 Under Your company applications, 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 on the New Relic One homepage, 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 access to save your selections. When you return to the New Relic One homepage, 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 custom application: 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",
+ "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"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "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-13T01:45:06Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.037275873,
+ "_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 our CLI wizard. For additional details about setting upyourenvironment, see Setupyourdevelopmentenvironment. Create a local version of the "Hello, World!" application The CLI allows you to run a local version of New"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
+ {
+ "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-howto/use-nerdstorage directory: cd / nr1 - howto / 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. Under Your applications 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 this is done, clicking the trash button will remove the item it's associated with, and the app will update 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 As the new Delete Document button will be calling the _deleteDocument helper method, you'll need to update that using the code below: _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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:40:44Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.03539673,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "body": " and the New Relic One CLI as described in Setupyourdevelopmentenvironment. 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"
+ },
+ "id": "5efa98d4e7b9d26d6b7bab74"
+ },
+ {
+ "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 New Relic's 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 New Relic 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 wizard, and be sure to make a copy of your account ID from step 1 because you’ll need it later. Note If you already installed the New Relic One CLI, but you can't remember your account ID, you can re-run the wizard just to get your account ID. 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 wizard (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) and click Use NerdGraph. Note If you don't see any launchers, click Your applications. After launching the Use NerdGraph application, you see a dashboard that gives an overview of the transactions in your New Relic 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 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 usage throughout the New Relic One application. Complete the following: Step 1 of 2 The following 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 the following code into the index.js 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 the following code to index.js for the second StackItem in the return statement: { accounts && ( ); } Copy After you complete these steps, look at the application in your browser, and note the following: The dropdown menu 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 completed all the steps in this example, you 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 NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application",
+ "sections": [
+ "Add the NerdGraphQuery component to an application",
+ "Note",
+ "Before you begin",
+ "Prepare the sample code",
+ "Add the NerdGraphQuery component",
+ "How to use NerdGraphQuery.query",
+ "Summary"
+ ],
+ "title": "Add the NerdGraphQuery component to an application",
+ "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-13T01:50:34Z",
+ "updated_at": "2020-08-08T01:40:44Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.02651936,
+ "_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": " just to get your account ID. For additional details, see Setupyourdevelopmentenvironment. 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"
+ },
+ "id": "5efa993c64441ff4865f7e32"
+ },
+ {
+ "body": "Add a time picker 20 min This guide steps you through the process of adding access to the New Relic 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 our CLI wizard, and be sure to make a copy of your account ID from step 1 because you’ll need it later. Note If you already installed the New Relic One CLI, but you can't remember your account ID, you can re-run the wizard just to get your account ID. 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 wizard (see Before you begin). this.accountId = ; Copy Step 5 of 7 Change to the add-time-picker directory: cd / nr1 - howto / 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 New Relic One homepage: https://one.newrelic.com/?nerdpacks=local and click Add Time Picker: Note If you don't see any launchers, click Your applications. 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 are 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.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Add a time picker to a sample application",
+ "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"
+ ],
+ "title": "Add a time picker",
+ "popularity": 1,
+ "external_id": "2602edf3077388ba4fded3a76208e5e0ae1be98f",
+ "image": "https://developer.newrelic.com/static/aeaa23cefbcc326c64be764bfd26df69/b01d9/homepage-launcher.png",
+ "url": "https://developer.newrelic.com/build-apps/add-time-picker-guide/",
+ "published_at": "2020-08-13T01:50:35Z",
+ "updated_at": "2020-08-08T01:40:44Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.026476001,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "body": " the wizard just to get your account ID. For additional details, see Setupyourdevelopmentenvironment. 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"
+ },
+ "id": "5efa993d28ccbc91ff307dde"
+ },
+ {
+ "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",
+ "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,
+ "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"
+ ],
+ "title": "Set up your Prometheus remote write integration",
+ "popularity": 1,
+ "external_id": "45a644202d25d6e49b8d4ffd61a4512316f5a38b",
+ "category_1": "Prometheus integrations",
+ "category_2": "Install and configure",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/integrations/prometheus-integrations/install-configure/set-your-prometheus-remote-write-integration",
+ "published_at": "2020-08-11T04:39:51Z",
+ "updated_at": "2020-07-31T01:42:36Z",
+ "category_0": "Integrations",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.004925982,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Setupyour Prometheus remote write integration",
+ "sections": "Setupyour Prometheus remote write integration",
+ "info": "How to setup or remove your Prometheus remote write integration on New Relic. ",
+ "body": " availability integration, see the Prometheus High Availability resource. Setup 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"
+ },
+ "id": "5f23770c28ccbc272332c204"
+ }
+ ],
+ "/explore-docs/query-and-store-data": [
+ {
+ "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 New Relic opensource agents provide out of the box -- Fetch a list of New Relic 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 in New Relic One that show your data from multiple angles. These dashboards can be shared 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 New Relic Explorers Hub. GitHub For examples of integrations and other technologies, check us out on GitHub.",
+ "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.",
+ "sections": [
+ "Query data with NRQL",
+ "Learn more and start building",
+ "Documentation",
+ "NRU Tutorials",
+ "Community Forum",
+ "GitHub"
+ ],
+ "title": "Query data with NRQL",
+ "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-13T01:45:06Z",
+ "updated_at": "2020-08-01T01:39:59Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.038812947,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Querydata with NRQL",
+ "sections": "Querydata 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": " functions, see NRQL syntax, components, and functions. NRU Tutorials To learn how to query and narrow a large datastore by a specific parameter, watch the tutorial on Filtering queries with NRQL. Community Forum Connect with other developers in the New Relic Explorers Hub. GitHub For examples of integrations and other technologies, check us out on GitHub."
+ },
+ "id": "5efa999ce7b9d29f377bab69"
+ },
+ {
+ "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-howto/use-nerdstorage directory: cd / nr1 - howto / 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. Under Your applications 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 this is done, clicking the trash button will remove the item it's associated with, and the app will update 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 As the new Delete Document button will be calling the _deleteDocument helper method, you'll need to update that using the code below: _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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:40:44Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.008778348,
+ "_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"
+ },
+ "id": "5efa98d4e7b9d26d6b7bab74"
+ },
+ {
+ "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",
+ "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,
+ "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"
+ ],
+ "title": "Query the Metric data type",
+ "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-11T00:11:05Z",
+ "updated_at": "2020-08-03T13:34:47Z",
+ "category_0": "Query your data",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.008204022,
+ "_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"
+ },
+ "id": "5efdd99528ccbc94fa307dca"
+ },
+ {
+ "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",
+ "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,
+ "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"
+ ],
+ "title": "Query and alert on usage data",
+ "popularity": 1,
+ "external_id": "94429d3c0366a8dee43d771c143fc6dacf4c4e31",
+ "category_1": "Accounts and billing",
+ "category_2": "New Relic One pricing and users",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/accounts/accounts-billing/new-relic-one-pricing-users/usage-queries-alerts",
+ "published_at": "2020-08-11T03:40:05Z",
+ "updated_at": "2020-07-30T16:30:53Z",
+ "category_0": "New Relic accounts",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.0075994283,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Queryand alert on usage data",
+ "sections": "Queryand alert on usage data",
+ "info": "How to create queriesand 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"
+ },
+ "id": "5f22f5bd64441f0c9e2a48ea"
+ },
+ {
+ "body": "This doc is for accounts on our New Relic One pricing plan. If you're on our original product-based pricing plan, see Original data retention. Not sure which you're on? See Overview of pricing and account/user structure. The Data retention UI page provides information on how long your data will be stored in the New Relic database (NRDB). Standard accounts have between 8 and 395 days of retention, depending on which capabilities of the New Relic platform you’re using. This level of data retention ensures that you can explore your data and experience the value of New Relic. Beyond that, you can purchase additional retention to ensure it suits your business needs. Use the Data retention page to review the sources of data that you’re storing, when they were last updated, and the length the data is stored. The Data retention page shows the source of data, and how long it's retained Retention periods For accounts on our New Relic One pricing plan, the following table provides the default retention periods. To increase retention, you must upgrade to a Pro or Enterprise tier. Source Event namespace Days retained APM APM 8 APM APM errors 8 Browser Browser 8 Browser Browser events 8 Browser Browser JS events 8 Browser Browser SPA monitoring 8 Browser Browser page view timing 8 Custom events Custom events 30 Serverless Lambda 8 Serverless Lambda custom 8 Serverless Lambda spans 8 Logs Log 30 Infrastructure Infrastructure processes 8 Infrastructure Infrastructure integrations 395 Metrics (dimensional metrics) Metric: Raw 30 Mobile Mobile crash event trails 8 Mobile Mobile exception 8 Mobile Mobile general 8 Mobile Mobile error 8 Mobile Mobile crash 90 Mobile Mobile session 90 Distributed tracing data Traces 8 Note: Metric timeslice data cannot be extended. That data type is aggregated (averaged) first to 1-minute rollups that are retained for 8 days. After 8 days, the 1-minute rollups are aggregated to 1-hour roll-ups and retained for 90 days. After 90 days, key metric data is then stored in 1-hour periods indefinitely. Data deletion Once telemetry data (events, metrics, logs, traces) is reported to New Relic and available for querying, that data cannot be edited or deleted. This is a purposeful design decision that optimizes New Relic's speed and performance. Data will expire after its data retention ends. 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 / Telemetry Data Platform / Ingest and manage data / Manage data",
+ "info": "Data retention: How long different types of New Relic data are stored. ",
+ "nodeid": 39286,
+ "sections": [
+ "Ingest and manage data",
+ "Get started",
+ "Understand data",
+ "Manage data",
+ "Ingest APIs",
+ "Manage retention of stored data",
+ "Retention periods",
+ "Data deletion",
+ "For more help"
+ ],
+ "title": "Manage retention of stored data",
+ "popularity": 1,
+ "external_id": "719011870379d0158c01a07ab09ea6a15d1a2319",
+ "category_1": "Ingest and manage data",
+ "category_2": "Manage data",
+ "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/retention-page.png",
+ "url": "https://docs.newrelic.com/docs/telemetry-data-platform/get-data-new-relic/manage-data/manage-retention-stored-data",
+ "published_at": "2020-08-11T05:31:01Z",
+ "updated_at": "2020-08-06T02:41:52Z",
+ "category_0": "Telemetry Data Platform",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.007415227,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Manage retention of storeddata",
+ "sections": "Manage retention of storeddata",
+ "info": "Data retention: How long different types of New Relic data are stored. ",
+ "category_0": "Telemetry Data Platform",
+ "category_1": "Ingest and manage data",
+ "category_2": "Manage data",
+ "body": "This doc is for accounts on our New Relic One pricing plan. If you're on our original product-based pricing plan, see Original data retention. Not sure which you're on? See Overview of pricing and account/user structure. The Data retention UI page provides information on how long your data",
+ "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Manage data"
+ },
+ "id": "5f2462e464441f8d0c75e7e9"
+ }
+ ],
+ "/collect-data/get-started-nerdgraph-api-explorer": [
+ {
+ "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",
+ "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,
+ "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"
+ ],
+ "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",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/what-entity-new-relic",
+ "published_at": "2020-08-10T23:53:11Z",
+ "updated_at": "2020-08-06T23:06:23Z",
+ "category_0": "New Relic One",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.15503374,
+ "_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"
+ },
+ "id": "5cdc20638e9c0f35676a8106"
+ },
+ {
+ "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 / 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",
+ "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"
+ ],
+ "title": "NerdGraph API: Examples ",
+ "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-11T04:59:01Z",
+ "updated_at": "2020-08-11T04:59:00Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.04339722,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NerdGraphAPI: Examples ",
+ "sections": "NerdGraphAPIexplorer",
+ "info": "Read about how you can manage alerts conditions, policies, and muting rules usingNerdGraph.",
+ "body": " Use NRQL conditions Muting rules: suppress notifications The easiest way to discover alerts queries and mutations is through the NerdGraphAPIexplorer. NerdGraphAPIexplorer Our NerdGraphAPIexplorer 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": "5f2dbad864441fd15456a9eb"
+ },
+ {
+ "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",
+ "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,
+ "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"
+ ],
+ "title": "NerdGraph entities API tutorial",
+ "popularity": 1,
+ "external_id": "6dad137791a70630e57cb10aa5f574776c26613f",
+ "category_1": "NerdGraph",
+ "category_2": "Examples",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-entities-api-tutorial",
+ "published_at": "2020-08-11T01:39:48Z",
+ "updated_at": "2020-08-11T01:39:48Z",
+ "category_0": "APIs",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.03174163,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NerdGraph entities API tutorial",
+ "sections": "NerdGraph entities API tutorial",
+ "info": "Use New Relic's NerdGraph (our GraphQLAPI) to query your monitored entities (applications, hosts, etc.)",
+ "category_0": "APIs",
+ "category_1": "NerdGraph",
+ "body": " entity by its GUID. For example, to useNerdGraph 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"
+ },
+ "id": "5d8fd87f196a67bba0756f3f"
+ },
+ {
+ "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",
+ "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": [
+ "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": "NerdGraph API: Alerts policies ",
+ "popularity": 1,
+ "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-11T04:56:49Z",
+ "updated_at": "2020-08-11T04:56:49Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.028399589,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NerdGraphAPI: Alerts policies ",
+ "sections": "NerdGraphAPI: Alerts policies",
+ "info": "Read about how you can list, create, update, and delete policies usingtheNerdGraphAPI.",
+ "body": "You can manage your alerts policies using our GraphQL NerdGraphAPI. Here are some queries and mutations you can develop in our NerdGraphAPIexplorer. See the NerdGraph introduction for help getting started with NerdGraphAPIexplorer. List and filter policies The policiesSearch query allows you",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph"
+ },
+ "id": "5f2dee1128ccbc65b688dfc1"
+ },
+ {
+ "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 / 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": [
+ "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": "NerdGraph API: NRQL condition alerts ",
+ "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-11T04:56:49Z",
+ "updated_at": "2020-08-11T04:56:49Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.024312286,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NerdGraphAPI: NRQL condition alerts ",
+ "sections": "NerdGraphAPI: NRQL condition alerts",
+ "info": "Examples of how to usetheNerdGraphAPIexplorer to create alert conditions, queries, and mutations.",
+ "body": "You can manage alerts conditions using our GraphQL NerdGraphAPI. Here are some conditions queries and mutations you can develop in our NerdGraphAPIexplorer. See the NerdGraph introduction for help getting started with NerdGraphAPIexplorer. This document covers the following: Steps to create",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph"
+ },
+ "id": "5f2dee1128ccbc562e88dfc1"
+ }
+ ],
+ "/collect-data/query-data-nrql": [
+ {
+ "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.",
+ "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,
+ "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",
+ "For more help"
+ ],
+ "title": "App data NRQL query examples",
+ "popularity": 1,
+ "external_id": "73d096e7e4470dd2fe07eb3aebc18271fc13a243",
+ "category_1": "NRQL: New Relic Query Language",
+ "category_2": "NRQL query tutorials",
+ "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-10T22:32:16Z",
+ "updated_at": "2020-08-05T14:57:07Z",
+ "category_0": "Query your data",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.16353735,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "App dataNRQLquery examples",
+ "sections": "App dataNRQLquery 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": "NRQLquery 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 / NRQLquery tutorials"
+ },
+ "id": "5f306ff2e7b9d226eac9debb"
+ },
+ {
+ "body": "New Relic 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? New Relic reports 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 New Relic 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 recreating APM metrics as dimensional metrics, which opens them up for querying via NRQL. This 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 build a metric timeslice data In New Relic 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 available for querying is an ongoing process and is not 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’ Here's the current list of APM metrics made available as dimensional metrics: Metric name Description Attributes 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 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, query for its dimensional metric name using this query syntax: from Metric SELECT uniques(metricName) where metricTimesliceName = 'Datastore/statement/MySQL/test/select' If the only metric name returned is newrelic.timeslice.value, you need to query your data using this metric. 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": "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 build a metric timeslice data",
+ "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-11T03:05:35Z",
+ "updated_at": "2020-08-05T20:15:05Z",
+ "category_0": "Query your data",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.15683046,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Query APM metric timeslice datawithNRQL",
+ "sections": "Query APM metric timeslice datawithNRQL",
+ "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": "NRQLquery tutorials",
+ "body": "New Relic 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? New Relic reports metrics in several ways. One variety of metric data we call metric timeslice data; this is the type of data used",
+ "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / NRQLquery tutorials"
+ },
+ "id": "5f2b1349196a67379343fbcf"
+ },
+ {
+ "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",
+ "sections": [
+ "Add custom attributes to your New Relic data"
+ ],
+ "title": "Add custom attributes to your New Relic data",
+ "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-13T01:45:06Z",
+ "updated_at": "2020-08-04T01:39:41Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.10931137,
+ "_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 NRQLquery that uses the 'userid' custom attribute. Once you have added a custom attribute like 'userid"
+ },
+ "id": "5efa999de7b9d2985d7bab67"
+ },
+ {
+ "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 New Relic implementation, or in apps you build. The opportunities are endless. Guides to collect data 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 15 min Collect data - any source APIs, agents, OS emitters - get any data Add custom attributes Use custom attributes for deeper analysis 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",
+ "type": "developer",
+ "document_type": "page",
+ "info": "",
+ "sections": [
+ "Collect data",
+ "Guides to collect data",
+ "Create custom events",
+ "Collect data - any source",
+ "Add custom attributes",
+ "Build queries with NerdGraph",
+ "Query data with NRQL"
+ ],
+ "title": "Collect data",
+ "popularity": 1,
+ "external_id": "fb5d6f75b61858b09e3e8c63f3b2af97813f47b6",
+ "image": "",
+ "url": "https://developer.newrelic.com/collect-data/",
+ "published_at": "2020-08-13T01:45:06Z",
+ "updated_at": "2020-08-12T01:50:25Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.10265674,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Collect data",
+ "sections": "QuerydatawithNRQL",
+ "body": " to collect data 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 15 min Collect data - any source APIs, agents, OS emitters - get any data Add custom attributes Use custom attributes for deeper analysis 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 10 min Querydata with NRQLQuery default event data, custom events, and attributes"
+ },
+ "id": "5efa997328ccbc768c307de2"
+ },
+ {
+ "body": "You can query New Relic data in several ways, including in the UI or via API. To understand your New Relic-stored data better, see Data types. Query data in the UI Reasons to query your data from the New Relic UI: To answer a specific question To create a custom chart or dashboard To access and navigate your data in a quick, visual way There are two ways to query data in the New Relic UI: using query languages (New Relic query language, or PromQL), or using simpler query interfaces that don't require knowledge of how to write a query. Query with NRQL or PromQL in the UI There are two ways to write your own queries to retrieve data and build charts: Query builder - NRQL mode: query using New Relic query language (NRQL), the same language we use to build most of our UI experiences. Query builder - PromQL mode: write basic queries in PromQL. You can also use New Relic Insights to query in NRQL. Query using simple UI interfaces New Relic One offers several experiences that don't require knowledge of NRQL: Data explorer: an intuitive data navigator to create visualizations for events and metrics. Query builder (basic mode): a simple, query-less, chart-building experience. Distributed tracing query: a specialized UI for querying traces. Logs query: a specialized UI for querying New Relic Logs data. Query data via API There are several APIs for retrieving and querying New Relic data. You can run NRQL (our query language) queries with NerdGraph (our GraphQL API). For more on New Relic APIs, see Intro to New Relic 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.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Understand data",
+ "info": "An introduction to querying your New Relic data in our UI or via our APIs.",
+ "nodeid": 35616,
+ "sections": [
+ "Ingest and manage data",
+ "Get started",
+ "Understand data",
+ "Manage data",
+ "Ingest APIs",
+ "Introduction to querying New Relic data",
+ "Query data in the UI",
+ "Query with NRQL or PromQL in the UI",
+ "Query using simple UI interfaces",
+ "Query data via API",
+ "For more help"
+ ],
+ "title": "Introduction to querying New Relic data",
+ "popularity": 1,
+ "external_id": "4b100d1c3eb477844b083a5c1baaf83b156808a2",
+ "category_1": "Ingest and manage data",
+ "category_2": "Understand data",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/query-your-data/explore-query-data/explore-data/introduction-querying-new-relic-data",
+ "published_at": "2020-08-12T01:27:14Z",
+ "updated_at": "2020-08-12T01:27:14Z",
+ "category_0": "Telemetry Data Platform",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.042140186,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Introduction to querying New Relic data",
+ "sections": "QuerywithNRQL or PromQL in the UI",
+ "info": "An introduction to querying your New Relic data in our UI or via our APIs.",
+ "category_0": "Telemetry Data Platform",
+ "category_1": "Ingest and manage data",
+ "category_2": "Understand data",
+ "body": " and navigate your data in a quick, visual way There are two ways to querydata in the New Relic UI: using query languages (New Relic query language, or PromQL), or using simpler query interfaces that don't require knowledge of how to write a query. Query with NRQL or PromQL in the UI There are two ways",
+ "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Understand data"
+ },
+ "id": "5f334572196a6794eafbd716"
+ }
+ ],
+ "/collect-data/custom-events": [
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables 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",
+ "sections": [
+ "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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:40:44Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.13364607,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelic CLI Reference",
+ "sections": "NewRelic CLI Reference",
+ "info": "The command line tools for performing tasks against NewRelic APIs",
+ "tags": "newrelic cli",
+ "body": "NewRelic CLI Reference The NewRelic CLI enables integration of NewRelic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding NewRelic into your CI/CD pipeline. NewRelic CLI commands Find details for the NewRelic 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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.093814656,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the NewRelic CLI",
+ "sections": "Create your NewRelic CLI profile",
+ "info": "Learn the essentials of the NewRelic CLI, from install and configuration to basic usage.",
+ "tags": "NewRelic CLI",
+ "body": ". This guide walks you through the essentials of NewRelic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your NewRelic personal API Key, which you can create from the Account settings of your NewRelic account An instrumented application in your"
+ },
+ "id": "5efa999c196a67c4e1766461"
+ },
+ {
+ "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 New Relic One apps, including the New Relic One CLI (command line interface). This page will explain 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 New Relic One Catalog Installing the New Relic One CLI From within New Relic, go to the Build your own application launcher and follow the instructions. This launcher will automatically generate an API key for the account you select, and give 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 CLI 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 from New Relic 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-13T01:50:34Z",
+ "updated_at": "2020-08-04T01:41:46Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.08682871,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelic One CLI reference",
+ "sections": "NewRelic One CLI reference",
+ "info": "An overview of the CLI to help you build, deploy, and manage NewRelic apps.",
+ "tags": "NewRelic One app",
+ "body": " application launcher and follow the instructions. This launcher will automatically generate an API key for the account you select, and give you the pre-populated commands to create a profile, generate your first "Hello World" app, and serve it locally. NewRelic One CLI Commands This table provides"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "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 in New Relic Insights. 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",
+ "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": [
+ "Go agent",
+ "Get started",
+ "Installation",
+ "Configuration",
+ "Instrumentation",
+ "API guides",
+ "Features",
+ "Troubleshooting",
+ "Create custom events in Insights (Go)",
+ "RecordCustomEvent parameters",
+ "Example",
+ "For more help"
+ ],
+ "title": "Create custom events in Insights (Go)",
+ "popularity": 1,
+ "external_id": "402e63e08ae6d64c7683950cd7c3b1fb37ce6c23",
+ "category_1": "Go agent",
+ "category_2": "Features",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/agents/go-agent/features/create-custom-events-insights-go",
+ "published_at": "2020-08-10T19:33:32Z",
+ "updated_at": "2020-07-26T04:15:52Z",
+ "category_0": "APM agents",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.0053885533,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Createcustomevents in Insights (Go)",
+ "sections": "Createcustomevents in Insights (Go)",
+ "info": "To track arbitrary event data in NewRelic Insights for apps monitored by your NewRelic Go agent, use RecordCustomEvent.",
+ "body": "Customevents 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 NewRelic Go agent, add RecordCustomEvent to the apps. You can then query and visualize"
+ },
+ "id": "5979980fe621f42b40c9353a"
+ },
+ {
+ "body": "If you have New Relic APM, you can report custom event data, which is then available for querying in New Relic. Related documentation: Add custom attributes to existing events Send custom events using the Event API (without need for APM) Custom events sent with the agent APIs are not compatible with high security mode. Data considerations The New Relic agents sends event data to New Relic as part of its normal harvest cycle every 5 seconds for agent versions supporting real time streaming. Sending a lot of events can increase the memory overhead of the agent. New Relic enforces an upper limit of 10,000 custom events per minute. Additionally, posts greater than 1MB in size will not be recorded, regardless of the custom event limit. For more information, check out New Relic University’s tutorial Adding custom data with the APM agent API. Or, go directly to the full online course Custom data with APM. Record a custom event To record a custom event, follow the procedure for your New Relic language agent: C SDK To add a custom event to apps monitored by the C SDK, start a transaction and use the newrelic_create_custom_event and newrelic_record_custom_event functions. For more information, see the Guide to using the C SDK API. Go To add a custom event to apps monitored by the Go agent, use RecordCustomEvent. Java Custom event collection is enabled by default in Java agent version 3.13.0 or higher. To send custom events, call recordCustomEvent. For example: Map eventAttributes = new HashMap(); NewRelic.getAgent().getInsights().recordCustomEvent(\"MyCustomEvent\", eventAttributes); The first argument defines the name of your event type, and the second argument is a map with the attributes for your custom event. Event attributes must be strings or numbers. Ensure you limit the number of unique event type names that you create, and do not generate these names dynamically. For restrictions on event type names, see Limits and restricted characters and Reserved words. You can change the maximum number of events recorded by the Java agent via a configuration parameter in newrelic.yml. Specify the maximum number of events to record per minute as an integer. For example, if you want to send less than the default of 10000 events: custom_insights_events: max_samples_stored: 5000 To disable custom events entirely, add the following to your newrelic.yml: custom_insights_events: enabled: false For Java agent versions prior to 4.1.0, use the following YAML configuration: custom_insights_events.enabled: true custom_insights_events.max_samples_stored: 5000 .NET Custom event collection is enabled by default in .NET agent version 4.6.29.0 or higher. To send custom events, simply call RecordCustomEvent(). For example: var eventAttributes = new Dictionary(); NewRelic.Api.Agent.NewRelic.RecordCustomEvent('MyCustomEvent', eventAttributes); The first argument defines the name of your event type, and the second argument is an IEnumerable with the attributes for your custom event. Ensure you limit the number of unique event type names that you create, and do not generate these names dynamically. For restrictions on event type names, see Limits and restricted characters and Reserved words. You can turn off custom events entirely by setting customEvents.enabled to false in newrelic.config. Node.js Custom event collection is enabled by default in Node.js agent version 1.15.0 or higher. To send custom events, simply call the relevant API. For example: 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. For restrictions on event type names, see Limits and restricted characters and Reserved words. To disable custom events entirely, add custom_insights_events.enabled: false to newrelic.js. PHP Custom event collection is enabled by default in PHP agent version 4.18 or higher. To send custom events, simply call the relevant API function. For example: newrelic_record_custom_event(\"WidgetSale\", array(\"color\"=>\"red\", \"weight\"=>12.5)); The first argument defines the name of your event type, and the second argument is an array with the attributes for your custom event. Ensure you limit the number of unique event type names that you create, and do not generate these names dynamically. For restrictions on event type names, see Limits and restricted characters and Reserved words. By default, the maximum number of custom events recorded per minute is 10,000. This setting cannot be changed. To disable custom events entirely, add newrelic.custom_insights_events.enabled = false to your newrelic.ini and restart the agent. Python Custom event collection is enabled by default in Python agent version 2.60.0.46 or higher. To send custom events, simply call the relevant API. For example: newrelic.agent. record_custom_event (event_type, params, application=None) The event_type defines the name (or type) of the custom event. Attributes of the custom event should be passed in as a dictionary via the params keyword argument. Ensure you limit the number of unique event type names that you create, and do not generate these names dynamically. For limits and restrictions on event_type and params, see Limits and restricted characters and Reserved words If called outside of the context of a monitored web request or background task, the call will be ignored unless the application keyword argument is provided and an application object corresponding to the application against which the exception should be recorded is provided. A suitable application object can be obtained using the newrelic.agent.application() function. To disable custom events entirely, set custom_insights_events.enabled to False in your newrelic.ini configuration file. Ruby Custom event collection is enabled by default in Ruby agent version 3.9.8.273 or higher. To send custom events, simply call the relevant API. For example: ::NewRelic::Agent.record_custom_event('WidgetSale', color: 'red', weight: 12.5) The first argument defines the name of your event type, and the second argument is a hash with the attributes for your custom event. Ensure you limit the number of unique event type names that you create, and do not generate these names dynamically. For restrictions on event type names, see Limits and restricted characters and Reserved words. You can change the maximum number of events recorded by the Ruby agent via a configuration parameter in newrelic.yml: Add custom_insights_events.max_samples_stored: to your configuration file. Specify the maximum number of events to record per minute as an integer. For example, if you want to be able to send up to 5000 events per minute, add: custom_insights_events.max_samples_stored: 5000 To disable custom events entirely, add custom_insights_events.enabled: false to newrelic.yml. Timestamps You may not specify a timestamp on events that are collected and recorded via the agent. The agent will automatically assign a timestamp to events based on when they are recorded via the API. Limits and restricted characters See Custom event data requirements for size limits, data types, and naming syntax requirements. Reserved words Before creating custom attributes, review New Relic's list of reserved terms used by NRQL. Otherwise unexpected results may occur. 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 / Event data sources / Custom events",
+ "info": "New Relic APM: how to report custom events and attributes.",
+ "nodeid": 6256,
+ "sections": [
+ "Event data sources",
+ "Default events",
+ "Custom events",
+ "New Relic APM: Report custom events",
+ "Data considerations",
+ "Record a custom event",
+ "Timestamps",
+ "Limits and restricted characters",
+ "Reserved words",
+ "For more help"
+ ],
+ "title": "New Relic APM: Report custom events",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insert-custom-events-new-relic-apm-agents",
+ "popularity": 1,
+ "external_id": "51eb61abc7e80c67654b29fcb2bd4c26522898d2",
+ "category_1": "Event data sources",
+ "category_2": "Custom events",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/insert-custom-events-new-relic-apm-agents",
+ "published_at": "2020-08-10T19:05:34Z",
+ "updated_at": "2020-07-26T06:22:05Z",
+ "category_0": "Insights",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.004642806,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelic APM: Report customevents",
+ "sections": "NewRelic APM: Report customevents",
+ "info": "NewRelic APM: how to report customevents and attributes.",
+ "category_1": "Event data sources",
+ "category_2": "Customevents",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insert-custom-events-new-relic-apm-agents",
+ "body": "If you have NewRelic APM, you can report customevent data, which is then available for querying in NewRelic. Related documentation: Add custom attributes to existing events Send customevents using the Event API (without need for APM) Customevents sent with the agent APIs are not compatible",
+ "breadcrumb": "Contents / Insights / Event data sources / Customevents"
+ },
+ "id": "59425efc4bb81c51f7de646a"
+ }
+ ],
+ "/build-apps/build-hello-world-app": [
+ {
+ "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 a Nerdlet or a launcher. This may be useful when adding Nerdlets to an existing Nerdpack. For documentation on generating and connecting Nerdpack components, see our workshop. 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 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\" } Copy 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 An empty SCSS file for styling your application. icon.png The launcher icon that appears on the one.newrelic.com home page when an application is deployed. 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 ). 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; this may 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 launcher icon that appears on the one.newrelic.com home page when an application is deployed.",
+ "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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:40:45Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.7904115,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Nerdpackfilestructure",
+ "sections": "Nerdpackfilestructure",
+ "info": "An overview of the NerdpackFileStructure",
+ "body": " 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 OneCLI command nr1 create and select Nerdpack to create"
+ },
+ "id": "5efa989e196a671300766404"
+ },
+ {
+ "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 New Relic One apps, including the New Relic One CLI (command line interface). This page will explain 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 New Relic One Catalog Installing the New Relic One CLI From within New Relic, go to the Build your own application launcher and follow the instructions. This launcher will automatically generate an API key for the account you select, and give 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 CLI 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 from New Relic 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-13T01:50:34Z",
+ "updated_at": "2020-08-04T01:41:46Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.66233027,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic OneCLI reference",
+ "sections": "New Relic OneCLI reference",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "tags": "New Relic One app",
+ "body": " 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"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables 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",
+ "sections": [
+ "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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:40:44Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.49550867,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic CLI Reference",
+ "sections": "New Relic CLI Reference",
+ "tags": "new relic cli",
+ "body": " 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": "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",
+ "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": [
+ "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": "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-11T01:30:03Z",
+ "updated_at": "2020-07-25T00:32:16Z",
+ "category_0": "New Relic One",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.49014038,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Nerdpackfilestructure",
+ "sections": "Nerdpackfilestructure",
+ "info": "For building a New Relic Oneapplication: an explanation of the Nerdpack/Nerdlet filestructure. ",
+ "category_0": "New Relic One",
+ "category_1": "Use New Relic One",
+ "category_2": "Build on New Relic One",
+ "body": " filestructure When you generate a Nerdpack template using the CLInr1 create command, it has this filestructure: 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": "5da0e07a64441f1328edf241"
+ },
+ {
+ "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 chart 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 components of the NR1 library. Before you begin Follow the instructions in New Relic One to create an API key and download and configure your NR1 CLI profile. This guide requires that you have Git and node.js installed on your machine. Step 1 of 14 Clone the example application In this guide you are going to experiment with tables. To do that, you need a New Relic One application you can modify and test on your computer. There's a demo application for you in the nr1-how-to repository. Start by cloning the repository from GitHub to your local machine. Then, navigate to the app directory. 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 14 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 14 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 NR1 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 14 Open one.newrelic.com/?nerdpacks=local in your browser. You should see a Create a table button in your launcher: That's the demo application you are going to work on. Go ahead and select it. Have a good look at the demo app: There is a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You are going to use Table components to add a new table in the second row. Step 5 of 14 Import the Table components 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 6 of 14 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 7 of 14 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(). ApplicationSizeCompanyTeamCommit; { ({ item }) => ( {item.name}{item.value}{item.company}{item.team}{item.commit} ); } Copy Step 8 of 14 Take a look at the application running in New Relic One: you should see something similar to the screenshot below. Step 9 of 14 Replace standard table cells with smart cells The NR1 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 10 of 14 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 11 of 14 Time to give your table a second look: The cell components you've added take care of properly formatting the data. Step 12 of 14 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 13 of 14 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 14 of 14 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": "Add a table to your New Relic One app.",
+ "sections": [
+ "Add tables to your New Relic One application",
+ "Before you begin",
+ "Clone the example application",
+ "Run the demo application",
+ "Import the Table components",
+ "Add a basic Table component",
+ "Add the header and rows",
+ "Replace standard table cells with smart cells",
+ "Add some action to your table!",
+ "Next steps"
+ ],
+ "title": "Add tables to your New Relic One 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-13T01:50:35Z",
+ "updated_at": "2020-08-12T01:55:38Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.44534552,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Add tables to your New Relic Oneapplication",
+ "sections": "Add tables to your New Relic Oneapplication",
+ "info": "Add a table to your New Relic One app.",
+ "body": " build your own tables into your New Relic One application. In this guide, you are going to build a sample table using various components of the NR1 library. Before you begin Follow the instructions in New Relic One to create an API key and download and configure your NR1CLI profile. This guide"
+ },
+ "id": "5efa989ee7b9d2ad567bab51"
+ }
+ ],
+ "/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 New Relic One apps, including the New Relic One CLI (command line interface). This page will explain 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 New Relic One Catalog Installing the New Relic One CLI From within New Relic, go to the Build your own application launcher and follow the instructions. This launcher will automatically generate an API key for the account you select, and give 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 CLI 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 from New Relic 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-13T01:50:34Z",
+ "updated_at": "2020-08-04T01:41:46Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.48371357,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelicOneCLI reference",
+ "sections": "NewRelicOneCLICommands",
+ "info": "An overview of the CLI to help you build, deploy, and manage NewRelic apps.",
+ "tags": "NewRelicOne app",
+ "body": " descriptions for the NewRelicOneCLIcommands. 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"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables 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",
+ "sections": [
+ "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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:40:44Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.293723,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelicCLI Reference",
+ "sections": "NewRelicCLIcommands",
+ "info": "The command line tools for performing tasks against NewRelic APIs",
+ "tags": "newreliccli",
+ "body": "NewRelicCLI Reference The NewRelicCLI enables integration of NewRelic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding NewRelic into your CI/CD pipeline. NewRelicCLIcommands Find details for the NewRelicCLIcommand 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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.18180177,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the NewRelicCLI",
+ "sections": "Get started with the NewRelicCLI",
+ "info": "Learn the essentials of the NewRelicCLI, from install and configuration to basic usage.",
+ "tags": "NewRelicCLI",
+ "body": "Get started with the NewRelicCLI 20 min Access the NewRelic platform from the comfort of your terminal: you can use the NewRelicCLI 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, we'll show you how to 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. We also have a 5-minute video that covers the steps below. Before you begin To get started, make sure you have accounts in GitHub and New Relic. 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 all the steps in our CLI wizard. 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 wizard, 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 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 New Relic One Catalog launcher. Step 4 of 4 Under Your company applications, 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 on the New Relic One homepage, 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 access to save your selections. When you return to the New Relic One homepage, 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 custom application: 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",
+ "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"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "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-13T01:45:06Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.057003114,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Publish your application to NewRelic",
+ "info": "Build a "Hello, World!" app and publish it to NewRelicOne",
+ "tags": "nr1 cli",
+ "body": " the application with others, you can publish it to NewRelicOne. We also have a 5-minute video that covers the steps below. Before you begin To get started, make sure you have accounts in GitHub and NewRelic. To develop projects, you need our NewRelicOneCLI (command line interface). If you haven't already"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
+ {
+ "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",
+ "info": "An overview of the CLI commands you can use to manage your Nerdpack subscriptions.",
+ "sections": [
+ "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": "New Relic One CLI subscription commands",
+ "popularity": 1,
+ "external_id": "12d2e1b06dede5b1272527f95a14518010aecc58",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-subscription/",
+ "published_at": "2020-08-13T01:50:34Z",
+ "updated_at": "2020-08-06T01:44:54Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.014300019,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelicOneCLI subscription commands",
+ "sections": "NewRelicOneCLI subscription commands",
+ "info": "An overview of the CLIcommands you can use to manage your Nerdpack subscriptions.",
+ "body": "NewRelicOneCLI 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": "5f2b6096e7b9d225ebc9de6f"
+ }
+ ],
+ "/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 New Relic One apps, including the New Relic One CLI (command line interface). This page will explain 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 New Relic One Catalog Installing the New Relic One CLI From within New Relic, go to the Build your own application launcher and follow the instructions. This launcher will automatically generate an API key for the account you select, and give 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 CLI 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 from New Relic 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-13T01:50:34Z",
+ "updated_at": "2020-08-04T01:41:46Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.31169063,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelicOne CLI reference",
+ "sections": "NewRelicOne CLI reference",
+ "info": "An overview of the CLI to help you build, deploy, and manage NewRelic apps.",
+ "tags": "NewRelicOne app",
+ "body": " application launcher and follow the instructions. This launcher will automatically generate an API key for the account you select, and give you the pre-populated commands to create a profile, generate your first "Hello World" app, and serve it locally. NewRelicOne CLI Commands This table provides"
+ },
+ "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",
+ "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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.13283461,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the NewRelic CLI",
+ "sections": "Get started with the NewRelic CLI",
+ "info": "Learn the essentials of the NewRelic CLI, from install and configuration to basic usage.",
+ "tags": "NewRelic CLI",
+ "body": ". This guide walks you through the essentials of NewRelic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your NewRelic personal API Key, which you can create from the Account settings of your NewRelic account An instrumented application in your"
+ },
+ "id": "5efa999c196a67c4e1766461"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables 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",
+ "sections": [
+ "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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:40:44Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.12601936,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelic CLI Reference",
+ "sections": "NewRelic CLI Reference",
+ "info": "The command line tools for performing tasks against NewRelicAPIs",
+ "tags": "newrelic cli",
+ "body": " of the NewRelic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with NewRelic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands"
+ },
+ "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, we'll show you how to 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. We also have a 5-minute video that covers the steps below. Before you begin To get started, make sure you have accounts in GitHub and New Relic. 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 all the steps in our CLI wizard. 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 wizard, 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
; } } 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 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 New Relic One Catalog launcher. Step 4 of 4 Under Your company applications, 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 on the New Relic One homepage, 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 access to save your selections. When you return to the New Relic One homepage, 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 custom application: 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",
+ "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"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "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-13T01:45:06Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.09402579,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Publish your application to NewRelic",
+ "info": "Build a "Hello, World!" app and publish it to NewRelicOne",
+ "tags": "NR OneCatalog",
+ "body": " the application with others, you can publish it to NewRelicOne. We also have a 5-minute video that covers the steps below. Before you begin To get started, make sure you have accounts in GitHub and NewRelic. To develop projects, you need our NewRelicOneCLI (command line interface). If you haven't already"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
+ {
+ "body": "New Relic One CLI common commands Here is 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 from New Relic 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 New Relic databases using a NRQL (New Relic query language) 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-13T01:49:30Z",
+ "updated_at": "2020-08-04T01:44:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.01726033,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelicOneCLI common commands",
+ "sections": "NewRelicOneCLI common commands",
+ "info": "An overview of common commands you can use with the NewRelicOneCLI.",
+ "body": "NewRelicOneCLI common commands Here is a list of common commands to get you started with the NewRelicOneCLI. 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-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 New Relic One apps, including the New Relic One CLI (command line interface). This page will explain 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 New Relic One Catalog Installing the New Relic One CLI From within New Relic, go to the Build your own application launcher and follow the instructions. This launcher will automatically generate an API key for the account you select, and give 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 CLI 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 from New Relic 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-13T01:50:34Z",
+ "updated_at": "2020-08-04T01:41:46Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.48601776,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelicOneCLI reference",
+ "sections": "NewRelicOneCLICommands",
+ "info": "An overview of the CLI to help you build, deploy, and manage NewRelic apps.",
+ "tags": "NewRelicOne app",
+ "body": " descriptions for the NewRelicOneCLIcommands. 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"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables 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",
+ "sections": [
+ "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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:40:44Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.2942244,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelicCLI Reference",
+ "sections": "NewRelicCLIcommands",
+ "info": "The command line tools for performing tasks against NewRelic APIs",
+ "tags": "newreliccli",
+ "body": "NewRelicCLI Reference The NewRelicCLI enables integration of NewRelic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding NewRelic into your CI/CD pipeline. NewRelicCLIcommands Find details for the NewRelicCLIcommand 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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.18122764,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the NewRelicCLI",
+ "sections": "Get started with the NewRelicCLI",
+ "info": "Learn the essentials of the NewRelicCLI, from install and configuration to basic usage.",
+ "tags": "NewRelicCLI",
+ "body": " that you've installed the NewRelicCLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLIcommand, 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, we'll show you how to 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. We also have a 5-minute video that covers the steps below. Before you begin To get started, make sure you have accounts in GitHub and New Relic. 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 all the steps in our CLI wizard. 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 wizard, 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 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 New Relic One Catalog launcher. Step 4 of 4 Under Your company applications, 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 on the New Relic One homepage, 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 access to save your selections. When you return to the New Relic One homepage, 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 custom application: 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",
+ "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"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "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-13T01:45:06Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.05710042,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Publish your application to NewRelic",
+ "info": "Build a "Hello, World!" app and publish it to NewRelicOne",
+ "tags": "nr1 cli",
+ "body": " the application with others, you can publish it to NewRelicOne. We also have a 5-minute video that covers the steps below. Before you begin To get started, make sure you have accounts in GitHub and NewRelic. To develop projects, you need our NewRelicOneCLI (command line interface). If you haven't already"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
+ {
+ "body": "New Relic One CLI common commands Here is 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 from New Relic 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 New Relic databases using a NRQL (New Relic query language) 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-13T01:49:30Z",
+ "updated_at": "2020-08-04T01:44:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.015971335,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelicOneCLI common commands",
+ "sections": "NewRelicOneCLI common commands",
+ "info": "An overview of common commands you can use with the NewRelicOneCLI.",
+ "body": "NewRelicOneCLI common commands Here is a list of common commands to get you started with the NewRelicOneCLI. 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 New Relic One apps, including the New Relic One CLI (command line interface). This page will explain 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 New Relic One Catalog Installing the New Relic One CLI From within New Relic, go to the Build your own application launcher and follow the instructions. This launcher will automatically generate an API key for the account you select, and give 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 CLI 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 from New Relic 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-13T01:50:34Z",
+ "updated_at": "2020-08-04T01:41:46Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.607372,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelicOneCLI reference",
+ "sections": "NewRelicOneCLICommands",
+ "info": "An overview of the CLI to help you build, deploy, and manage NewRelic apps.",
+ "tags": "NewRelicOne app",
+ "body": " on Deploying your NewRelicOne 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"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables 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",
+ "sections": [
+ "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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:40:44Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.29139215,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelicCLI Reference",
+ "sections": "NewRelicCLIcommands",
+ "info": "The command line tools for performing tasks against NewRelic APIs",
+ "tags": "newreliccli",
+ "body": "NewRelicCLI Reference The NewRelicCLI enables integration of NewRelic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding NewRelic into your CI/CD pipeline. NewRelicCLIcommands Find details for the NewRelicCLIcommand 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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.18125051,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the NewRelicCLI",
+ "sections": "Get started with the NewRelicCLI",
+ "info": "Learn the essentials of the NewRelicCLI, from install and configuration to basic usage.",
+ "tags": "NewRelicCLI",
+ "body": " that you've installed the NewRelicCLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLIcommand, 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 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",
+ "info": "An overview of the CLI commands you can use to manage your Nerdpack subscriptions.",
+ "sections": [
+ "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": "New Relic One CLI subscription commands",
+ "popularity": 1,
+ "external_id": "12d2e1b06dede5b1272527f95a14518010aecc58",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-subscription/",
+ "published_at": "2020-08-13T01:50:34Z",
+ "updated_at": "2020-08-06T01:44:54Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.1032447,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelicOneCLI subscription commands",
+ "sections": "NewRelicOneCLI subscription commands",
+ "info": "An overview of the CLIcommands you can use to manage your Nerdpack subscriptions.",
+ "body": "NewRelicOneCLI 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": "5f2b6096e7b9d225ebc9de6f"
+ },
+ {
+ "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, we'll show you how to 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. We also have a 5-minute video that covers the steps below. Before you begin To get started, make sure you have accounts in GitHub and New Relic. 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 all the steps in our CLI wizard. 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 wizard, 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 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 New Relic One Catalog launcher. Step 4 of 4 Under Your company applications, 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 on the New Relic One homepage, 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 access to save your selections. When you return to the New Relic One homepage, 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 custom application: 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",
+ "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"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "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-13T01:45:06Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.090427466,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Publish your application to NewRelic",
+ "info": "Build a "Hello, World!" app and publish it to NewRelicOne",
+ "tags": "nr1 cli",
+ "body": " the application with others, you can publish it to NewRelicOne. We also have a 5-minute video that covers the steps below. Before you begin To get started, make sure you have accounts in GitHub and NewRelic. To develop projects, you need our NewRelicOneCLI (command line interface). If you haven't already"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ }
+ ],
+ "/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 New Relic One apps, including the New Relic One CLI (command line interface). This page will explain 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 New Relic One Catalog Installing the New Relic One CLI From within New Relic, go to the Build your own application launcher and follow the instructions. This launcher will automatically generate an API key for the account you select, and give 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 CLI 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 from New Relic 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-13T01:50:34Z",
+ "updated_at": "2020-08-04T01:41:46Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.47204095,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelicOneCLI reference",
+ "sections": "NewRelicOneCLICommands",
+ "info": "An overview of the CLI to help you build, deploy, and manage NewRelic apps.",
+ "tags": "NewRelicOne app",
+ "body": " descriptions for the NewRelicOneCLIcommands. 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"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables 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",
+ "sections": [
+ "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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:40:44Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.28477308,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelicCLI Reference",
+ "sections": "NewRelicCLIcommands",
+ "info": "The command line tools for performing tasks against NewRelic APIs",
+ "tags": "newreliccli",
+ "body": "NewRelicCLI Reference The NewRelicCLI enables integration of NewRelic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding NewRelic into your CI/CD pipeline. NewRelicCLIcommands Find details for the NewRelicCLIcommand 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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.18170303,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the NewRelicCLI",
+ "sections": "Get started with the NewRelicCLI",
+ "info": "Learn the essentials of the NewRelicCLI, from install and configuration to basic usage.",
+ "tags": "NewRelicCLI",
+ "body": " that you've installed the NewRelicCLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLIcommand, 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, we'll show you how to 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. We also have a 5-minute video that covers the steps below. Before you begin To get started, make sure you have accounts in GitHub and New Relic. 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 all the steps in our CLI wizard. 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 wizard, 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 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 New Relic One Catalog launcher. Step 4 of 4 Under Your company applications, 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 on the New Relic One homepage, 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 access to save your selections. When you return to the New Relic One homepage, 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 custom application: 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",
+ "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"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "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-13T01:45:06Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.055209816,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Publish your application to NewRelic",
+ "info": "Build a "Hello, World!" app and publish it to NewRelicOne",
+ "tags": "nr1 cli",
+ "body": " the application with others, you can publish it to NewRelicOne. We also have a 5-minute video that covers the steps below. Before you begin To get started, make sure you have accounts in GitHub and NewRelic. To develop projects, you need our NewRelicOneCLI (command line interface). If you haven't already"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
+ {
+ "body": "New Relic One CLI common commands Here is 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 from New Relic 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 New Relic databases using a NRQL (New Relic query language) 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-13T01:49:30Z",
+ "updated_at": "2020-08-04T01:44:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.01591634,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelicOneCLI common commands",
+ "sections": "NewRelicOneCLI common commands",
+ "info": "An overview of common commands you can use with the NewRelicOneCLI.",
+ "body": "NewRelicOneCLI common commands Here is a list of common commands to get you started with the NewRelicOneCLI. 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"
+ }
+ ],
+ "/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 New Relic One apps, including the New Relic One CLI (command line interface). This page will explain 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 New Relic One Catalog Installing the New Relic One CLI From within New Relic, go to the Build your own application launcher and follow the instructions. This launcher will automatically generate an API key for the account you select, and give 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 CLI 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 from New Relic 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-13T01:50:34Z",
+ "updated_at": "2020-08-04T01:41:46Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.18393576,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelicOne CLI reference",
+ "sections": "NewRelicOne CLI reference",
+ "info": "An overview of the CLI to help you build, deploy, and manage NewRelicapps.",
+ "tags": "NewRelicOneapp",
+ "body": " will explain 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 NewRelicOne Catalog Installing the NewRelicOne CLI From within NewRelic, go to the Build your own"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables 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",
+ "sections": [
+ "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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:40:44Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.043632768,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelic CLI Reference",
+ "sections": "NewRelic CLI Reference",
+ "info": "The command line tools for performing tasks against NewRelic APIs",
+ "tags": "newrelic cli",
+ "body": "NewRelic CLI Reference The NewRelic CLI enables integration of NewRelic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding NewRelic into your CI/CD pipeline. NewRelic CLI commands Find details for the NewRelic 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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.033969928,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the NewRelic CLI",
+ "sections": "Create yourNewRelic CLI profile",
+ "info": "Learn the essentials of the NewRelic CLI, from install and configuration to basic usage.",
+ "tags": "NewRelic CLI",
+ "body": "Get started with the NewRelic CLI 20 min Access the NewRelic platform from the comfort of your terminal: you can use the NewRelic 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": "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 chart 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 components of the NR1 library. Before you begin Follow the instructions in New Relic One to create an API key and download and configure your NR1 CLI profile. This guide requires that you have Git and node.js installed on your machine. Step 1 of 14 Clone the example application In this guide you are going to experiment with tables. To do that, you need a New Relic One application you can modify and test on your computer. There's a demo application for you in the nr1-how-to repository. Start by cloning the repository from GitHub to your local machine. Then, navigate to the app directory. 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 14 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 14 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 NR1 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 14 Open one.newrelic.com/?nerdpacks=local in your browser. You should see a Create a table button in your launcher: That's the demo application you are going to work on. Go ahead and select it. Have a good look at the demo app: There is a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You are going to use Table components to add a new table in the second row. Step 5 of 14 Import the Table components 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 6 of 14 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 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 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 New Relic One Catalog launcher. Step 4 of 4 Under Your company applications, 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 on the New Relic One homepage, 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 access to save your selections. When you return to the New Relic One homepage, 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 custom application: 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",
+ "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"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "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-13T01:45:06Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.05531139,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Publish your application to NewRelic",
+ "info": "Build a "Hello, World!" app and publish it to NewRelicOne",
+ "tags": "nr1 cli",
+ "body": " the application with others, you can publish it to NewRelicOne. We also have a 5-minute video that covers the steps below. Before you begin To get started, make sure you have accounts in GitHub and NewRelic. To develop projects, you need our NewRelicOneCLI (command line interface). If you haven't already"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
+ {
+ "body": "New Relic One CLI common commands Here is 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 from New Relic 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 New Relic databases using a NRQL (New Relic query language) 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-13T01:49:30Z",
+ "updated_at": "2020-08-04T01:44:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.01594562,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelicOneCLI common commands",
+ "sections": "NewRelicOneCLI common commands",
+ "info": "An overview of common commands you can use with the NewRelicOneCLI.",
+ "body": "NewRelicOneCLI common commands Here is a list of common commands to get you started with the NewRelicOneCLI. 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-cli": [
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables 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",
+ "sections": [
+ "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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:40:44Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 1.023032,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelic CLI Reference",
+ "sections": "NewRelic CLI commands",
+ "info": "The command line tools for performing tasks against NewRelic APIs",
+ "tags": "newrelic cli",
+ "body": "NewRelic CLI Reference The NewRelic CLI enables integration of NewRelic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding NewRelic into your CI/CD pipeline. NewRelic CLI commands Find details for the NewRelic 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-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.63192666,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the NewRelic CLI",
+ "sections": "Get started with the NewRelic CLI",
+ "info": "Learn the essentials of the NewRelic CLI, from install and configuration to basic usage.",
+ "tags": "NewRelic CLI",
+ "body": " that you've installed the NewRelic 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-13T01:50:34Z",
+ "updated_at": "2020-08-04T01:44:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.54009736,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelicOne CLI Nerdpackcommands",
+ "sections": "NewRelicOne CLI Nerdpackcommands",
+ "info": "An overview of the CLI commands you can use to set up your NewRelicOneNerdpacks.",
+ "body": "NewRelicOne CLI Nerdpackcommands 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, we'll show you how to 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. We also have a 5-minute video that covers the steps below. Before you begin To get started, make sure you have accounts in GitHub and New Relic. 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 all the steps in our CLI wizard. 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 wizard, 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 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 New Relic One Catalog launcher. Step 4 of 4 Under Your company applications, 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 on the New Relic One homepage, 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 access to save your selections. When you return to the New Relic One homepage, 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 custom application: 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",
+ "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"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "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-13T01:45:06Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.4112208,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Create a "Hello, World!" application",
+ "sections": "Publish your application to NewRelic",
+ "info": "Build a "Hello, World!" app and publish it to NewRelicOne",
+ "tags": "Nerdpack file structure",
+ "body": " the application with others, you can publish it to NewRelicOne. We also have a 5-minute video that covers the steps below. Before you begin To get started, make sure you have accounts in GitHub and NewRelic. To develop projects, you need our NewRelicOne CLI (command line interface). If you haven't already"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
+ {
+ "body": "Developers are creating new and innovative apps that extend and enhance your data views. From New Relic One's apps page, you can subscribe to apps you create, publish, and deploy, as well as those created by New Relic engineers and other organizations. You can also launch the apps you subscribe to. Just select Apps from the New Relic One home page to see what's available. one.newrelic.com > Apps: Under the New Relic One catalog section, you can subscribe to applications. Create and share open source apps The Other apps section shows launchers for New Relic apps, as well as any third-party apps that you subscribe to. The New Relic One catalog provides apps that you haven't subscribed to, some developed by New Relic engineers to provide information we think you'll want, like Cloud Optimizer, which analyzes your cloud environment, or PageView Map, which uses Browser events to chart performance across geographies. Other apps in the catalog are created by third-party contributors and are submitted via opensource.newrelic.com. All are intended to help you visualize the data you need, the way you want it. If you’ve started to develop applications on the New Relic One platform, you probably want to share them with your broader organization. That’s where the catalog comes in. When you publish and deploy your app, it’s available to you in the catalog. You can manage the information that you want to share about your application, as well as how it appears on the New Relic One app page. You can also subscribe accounts to it. Permission for managing applications User permissions vary depending on which pricing plan you are on: New Relic One pricing plan For accounts with New Relic One pricing, there are permissions differences for basic users and full users: Full users have the Nerdpack Manager role and have full capabilities for creating and managing New Relic One applications as well as accessing all types of applications in the New Relic One catalog. A basic user can develop and view their own local New Relic One apps, but they cannot: Subscribe other users to apps they’ve created. Access or manage apps in the New Relic One catalog. Access apps in the entity explorer sidebar. Original product-based pricing For accounts on our original product-based pricing, here are access details: Subscribe to publicly available applications To subscribe to publicly available applications, you must have the Nerdpack manager role. Nerdpack manager permissions are automatically assigned to New Relic account owners and admins and can be assigned to individual users. If you aren’t an owner or admin, you can request Nerdpack manager permission, or ask your New Relic admin or owner to subscribe the apps to your account for you. You can add any of the publicly available applications to master accounts or separate sub-accounts on which you have the Nerdpack manager role, or to separate sub-accounts under a master account you own or administer. If you add the application to a master account, the access flows to all of its sub-accounts as well. Subscribe to applications that you create You also must have the Nerdpack manager role to subscribe the applications you create to accounts. Applications that you publish and deploy can only be subscribed to the master account that was used to publish them, or to its sub-accounts. This means you might want a New Relic admin to deploy your applications for you if they need to be available across the organization. Add images and metadata to your apps Application creators can include a description of what the apps do and how they're best used when they build an app. They can also include screenshots, icons, and metadata that help to make them easy to spot amongst other applications. Some metadata is added automatically when an app is published: Related entities, listed if there are any. Origin label to indicate where the app comes from: local (you made it!), custom, or public. Browser Analyzer app with browser app entity listed, plus duplicate clean up tab. The New Relic One CLI enables you to provide the information and images you want to include with your application. Then it's a matter of kicking off a catalog command that validates the information and saves it to the catalog. When you create an application by running nr1 create, a generic icon.png file is added to your project. Replace this with an icon of your choice, but keep the file name icon.png to update your application's icon in the catalog. 1. Update the New Relic One CLI Make sure you have the latest version of the New Relic One CLI by running nr1 update. 2. Add catalog metadata and screenshots Run nr1 create and then select catalog to add a catalog folder to your New Relic One project. The folder contains the following empty files and folder. Add the information as described in the following table for the process to succeed. File Requirements screenshots folder A directory that must contain no more than 6 images and meet these criteria: 3:2 aspect ratio PNG format landscape orientation 1600 to 2400 pixels wide documentation.md A markdown file that presents usage information pulled into the Documentation tab for the application in the catalog. additionalInfo.md An optional markdown file for any additional information about using your application. config.json A JSON file that contains the following fields: tagline: A brief headline for the application. Must not exceed 30 characters. repository: The URL to the GitHub repo for the application. Must not exceed 1000 characters. details: Describes the purpose of the application and how to use it. Information must not exceed 1000. Use carriage returns for formatting. Do not include any markdown or HTML. support: An object that contains: issues: A valid URL to the GitHub repository's issues list, generally the GitHub Issues tab for the repo. email: A valid email address for the team supporting the application. community: URL to a support thread, forum, or website for troubleshooting and usage support. whatsNew: A bulleted list of changes in this version. Must not exceed 500 characters. Use carriage returns for formatting. Do not include markdown or HTML. Example: { \"tagline\": \"Map your workloads & entities\", \"repository\": \"https://github.com/newrelic/nr1-workload-geoops.git\", \"details\": \"Describe, consume, and manage Workloads and Entities in a geographic model that supports location-specific KPI's, custom metadata, drill-down navigation into Entities and Workloads, real-time configuration, and configuration via automation using the newrelic-cli.\", \"support\": { \"issues\": { \"url\": \"https://github.com/newrelic/nr1-workload-geoops/issues\" }, \"email\": { \"address\": \"opensource+nr1-workload-geoops@newrelic.com\" }, \"community\": { \"url\": \"https://discuss.newrelic.com/t/workload-geoops-nerdpack/99478\" } }, \"whatsNew\": \"\\n-Feat: Geographic mapping of Workloads and Entities\\n-Feat: Programmatic alerting rollup of underlying Entities\\n-Feat: Custom KPI measurement per location\\n-Feat: Empty-state edit workflow\\n-Feat: JSON file upload format\\n-Feat: Published (in open source docs) guide to automating configuration using the newrelic-cli\" } 3. Save the metadata and screenshots to the catalog Run nr1 catalog:submit. This validates the information you added to the catalog directory against the criteria described in the previous step, and saves it to the catalog. Subscribe accounts to an application Select an application you want to add to your New Relic account. Click Add this app. Note that this button says Manage access if the app has already been subscribed to an account you manage. On the Account access page listing the accounts you can subscribe to an application: - Select the accounts you want to subscribe the app to. - Choose the channel you want to subscribe the app to, Stable or Dev. This can only be Stable for the Public apps created by New Relic. - Click the update button. Now you and the accounts you subscribed to the app can launch it from New Relic One. Unsubscribe to an application On the Apps page, open the app you want to unsubscribe. Click Manage access. Clear the check box for any accounts you want to unsubscribe, and then click the update button. The application is no longer listed in the Other apps section of the Apps page, and you have unsubscribed. Handle duplicate applications You might end up with duplicate applications on your New Relic One Apps page. This can happen when you subscribe to the same app using both the CLI and the catalog. Or if you clone an app, modify and deploy it, but keep the original name. You can manage duplicates with the catalog. Good to know before you start: You need a user role with the ability to manage Nerdpacks for accounts that you want to unsubscribe and undeploy from applications. You can't remove the public apps. When a duplicate application has no accounts subscribed to it, you undeploy it. For applications that have accounts subscribed to them, you unscubscribe and undeploy. The unsubscribe and undeploy process happens in a batch. To remove an account from an application, but ensure that other accounts continue to be subscribed, select the checkbox, Resubscribe these accounts to the new application. Remove duplicates In the New Relic One catalog, click a public application that has one or more duplicates. (You can only manage duplicates from the public version of the application.) On the application information page, select Clean up applications. Review the information about the application that's open, as well as any duplicates. Click Manage app for duplicates you want to remove. If needed, select Resubscribe these accounts to the new application. Click Unsubscribe and undeploy, and agree to the terms and conditions. For more help Additional documentation resources include: Add-on roles for learning about Nerdpack manager permissions Permissions for managing applications Take a tour of the catalog 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": "About the New Relic One catalog, where you can subscribe to open source New Relic One applications, and to which you can deploy your own custom apps. ",
+ "nodeid": 37996,
+ "sections": [
+ "Use New Relic One",
+ "Get started",
+ "Core concepts",
+ "UI and data",
+ "Workloads",
+ "Build on New Relic One",
+ "Discover and manage New Relic One applications",
+ "Create and share open source apps",
+ "Permission for managing applications",
+ "Add images and metadata to your apps",
+ "Subscribe accounts to an application",
+ "Unsubscribe to an application",
+ "Handle duplicate applications",
+ "For more help"
+ ],
+ "title": "Discover and manage New Relic One applications",
+ "popularity": 1,
+ "external_id": "66a00fb098d21829d83384d8948e701cd9aa86f0",
+ "category_1": "Use New Relic One",
+ "category_2": "Build on New Relic One",
+ "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/nr1_catalog_0.png",
+ "url": "https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/discover-manage-applications-new-relic-one-catalog",
+ "published_at": "2020-08-11T05:10:24Z",
+ "updated_at": "2020-08-11T05:10:23Z",
+ "category_0": "New Relic One",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.19220884,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Discover and manage NewRelicOneapplications",
+ "sections": "Discover and manage NewRelicOneapplications",
+ "info": "About the NewRelicOne catalog, where you can subscribe to open source NewRelicOneapplications, and to which you can deploy your own custom apps. ",
+ "category_0": "NewRelicOne",
+ "category_1": "Use NewRelicOne",
+ "category_2": "Build on NewRelicOne",
+ "body": " comes from: local (you made it!), custom, or public. Browser Analyzer app with browser app entity listed, plus duplicate clean up tab. The NewRelicOne CLI enables you to provide the information and images you want to include with your application. Then it's a matter of kicking off a catalog command",
+ "breadcrumb": "Contents / NewRelicOne / Use NewRelicOne / Build on NewRelicOne"
+ },
+ "id": "5e836492196a679b4102bd12"
+ }
+ ],
+ "/explore-docs/nerdpack-file-structure": [
+ {
+ "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, we'll show you how to 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. We also have a 5-minute video that covers the steps below. Before you begin To get started, make sure you have accounts in GitHub and New Relic. 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 all the steps in our CLI wizard. 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 wizard, 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 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 New Relic One Catalog launcher. Step 4 of 4 Under Your company applications, 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 on the New Relic One homepage, 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 access to save your selections. When you return to the New Relic One homepage, 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 custom application: 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",
+ "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"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "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-13T01:45:06Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 7.823373,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "tags": "Nerdpackfilestructure",
+ "body": " 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"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
+ {
+ "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",
+ "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": [
+ "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": "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-11T01:30:03Z",
+ "updated_at": "2020-07-25T00:32:16Z",
+ "category_0": "New Relic One",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 1.30332,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Nerdpackfilestructure",
+ "sections": "Nerdpackfilestructure",
+ "info": "For building a New Relic One application: an explanation of the Nerdpack/Nerdlet filestructure. ",
+ "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 filestructure for a Nerdpack, a Nerdlet and a launcher How to link a launcher file to a Nerdlet How to link your"
+ },
+ "id": "5da0e07a64441f1328edf241"
+ },
+ {
+ "body": "New Relic One CLI common commands Here is 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 from New Relic 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 New Relic databases using a NRQL (New Relic query language) 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-13T01:49:30Z",
+ "updated_at": "2020-08-04T01:44:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.11849282,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "body": ". To learn more about Nerdpacks and their filestructure, see Nerdpackfilestructure. 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"
+ },
+ "id": "5f28bd6ae7b9d267996ade94"
+ },
+ {
+ "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 Chart 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), and then select Advanced (NRQL). You'll use NRQL to test your query before dropping the data into your table. Copy and paste this query into the 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 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\".
; 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'; }}