From 85b2c9dd5cc7c54e5ad499e7cec0928c81333bbe Mon Sep 17 00:00:00 2001 From: Cayla Hamann Date: Fri, 25 Sep 2020 14:54:12 -0400 Subject: [PATCH 01/15] chore: update branch name in workflow files --- .github/workflows/fetch-related-content.yml | 6 +++--- .github/workflows/release.yml | 13 ++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/fetch-related-content.yml b/.github/workflows/fetch-related-content.yml index 5a949f58d..7e8c7799a 100644 --- a/.github/workflows/fetch-related-content.yml +++ b/.github/workflows/fetch-related-content.yml @@ -58,7 +58,7 @@ jobs: const result = await github.repos.updateBranchProtection({ owner: context.repo.owner, repo: context.repo.repo, - branch: 'main', + branch: 'develop', required_status_checks: null, restrictions: null, enforce_admins: null, @@ -71,7 +71,7 @@ jobs: uses: ad-m/github-push-action@v0.6.0 with: github_token: ${{ secrets.OPENSOURCE_BOT_TOKEN }} - branch: main + branch: develop - name: Re-enable "required_pull_request_reviews" branch protection id: enable-branch-protection @@ -84,7 +84,7 @@ jobs: const result = await github.repos.updateBranchProtection({ owner: context.repo.owner, repo: context.repo.repo, - branch: 'main', + branch: 'develop', required_status_checks: null, restrictions: null, enforce_admins: true, diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e9201869b..74aea50d6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,8 +3,7 @@ name: Release on: push: branches: - # todo: change this branch name - - main + - develop env: BOT_NAME: nr-opensource-bot @@ -111,7 +110,7 @@ jobs: const result = await github.repos.updateBranchProtection({ owner: context.repo.owner, repo: context.repo.repo, - branch: 'main', + branch: 'develop', required_status_checks: null, restrictions: null, enforce_admins: null, @@ -124,7 +123,7 @@ jobs: uses: ad-m/github-push-action@v0.6.0 with: github_token: ${{ secrets.OPENSOURCE_BOT_TOKEN }} - branch: main + branch: develop - name: Re-enable "required_pull_request_reviews" branch protection id: enable-branch-protection @@ -137,7 +136,7 @@ jobs: const result = await github.repos.updateBranchProtection({ owner: context.repo.owner, repo: context.repo.repo, - branch: 'main', + branch: 'develop', required_status_checks: null, restrictions: null, enforce_admins: true, @@ -187,7 +186,7 @@ jobs: const result = await github.repos.updateBranchProtection({ owner: context.repo.owner, repo: context.repo.repo, - branch: 'main', + branch: 'develop', required_status_checks: null, restrictions: null, enforce_admins: null, @@ -217,7 +216,7 @@ jobs: const result = await github.repos.updateBranchProtection({ owner: context.repo.owner, repo: context.repo.repo, - branch: 'main', + branch: 'develop', required_status_checks: null, restrictions: null, enforce_admins: true, From c942c60a494bcf907cac450386ea95644852707d Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 25 Sep 2020 15:12:35 -0700 Subject: [PATCH 02/15] feat: beef up useScript to better load a script async --- src/hooks/useScript.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/hooks/useScript.js b/src/hooks/useScript.js index e39631f8a..b8de4b3b6 100644 --- a/src/hooks/useScript.js +++ b/src/hooks/useScript.js @@ -1,21 +1,33 @@ import { useEffect, useState } from 'react'; +import useShallowMemo from './useShallowMemo'; -const useScript = (src) => { +const useScript = (src, options) => { + const { attributes = {}, async: isAsync = true, crossOrigin } = options || {}; const [loaded, setLoaded] = useState(false); + const [error, setError] = useState(null); + const attrs = useShallowMemo(() => attributes, [attributes]); useEffect(() => { const script = window.document.createElement('script'); - script.async = true; - script.crossOrigin = 'anonymous'; - script.onload = () => setLoaded(true); + script.async = isAsync; + script.crossOrigin = crossOrigin; + script.onload = () => { + setLoaded(true); + }; + script.onerror = setError; script.src = src; + + Object.entries(attrs).forEach(([attribute, value]) => + script.setAttribute(attribute, value) + ); + document.body.appendChild(script); return () => document.body.removeChild(script); - }, [src]); + }, [src, attrs, isAsync, crossOrigin]); - return loaded; + return [loaded, { error }]; }; export default useScript; From 28aa1d28050961e2e98468c30704a97ecb64f97c Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 25 Sep 2020 17:16:01 -0700 Subject: [PATCH 03/15] chore: add xstate libraries --- package-lock.json | 28 +++++++++++++++++++++++++--- package.json | 4 +++- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8ddbf6be3..28dffce18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6257,6 +6257,15 @@ "resolved": "https://registry.npmjs.org/@xobotyi/scrollbar-width/-/scrollbar-width-1.9.5.tgz", "integrity": "sha512-N8tkAACJx2ww8vFMneJmaAgmjAG1tnVBZJRLRcx061tmsLRZHSEZSLuGWnwPtunsSLvSqXQ2wfp7Mgqg1I+2dQ==" }, + "@xstate/react": { + "version": "1.0.0-rc.6", + "resolved": "https://registry.npmjs.org/@xstate/react/-/react-1.0.0-rc.6.tgz", + "integrity": "sha512-H4VMWaF60thHEZEMHBXWFUwOr0ppPFg65Q8effrG0EgBA+hIFDkJF6OzNVQReeD4HmYrGw7hRuuHTR8elanfnQ==", + "requires": { + "use-isomorphic-layout-effect": "^1.0.0", + "use-subscription": "^1.3.0" + } + }, "@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -31450,6 +31459,11 @@ "use-persisted-state": "^0.3.0" } }, + "use-isomorphic-layout-effect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.0.0.tgz", + "integrity": "sha512-JMwJ7Vd86NwAt1jH7q+OIozZSIxA4ND0fx6AsOe2q1H8ooBUp5aN6DvVCqZiIaYU6JaMRJGyR0FO7EBCIsb/Rg==" + }, "use-media": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/use-media/-/use-media-1.4.0.tgz", @@ -31463,6 +31477,14 @@ "@use-it/event-listener": "^0.1.2" } }, + "use-subscription": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/use-subscription/-/use-subscription-1.4.1.tgz", + "integrity": "sha512-7+IIwDG/4JICrWHL/Q/ZPK5yozEnvRm6vHImu0LKwQlmWGKeiF7mbAenLlK/cTNXrTtXHU/SFASQHzB6+oSJMQ==", + "requires": { + "object-assign": "^4.1.1" + } + }, "utfx": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utfx/-/utfx-1.0.1.tgz", @@ -32516,9 +32538,9 @@ } }, "xstate": { - "version": "4.11.0", - "resolved": "https://registry.npmjs.org/xstate/-/xstate-4.11.0.tgz", - "integrity": "sha512-v+S3jF2YrM2tFOit8o7+4N3FuFd9IIGcIKHyfHeeNjMlmNmwuiv/IbY9uw7ECifx7H/A9aGLcxPSr0jdjTGDww==" + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/xstate/-/xstate-4.13.0.tgz", + "integrity": "sha512-UnUJJzP2KTPqnmxIoD/ymXtpy/hehZnUlO6EXqWC/72XkPb15p9Oz/X4WhS3QE+by7NP+6b5bCi/GTGFzm5D+A==" }, "xtend": { "version": "4.0.2", diff --git a/package.json b/package.json index 20925fe52..061c482a6 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "@mdx-js/react": "^1.6.16", "@newrelic/gatsby-theme-newrelic": "^1.9.5", "@splitsoftware/splitio-react": "^1.2.0", + "@xstate/react": "^1.0.0-rc.6", "classnames": "^2.2.6", "date-fns": "^2.16.1", "eslint-plugin-react-hooks": "^4.1.0", @@ -50,7 +51,8 @@ "react-shadow": "^18.3.0", "react-simple-code-editor": "^0.11.0", "use-dark-mode": "^2.3.1", - "use-media": "^1.4.0" + "use-media": "^1.4.0", + "xstate": "^4.13.0" }, "devDependencies": { "@newrelic/eslint-plugin-newrelic": "^0.3.0", From 5be934ee58e0902816f2051a75ec96432b364127 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 25 Sep 2020 17:17:51 -0700 Subject: [PATCH 04/15] feat: add ability to define onLoad and onError handlers for useScript --- src/hooks/useScript.js | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/hooks/useScript.js b/src/hooks/useScript.js index b8de4b3b6..2aa11004c 100644 --- a/src/hooks/useScript.js +++ b/src/hooks/useScript.js @@ -1,11 +1,29 @@ -import { useEffect, useState } from 'react'; +import { useEffect, useState, useRef } from 'react'; import useShallowMemo from './useShallowMemo'; +const noop = () => {}; + const useScript = (src, options) => { - const { attributes = {}, async: isAsync = true, crossOrigin } = options || {}; + const { + attributes = {}, + async: isAsync = true, + crossOrigin, + onLoad = noop, + onError = noop, + } = options || {}; const [loaded, setLoaded] = useState(false); - const [error, setError] = useState(null); + const [error, setError] = useState(false); const attrs = useShallowMemo(() => attributes, [attributes]); + const onLoadHandler = useRef(); + const onErrorHandler = useRef(); + + useEffect(() => { + onLoadHandler.current = onLoad; + }, [onLoad]); + + useEffect(() => { + onErrorHandler.current = onError; + }, [onError]); useEffect(() => { const script = window.document.createElement('script'); @@ -14,8 +32,14 @@ const useScript = (src, options) => { script.crossOrigin = crossOrigin; script.onload = () => { setLoaded(true); + onLoadHandler.current(); + }; + + script.onerror = () => { + setError(true); + onErrorHandler.current(); }; - script.onerror = setError; + script.src = src; Object.entries(attrs).forEach(([attribute, value]) => From 578659d99d395887c99f8927b5c370a5ef5df4a9 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 25 Sep 2020 17:18:27 -0700 Subject: [PATCH 05/15] refactor: refactor useMarketoForm to use a state machine --- src/components/MarketoForm/MarketoForm.js | 7 +- src/hooks/useMarketoForm.js | 123 ++++++++++++++-------- 2 files changed, 81 insertions(+), 49 deletions(-) diff --git a/src/components/MarketoForm/MarketoForm.js b/src/components/MarketoForm/MarketoForm.js index a59f293c7..da90610f3 100644 --- a/src/components/MarketoForm/MarketoForm.js +++ b/src/components/MarketoForm/MarketoForm.js @@ -11,9 +11,9 @@ const MarketoForm = ({ publishableKey, redirectLink, }) => { - const loaded = useMarketoForm(munchkinId, id, publishableKey, redirectLink); + const [state] = useMarketoForm(munchkinId, id, publishableKey, redirectLink); - return loaded ? ( + return (

- ) : null; + ); }; MarketoForm.propTypes = { diff --git a/src/hooks/useMarketoForm.js b/src/hooks/useMarketoForm.js index b44cd0c19..ca6ec3f1c 100644 --- a/src/hooks/useMarketoForm.js +++ b/src/hooks/useMarketoForm.js @@ -1,57 +1,88 @@ -import { useEffect, useState } from 'react'; import { navigate } from 'gatsby'; +import { assign, Machine } from 'xstate'; +import { asEffect, useMachine } from '@xstate/react'; +import useScript from './useScript'; -const useMarketoForm = (munchkinId, id, publishableKey, redirectLink) => { - const [loaded, setLoaded] = useState(false); - - useEffect(() => { - if (!window.MktoForms2) { - return; - } - setLoaded(true); +const machine = Machine({ + id: 'marketo', + initial: 'loading', + context: { + form: null, + error: null, + }, + states: { + loading: { + on: { LOADED: 'scriptLoaded', LOAD_ERROR: 'error', BLOCKED: 'blocked' }, + }, + scriptLoaded: { + entry: ['loadForm'], + on: { + FORM_LOADED: { + target: 'formLoaded', + actions: assign({ form: (_context, event) => event.form }), + }, + BLOCKED: 'blocked', + }, + }, + formLoaded: { + type: 'final', + entry: ['defineFormActions'], + }, + blocked: { + type: 'final', + entry: assign({ + error: + 'Unable to load the script. Perhaps this was due to an ad blocker.', + }), + }, + error: { + type: 'final', + entry: assign({ error: 'Unable to load the script.' }), + }, + }, +}); - window.MktoForms2.loadForm( - '//app-abj.marketo.com', - munchkinId, - id, - (form) => { - // eslint-disable-next-line no-unused-vars - form.onSuccess(function (values, followUpUrl) { +const useMarketoForm = (munchkinId, id, publishableKey, redirectLink) => { + const [state, send] = useMachine(machine, { + actions: { + loadForm: asEffect(() => { + window.MktoForms2.loadForm( + '//app-abj.marketo.com', + munchkinId, + id, + (form) => send({ type: 'FORM_LOADED', form }) + ); + }), + defineFormActions: asEffect(({ form }) => { + form.onSuccess(() => { navigate(redirectLink); + + // prevent the default behavior of redirecting via marketo to another + // page. We want to control the navigation ourselves. + // https://developers.marketo.com/javascript-api/forms/api-reference/ + return false; }); - } - ); + }), + }, + }); - const pollForDefinition = (scope, varname, callback) => { - if (typeof scope[varname] !== 'undefined') { - return callback(); + useScript('https://marketo.clearbit.com/assets/v1/marketo/forms.js', { + attributes: { 'data-clearbit-publishable-key': publishableKey }, + onError: () => send('LOAD_ERROR'), + onLoad: () => { + if (window.MktoForms2) { + send('LOADED'); + } else { + // Some ad blockers block the marketo script from loading. In this case, + // we won't have the MktoForms2 variable available on window. We need + // to prevent the rest of the script from running to avoid triggering + // errors on the page that would cause the page to go blank. + send('BLOCKED'); } - const interval = setInterval(() => { - if (typeof scope[varname] !== 'undefined') { - clearInterval(interval); - callback(); - } - }, 250); - }; - const script = document.createElement('script'); - script.src = 'https://marketo.clearbit.com/assets/v1/marketo/forms.js'; - script.async = true; - script.setAttribute('data-clearbit-publishable-key', publishableKey); - script.onerror = () => { - // eslint-disable-next-line no-console - console.log('Clearbit Form JS unable to load'); - pollForDefinition(window, 'MktoForms2', () => { - window.MktoForms2.whenReady((form) => { - form.setValues({ - clearbitFormStatus: 'Clearbit Form JS unable to load', - }); - }); - }); - }; - document.body.append(script); - }, [munchkinId, id, publishableKey, redirectLink]); + }, + }); - return loaded; + return [state.value, state.context]; }; export default useMarketoForm; From e576ad111c1423259cdd1668af0e6c1630b66598 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 25 Sep 2020 17:36:04 -0700 Subject: [PATCH 06/15] feat: add a Spinner component --- src/components/Spinner.js | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/components/Spinner.js diff --git a/src/components/Spinner.js b/src/components/Spinner.js new file mode 100644 index 000000000..e778cff31 --- /dev/null +++ b/src/components/Spinner.js @@ -0,0 +1,49 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { css, keyframes } from '@emotion/core'; + +const spin = keyframes` + to { + transform: rotate(1turn); + } +`; + +const Spinner = ({ inline }) => ( +
+); + +Spinner.propTypes = { + inline: PropTypes.bool, +}; + +Spinner.defaultProps = { + inline: false, +}; + +export default Spinner; From 803c4f926774f912099e4d0fb2a73b3b76653e59 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 25 Sep 2020 17:37:34 -0700 Subject: [PATCH 07/15] chore: add a loading spinner when loading the marketo form --- src/components/MarketoForm/MarketoForm.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/MarketoForm/MarketoForm.js b/src/components/MarketoForm/MarketoForm.js index da90610f3..5256ea09c 100644 --- a/src/components/MarketoForm/MarketoForm.js +++ b/src/components/MarketoForm/MarketoForm.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import { css } from '@emotion/core'; import './marketo.scss'; import useMarketoForm from '../../hooks/useMarketoForm'; +import Spinner from '../Spinner'; const MarketoForm = ({ title, @@ -26,7 +27,6 @@ const MarketoForm = ({ border-radius: 5px; border: 1px solid var(--border-color); padding: 1.25rem; - display: ${state === 'formLoaded' ? 'block' : 'none'}; `} >

+ {(state === 'loading' || state === 'scriptLoaded') && }
); From 0e8685fb8dd5baa99e503918c63c8ff3d15f1868 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 25 Sep 2020 17:45:00 -0700 Subject: [PATCH 08/15] chore: rename state to ready and update the API slightly --- src/components/MarketoForm/MarketoForm.js | 7 ++++++- src/hooks/useMarketoForm.js | 13 ++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/components/MarketoForm/MarketoForm.js b/src/components/MarketoForm/MarketoForm.js index 5256ea09c..98f83da7b 100644 --- a/src/components/MarketoForm/MarketoForm.js +++ b/src/components/MarketoForm/MarketoForm.js @@ -12,7 +12,12 @@ const MarketoForm = ({ publishableKey, redirectLink, }) => { - const [state] = useMarketoForm(munchkinId, id, publishableKey, redirectLink); + const [, { state }] = useMarketoForm( + munchkinId, + id, + publishableKey, + redirectLink + ); return (
event.form }), }, BLOCKED: 'blocked', }, }, - formLoaded: { + ready: { type: 'final', entry: ['defineFormActions'], }, @@ -50,7 +50,7 @@ const useMarketoForm = (munchkinId, id, publishableKey, redirectLink) => { '//app-abj.marketo.com', munchkinId, id, - (form) => send({ type: 'FORM_LOADED', form }) + (form) => send({ type: 'READY', form }) ); }), defineFormActions: asEffect(({ form }) => { @@ -82,7 +82,10 @@ const useMarketoForm = (munchkinId, id, publishableKey, redirectLink) => { }, }); - return [state.value, state.context]; + return [ + state.context.form, + { state: state.value, error: state.context.error }, + ]; }; export default useMarketoForm; From 71467ed91715cde5531779be834368caba7c6e69 Mon Sep 17 00:00:00 2001 From: nr-opensource-bot Date: Sat, 26 Sep 2020 00:56:54 +0000 Subject: [PATCH 09/15] chore(related-content): updated related content data --- src/data/related-pages.json | 7270 ++++++++++++++++++----------------- 1 file changed, 3638 insertions(+), 3632 deletions(-) diff --git a/src/data/related-pages.json b/src/data/related-pages.json index c658236a1..c68fede15 100644 --- a/src/data/related-pages.json +++ b/src/data/related-pages.json @@ -1,5 +1,5 @@ { - "/build-apps/add-query-mutate-data-nerdstorage": [ + "/build-apps/publish-deploy": [ { "image": "", "url": "https://developer.newrelic.com/build-apps/", @@ -13,235 +13,463 @@ "Add the NerdGraphQuery component to an application", "Add a time picker to your app", "Add a table to your app", - "Publish and deploy apps", - "Create a custom map view" + "Create a custom map view", + "Publish and deploy apps" ], - "published_at": "2020-09-24T02:30:06Z", + "published_at": "2020-09-25T01:49:59Z", "title": "Build apps", - "updated_at": "2020-09-24T01:55:00Z", + "updated_at": "2020-09-25T01:49:59Z", "type": "developer", "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", "document_type": "page", "popularity": 1, - "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   Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 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 Publish and deploy apps Start sharing the apps you build 30 min Create a custom map view Build an app to show page view data on a map", + "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   Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 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 30 min Publish and deploy apps Start sharing the apps you build", "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 429.20538, + "_score": 174.43723, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Add, query, and mutate data using NerdStorage", - "body": "   Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One" + "title": "Build apps", + "sections": "Publish and deploy apps", + "body": " 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 30 min Publish and deploy apps Start sharing the apps you build" }, "id": "5efa999d64441fc0f75f7e21" }, { "sections": [ - "Intro to NerdStorage", - "Use NerdStorage in your apps", - "Data model", - "Limits", - "Data access", - "Permissions for working with NerdStorage" + "Permissions for managing applications", + "New Relic One pricing plan", + "Original product-based pricing" ], - "title": "Intro to NerdStorage", + "title": "Permissions for managing applications", "type": "developer", "tags": [ - "nerdstorage", - "nerdstorage components", - "new relic one apps", - "data access" + "nerdpack manager", + "permissions", + "managing apps" ], - "external_id": "709e06c25376d98b2191ca369b4d139e5084bd62", + "external_id": "c7f4c7fbd9d093d303c7f8268f8560ff9f435230", "image": "", - "url": "https://developer.newrelic.com/explore-docs/nerdstorage/", - "published_at": "2020-09-24T02:28:37Z", - "updated_at": "2020-09-08T01:50:19Z", + "url": "https://developer.newrelic.com/build-apps/permission-manage-apps/", + "published_at": "2020-09-25T01:57:48Z", + "updated_at": "2020-09-02T02:04:41Z", "document_type": "page", "popularity": 1, - "info": "Intro to NerdStorage on New Relic One", - "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,500 documents, plus storage type. Each document can have a maximum length of 1024 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.", + "info": "Learn about permissions for subscribing to apps", + "body": "Permissions for managing applications When you create an app, you'll likely want to share it. From New Relic One's Apps page, you can subscribe to apps you create, publish, and deploy, and to other publicly available apps. You must have the Nerdpack manager role to subcribe accounts to apps. Read on to learn about permissions and versions. Permissions for managing applications The Nerdpack manager role is a New Relic add-on role. When you create a Nerdpack, you have the Nerdpack manager role for handling that Nerdpack. New Relic account administrators have the Nerdpack manager role automatically, and can subscribe their accounts to available Nerdpacks. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 142.13641, + "_score": 66.9317, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Intro to NerdStorage", - "sections": "Intro to NerdStorage", - "info": "Intro to NerdStorage on New Relic One", - "tags": "nerdstorage", - "body": " document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing" + "title": "Permissions for managing applications", + "sections": "Permissions for managing applications", + "info": "Learn about permissions for subscribing to apps", + "tags": "managing apps", + "body": "Permissions for managing applications When you create an app, you'll likely want to share it. From New Relic One's Apps page, you can subscribe to apps you create, publish, and deploy, and to other publicly available apps. You must have the Nerdpack manager role to subcribe accounts to apps. Read" }, - "id": "5efa989ee7b9d2048e7bab92" + "id": "5f45bf2864441ffb4dfdcdbb" }, { + "category_2": "Hosting services", + "nodeid": 13151, "sections": [ - "New Relic CLI Reference", - "New Relic CLI commands", - "Options", - "Commands" + "Node.js agent", + "Getting started", + "Installation and configuration", + "Supported features", + "Attributes", + "API guides", + "Hosting services", + "Troubleshooting", + "Install New Relic Node.js agent in GAE flexible environment", + "Use native deploy", + "Build a custom runtime", + "Optional: Disable health checks", + "Get New Relic agent troubleshooting logs from GAE", + "For more help" ], - "title": "New Relic CLI Reference", - "type": "developer", - "tags": "new relic cli", - "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", + "title": "Install New Relic Node.js agent in GAE flexible environment", + "category_0": "APM agents", + "type": "docs", + "category_1": "Node.js agent", + "external_id": "92a838b215a23bd47fcc8b45abdf347c56f720db", "image": "", - "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-09-24T02:31:14Z", - "updated_at": "2020-08-14T01:47:12Z", + "url": "https://docs.newrelic.com/docs/agents/nodejs-agent/hosting-services/install-new-relic-nodejs-agent-gae-flexible-environment", + "published_at": "2020-09-24T06:38:34Z", + "updated_at": "2020-08-18T06:29:37Z", + "breadcrumb": "Contents / APM agents / Node.js agent / Hosting services", "document_type": "page", "popularity": 1, - "info": "The command line tools for performing tasks against New Relic APIs", - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", + "info": "How to install your APM's Node.js app in the Google App Engine (GAE) flexible environment. ", + "body": "With New Relic's Node.js agent, you can monitor applications that reside in the Google App Engine (GAE) flexible environment. Adding New Relic to your GAE flex app gives you insight into the health and performance of your app and extends GAE with metrics you can view in APM and browser monitoring. This document explains how to add New Relic to your GAE flex app using either of these methods: Google App Engine's \"native mode\" installation with a standard GAE runtime Docker installation using a custom runtime Use native deploy To use Google App Engine's \"native mode\" installation with your Node.js app: Follow standard procedures to install New Relic's Node.js agent, including your license key. Be sure to save the newrelic module to the package.json file. Follow Google App Engine procedures for Node.js to create a new Cloud Platform project, create an App Engine application, and complete other prerequisites for the Google Cloud SDK. Optional: Set environment variables to configure the Node.js agent's GAE app.yaml file. Use the Google Cloud SDK's gcloud command line tool to deploy GAE apps. To deploy your Node.js app to your initialized GAE flexible environment, run the following command: gcloud --project new-relic-apm-nodejs app deploy Google App Engine automatically includes your Node.js app's newrelic.js configuration file in the deployed package. Wait until the deployment completes, then view your GAE flex app data in the APM Summary page. Build a custom runtime See Google's documentation for building custom runtimes. This example describes how to add New Relic to your GAE flex app by building a custom runtime for Docker. You can deploy the app without any special configuration. For more information about deploying and configuring your Node.js app in the GAE flexible environment, see: Google App Engine's documentation for Node.js Google App Engine's tutorial to deploy a Node.js app 1. Set up the GAE project and install dependencies Follow standard procedures to install New Relic's Node.js agent, including your license key. Be sure to save the newrelic module to the package.json file. Follow Google App Engine procedures for Node.js to create a new Cloud Platform project, create an App Engine application, and complete other prerequisites for the Google Cloud SDK. The Google Cloud SDK provides the gcloud command line tool to manage and deploy GAE apps. 2. Configure your app.yaml The app.yaml configuration file is required for a GAE flexible environment app with a custom runtime. At a minimum, make sure it contains: runtime: custom env: flex Optional: Set environment variables. 3. Configure and deploy The Dockerfile defines the Docker image to be built and is required for a GAE flexible environment app. To create the Dockerfile, build the container, and deploy your app, follow the GAE procedures for Node.js. Wait until the deployment completes. To view your GAE flex app data in New Relic, go to the APM Summary page. Optional: Disable health checks Google App Engine sends periodic health check requests to confirm that an instance has been successfully deployed, and to check that a running instance maintains a healthy status. A health check is an HTTP request to the URL /_ah/health. If you create a custom runtime, your app must be able to handle a large number of health check requests. Otherwise, your app data may not display correctly in New Relic APM. If you notice performance issues, disable GAE health checks. In your app.yaml, add: health_check: enable_health_check: False Get New Relic agent troubleshooting logs from GAE Use these resources to troubleshoot your GAE flex environment app: To connect to the GAE instance and start a shell in the Docker container running your code, see Debugging an instance. To redirect New Relic Node.js agent logs to Stackdriver in the Cloud Platform Console, change the newrelic.js configuration file to: log_file_name: STDOUT To view the logs, use the Cloud Platform Console's Log Viewer. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 99.04372, + "_score": 34.271152, "_version": null, "_explanation": null, "sort": null, "highlight": { - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" + "sections": "Use native deploy", + "info": "How to install your APM's Node.js app in the Google App Engine (GAE) flexible environment. ", + "body": ". This document explains how to add New Relic to your GAE flex app using either of these methods: Google App Engine's "native mode" installation with a standard GAE runtime Docker installation using a custom runtime Use native deploy To use Google App Engine's "native mode" installation with your" }, - "id": "5efa989ee7b9d2024b7bab97" + "id": "5972fea707552313d3f9ba8d" }, { + "category_2": "Hosting services", + "nodeid": 13866, "sections": [ - "Query and store data", - "Components overview", - "Query components", - "Mutation components", - "Static methods", - "NrqlQuery" - ], - "title": "Query and store data", - "type": "developer", - "tags": [ - "nerdgraph query components", - "mutation components", - "static methods" + "Python agent", + "Getting started", + "Installation", + "Configuration", + "Supported features", + "Back-end services", + "Custom instrumentation", + "API guides", + "Python agent API", + "Web frameworks and servers", + "Hosting services", + "Attributes", + "Troubleshooting", + "Install the Python agent in GAE flexible environment", + "Deploy using GAE's native support", + "Build a custom runtime using Docker", + "Recommendation: Disable health checks", + "Get agent troubleshooting logs from GAE", + "For more help" ], - "external_id": "cbbf363393edeefbc4c08f9754b43d38fd911026", + "title": "Install the Python agent in GAE flexible environment", + "category_0": "APM agents", + "type": "docs", + "category_1": "Python agent", + "external_id": "c1ce9a74f2eccba9cf0cd509a6f15f2d02fabb16", "image": "", - "url": "https://developer.newrelic.com/explore-docs/query-and-store-data/", - "published_at": "2020-09-24T02:26:06Z", - "updated_at": "2020-08-01T01:42:02Z", + "url": "https://docs.newrelic.com/docs/agents/python-agent/hosting-services/install-python-agent-gae-flexible-environment", + "published_at": "2020-09-24T08:57:17Z", + "updated_at": "2020-08-30T17:24:26Z", + "breadcrumb": "Contents / APM agents / Python agent / Hosting services", "document_type": "page", "popularity": 1, - "info": "Reference guide for SDK query components using NerdGraph", - "body": "Query and store data 10 min To help you build a New Relic One application, we provide you with the New Relic One SDK. Here you can learn how to use the SDK query components, which allow you to make queries and mutations via NerdGraph, our GraphQL endpoint. Query-related React components can be identified by the Query suffix. Mutation-related components can be identified by the Mutation prefix. Components overview Our data components are based on React Apollo. The most basic component is NerdGraphQuery, which accepts any GraphQL (or GraphQL AST generated by the graphql-tag library as the query parameter, and a set of query variables passed as variables. Over this query, we have created an additional set of queries, which can be divided into four groups: User queries: These allow you to query the current user and its associated accounts. Components in this category: UserStorageQuery and AccountsQuery. Entities queries: Because New Relic One is entity-centric, we use queries to make access to your entities easier. You can count, search, list, query, and favorite them. Components in this category: EntityCountQuery, EntitySearchQuery, EntitiesByDomainTypeQuery, EntitiesByGuidsQuery, EntityByGuidQuery, EntityByNameQuery. Storage queries: New Relic One provides a simple storage mechanism that we call NerdStorage. This can be used by Nerdpack creators to store application configuration setting data, user-specific data, and other small pieces of data. Components in this category: UserStorageQuery, AccountStorageQuery, EntityStorageQuery, UserStorageMutation, AccountStorageMutation, and EntityStorageMutation. For details, see NerdStorage. NRQL queries: To be able to query your New Relic data via NRQL (New Relic Query Language), we provide a NrqlQuery component. This component can return data in different formats, so that you can use it for charting and not only for querying. Query components All query components accept a function as a children prop where the different statuses can be passed. This callback receives an object with the following properties: loading: Boolean that is set to true when data fetching is happening. Our components use the cache-and-network strategy, meaning that after the data has loaded, subsequent data reloads might be triggered first with stale data, then refreshed when the most recent data has arrived. data: Root property where the data requested is retrieved. The structure matches a root structure based on the NerdGraph schema. This is true even for highly nested data structures, which means you’ll have to traverse down to find the desired data. error: Contains an Error instance when the query fails. Set to undefined when data is loading or the fetch was successful. fetchMore: Callback function that can be called when the query is being loaded in chunks. The function will only be present when it’s feasible to do so, more data is available, and no fetchMore has already been triggered. Data is loaded in batches of 200 by default. Other components provided by the platform (like the Dropdown or the List) are capable of accepting fetchMore, meaning you can combine them easily. Mutation components Mutation components also accept a children as a function, like the query ones. The mutation can be preconfigured at the component level, and a function is passed back that you can use in your component. This is the standard React Apollo approach for performing mutations, but you might find it easier to use our static mutation method added to the component. More on this topic below. Static methods All of the described components also expose a static method so that they can be used imperatively rather than declaratively. All Query components have a static Query method, and all Mutation components have a mutation method. These static methods accept the same props as their query component, but passed as an object. For example: // Declarative way (using components). function renderAccountList() { return (
    ({data, error}) => { if (error) { return
  • Failed to retrieve list: {error.message}
  • ; } return data.map((account) => {
  • {account.name}
  • }); }}
); } // Imperative way (using promises). async function getAccountList() { let data = {}; try { data = await AccountsQuery.query(); } catch (error) { console.log('Failed to retrieve list: ' + error.message); return; } return data.actor.accounts.map((account) => { return account.name; }); } Copy Similarly, a mutation can happen either way; either declaratively or imperatively. NrqlQuery NrqlQuery deserves additional explanation, because there are multiple formats in which you can return data from it. To provide maximum functionality, all three are exposed through a formatType property. You can find its different values under NrqlQuery.formatType: NERD_GRAPH: Returns the format in which it arrives from NerdGraph. RAW: The format exposed by default in Insights and dashboards when being plotted as JSON. This format is useful if you have a pre-existing script in this format that you're willing to migrate to or incorporate with. CHART: The format used by the charting engine that we also expose. You can find a more detailed explanation of how to manipulate this format in the guide to chart components, and some examples. If you are willing to push data, we currently do not expose NrqlMutation. To do that, see the Event API for how to add custom events.", + "info": "How to install your Python app in the Google App Engine (GAE) flexible environment. ", + "body": "With the Python agent, you can monitor applications that reside in the Google App Engine (GAE) flexible environment. Adding agent data to your GAE flex app gives you insight into the health and performance of your app and extends GAE with metrics you can view in New Relic One. This document explains how to add agent data to your GAE flex app using either of these methods: Google App Engine's \"native mode\" installation with a standard GAE runtime Docker installation using a custom runtime Deploy using GAE's native support When using Google App Engine \"native mode\" installation, you provide your app code and an app.yaml file. Google App Engine then deploys to a standard prebuilt Docker image. For example, to deploy with native support for a Flask/Django app: Follow standard procedures to install the Python agent, including your license key. Set the NEW_RELIC_CONFIG_FILE as an environment variable pointing to newrelic.ini. Once the agent and configuration file have been installed, the Python agent can automatically monitor applications that reside in the GAE flexible environment. Wait until the deployment completes, then view your GAE flex app data in the APM Summary page. Build a custom runtime using Docker See Google's documentation for building custom runtimes. This example describes how to add agent data to your GAE flex app by building a custom runtime for Docker. For more information about deploying and configuring your Node.js app in the GAE flexible environment, see: Our GAE flex examples on Github for Python Google App Engine's documentation for Python Google App Engine's tutorials to deploy a Python app 1. Set up the GAE project and install dependencies When building a custom runtime using Docker, set the NEW_RELIC_CONFIG_FILE as an environment variable pointing to the Dockerfile instead of to your Python app's newrelic.ini. Follow standard procedures to install the Python agent, including your license key. Follow Google App Engine procedures Python to create a Google Cloud Platform project, create an App Engine application, and complete other prerequisites for the Google Cloud SDK. The Google Cloud SDK also provides the gcloud command line tool to manage and deploy GAE apps. 2. Configure your app.yaml The app.yaml configuration file is required for a GAE flexible environment app with a custom runtime. At a minimum, make sure it contains: env: flex runtime: custom 3. Configure a Dockerfile The Dockerfile defines the Docker image to be built and is required for a GAE flexible environment app. The following Dockerfile example shows the Python agent installed for an application served with gunicorn. These procedures are similar to the Python quick start guide. The Dockerfile will contain customer-specific code, including Python version, installation requirements, etc). # [START dockerfile] FROM gcr.io/google_appengine/python # Install the fortunes binary from the debian repositories. RUN apt-get update && apt-get install -y fortunes # Optional: Change the -p argument to use Python 2.7. RUN virtualenv /env -p python3.5 # Set virtualenv environment variables. This is equivalent to running # source /env/bin/activate. ENV VIRTUAL_ENV /env ENV PATH /env/bin:$PATH ADD requirements.txt /app/ RUN pip install -r requirements.txt ADD . /app/ CMD NEW_RELIC_CONFIG_FILE=newrelic.ini newrelic-admin run-program gunicorn -b :$PORT main:app # [END dockerfile] 4. Deploy Docker image to initialized GAE flexible environment To deploy your Docker image to your initialized GAE flexible environment, run the following command: gcloud app deploy Wait until the deployment completes. To open the app in the browser, run the following command: gcloud app browse To view your GAE flex app data, go to the APM Summary page. Recommendation: Disable health checks Google App Engine sends periodic health check requests to confirm that an instance has been successfully deployed, and to check that a running instance maintains a healthy status. A health check is an HTTP request to the URL /_ah/health. If you create a custom runtime, your app must be able to handle a large number of health check requests. Otherwise, your app data may not display correctly in APM. Recommendation: Configure your app.yaml to disable health checks by adding: health_check: enable_health_check: False Get agent troubleshooting logs from GAE Use these resources to troubleshoot your GAE flex environment app: To connect to the GAE instance and start a shell in the Docker container running your code, see Debugging an instance. To redirect Python agent logs to Stackdriver in the Cloud Platform Console, add the following statement to the newrelic.ini configuration: log_file = stderr To view the logs, use the Cloud Platform Console's Log Viewer. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 86.47445, + "_score": 23.775755, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Query and store data", - "sections": "Query and store data", - "info": "Reference guide for SDK query components using NerdGraph", - "tags": "nerdgraph query components", - "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" + "sections": "Deploy using GAE's native support", + "info": "How to install your Python app in the Google App Engine (GAE) flexible environment. ", + "body": " explains how to add agent data to your GAE flex app using either of these methods: Google App Engine's "native mode" installation with a standard GAE runtime Docker installation using a custom runtime Deploy using GAE's native support When using Google App Engine "native mode" installation, you provide" }, - "id": "5efa989e28ccbc2f15307deb" + "id": "5f3fb624196a672fda1cd4a3" }, { - "image": "https://opensource.newrelic.com/static/New_Relic_One_Catalog_Project-044e387f68b03896ff65f46edcffb1f3.png", - "url": "https://opensource.newrelic.com/oss-category/", + "category_2": "Installation", + "nodeid": 13121, "sections": [ - "Categories", - "Community Project", - "Requirements", - "Community Plus", - "New Relic One Catalog", - "Example Code", - "New Relic Experimental", - "Archived" - ], - "published_at": "2020-09-24T02:47:49Z", - "title": "New Relic Open Source Categories", - "updated_at": "2020-09-02T02:08:45Z", - "type": "opensource", - "external_id": "87c1876d27bdde7fb6636382fb5e659ae47c496a", + "Go agent", + "Get started", + "Installation", + "Configuration", + "Instrumentation", + "API guides", + "Features", + "Troubleshooting", + "Install the Go agent in GAE flexible environment", + "Build a custom runtime using Docker", + "Recommendation: Disable health checks", + "Get agent troubleshooting logs from GAE", + "For more help" + ], + "title": "Install the Go agent in GAE flexible environment", + "category_0": "APM agents", + "type": "docs", + "category_1": "Go agent", + "external_id": "d6409627d1a1d951d544a84613ad1709456f4560", + "image": "", + "url": "https://docs.newrelic.com/docs/agents/go-agent/installation/install-go-agent-gae-flexible-environment", + "published_at": "2020-09-24T06:37:14Z", + "updated_at": "2020-08-15T09:48:00Z", + "breadcrumb": "Contents / APM agents / Go agent / Installation", "document_type": "page", "popularity": 1, - "info": "", - "body": "New Relic Open Source External Projects Highlighted Projects New Relic Projects Menu External Projects Highlighted Projects New Relic Projects Categories Community Project Community Plus New Relic One Catalog Example Code New Relic Experimental Archived For the code snippets that appear in the project's README file, see this documentation. Community Project This code is developed in the open with input from the community through issues and PRs. There is an active maintainer team within New Relic, troubleshooting support in the New Relic Explorers Hub, and the documentation is available in the project repository. Requirements Complies with New Relic's legal and security requirements for open source software Contains the appropriate New Relic open source category header in the repository's README file Has active maintainer / maintainers, including at least one Relic Troubleshooting support via the New Relic Explorers Hub Issues and PR’s managed in GitHub Documentation reviewed by the New Relic documentation team Linted code An automated release pipeline Community Plus This code is developed in the open with input from the community through issues and PRs. A New Relic engineering team serves as the maintainer. Troubleshooting support is available in the New Relic Explorers Hub, and documentation is available in the project repository and docs.newrelic.com. Requirements Complies with New Relic's legal and security requirements for open source software Contains the appropriate New Relic open source category header in the repository's README file Is maintained by a New Relic engineering team Troubleshooting support via the New Relic Explorers Hub Issues and PR’s managed in GitHub For additional details on support options, see the Open Source Support Policy Documentation reviewed by the New Relic documentation team Linted code An automated release pipeline New Relic One Catalog This code is a part of the New Relic One Catalog. It meets the criteria for a Community Project; but it also contains UI workflows for configuration. Most Catalog projects seek to maintain a public roadmap, often expressed in a GitHub Project board and Issues within the repository. Requirements All the requirements of a Community Project An empty state application workflow that guides users through the setup of configuration data that is stored in NerdStorage Architectural review (including UX) by New Relic (Optional) maintains a public roadmap (recommended via a GitHub project in the repo) Example Code This code demonstrates an aspect of building on the New Relic One platform. Find the complete description of its usage and other relevant docs in the README. There is no long-term maintainer for this code nor is support provided, but the author(s) may address future updates / needs as platform features change. Requirements Complies with New Relic's legal and security requirements for open source software Contains the appropriate New Relic open source category header in the repository's README file (optional) Issues are available at the project author's discretion Documentation reviewed by the New Relic documentation team Linted code New Relic Experimental This code solves an interesting problem but does not yet have an active maintainer(s). The project is being developed in the open for the purpose of feedback on a new feature or function. Requirements Complies with New Relic's legal and security requirements for open source software Contains the appropriate New Relic open source category header in the repository's README file Typically hosted in the New Relic Experimental GitHub org (Optional) Issues at the project owner's discertion Archived This code is read-only. There is neither a maintainer team nor support. Requirements Complies with New Relic's legal requirements for open source software Contains the appropriate New Relic open source category header in the repository's README file Previous references to Support should be modified or removed from the README Project is read-only and available for cloning only New Relic Open Source Standards External Projects Highlighted Projects New Relic Projects Create an issue Copyright © 2020 New Relic Inc.Version 1.9.2", + "info": "How to install your New Relic's Go app in the Google App Engine (GAE) flexible environment. ", + "body": "With our Go agent, you can monitor applications that reside in the Google App Engine (GAE) flexible environment. Adding New Relic to your GAE flex app gives you insight into the health and performance of your app and extends GAE with metrics you can view in APM and browser monitoring. Here we explain how to add New Relic to your GAE flex app by configuring a custom runtime, and give an example of deploying a Go app with Docker. The Go agent can run in a GAE flexible environment using a custom runtime. Due to limitations of other environments, do not use the GAE standard environment or Google App Engine's \"native mode\" installation. Build a custom runtime using Docker See Google's documentation for building custom runtimes. This example describes how to add New Relic to your GAE flex app by installing the Go agent, building a custom Go runtime for Docker, and deploying a golang application. For more information about deploying and configuring your Go app in the GAE flexible environment, see: Google App Engine's documentation for Go Google App Engine's tutorials to deploy a Go app 1. Set up the GAE project and install dependencies Follow standard procedures to install the Go agent for your specific app server, including your license key. Follow Google App Engine procedures for Go to create a new Cloud Platform project, create an App Engine application, download and install git, and complete other prerequisites for the Google Cloud SDK. The Google Cloud SDK provides the gcloud command line tool to manage and deploy GAE apps. 2. Configure your app.yaml The app.yaml configuration file is required for a GAE flexible environment app with a custom runtime. At a minimum, make sure it contains: runtime: custom env: flex 3. Configure a Dockerfile The Dockerfile defines the Docker image to be built and is required for a GAE flexible environment app. The following Dockerfile example code defines the golang version used. FROM golang:1.8-onbuild CMD go run main.go 4. Build a Docker image To build the Docker image, run the following command. Be sure to include the period at the end of the code, to indicate the current directory contains the build files. docker build --rm -t Docker-image-name . 5. Deploy Docker image to initialized GAE flexible environment To deploy your Docker image to your initialized GAE flexible environment, run the following command: gcloud --project go-app-name app deploy Wait until the deployment completes. To view your GAE flex app data in New Relic, go to the APM Summary page. Recommendation: Disable health checks Google App Engine sends periodic health check requests to confirm that an instance has been successfully deployed, and to check that a running instance maintains a healthy status. A health check is an HTTP request to the URL /_ah/health. If you create a custom runtime, your app must be able to handle a large number of health check requests. Otherwise, your app data may not display correctly in APM. Recommendation: Configure your app.yaml to disable health checks by adding: health_check: enable_health_check: False Get agent troubleshooting logs from GAE Use these resources to troubleshoot your GAE flex environment app: To connect to the GAE instance and start a shell in the Docker container running your code, see GAE's documentation for debugging an instance. To redirect New Relic Go agent logs to Stackdriver in the Cloud Platform Console, change the newrelic.yml file to: log_file_name: STDOUT 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 80.46596, + "_score": 21.329435, "_version": null, "_explanation": null, "sort": null, "highlight": { - "body": " a public roadmap, often expressed in a GitHub Project board and Issues within the repository. Requirements All the requirements of a Community Project An empty state application workflow that guides users through the setup of configuration data that is stored in NerdStorage Architectural review (including" + "info": "How to install your New Relic's Go app in the Google App Engine (GAE) flexible environment. ", + "body": " command line tool to manage and deploy GAE apps. 2. Configure your app.yaml The app.yaml configuration file is required for a GAE flexible environment app with a custom runtime. At a minimum, make sure it contains: runtime: custom env: flex 3. Configure a Dockerfile The Dockerfile defines the Docker" }, - "id": "5f31822228ccbc916988dff8" + "id": "5f37af50196a67d8f955e63e" } ], - "/automate-workflows/automated-tagging": [ + "/build-apps/add-time-picker-guide": [ { "image": "", - "url": "https://developer.newrelic.com/automate-workflows/", + "url": "https://developer.newrelic.com/build-apps/", "sections": [ - "Automate workflows", - "Guides to automate workflows", - "Quickly tag resources", - "Set up New Relic using Helm charts", - "Set up New Relic using the Kubernetes operator", - "Automatically tag a simple \"Hello World\" Demo across the entire stack", - "Automate common tasks", - "Set up New Relic using Terraform" + "Build apps", + "Guides to build apps", + "Create a \"Hello, World!\" application", + "Permissions for managing applications", + "Set up your development environment", + "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", + "Publish and deploy apps" ], - "published_at": "2020-09-24T02:30:06Z", - "title": "Automate workflows", - "updated_at": "2020-09-24T01:55:00Z", + "published_at": "2020-09-25T01:49:59Z", + "title": "Build apps", + "updated_at": "2020-09-25T01:49:59Z", "type": "developer", - "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871", + "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", "document_type": "page", "popularity": 1, - "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 30 min Automatically tag a simple \"Hello World\" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform", + "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   Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 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 30 min Publish and deploy apps Start sharing the apps you build", "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 213.1271, + "_score": 157.51743, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Automate workflows", - "sections": "Automatically tag a simple "Hello World" Demo across the entire stack", - "body": " resources using the Kubernetes operator 30 min Automatically tag a simple "Hello World" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform" + "title": "Build apps", + "sections": "Add a time picker to your app", + "body": " 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 30 min Publish and deploy apps Start sharing the apps you build" }, - "id": "5efa999c196a67dfb4766445" + "id": "5efa999d64441fc0f75f7e21" }, { - "category_2": "Cloud adoption", - "nodeid": 16276, + "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png", + "url": "https://developer.newrelic.com/", "sections": [ - "New Relic solutions", - "Measure DevOps success", - "Cloud adoption", - "Optimize your cloud native environment", - "Modern and cloud services", - "1. Identify applications, cloud services, infrastructure, and technologies", - "2. Deploy Infrastructure", - "3. Configure cloud integrations", - "4. Track data on your dashboards", - "5. Add alerts for cloud-based metrics", - "6. Set up additional monitoring", - "7. CI/CD Pipeline integration", - "For more help" + "Mark your calendar for Nerd Days 1.0", + "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": "Modern and cloud services ", - "category_0": "New Relic solutions", - "type": "docs", - "category_1": "New Relic solutions", - "external_id": "b9d879c0bea5c876edd35f384cf569e41fddad2a", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/GCPComputeEngineDashboard.png", + "published_at": "2020-09-25T01:41:27Z", + "title": "New Relic Developers", + "updated_at": "2020-09-25T01:37:24Z", + "type": "developer", + "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab", + "document_type": "page", + "popularity": 1, + "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 18 Days : 14 Hours : 58 Minutes : 41 Seconds Register 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 20 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", + "info": "", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 157.40701, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "sections": "Add a time picker to your app", + "body": " 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" + }, + "id": "5d6fe49a64441f8d6100a50f" + }, + { + "sections": [ + "Add tables to your New Relic One application", + "Before you begin", + "Clone and set up the example application", + "Work with table components", + "Next steps" + ], + "title": "Add tables to your New Relic One application", + "type": "developer", + "tags": [ + "table in app", + "Table component", + "TableHeaderc omponent", + "TableHeaderCell component", + "TableRow component", + "TableRowCell component" + ], + "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-09-25T01:48:39Z", + "updated_at": "2020-09-17T01:48:42Z", + "document_type": "page", + "popularity": 1, + "info": "Add a table to your New Relic One app.", + "body": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application. In this guide, you are going to build a sample table using various New Relic One components. Before you begin If you haven't already installed the New Relic One CLI, step through the quick start in New Relic One. This process also gets you an API key. In addition, to complete the steps in this guide, you need a GitHub account and Node.js installed on your machine. See Setting up your development environment for more info. Clone and set up the example application Step 1 of 4 Clone the nr1-how-to example application from GitHub to your local machine. Then, navigate to the app directory. The example app lets you experiment with tables. git clone https://github.com/newrelic/nr1-how-to.git` cd nr1-how-to/create-a-table/nerdlets/create-a-table-nerdlet` Copy Step 2 of 4 Edit the index.json file and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install dependencies nr1 nerdpack:serve # Serve the demo app locally Copy Step 4 of 4 Open one.newrelic.com/?nerdpacks=local in your browser. Click Apps, and then in the Your apps section, you should see a Create a table launcher. That's the demo application you're going to work on. Go ahead and select it. Have a good look at the demo app. There's a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You'll use Table components to add a new table in the second row. Work with table components Step 1 of 10 Navigate to the nerdlets/create-a-table-nerdlet subdirectory and open the index.js file. Add the following components to the import statement at the top of the file so that it looks like the example: Table TableHeader TableHeaderCell TableRow TableRowCell import { Table, TableHeader, TableHeaderCell, TableRow, TableRowCell, PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart, } from 'nr1'; Copy Step 2 of 10 Add a basic Table component Locate the empty GridItem in index.js: This is where you start building the table. Add the initial component. The items property collects the data by calling _getItems(), which contains sample values.
; Copy Step 3 of 10 Add the header and rows As the Table component renders a fixed number of header cells and rows, your next step is adding header components, as well as a function that returns the required table rows. Inside of the Table component, add the TableHeader and then a TableHeaderCell child for each heading. Since you don't know how many rows you'll need, your best bet is to call a function to build as many TableRows as items returned by _getItems(). Application Size Company Team Commit ; { ({ item }) => ( {item.name} {item.value} {item.company} {item.team} {item.commit} ); } Copy Step 4 of 10 Take a look at the application running in New Relic One: you should see something similar to the screenshot below. Step 5 of 10 Replace standard table cells with smart cells The New Relic One library includes cell components that can automatically format certain data types, like users, metrics, and entity names. The table you've just created contains columns that can benefit from those components: Application (an entity name) and Size (a metric). Before you can use EntityTitleTableRowCell and MetricTableRowCell, you have to add them to the import statement first. import { EntityTitleTableRowCell, MetricTableRowCell, ... /* All previous components */ } from 'nr1'; Copy Step 6 of 10 Update your table rows by replacing the first and second TableRowCells with entity and metric cells. Notice that EntityTitleTableRowCell and MetricTableRowCell are self-closing tags. { ({ item }) => ( {item.company} {item.team} {item.commit} ); } Copy Step 7 of 10 Time to give your table a second look: The cell components you've added take care of properly formatting the data. Step 8 of 10 Add some action to your table! Tables are great, but interactive tables can be better: As a last update, you are going to allow users to act on each data row. Add the _getActions() method to your index.js file, right before _getItems(). As you may have guessed from the code, _getActions() spawns an alert box when you click Team or Commit cells. _getActions() { return [ { label: 'Alert Team', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__ALERT, onClick: (evt, { item, index }) => { alert(`Alert Team: ${item.team}`); }, }, { label: 'Rollback Version', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__UNDO, onClick: (evt, { item, index }) => { alert(`Rollback from: ${item.commit}`); }, }, ]; } Copy Step 9 of 10 Find the TableRow component in your return statement and point the actions property to _getActions(). The TableRow actions property defines a set of actions that appear when the user hovers over a table row. Actions have a mandatory text and an onClick callback, but can also display an icon or be disabled if needed. Copy Step 10 of 10 Go back to your application and try hovering over any of the rows: Notice how the two available actions appear. When you click them, a function triggers with the selected row data as an argument, and an alert displays in your browser. Next steps You've built a table into a New Relic One application, using components to format data automatically and provide contextual actions. Well done! Keep exploring the Table components, their properties, and how to use them, in our SDK documentation.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 145.49084, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "Add tables to your New Relic One application", + "sections": "Add tables to your New Relic One application", + "info": "Add a table to your New Relic One app.", + "tags": "table in app", + "body": " as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo" + }, + "id": "5efa989ee7b9d2ad567bab51" + }, + { + "sections": [ + "Intro to New Relic One API components", + "Components of the SDK", + "UI components", + "Chart components", + "Query and storage components", + "Platform APIs" + ], + "title": "Intro to New Relic One API components", + "type": "developer", + "tags": [ + "SDK components", + "New Relic One apps", + "UI components", + "chart components", + "query and storage components", + "Platform APIs" + ], + "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2", + "image": "", + "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/", + "published_at": "2020-09-25T01:48:39Z", + "updated_at": "2020-08-14T01:47:12Z", + "document_type": "page", + "popularity": 1, + "info": "Intro to New Relic One API components", + "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 127.53267, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "tags": "New Relic One apps", + "body": ". They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet" + }, + "id": "5efa989e28ccbc4071307de5" + }, + { + "image": "", + "url": "https://developer.newrelic.com/components/platform-state-context/", + "sections": [ + "PlatformStateContext", + "Usage", + "Props" + ], + "published_at": "2020-09-25T01:56:09Z", + "title": "PlatformStateContext", + "updated_at": "2020-08-01T01:47:08Z", + "type": "developer", + "external_id": "aa6b86b3dc0dcd7cd758b20655318b108875cce7", + "document_type": "page", + "popularity": 1, + "info": "A PlatformStateContext component!", + "body": "PlatformStateContext Usage Copy Props There are no props for this component.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 100.08603, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "PlatformStateContext", + "sections": "PlatformStateContext", + "info": "A PlatformStateContext component!", + "body": "PlatformStateContext Usage Copy Props There are no props for this component." + }, + "id": "5efa997128ccbccc6f307dc0" + } + ], + "/automate-workflows/automated-tagging": [ + { + "image": "", + "url": "https://developer.newrelic.com/automate-workflows/", + "sections": [ + "Automate workflows", + "Guides to automate workflows", + "Quickly tag resources", + "Set up New Relic using Helm charts", + "Automatically tag a simple \"Hello World\" Demo across the entire stack", + "Set up New Relic using the Kubernetes operator", + "Automate common tasks", + "Set up New Relic using Terraform" + ], + "published_at": "2020-09-25T01:49:59Z", + "title": "Automate workflows", + "updated_at": "2020-09-25T01:49:59Z", + "type": "developer", + "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871", + "document_type": "page", + "popularity": 1, + "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 30 min Automatically tag a simple \"Hello World\" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform", + "info": "", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 216.39626, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "Automate workflows", + "sections": "Automatically tag a simple "Hello World" Demo across the entire stack", + "body": " solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 30 min Automatically tag a simple "Hello World" Demo across the entire stack See how easy" + }, + "id": "5efa999c196a67dfb4766445" + }, + { + "category_2": "Cloud adoption", + "nodeid": 16276, + "sections": [ + "New Relic solutions", + "Measure DevOps success", + "Cloud adoption", + "Optimize your cloud native environment", + "Modern and cloud services", + "1. Identify applications, cloud services, infrastructure, and technologies", + "2. Deploy Infrastructure", + "3. Configure cloud integrations", + "4. Track data on your dashboards", + "5. Add alerts for cloud-based metrics", + "6. Set up additional monitoring", + "7. CI/CD Pipeline integration", + "For more help" + ], + "title": "Modern and cloud services ", + "category_0": "New Relic solutions", + "type": "docs", + "category_1": "New Relic solutions", + "external_id": "b9d879c0bea5c876edd35f384cf569e41fddad2a", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/GCPComputeEngineDashboard.png", "url": "https://docs.newrelic.com/docs/new-relic-solutions/new-relic-solutions/cloud-adoption/modern-cloud-services", "published_at": "2020-09-24T08:03:06Z", "updated_at": "2020-09-24T08:03:06Z", @@ -252,7 +480,7 @@ "body": "Whether you've just completed your cloud migration, have been using cloud based services for awhile, or have always been in the cloud, you may find yourself deploying or running technologies and services that are new and modern. These modern technologies could be container solutions such as Docker, Kubernetes, and Amazon AWS ECS or Fargate for example. Or they could be serverless services such as AWS Lambda, Microsoft Azure, or Google Cloud Platform Functions, cloud based databases, or any number of cloud services that abstract the service away from an operations-maintained infrastructure. In these situations you still want to monitor, query, and alert on the performance and usage metrics for both modern technologies and cloud-based services, allowing for faster deployments, the ability to adopt new services, better business decisions, and to expand horizons. This doc demonstrates how to use the New Relic Platform to monitor your modern technologies and cloud services. 1. Identify applications, cloud services, infrastructure, and technologies Determine the components you need to monitor by answering the following the questions: What cloud-based applications do I have? What are the underlying cloud-based services, technologies, and infrastructure supporting those applications? When you have a full understanding of your architecture, you reduce the possibility of missing dependencies during your migration. 2. Deploy Infrastructure After reviewing the requirements for New Relic Infrastructure, install the Infrastructure agent on the hosts you identified so you can start to monitor your cloud services. If you use Ansible, Chef, or Puppet for automation, you can use those tools to deploy Infrastructure agents to your hosts. 3. Configure cloud integrations Once your applications are migrated to the cloud and you start to integrate new cloud services, you can use New Relic to monitor and report data about your cloud services, offering you a comprehensive view of your entire architecture in one place. To get started configuring cloud service integrations, link your cloud service provider account with New Relic, depending on whether you use Amazon Web Services (AWS), Microsoft Azure, or Google Cloud Platform (GCP). 4. Track data on your dashboards New Relic Infrastructure integrations auto-populate dashboards with metrics from cloud providers like AWS, Azure, and GCP so you can track the data that is critical to your cloud adoption success. If you adopt a hybrid cloud of multiple cloud providers, New Relic can provide a holistic perspective that is agnostic to cloud providers. AWS EC2 monitoring integration dashboard In this default dashboard for the AWS EC2 monitoring integration, New Relic captures metrics for EC2 instances per region, instance state, and instance type. The dashboard also shows inventory for different software packages and configurations that are installed on those instances. infrastructure.newrelic.com > Integrations > Amazon Web Services: View AWS EC2 data on the default dashboard for the AWS EC2 monitoring integration. Azure VMs monitoring integration dashboard The default Azure virtual machine integration dashboard shows data for VM sizes, VMs per region, and VMs per resource group. infrastructure.newrelic.com > Integrations > Microsoft Azure: View Azure virtual machine data on the default dashboard for the Azure VMs monitoring integration. GCP Compute Engine monitoring integration dashboard In this default dashboard for the Google Cloud Platform, New Relic captures metrics for instances per zone, instance status, firewall dropped packets, reserved cores, and disk throttled operations. The dashboard also shows inventory for different software packages and configurations that are installed on those instances. infrastructure.newrelic.com > Integrations > Google Cloud Platform: View GCP Compute Engine data on the default dashboard for the GCP Compute Engine monitoring integration. Example modern and cloud services dashboard In this example dashboard, three different cloud vendors, modern technologies, cloud services, infrastructure instance locations, and DevOps widgets are combined for an overall view. one.newrelic.com > Dashboards: Here is an example of a dashboard with data about vendors, technologies, services, instances, and other important details. 5. Add alerts for cloud-based metrics When monitoring cloud-based services, it is essential to keep track of all the changes happening with the system by alerting on them. Integrations with New Relic Infrastructure allow you to create alerts on the metrics that are the most important to you. Here is an example of a baseline alert that will notify you based on the number of requests received on all ALB systems for the AWS Elastic Load Balancing (ALB) monitoring integration: alerts.newrelic.com > Alert policies > (selected policy) > Alert conditions: Create a NRQL baseline alert to monitor the number of requests received your ALB systems. 6. Set up additional monitoring In addition to monitoring cloud services, you can deploy New Relic APM, Browser, Mobile, and Synthetics to gain full-stack visibility into all of the components of your applications: Use New Relic APM to report application-tier performance metrics. Use New Relic Browser to report front-end web metrics. Use New Relic Mobile to report front-end mobile app metrics. Use New Relic Synthetics to monitor websites, critical business transactions, and API endpoints. 7. CI/CD Pipeline integration It's important to track deployments and how the impact of the code and infrastructure changes you make affect customer experience. New Relic APM's deployment markers feature allows you to record deployments for each application. A deployment marker is an event indicating that a deployment happened, and it's paired with metadata available from your SCM system (such metadata typically includes the user, revision, change log, etc.). APM displays a vertical line, or marker, on charts and graphs at the deployment event's timestamp. When you hover over the line, APM displays the associated metadata for that deployment. Tracking deployments is an invaluable way to determine the root cause of immediate, long-term, or gradual degradations in your application. Recommendation: Make POST requests to the New Relic REST API as the final step of a successful CI/CD deployment as described in the API documentation. The following tools have integrations or plugins available to help automate CI/CD deployments: Chef (see newrelic_deployment) Jenkins Ansible For more help", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 109.01318, + "_score": 103.28584, "_version": null, "_explanation": null, "sort": null, @@ -282,18 +510,18 @@ "New Relic developer champions", "New Relic Podcasts" ], - "published_at": "2020-09-24T02:24:45Z", + "published_at": "2020-09-25T01:41:27Z", "title": "New Relic Developers", - "updated_at": "2020-09-24T01:39:32Z", + "updated_at": "2020-09-25T01:37:24Z", "type": "developer", "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab", "document_type": "page", "popularity": 1, - "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 19 Days : 14 Hours : 58 Minutes : 8 Seconds Register 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 20 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", + "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 18 Days : 14 Hours : 58 Minutes : 41 Seconds Register 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 20 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", "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 99.97926, + "_score": 101.773346, "_version": null, "_explanation": null, "sort": null, @@ -334,7 +562,7 @@ "body": "New Relic One provides unified access to all the entities you monitor with New Relic. Tags are used to organize and group all your entities in a way that's useful for troubleshooting and understanding your environment. To add, delete, or modify your tags, use the NerdGraph GraphiQL explorer. NerdGraph allows you to tag your entities with a key and an associated list of values. You can also use NerdGraph to query entities. Read tags for an entity To construct these queries and see responses: Go to the NerdGraph GraphiQL explorer at https://api.newrelic.com/graphiql. Use entitySearch() to find the entity and then fetch its tags. Use NerdGraph's tag API to read the existing tags and their values. In this example, our entity is a browser app called Cookie Checkout: { actor { entitySearch (query: \"name like 'Cookie Checkout'\") { results { entities { tags { key values } } } } } } The actual values vary depending on your data. Use the New Relic GraphiQL explorer to experiment with queries. Add tags for an entity To add new tags for an entity: Go to the NerdGraph GraphiQL explorer at https://api.newrelic.com/graphiql. Use entitySearch() to locate the GUID for the entity you want to tag. Use the taggingAddTagsToEntity mutation to add a tag with a value to the entity. In this example, we have a browser application called Cookie Checkout owned by a UI team. We want to add a team tag with a ui value to this instance. Once the tag is added, we can filter by the tag team:ui and find the Cookie Checkout app in the New Relic One UI. mutation { taggingAddTagsToEntity ( guid: \"ENTITY_GUID\", tags: { key: \"team\", values: [\"ui\"]}) { errors { message } } } Remove a tag from an entity To delete a tag and all of its associated values from an entity: Go to the NerdGraph GraphiQL explorer at https://api.newrelic.com/graphiql. Use entitySearch() to locate the GUID for the entity with the tag you want to remove. Use the taggingDeleteTagFromEntity mutation. The following example mutation removes the team tag from an entity: mutation { taggingDeleteTagFromEntity ( guid: \"ENTITY_GUID\", tagKeys: [\"team\"]) { errors { message } } } Delete specific tag values for an entity Instead of deleting an entire tag and all of its values, you can delete a single tag value. Go to the NerdGraph GraphiQL explorer at https://api.newrelic.com/graphiql. Use entitySearch() to locate the GUID for the entity with the tag you want to remove. Use the taggingDeleteTagValuesFromEntity mutation. The following example mutation deletes the ui value from the tag key: mutation { taggingDeleteTagValuesFromEntity ( guid: \"ENTITY_GUID\", tagValues : [{key: \"team\" value: \"ui\"}]) { errors { message } } } Because tagValues is an array, you can delete multiple specific values from a single entity in one mutation. Replace all tag values for an entity To replace all the existing values for a tag with new ones: Go to the NerdGraph GraphiQL explorer at https://api.newrelic.com/graphiql. Use entitySearch() to locate the GUID for the entity with the tag you want to remove. Use the taggingReplaceTagsOnEntity mutation. In this example, the Cookie Checkout browser application was transferred from the ui team to the cookie-dev team. You can replace the tag values for team with the following mutation: mutation { taggingReplaceTagsOnEntity ( guid: \"ENTITY_GUID\", tags: {key: \"team\" values: [\"cookie-dev\"]}) { errors { message } } } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 90.87871, + "_score": 90.093636, "_version": null, "_explanation": null, "sort": null, @@ -372,7 +600,7 @@ "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 88.60191, + "_score": 89.28978, "_version": null, "_explanation": null, "sort": null, @@ -403,18 +631,18 @@ "New Relic developer champions", "New Relic Podcasts" ], - "published_at": "2020-09-24T02:24:45Z", + "published_at": "2020-09-25T01:41:27Z", "title": "New Relic Developers", - "updated_at": "2020-09-24T01:39:32Z", + "updated_at": "2020-09-25T01:37:24Z", "type": "developer", "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab", "document_type": "page", "popularity": 1, - "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 19 Days : 14 Hours : 58 Minutes : 8 Seconds Register 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 20 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", + "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 18 Days : 14 Hours : 58 Minutes : 41 Seconds Register 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 20 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", "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 185.26157, + "_score": 180.95192, "_version": null, "_explanation": null, "sort": null, @@ -433,29 +661,29 @@ "Guides to automate workflows", "Quickly tag resources", "Set up New Relic using Helm charts", - "Set up New Relic using the Kubernetes operator", "Automatically tag a simple \"Hello World\" Demo across the entire stack", + "Set up New Relic using the Kubernetes operator", "Automate common tasks", "Set up New Relic using Terraform" ], - "published_at": "2020-09-24T02:30:06Z", + "published_at": "2020-09-25T01:49:59Z", "title": "Automate workflows", - "updated_at": "2020-09-24T01:55:00Z", + "updated_at": "2020-09-25T01:49:59Z", "type": "developer", "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871", "document_type": "page", "popularity": 1, - "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 30 min Automatically tag a simple \"Hello World\" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform", + "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 30 min Automatically tag a simple \"Hello World\" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform", "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 164.19998, + "_score": 160.2992, "_version": null, "_explanation": null, "sort": null, "highlight": { "sections": "Set up New Relic using Helm charts", - "body": " solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic" + "body": " solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 30 min Automatically tag a simple "Hello World" Demo across the entire stack See how easy" }, "id": "5efa999c196a67dfb4766445" }, @@ -485,7 +713,7 @@ "external_id": "531f2f3985bf64bb0dc92a642445887095048882", "image": "", "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/", - "published_at": "2020-09-24T02:28:37Z", + "published_at": "2020-09-25T01:49:59Z", "updated_at": "2020-08-08T01:41:47Z", "document_type": "page", "popularity": 1, @@ -493,7 +721,7 @@ "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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 107.23486, + "_score": 104.296036, "_version": null, "_explanation": null, "sort": null, @@ -525,7 +753,7 @@ "Tear down your resources", "Next steps" ], - "published_at": "2020-09-24T02:32:50Z", + "published_at": "2020-09-25T01:48:40Z", "title": "Automate tagging of your entire stack", "updated_at": "2020-09-19T01:54:15Z", "type": "developer", @@ -536,7 +764,7 @@ "body": "Automate tagging of your entire stack 30 min Organizing your services, hosts, and applications in New Relic can be challenging, especially as resources come and go. One strategy to overcome this challenge is to apply tags, consistently, across your stack. In this guide, you: Provision a host on AWS Deploy a small Node.js app on that host Instrument the host and the application with New Relic agents Apply consistent tags across all your entities Tear down everything you make when you're done The next section introduces you to tools for performing tasks in this guide. Before you begin Throughout this guide, you use three open source projects to automatically set up, instrument, and tear down your infrastructure: Demo Deployer: The engine that drives the automation Demo Nodetron: A Node.js app that you run on your host. It presents a web page and an API, which you use to generate traffic. Demo New Relic Instrumentation: A project that instruments your host and application Each project is distinct, and encapsulates its own behavior. This maintains a separation of concerns and allows you to compose complex scenarios using a modular approach. Collaborate with us The Demo Deployer is currently in development. Because of our commitment to open source, we are working in the open early in the process and invite you to collaborate with us. Drop any thoughts and comments in the Build on New Relic support thread, and let us know what you think! The last thing you need before you get started is to install Docker if you don't have it already. Now that you have a high-level understanding of the tools you'll use, you can begin by building the Demo Deployer! Step 1 of 6 Build the deployer To use the deployer, first clone its repository from GitHub. Then, build a Docker image using the local copy of the code. First, clone the repository from GitHub: git clone https://github.com/newrelic/demo-deployer.git Copy Second, build the deployer Docker image: docker build -t deployer demo-deployer Copy Now, you have a Docker image, named deployer, which you use throughout the rest of this guide. Step 2 of 6 Configure your credentials In this guide, you provision a host on AWS. The deployer uses a configuration file that contains your credentials for each service it communicates with so that it can invoke the necessary APIs. You can follow the User Config documentation in the deployer repository to set up each account and create your configuration file. In the end, you'll have a JSON file that contains credentials for AWS, New Relic, and GitHub: { \"credentials\": { \"aws\": { \"apiKey\": \"my_aws_api_key\", \"secretKey\": \"my_aws_secret_key\", \"secretKeyPath\": \"/path/to/my/secretkey.pem\", \"region\": \"my_aws_region\" }, \"newrelic\": { \"licenseKey\": \"my_new_relic_license_key\", \"accountId\": \"my_new_relic_account_id\" }, \"git\": { \"username\": \"my_git_access_token\" } } } Copy Name the credentials file creds.json, and store it—along with your [keypair filename].pem file—in a directory called $HOME/configs. Step 3 of 6 Run the application Now that everything is set up, you can run the deployer application in a Docker container: docker run -it\\ -v $HOME/configs/:/mnt/deployer/configs/\\ --entrypoint ruby deployer main.rb -c configs/creds.json -d documentation/tutorial/user_stories/Hello/hello.json Copy With this command, you're running the deployer Docker container with the following options: -v mounts the $HOME/configs volume (where you stored your configuration files) at /mnt/deployer/configs/ in the container --entrypoint sets the default command for Docker to ruby Finally, you pass a list of arguments to the entrypoint, including: -c configs/creds.json: The user credentials configuration file -d documentation/tutorial/user_stories/Hello/hello.json: The deployment configuration file Tip You can specify the log level for the deployer using -l. info is the default, but you can also use debug or error. This is a helpful option to use when something goes wrong. Once you run this command, the deployer will create and instrument some specific resources. This may take a few minutes. In the meantime, read on to learn more about what is actually happening during this process. Locating the user configuration files Notice, in the Docker command, that -c takes configs/creds.json. Also, you referenced your .pem file from configs/, as well. This is because you mounted $HOME/configs to /mnt/deployer/configs/ and /mnt/deployer/ is the working directory, according to the deployer's Dockerfile. So, you can access your user configuration files at configs/, which is a relative path from your working directory. Understanding the deployment configuration file The deployment configuration file, hello.json, which drives the deployer, contains four sections: services global_tags resources instrumentations These sections describe the actions the deployer executes. The first section is services: { \"services\": [ { \"id\": \"app1\", \"display_name\": \"Hello-App1\", \"source_repository\": \"-b main https://github.com/newrelic/demo-nodetron.git\", \"deploy_script_path\": \"deploy/linux/roles\", \"port\": 5001, \"destinations\": [\"host1\"], \"files\": [ { \"destination_filepath\": \"engine/data/index.json\", \"content\": } ] } ] } Copy services defines one service, app1, which lives on host1 at port 5001. It uses the Demo Nodetron you learned about earlier in this guide as its source. Note In this example, some HTML has been removed for clarity. To run the deployer, you need to use the real content in hello.json. The second section is global_tags: { \"global_tags\": { \"dxOwningTeam\": \"DemoX\", \"dxEnvironment\": \"development\", \"dxDepartment\": \"Area51\", \"dxProduct\": \"Hello\" } } Copy global_tags defines tags for the deployer to apply to all the resources in your stack. These tags are an important part of organizing your New Relic entities. The third section is resources: { \"resources\": [ { \"id\": \"host1\", \"display_name\": \"Hello-Host1\", \"provider\": \"aws\", \"type\": \"ec2\", \"size\": \"t3.micro\" } ], } Copy resources defines one host, host1, which is a small EC2 instance on AWS. This host is referred to in the services section. The fourth, and final, section is instrumentations: { \"instrumentations\": { \"resources\": [ { \"id\": \"nr_infra\", \"resource_ids\": [\"host1\"], \"provider\": \"newrelic\", \"source_repository\": \"-b main https://github.com/newrelic/demo-newrelic-instrumentation.git\", \"deploy_script_path\": \"deploy/linux/roles\", \"version\": \"1.12.1\" } ], \"services\": [ { \"id\": \"nr_node_agent\", \"service_ids\": [\"app1\"], \"provider\": \"newrelic\", \"source_repository\": \"-b main https://github.com/newrelic/demo-newrelic-instrumentation.git\", \"deploy_script_path\": \"deploy/node/linux/roles\", \"version\": \"6.11.0\" } ] } } Copy instrumentations configures, as the name implies, New Relic instrumentations for the host1 infrastructure and the app1 Node.js application. These definitions use the Demo New Relic Instrumentation project you learned about earlier. Step 4 of 6 Generate some traffic When deployer has run successfully, you will see a message that describes the resources deployed and services installed during the process: [INFO] Executing Deployment [✔] Parsing and validating Deployment configuration success [✔] Provisioner success [✔] Installing On-Host instrumentation success [✔] Installing Services and instrumentations success [INFO] Deployment successful! Deployed Resources: host1 (aws/ec2): ip: 52.90.86.109 services: [\"app1\"] instrumentation: nr_infra: newrelic v1.12.1 Installed Services: app1: url: http://52.90.86.109:5001 instrumentation: nr_node_agent: newrelic v6.11.0 Completed at 2020-08-20 15:11:14 +0000 Copy Visit your application by navigating to the app1 url in your browser: From there, you can follow the instructions to send traffic to New Relic. Note Your app1 url will be different than the url shown in this guide. Step 5 of 6 Check your tags After you've generated some traffic to your Node.js application, use the New Relic search redirect to find the resources you deployed: Once you have found your resources, select the service you deployed, Hello-App1. Then, click on the 'i' icon next to the name, which opens the metadata and tags modal: Notice that all the tags in the global_tags section of the deployment configuration show up under Tags: If you open the metadata modal for the host, you'll also see the global_tags. Step 6 of 6 Tear down your resources Because you've provisioned resources in your cloud account, you need to decommission them. You can do this with the deployer. Add the teardown flag, -t, to the end of your command: docker run -it\\ -v $HOME/configs/:/mnt/deployer/configs/\\ --entrypoint ruby deployer main.rb -c configs/creds.json -d documentation/tutorial/user_stories/Hello/hello.json -t Copy When the deployer has finished successfully, you'll see output that is similar to what you saw during deployment: [INFO] Executing Teardown [✔] Parsing and validating Teardown configuration success [✔] Provisioner success [✔] Uninstalling On-Host instrumentation success [✔] Uninstalling Services and instrumentations success [✔] Terminating infrastructure success [INFO] Teardown successful! Copy Next steps Congratulations! Throughout this guide, you used the Demo Deployer to provision and instrument a host and application in AWS and automatically configured those entities with a list of tags. Next, try creating your own deployment configuration and change the global tags! One cool thing you can do is pass in a configuration file URL to the deployer. Here's one that uses a gist on GitHub: docker run -it\\ -v $HOME/configs/:/mnt/deployer/configs/\\ --entrypoint ruby deployer main.rb -c configs/creds.json -d https://gist.githubusercontent.com/markweitzel/d281fde8ca572ced6346dc25470790a5/raw/373166eb50929a0dd23ba5136abf2fa5caf3d369/MarksHelloDemoConfig.json Copy", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 89.11037, + "_score": 83.90514, "_version": null, "_explanation": null, "sort": null, @@ -549,732 +777,909 @@ "id": "5f40792e196a6757721cd49c" }, { - "category_2": "Logs in context for Ruby", - "nodeid": 35726, "sections": [ - "Enable log management", - "New Relic Logs", - "Enable log monitoring", - "Configure logs in context", - "Logs in context for Go", - "Logs in context for Java", - "Logs in context for .NET", - "Logs in context for Node.js", - "Logs in context for PHP", - "Logs in context for Python", - "Logs in context for Ruby", - "Logs in context with agent APIs", - "Configure logs in context for Ruby", - "Compatibility and requirements", - "Configure logs in context with log management", - "Install or update the Ruby agent", - "Configure for Rails", - "Rails advanced configuration", - "Configure for Ruby without Rails", - "Advanced configuration", - "Custom logger configuration", - "Lograge configuration", - "Check for logging data", - "Troubleshooting", - "Incompatible gems", - "What's next?", - "For more help" - ], - "title": "Configure logs in context for Ruby", - "category_0": "Log management", + "New Relic Platform release notes", + "Alerts release notes", + "APM release notes", + "Cloud Integrations release notes", + "Diagnostics release notes", + "Mobile release notes", + "Kubernetes integration release notes", + "APM agent release notes", + "Go agent release notes", + "Java agent release notes", + ".NET agent release notes", + "Node.js agent release notes", + "PHP agent release notes", + "Python agent release notes", + "Ruby agent release notes", + "C SDK release notes", + "Infrastructure agent release notes", + "Browser agent release notes", + "Synthetics private minion release notes", + "Containerized private minions release notes", + "Mobile agent release notes", + "iOS release notes", + "XCFramework release notes", + "Android release notes", + "tvOS release notes", + "Mobile apps release notes", + "New Relic for Android release notes", + "Insights for tvOS release notes", + "New Relic for iOS release notes", + "Insights for Android release notes", + "Insights for iOS release notes", + "Pages" + ], + "title": "New Relic Platform release notes", "type": "docs", - "category_1": "Enable log management", - "external_id": "39429728c3bc0c83479db2ebe30dee4a31efd2b3", + "external_id": "417582d1ccf7ed32d7bf3d5059920da59a8254cd", "image": "", - "url": "https://docs.newrelic.com/docs/logs/enable-log-management-new-relic/logs-context-ruby/configure-logs-context-ruby", - "published_at": "2020-09-24T11:09:47Z", - "updated_at": "2020-09-24T11:09:47Z", - "breadcrumb": "Contents / Log management / Enable log management / Logs in context for Ruby", - "document_type": "page", + "url": "https://docs.newrelic.com/docs/release-notes/platform-release-notes", + "published_at": "2020-09-25T10:05:26Z", + "updated_at": "2020-09-25T10:05:25Z", + "breadcrumb": "Contents", + "document_type": "views_page_content", "popularity": 1, - "info": "A description of the logs in context configuration process for the Ruby agent.", - "body": "Logs in context for the Ruby agent connects your logs and APM data in New Relic, giving full context to high-level events and providing high value data to specific log lines. Read on to learn how to configure logs in context and enrich your log data. Compatibility and requirements To use log management with the Ruby agent, ensure your configuration meets the following requirements: Ruby agent 6.7.0 or higher: Install or update Supported Rails version (for Rails applications) Configure logs in context with log management To configure logs in context with Ruby: Enable log management with a compatible log forwarding plugin. Install or update the Ruby agent. Configure logs in context for Ruby. Optional: Advanced configuration. Check for logging data. Enable log management Confirm that you have log management enabled, with a compatible log forwarding plugin installed to send your application logs to New Relic. Install or update the Ruby agent Install or update to the most recent Ruby agent version, and enable distributed tracing. Configure logs in context for Ruby Configure for Rails Rails logging is controlled by two components: a logger (customizable by setting config.logger) and a log formatter (customizable by setting config.log_formatter). In most cases, logs in context should be configured by setting config.log_formatter to the DecoratingFormatter in your Rails application. For more guidance regarding Rails configuration, see Configuring Rails Applications. In your application's config, require 'newrelic_rpm', then add the following line: module ________ class Application < Rails::Application ... config.log_formatter = ::NewRelic::Agent::Logging::DecoratingFormatter.new end end This will use the New Relic formatter to format log messages, but the rest of the logging configuration will be provided by the other Rails config settings. Please note that Logs in Context for Ruby does not currently support tagged logging; if you are initializing your logger with a log_tags argument, your custom tags may not appear on the final version of your logs. Rails advanced configuration If setting the log_formatter option doesn't meet your needs, replace the entire Rails logger with an instance of the New Relic logger. Provide the parameters to the logger's constructor, like this: module ________ class Application < Rails::Application ... config.logger = ::NewRelic::Agent::Logging::DecoratingLogger.new( \"log/application.log\", #etc... ) end end Configure for Ruby without Rails For non-Rails applications, use the DecoratingLogger in place of the Ruby standard ::Logger, like this: logger = ::NewRelic::Agent::Logging::DecoratingLogger.new( 'log/application.log', #etc... ) ... logger.info(...) The DecoratingLogger is a drop-in replacement for the Ruby standard ::Logger. Their constructors accept the same parameters. Advanced configuration Custom logger configuration To use our logging extension with a different logging implementation, or your own custom logger, use the DecoratingFormatter. Example: module ________ class Application < Rails::Application ... config.logger = ::YourCustomLoggerImplementation.new( $stdout, formatter: ::NewRelic::Agent::Logging::DecoratingFormatter.new ) end end Lograge configuration To configure this extension with the lograge gem, there is no additional configuration required. Check for logging data If you have configured your logging in /config/application.rb, or in /config/environments/development.rb, run your application locally and check its logging output. You should see some output like this: {\"entity.name\":\"your_app_name\",\"entity.type\":\"SERVICE\",\"hostname\":\"79bcbf8d\",\"trace.id\":\"79bcbf8d\",\"span.id\":\"00fc7d46\",\"timestamp\":1567701375543,\"message\":\"example log message one\",\"log.level\":\"DEBUG\"} {\"entity.name\":\"your_app_name\",\"entity.type\":\"SERVICE\",\"hostname\":\"79bcbf8d\",\"trace.id\":\"79bcbf8d\",\"span.id\":\"6754870b\",\"timestamp\":1567702843604,\"message\":\"example log message two\",\"log.level\":\"DEBUG\"} If you have deployed this application to an environment with a log forwarder, your application's logs will appear in the New Relic Logs UI with metadata linking them to a trace and a span. You can find them using a query like this: entity.name:\"your_app_name\" has:trace.id If you see JSON logs in your application's output, but no logs returned by a query like the above, check your log forwarder. Troubleshooting If the logs from your application are not formatted in JSON with fields like trace.id and span.id, there may be a problem with the configuration of the New Relic Logging Extension. Check that: the application is using a supported logging framework. the configuration has been applied to all the environments where you would like to use the New Relic Logging Extension. there is not another logger configured later in the configuration of the application. Incompatible gems The New Relic decorating logger is known to be incompatible with the following gems: logging semantic logger rails_stdout_logger rails_12factor What's next? Now that you've set up APM logs in context, here are some potential next steps: Explore your data using the Logs UI. Troubleshoot errors with distributed tracing, stack traces, application logs, and more. Query your data and create custom dashboards or alerts. For more help", + "body": "New Relic platform release notes include information on new or updated features or functionality to New Relic products (for example: user interface changes, a new REST API call, changes to how data is reported to a given product, etc). Releases are categorized by the type of impact they have on end-users: Bug fixes: For minor non-breaking fixes to features or functionality. Changes: For significant changes to features or functionality that could break a user’s experience, tooling, processes, etc. New: For new features or functionality. For release information on downloadable/versioned New Relic software (such as APM agents, the Browser agent, Synthetics minions, etc.), see Release notes. Release Impact Bug Fixes Changes New Products Alerts APM Browser Cloud Integrations Infrastructure Insights Mobile New Relic Diagnostics On-Host Integrations Synthetics Date Release Name Products Release Impact September 23, 2020 New Relic integration for Kubernetes 1.26.4 Infrastructure Bug Fixes September 9, 2020 3 new integrations available for Azure and AWS Cloud Integrations New September 7, 2020 New Relic integration for Kubernetes 1.26.2 Infrastructure, On-Host Integrations Changes August 26, 2020 New Relic integration for Kubernetes 1.26.1 Infrastructure, On-Host Integrations Changes August 20, 2020 1 new integrations available for AWS and new statistics Cloud Integrations New August 18, 2020 08-18-2020 : Fixed : Missing Synthetics Labels / Tags on Synthetics Violations Alerts Bug Fixes August 13, 2020 New Relic integration for Kubernetes 1.26.0 Infrastructure, On-Host Integrations Changes, New August 13, 2020 5 new integrations available for Azure and AWS Cloud Integrations New July 30, 2020 07-30-2020 : Muting Rules : Single Occurrence Scheduling Alerts New July 30, 2020 New Relic integration for Kubernetes 1.25.0 Infrastructure, On-Host Integrations Changes, New Pages 1 2 3 4 5 6 7 8 9 … next › last »", + "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 83.894165, + "_score": 80.39563, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "New Relic Logs", - "body": "Logs in context for the Ruby agent connects your logs and APM data in New Relic, giving full context to high-level events and providing high value data to specific log lines. Read on to learn how to configure logs in context and enrich your log data. Compatibility and requirements To use log" + "title": "New Relic Platform release notes", + "sections": "New Relic Platform release notes", + "body": " 26, 2020 New Relic integration for Kubernetes 1.26.1 Infrastructure, On-Host Integrations Changes August 20, 2020 1 new integrations available for AWS and new statistics Cloud Integrations New August 18, 2020 08-18-2020 : Fixed : Missing Synthetics Labels / Tags on Synthetics Violations Alerts Bug" }, - "id": "5f37c37164441ffb9aa0a5f1" + "id": "5ae1a73a0cc37f6c7bbedee4" } ], - "/collect-data/custom-events": [ + "/terms": [ { - "category_2": "Custom events", - "nodeid": 6256, + "category_2": "Data privacy", + "nodeid": 1591, "sections": [ - "Event data sources", - "Default events", - "Custom events", - "APM: Report custom events", - "Data considerations", - "Record a custom event", - "Timestamps", - "Limits and restricted characters", - "Reserved words", - "For more help" - ], - "title": "APM: Report custom events", - "category_0": "Insights", + "Security and Privacy", + "Data privacy", + "Compliance", + "Information security", + "Security bulletins", + "Security controls for privacy", + "Secured content", + "Analytics", + "Data transmission and firewalls", + "Hosting and data storage", + "Data access", + "HTTP parameters disabled by default", + "For more help" + ], + "title": "Security controls for privacy", + "category_0": "New Relic Security and Privacy", "type": "docs", - "category_1": "Event data sources", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/event-data-sources/custom-events/apm-report-custom-events", - "external_id": "0c3f09d0d0e04ad50bedcdf7088eed7c171001d8", + "category_1": "Security and Privacy", + "external_id": "bc8220cf6b971d3e72dbcd38b006d799a1041cd3", "image": "", - "url": "https://docs.newrelic.com/docs/insights/event-data-sources/custom-events/apm-report-custom-events", - "published_at": "2020-09-24T07:10:11Z", - "updated_at": "2020-09-24T07:10:11Z", - "breadcrumb": "Contents / Insights / Event data sources / Custom events", + "url": "https://docs.newrelic.com/docs/security/security-privacy/data-privacy/security-controls-privacy", + "published_at": "2020-09-24T19:01:05Z", + "updated_at": "2020-09-24T07:44:02Z", + "breadcrumb": "Contents / New Relic Security and Privacy / Security and Privacy / Data privacy", "document_type": "page", "popularity": 1, - "info": "New Relic APM: how to report custom events and attributes.", - "body": "If you have 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 833 custom events every 5 seconds. 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.", + "info": "New Relic data security: content, analytics, transmission, hosting and storage, data access, etc. For complete details, see https://newrelic.com/security", + "body": "This document describes how New Relic protects the security of your data. For more information about our security measures, see our data privacy documentation and the New Relic Security website. Secured content Data for New Relic accounts are isolated so that users can only see the data for accounts they own (or have been given permission to see). New Relic also has certain rights regarding customers' data, described in the Terms and Conditions page on the New Relic website. Analytics In order to help us improve our product and user experience, New Relic uses third-party analytics services to better understand the behavior of users on our site. The user data that New Relic collects is used solely by New Relic and is not shared, sold, or rented to any third parties for their own use. For more information, see our Services data privacy notice. Data transmission and firewalls The New Relic agent communicates with two hosts: collector.newrelic.com collector-nnn.newrelic.com, where nnn is a numerical value Typically the numbered host is fixed for your account, and it appears in log/newrelic.agent.log. For required changes when you want to create firewall rules to allow the agent to communicate, see Networks. For more information about security measures for your data in transit to New Relic or at rest in our storage, see Data encryption. Hosting and data storage New Relic is self-hosted with co-location services called Server Central in a Tier 3 data center in Chicago, Illinois and an IBM-hosted data center near Frankfurt, Germany, as well as cloud storage through Amazon AWS. We use standard best practices to maintain a firewall for our servers and to protect our servers from unauthorized login. All data is stored in a cluster of MySQL databases. New Relic data is backed up nightly, and an archive is stored at a secondary data center. Data access Access to account data by New Relic employees is limited to a necessary set of users consistent with their assigned New Relic responsibilities. Except to the extent necessary to provide subscribed services and as documented in our Services data privacy notice, customer account data is not shared with any third parties. All customer account data access is logged and regularly audited. HTTP parameters disabled by default By default, New Relic agents disable collection of HTTP request parameters, such as the query string of a URL. This is an automatic safeguard to protect potentially sensitive data. New Relic collects and displays HTTP parameters only when you explicitly enable them in your agent configuration file. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 116.54771, + "_score": 482.73764, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "APM: Report custom events", - "sections": "Custom events", - "info": "New Relic APM: how to report custom events and attributes.", - "category_1": "Event data sources", - "category_2": "Custom events", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/event-data-sources/custom-events/apm-report-custom-events", - "body": "If you have 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", - "breadcrumb": "Contents / Insights / Event data sources / Custom events" + "sections": "Security and Privacy", + "info": "New Relic data security: content, analytics, transmission, hosting and storage, data access, etc. For complete details, see https://newrelic.com/security", + "category_0": "New Relic Security and Privacy", + "category_1": "Security and Privacy", + "body": " for accounts they own (or have been given permission to see). New Relic also has certain rights regarding customers' data, described in the Terms and Conditions page on the New Relic website. Analytics In order to help us improve our product and user experience, New Relic uses third-party analytics services" }, - "id": "5f480a5a64441f578bfdcdb1" + "id": "5e30b8a864441f47ebd05cb0" }, { - "category_2": "Custom events", - "nodeid": 13661, + "category_2": "Product definitions", + "nodeid": 39646, "sections": [ - "Event data sources", - "Default events", - "Custom events", - "Data requirements and limits for custom event data", - "General requirements", - "Reserved words", - "Additional Browser PageAction requirements", - "Additional Event API requirements", - "Event type limits", + "License information", + "General usage licenses", + "Special services licenses", + "Distributed licenses", + "Referenced policies", + "Product definitions", + "Usage plans", + "FAQ", + "New Relic One pricing: Definitions", "For more help" ], - "title": "Data requirements and limits for custom event data", - "category_0": "Insights", + "title": "New Relic One pricing: Definitions", + "category_0": "Licenses", "type": "docs", - "category_1": "Event data sources", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", - "external_id": "f5beef0d09bb5918be3f8a1a3ece98c09947cd1e", + "category_1": "License information", + "external_id": "097fc095ef18942f3af1845237742340e36416b8", "image": "", - "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", - "published_at": "2020-09-24T07:25:32Z", - "updated_at": "2020-09-20T19:39:10Z", - "breadcrumb": "Contents / Insights / Event data sources / Custom events", + "url": "https://docs.newrelic.com/docs/licenses/license-information/product-definitions/new-relic-one-pricing-definitions", + "published_at": "2020-09-24T19:28:53Z", + "updated_at": "2020-09-10T14:58:10Z", + "breadcrumb": "Contents / Licenses / License information / Product definitions", "document_type": "page", "popularity": 1, - "info": "For New Relic, general limits and requirements for reporting custom events and attributes. ", - "body": "You can report custom events to New Relic in several ways, including the New Relic Event API, APM agent APIs, Browser agent APIs, and the Mobile SDK. This document contains general requirements and rules for inserting and using custom events and their associated attributes. Additional requirements may apply based on the method you use. General requirements How long custom data is retained depends on your Insights subscription and its associated data retention. When reporting custom events and attributes, follow these general requirements for supported data types, naming syntax, and size: Requirement Description Payload Total maximum size or length: 1 MB maximum per POST. We highly recommend using compression. The Event API has additional HTTP rate limits. Attribute data types Attribute values can be either a string or a numeric integer or float. If your attribute values contain date information, define it as an unformatted Unix timestamp (in seconds or milliseconds) by using the Insights data formatter. Attribute size Maximum name size: 255 bytes. Maximum attribute value size: Custom attributes sent by the agent: 255 bytes Attributes attached to custom events sent using the Event API: 4096 characters Charts may only display the first 255 characters of attribute values. For complete attribute values, use the JSON chart type or Query API. Maximum total attributes per event: 254. Exception: If you use an APM agent API, the max is 64. Maximum total attributes per event type: 48,000. Naming syntax Attribute names can be a combination of alphanumeric characters, colons (:), periods (.), and underscores (_). Event types (using the eventType attribute) can be a combination of alphanumeric characters, colons (:), and underscores (_). Do not use words reserved for use by NRQL. Null values The database does not store any data with a null value. Reserved words Avoid using the following reserved words as names for events and attributes. Otherwise, unexpected results may occur. This is not a complete list. In general, it's a good practice to avoid using MySQL-reserved words to avoid collision with future New Relic functionality. Keyword Description accountId This is a reserved attribute name. If it's included, it will be dropped during ingest. appId Value must be an integer. If it is not an integer, the attribute name and value will be dropped during ingest. eventType The event type as stored in New Relic. New Relic agents and scripts normally report this as eventType. Can be a combination of alphanumeric characters, colons (:), and underscores (_). Be sure to review the prohibited eventType values and eventType limits. Prohibited eventType values For your eventType value, avoid using: Metric, MetricRaw, and strings prefixed with Metric[0-9] (such as Metric2 or Metric1Minute). Public_ and strings prefixed with Public_. These event types are reserved for use by New Relic. Events passed in with these eventType values will be dropped. timestamp Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds. It must be +/-1 day (24 hours) of the current time on the server. Log forwarding terms The following keys are reserved by the Infrastructure agent's log forwarding feature: entity.guid, log, hostname, plugin.type, fb.input. If used, they are dropped during ingest and a warning is added to the logs. NRQL syntax terms If you need to use NRQL syntax terms as attribute names, including dotted attributes, they must be enclosed in backticks; for example, `LIMIT` or `consumer.offset`. Otherwise, avoid using these reserved words: ago, and, as, auto, begin, begintime, compare, day, days, end, endtime, explain, facet, from, hour, hours, in, is, like, limit, minute, minutes, month, months, not, null, offset, or, raw, second, seconds, select, since, timeseries, until, week, weeks, where, with Additional Browser PageAction requirements For additional requirements for using New Relic Browser's custom PageAction event, see Insert custom data via New Relic Browser agent. Additional Event API requirements For more requirements and details for the Event API, see Event API. Event type limits The current limit for total number of eventType values is 250 per sub-account in a given 24-hour time period. If a user exceeds this limit, New Relic may filter or drop data. Event types include: Default events from New Relic agents Custom events from New Relic agents Custom events from Insights custom event inserter 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.", + "info": "This document provides definitions of terminology you may see in New Relic contracts.", + "body": "This document provides definitions of terminology you may see in the Terms or this site for New Relic One pricing and billing: Account Account refers to the online account or subaccounts that New Relic provides for customers to manage their use of the Products. Commitment Term Commitment Term means the non-cancelable, committed Subscription Term for the Products. Customer Data Customer Data means the data, information, or content that Customer and its users send to an Account from the Software, the Customer Properties, or Third-Party Services. Customer Properties Customer Properties means Customer’s websites, infrastructure, networks, mobile applications, or other systems, as well as Customer accounts on Third-Party Services. Documentation Documentation means the New Relic technical guides and documentation made available from the dedicated ‘Documentation’ page of the New Relic website. GB Ingested A GB Ingested is a measurement of the volume of metrics, events, logs, traces, or other telemetry data sent to or generated by the Products for the benefit of the Customer, including from the Software, the Customer Properties, or Third-Party Services. In this context, a GB is defined as 1 billion bytes. Login Credentials Login Credentials means the username, email address, password, or other personal information that is provided by a Customer user in order to manage an Account. Monthly Provisioned User A Monthly Provisioned User is any user who can log into Customer’s Account(s) and access the New Relic One Product functionality as specified in an Order and the Documentation. Order Order means the purchasing order for access to the Service or related services that: (1) is either executed by the Parties or entered into by you via self-service, and references this Agreement, or (2) is entered into by you and a Channel Partner. Paid Terms of Service Paid Terms of Service means the legal terms and conditions located at: https://newrelic.com/termsandconditions/paid. Product(s) Product(s) mean the purchase of the New Relic subscription products described in the applicable Order and any updates, corrections, bug fixes, modifications, improvements, related services, new features, and functionality (made generally available to New Relic’s customer base) thereto. Software Software means the distributed software, APIs, scripts, or other code proprietary to New Relic provided with the Products. Terms Terms means the underlying Customer-New Relic agreement and the Order. Third-Party Services Third-Party Services means any third party platform, add-on, service, or product not provided by New Relic and that a user integrates or enables for use with the Products, including third-party applications and plug-ins. Unpaid Terms of Service Unpaid Terms of Service means the legal terms and conditions located at: https://newrelic.com/termsandconditions/unpaid. Usage Plan Usage Plan refers to the Service or Product pricing, invoicing related information, and product-specific terms (e.g. concurrent user account sessions) contained within the Documentation. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 113.30803, + "_score": 397.50897, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Data requirements and limits for custom event data", - "sections": "Custom events", - "info": "For New Relic, general limits and requirements for reporting custom events and attributes. ", - "category_1": "Event data sources", - "category_2": "Custom events", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", - "body": "You can report custom events to New Relic in several ways, including the New Relic Event API, APM agent APIs, Browser agent APIs, and the Mobile SDK. This document contains general requirements and rules for inserting and using custom events and their associated attributes. Additional requirements", - "breadcrumb": "Contents / Insights / Event data sources / Custom events" + "info": "This document provides definitions of terminology you may see in New Relic contracts.", + "body": "This document provides definitions of terminology you may see in the Terms or this site for New Relic One pricing and billing: Account Account refers to the online account or subaccounts that New Relic provides for customers to manage their use of the Products. Commitment Term Commitment Term means" }, - "id": "59f4354f4bb81c2ea8b80d0a" + "id": "5f23b039196a67030b94f5c4" }, { - "category_2": "Custom events", - "nodeid": 13806, + "image": "", + "url": "https://opensource.newrelic.com/cla/", "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" + "NEW RELIC, INC.", + "INDIVIDUAL CONTRIBUTOR LICENSE AGREEMENT", + "Definitions." ], - "title": "Report custom event data", - "category_0": "Insights", - "type": "docs", - "category_1": "Event data sources", - "external_id": "afb5f5a81ae06b22935d98c470ed9cabd7c9da6b", - "image": "", - "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/report-custom-event-data", - "published_at": "2020-09-24T03:37:06Z", - "updated_at": "2020-07-26T05:52:23Z", - "breadcrumb": "Contents / Insights / Event data sources / Custom events", + "published_at": "2020-09-25T01:59:23Z", + "title": "New Relic Open Source Contributor License Agreement", + "updated_at": "2020-09-02T02:08:45Z", + "type": "opensource", + "external_id": "478151b2a97835e82c3cd1eaa49610793dc56783", "document_type": "page", "popularity": 1, - "info": "An overview of the options for sending custom event data to New Relic. ", - "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.", + "info": "", + "body": "New Relic Open Source External Projects Highlighted Projects New Relic Projects Menu External Projects Highlighted Projects New Relic Projects NEW RELIC, INC. INDIVIDUAL CONTRIBUTOR LICENSE AGREEMENT Thank you for your interest in contributing to the open source projects of New Relic, Inc. (“New Relic”). In order to clarify the intellectual property license granted with Contributions from any person or entity, New Relic must have a Contributor License Agreement (\"Agreement\") on file that has been signed by each Contributor, indicating agreement to the license terms below. This Agreement is for your protection as a Contributor as well as the protection of New Relic; it does not change your rights to use your own Contributions for any other purpose. You accept and agree to the following terms and conditions for Your present and future Contributions submitted to New Relic. Except for the licenses granted herein to New Relic and recipients of software distributed by New Relic, You reserve all right, title, and interest in and to Your Contributions. Definitions. \"You\" (or \"Your\") shall mean the copyright owner or legal entity authorized by the copyright owner that is entering into this Agreement with New Relic. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. \"Contribution\" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to New Relic for inclusion in, or documentation of, any of the products managed or maintained by New Relic (the \"Work\"). For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to New Relic or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, New Relic for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as \"Not a Contribution.\" Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to New Relic and to recipients of software distributed by New Relic a perpetual, worldwide, non-exclusive, no-charge, royalty-free, transferable, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to New Relic and to recipients of software distributed by New Relic a perpetual, worldwide, non-exclusive, no-charge, royalty-free, transferable, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contributions alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that Your Contribution, or the Work to which You have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed. You represent that You are legally entitled to grant the above licenses. If Your employer(s) has rights to intellectual property that You create that includes Your Contributions, You represent that You have received permission to make Contributions on behalf of that employer, that Your employer has waived such rights for Your Contributions to New Relic, or that Your employer has executed a separate Agreement with New Relic. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which You are personally aware and which are associated with any part of Your Contributions. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. Should You wish to submit work that is not Your original creation, You may submit it to New Relic separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which You are personally aware, and conspicuously marking the work as \"Submitted on behalf of a third-party: [named here] \". You agree to notify New Relic of any facts or circumstances of which You become aware that would make these representations inaccurate in any respect. New Relic Open Source Standards External Projects Highlighted Projects New Relic Projects Edit this page Create an issue Copyright © 2020 New Relic Inc.Version 1.9.2", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 58.95779, + "_score": 372.402, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Report custom event data", - "sections": "Custom events", - "info": "An overview of the options for sending custom event data to New Relic. ", - "category_1": "Event data sources", - "category_2": "Custom events", - "body": " retention policy. Send custom events and attributes Methods for sending custom events and attributes include: Source How to send custom data APM agent Use APM agent APIs to report custom events and custom attributes. Browser agent Add custom attributes to the PageView event via the Browser API call", - "breadcrumb": "Contents / Insights / Event data sources / Custom events" + "body": " is for your protection as a Contributor as well as the protection of New Relic; it does not change your rights to use your own Contributions for any other purpose. You accept and agree to the following terms and conditions for Your present and future Contributions submitted to New Relic. Except" }, - "id": "5e8e7f9de7b9d2aa122cf0f6" + "id": "5f31822264441fcbe056a984" }, { + "category_2": "Developer Edition", + "nodeid": 39641, "sections": [ - "Collect data from any source", - "Agent APIs", - "Telemetry SDK", - "Trace API", - "Metric API", - "Event API", - "Log API" - ], - "title": "Collect data from any source", - "type": "developer", - "tags": [ - "Agent API", - "Telemetry SDK", - "Trace API", - "Metric API", - "Event API" + "Product or service licenses", + "New Relic One", + "APM", + "Browser", + "Developer Edition", + "Infrastructure", + "Insights", + "Logs", + "Mobile", + "Synthetics", + "Mobile apps", + "Plugins", + "Miscellaneous", + "Developer Program Resources", + "For more help" ], - "external_id": "5bfb043fffe42ea4a78d5a90bf8e92aa8b8f8c33", + "title": "Developer Program Resources", + "category_0": "Licenses", + "type": "docs", + "category_1": "Product or service licenses", + "external_id": "98308cfffa652e4c25967e1be5b848b9c28ca410", "image": "", - "url": "https://developer.newrelic.com/collect-data/collect-data-from-any-source/", - "published_at": "2020-09-24T02:28:37Z", - "updated_at": "2020-08-14T01:45:09Z", + "url": "https://docs.newrelic.com/docs/licenses/product-or-service-licenses/new-relic-developer-edition/developer-program-resources", + "published_at": "2020-09-24T19:28:53Z", + "updated_at": "2020-08-08T19:17:02Z", + "breadcrumb": "Contents / Licenses / Product or service licenses / Developer Edition", "document_type": "page", "popularity": 1, - "info": "Open source emitters. APIs. New Relic agents. Get data from anywhere. ", - "body": "Collect data from any source 15 min New Relic products report a lot of data “out of the box.” When you use products like APM, Browser, Mobile, Infrastructure monitoring, or an integration, by default you receive performance data. But you may want to bring data into New Relic that isn't collected by default. Maybe you want an API-based solution that doesn't require install of an agent. Maybe you want to bring telemetry data from another analysis service into New Relic. This page describes several ways to get data into New Relic. Step 1 of 6 Agent APIs If you use our APM, Browser, or Mobile agents to report data, you can use their associated APIs to report custom data. For example, if you monitor your application with the our APM Python agent, you can use the Python agent API to set up custom instrumentation. See the agent APIs. Step 2 of 6 Telemetry SDK Our Telemetry SDKs are language wrappers for our Trace API and Metric API (and eventually our Log API and Event API). These SDKs let you easily send metrics and trace data to New Relic without needing to install an agent. For customers, we offer open-source exporters and integrations that use the Telemetry SDKs to send metrics and trace data: Istio adaptor Prometheus OpenMetrics (for Docker | for Kubernetes) OpenCensus exporter (for Go | for Python) DropWizard exporter Micrometer exporter Want to build your own solution? See our Telemetry SDK docs. Step 3 of 6 Trace API Our Trace API lets you send distributed tracing data to New Relic and consolidate tracing data from multiple sources in one place. We accept trace data in two formats: Zipkin format New Relic format (if you don’t have Zipkin-format data, you’d use this) 1 curl -i -X POST https://trace-api.newrelic.com/trace/v1 \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"Api-Key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -H 'Data-Format: newrelic' \\ 5 -H 'Data-Format-Version: 1' \\ 6 -d '[ 7 { 8 \"common\": { 9 \"attributes\": { 10 \"service.name\": \"Test Service A\", 11 \"host\": \"host123.test.com\" 12 } 13 }, 14 \"spans\": [ 15 { 16 \"trace.id\": \"123456\", 17 \"id\": \"ABC\", 18 \"attributes\": { 19 \"duration.ms\": 12.53, 20 \"name\": \"/home\" 21 } 22 }, 23 { 24 \"trace.id\": \"123456\", 25 \"id\": \"DEF\", 26 \"attributes\": { 27 \"service.name\": \"Test Service A\", 28 \"host\": \"host456.test.com\", 29 \"duration.ms\": 2.97, 30 \"name\": \"/auth\", 31 \"parent.id\": \"ABC\" 32 } 33 } 34 ] 35 } 36 ]' Copy Step 4 of 6 Metric API You can use our Metric API to send metric data to New Relic from any source. 1 curl -i -X POST https://metric-api.newrelic.com/metric/v1 \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"Api-Key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -d '[ 5 { 6 \"metrics\": [ 7 { 8 \"name\": \"memory.heap\", 9 \"type\": \"gauge\", 10 \"value\": 2.3, 11 \"timestamp\": 1531414060739, 12 \"attributes\": { 13 \"host.name\": \"dev.server.com\" 14 } 15 } 16 ] 17 } 18 ]' Copy Step 5 of 6 Event API For sending arbitrary events to New Relic, you can use our Event API. We save these events as a new event type, which can then be queried via NRQL. (Eventually, the Telemetry SDKs will support the Event API.) 1 curl -i -X POST https://insights-collector.newrelic.com/v1/accounts/$ACCOUNT_ID/events \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"x-insert-key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -d '[ 5 { 6 \"eventType\": \"LoginEvent\", 7 \"service\": \"login-service\", 8 \"customerId\": \"xyz\" 9 } 10 ]' Copy Step 6 of 6 Log API If our existing logging integrations don’t meet your needs, you can use our Log API to send any arbitrary log data to New Relic. (Eventually, the Telemetry SDKs will support the Log API.) 1 curl -i -X POST https://log-api.newrelic.com/log/v1 \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"Api-Key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -d '[ 5 \"logs\": [ 6 { 7 \"timestamp\": 1593538496000, 8 \"message\": \"User xyz logged in\", 9 \"service\": \"login-service\", 10 \"hostname\": \"login.example.com\" 11 } 12 ] 13 ]' Copy", + "info": "New Relic Developer edition policy", + "body": "As a customer, you are eligible to participate in New Relic’s Developer Program. Additional information and resources are available at New Relic’s Developer Program site. By downloading, accessing, or using the developer resources (including the CLI), you agree that usage of the developer resources is pursuant to the New Relic Developers Terms and Conditions and that you have the authority to bind your organization. Such terms do not have to be signed in order to be binding. If you do not agree to these terms and conditions, your sole remedy is to not use these developer resources. If your use of the New Relic developer resources are covered under a separate agreement, the above does not apply to you. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 54.856693, + "_score": 354.87463, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Agent APIs", - "info": "Open source emitters. APIs. New Relic agents. Get data from anywhere. ", - "tags": "Agent API", - "body": " agents to report data, you can use their associated APIs to report custom data. For example, if you monitor your application with the our APM Python agent, you can use the Python agent API to set up custom instrumentation. See the agent APIs. Step 2 of 6 Telemetry SDK Our Telemetry SDKs are language" + "body": " is pursuant to the New Relic Developers Terms and Conditions and that you have the authority to bind your organization. Such terms do not have to be signed in order to be binding. If you do not agree to these terms and conditions, your sole remedy is to not use these developer resources. If your" }, - "id": "5efa997128ccbc3c9a307dfd" + "id": "5f338507e7b9d2f670c9de83" }, { - "category_2": "Logs in context with agent APIs", - "nodeid": 36921, + "category_2": "New Relic One", + "nodeid": 39366, "sections": [ - "Enable log management", - "New Relic Logs", - "Enable log monitoring", - "Configure logs in context", - "Logs in context for Go", - "Logs in context for Java", - "Logs in context for .NET", - "Logs in context for Node.js", - "Logs in context for PHP", - "Logs in context for Python", - "Logs in context for Ruby", - "Logs in context with agent APIs", - "Annotate logs for logs in context using APM agent APIs", - "APM agent trace metadata and linking metadata APIs", - "Resources for correctly annotating logs", + "Product or service licenses", + "New Relic One", + "APM", + "Browser", + "Developer Edition", + "Infrastructure", + "Insights", + "Logs", + "Mobile", + "Synthetics", + "Mobile apps", + "Plugins", + "Miscellaneous", + "Preview access for New Relic One", "For more help" ], - "title": "Annotate logs for logs in context using APM agent APIs", - "category_0": "Log management", + "title": "Preview access for New Relic One", + "category_0": "Licenses", "type": "docs", - "category_1": "Enable log management", - "external_id": "9d737d9f02561f18b47103b62ce11ada3dfae106", + "category_1": "Product or service licenses", + "external_id": "eae3865081d3bd8ad2dd8b6eaf0fe0147355360c", "image": "", - "url": "https://docs.newrelic.com/docs/logs/enable-log-management-new-relic/logs-context-agent-apis/annotate-logs-logs-context-using-apm-agent-apis", - "published_at": "2020-09-24T12:35:13Z", - "updated_at": "2020-08-15T03:15:39Z", - "breadcrumb": "Contents / Log management / Enable log management / Logs in context with agent APIs", + "url": "https://docs.newrelic.com/docs/licenses/product-or-service-licenses/new-relic-one/preview-access-new-relic-one", + "published_at": "2020-09-24T17:25:08Z", + "updated_at": "2020-07-31T04:41:27Z", + "breadcrumb": "Contents / Licenses / Product or service licenses / New Relic One", "document_type": "page", "popularity": 1, - "info": "New Relic's log management: How to use APM agent APIs to manually set up your own logs in context solution. ", - "body": "If you use log management and APM, you can configure logs in context to correlate log data with other New Relic features. If you use a logging framework not covered by our existing logs in context solutions, we provide a way for you to configure your logging libraries to achieve annotated logs necessary for logs in context. APM agent trace metadata and linking metadata APIs To get properly annotated logs for logs in context, use APM agent API calls (listed below). These APIs pass metadata required for linking log data to other New Relic data. This metadata is referred to as trace metadata and linking metadata. For tips on using these, see Resources for correct annotation. APM agent APIs: Go agent APIs: GetTraceMetadata GetLinkingMetadata Java agent APIs: getTraceMetadata getLinkingMetadata .NET agent APIs: TraceMetadata GetLinkingMetadata Node.js agent APIs: getTraceMetadata getLinkingMetadata PHP agent APIs: GetTraceMetadata GetLinkingMetadata Python agent API: get_linking_metadata Ruby agent APIs: linking_metadata current_trace_id current_span_id Resources for correctly annotating logs For more information on using the trace metadata and linking metadata APIs to annotate logs for logs in context, see the following resources: Review the APM agent specifications for getting properly formatted annotated logs for logs in context functionality, which include the required fields and properly formatted output. View the source code for our own logs in context extensions to see how we use these APIs: Go: Logrus extension Java: Log4j2 extension .NET: Serilog extension Node.js: Winston extension Python: see Python agent logging configuration PHP: Monolog extension Ruby: Logging extension For more help", + "body": "As a customer with a paid subscription to New Relic products, you are eligible to participate in preview access of the New Relic One platform (e.g. Telemetry Data Platform, Full Stack Observability, and Applied Intelligence products) for the period beginning July 31, 2020 and ending December 31, 2020 (“Preview Access”). BY DOWNLOADING, ACCESSING, INDICATING YOUR AGREEMENT TO, OR USING THE PREVIEW ACCESS PRODUCTS, YOU AGREE THAT YOUR PREVIEW ACCESS USAGE IS PURSUANT TO THESE SEPARATE TERMS AND CONDITIONS IN LIEU OF ANY OTHER TERMS. These terms do not have to be signed in order to be binding. If you do not agree to these terms and conditions, your sole remedy is to not participate in Preview Access. New Relic reserves the right to terminate or restrict Preview Access, in whole or in part, at any time. Notwithstanding the foregoing and any other materials provided by New Relic, select customers are ineligible for the Preview Access. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 53.8836, + "_score": 344.03262, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Annotate logs for logs in context using APM agent APIs", - "sections": "Logs in context with agent APIs", - "info": "New Relic's log management: How to use APM agent APIs to manually set up your own logs in context solution. ", - "category_2": "Logs in context with agent APIs", - "body": " necessary for logs in context. APM agent trace metadata and linking metadata APIs To get properly annotated logs for logs in context, use APM agent API calls (listed below). These APIs pass metadata required for linking log data to other New Relic data. This metadata is referred to as trace metadata", - "breadcrumb": "Contents / Log management / Enable log management / Logs in context with agent APIs" + "body": ", 2020 (“Preview Access”). BY DOWNLOADING, ACCESSING, INDICATING YOUR AGREEMENT TO, OR USING THE PREVIEW ACCESS PRODUCTS, YOU AGREE THAT YOUR PREVIEW ACCESS USAGE IS PURSUANT TO THESE SEPARATE TERMS AND CONDITIONS IN LIEU OF ANY OTHER TERMS. These terms do not have to be signed in order to be binding" }, - "id": "5f37535c196a67c8c055e5ff" + "id": "5f23a0f7e7b9d29da9c82305" } ], - "/automate-workflows/get-started-kubernetes": [ + "/build-apps/add-query-mutate-data-nerdstorage": [ { "image": "", - "url": "https://developer.newrelic.com/automate-workflows/", + "url": "https://developer.newrelic.com/build-apps/", "sections": [ - "Automate workflows", - "Guides to automate workflows", - "Quickly tag resources", - "Set up New Relic using Helm charts", - "Set up New Relic using the Kubernetes operator", - "Automatically tag a simple \"Hello World\" Demo across the entire stack", - "Automate common tasks", - "Set up New Relic using Terraform" + "Build apps", + "Guides to build apps", + "Create a \"Hello, World!\" application", + "Permissions for managing applications", + "Set up your development environment", + "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", + "Publish and deploy apps" ], - "published_at": "2020-09-24T02:30:06Z", - "title": "Automate workflows", - "updated_at": "2020-09-24T01:55:00Z", + "published_at": "2020-09-25T01:49:59Z", + "title": "Build apps", + "updated_at": "2020-09-25T01:49:59Z", "type": "developer", - "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871", + "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", "document_type": "page", "popularity": 1, - "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 30 min Automatically tag a simple \"Hello World\" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform", + "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   Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 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 30 min Publish and deploy apps Start sharing the apps you build", "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 140.46004, + "_score": 413.79144, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Set up New Relic using the Kubernetes operator", - "body": " solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic" + "sections": "Add, query, and mutate data using NerdStorage", + "body": "   Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One" }, - "id": "5efa999c196a67dfb4766445" + "id": "5efa999d64441fc0f75f7e21" }, { - "category_2": "New Relic One pricing and users", - "nodeid": 39496, "sections": [ - "Accounts and billing", - "Account setup", - "Account structure", - "New Relic One pricing and users", - "General account settings", - "SAML single sign on", - "Automated user management", - "Partner install", - "Query and alert on usage data", - "Data types", - "Query examples", - "Data usage queries", - "User count queries", - "Set usage alerts", - "General attributes", - "For more help" + "Intro to NerdStorage", + "Use NerdStorage in your apps", + "Data model", + "Limits", + "Data access", + "Permissions for working with NerdStorage" ], - "title": "Query and alert on usage data", - "category_0": "New Relic accounts", - "type": "docs", - "category_1": "Accounts and billing", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/accounts/accounts-billing/new-relic-one-pricing-users/usage-queries-alerts", - "external_id": "94429d3c0366a8dee43d771c143fc6dacf4c4e31", + "title": "Intro to NerdStorage", + "type": "developer", + "tags": [ + "nerdstorage", + "nerdstorage components", + "new relic one apps", + "data access" + ], + "external_id": "709e06c25376d98b2191ca369b4d139e5084bd62", "image": "", - "url": "https://docs.newrelic.com/docs/accounts/accounts-billing/new-relic-one-pricing-users/usage-queries-alerts", - "published_at": "2020-09-24T19:20:19Z", - "updated_at": "2020-09-24T19:20:19Z", - "breadcrumb": "Contents / New Relic accounts / Accounts and billing / New Relic One pricing and users", + "url": "https://developer.newrelic.com/explore-docs/nerdstorage/", + "published_at": "2020-09-25T01:49:59Z", + "updated_at": "2020-09-08T01:50:19Z", "document_type": "page", "popularity": 1, - "info": "How to create queries and alerts for your New Relic billing-related usage. ", - "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 The usage UI displays your data usage and billable user count. But to get more detail, you can use these NRQL queries. For definitions of some of the attributes used in these queries, see Attributes. Data usage queries Here are some data usage query examples: Daily data usage 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 data usage This query shows the current full user count. In other words, it shows how much you'd be billed for your data for that month if you were billed right now. FROM NrMTDConsumption SELECT latest(GigabytesIngested) WHERE productLine = 'DataPlatform' SINCE this month Month-to-date estimated data cost This query shows the estimated cost of your ingested data: FROM NrMTDConsumption SELECT latest(estimatedCost) WHERE productLine = 'DataPlatform' SINCE this month User count queries Here are some user-related query examples. For details on how users are counted, see User count calculations. Month-to-date full users This query shows the billable full users for the month. In other words, it shows how much you'd be billed for your users for that month if you were billed right now. FROM NrMTDConsumption SELECT latest(usersBillable) SINCE this month This query shows how many full users were counted by hour. This is useful for seeing how the full user count changed over time. from NrConsumption SELECT max(FullUsers) SINCE 10 days ago TIMESERIES 1 hour Projected monthly full user count This query shows a projected count of monthly users. This query would not be good for using in a dashboard; it requires values based on a) the days remaining in the month, b) the start of the month. Here's an example querying the projected end-of-month count with 10 days left in that month: FROM NrMTDConsumption SELECT predictLinear(FullUsers, 10 days) SINCE '2020-09-01' Count full users and basic users The usage UI shows the count of full users and basic users. The query used is: FROM NrUsage SELECT max(usage) SINCE 10 days ago WHERE productLine='FullStackObservability' WHERE metric in ('FullUsers', 'BasicUsers') FACET metric To see the count of full and basic users over time: FROM NrUsage SELECT max(usage) SINCE 10 days ago WHERE productLine='FullStackObservability' WHERE metric in ('FullUsers', 'BasicUsers') FACET metric TIMESERIES 1 hour 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. Ingested gigabytes exceed 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 users This query will create an alert when your usage exceeds fixed monthly threshold for billable users: FROM NrMTDConsumption SELECT latest(usersBillable) 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.", + "info": "Intro to NerdStorage on New Relic One", + "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,500 documents, plus storage type. Each document can have a maximum length of 1024 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 84.55346, + "_score": 132.20593, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Query and alert on usage data", - "sections": "Query and alert on usage data", - "info": "How to create queries and alerts for your New Relic billing-related usage. ", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/accounts/accounts-billing/new-relic-one-pricing-users/usage-queries-alerts", - "body": "For accounts on our New Relic One pricing plan, we provide a UI for understanding your New Relic usage and managing your data. Additionally, you can: Query your usage data to get more detail than is available in the UI Set up NRQL alert conditions to get notifications about changes in your usage" + "title": "Intro to NerdStorage", + "sections": "Intro to NerdStorage", + "info": "Intro to NerdStorage on New Relic One", + "tags": "nerdstorage", + "body": " document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing" }, - "id": "5f22f5bd64441f0c9e2a48ea" + "id": "5efa989ee7b9d2048e7bab92" }, { - "category_2": "Alert conditions", - "nodeid": 9231, "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", - "Create NRQL alert conditions", - "Create NRQL alert condition", - "Alert threshold types", - "NRQL alert syntax", - "Sum of query results (limited or intermittent data)", - "Offset the query time window", - "NRQL alert threshold examples", - "Create a description", - "For more help" + "New Relic CLI Reference", + "New Relic CLI commands", + "Options", + "Commands" ], - "title": "Create NRQL alert conditions", - "category_0": "Alerts and Applied intelligence", - "type": "docs", - "category_1": "New Relic Alerts", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions", - "external_id": "956a7a0b84d2afac5e6236df3143085ebc4f7459", + "title": "New Relic CLI Reference", + "type": "developer", + "tags": "new relic cli", + "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", "image": "", - "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions", - "published_at": "2020-09-24T23:57:53Z", - "updated_at": "2020-09-03T23:54:56Z", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert conditions", + "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", + "published_at": "2020-09-25T01:50:00Z", + "updated_at": "2020-08-14T01:47:12Z", "document_type": "page", "popularity": 1, - "info": "How to define thresholds that trigger alert notifications based on your NRQL queries.", - "body": "You can create alert conditions using NRQL queries. Create NRQL alert condition To create a NRQL alert condition: When you start to create a condition, where it prompts you to Select a product, click NRQL. Tips for creating and using a NRQL condition: Topic Tips Condition types NRQL condition types include static, baseline, and outlier. Create a description For some condition types, you can create a Description. Query results Queries must return a number. The condition works by evaluating that returned number against the thresholds you set. Time period As with all alert conditions, NRQL conditions evaluate one single minute at a time. The implicit SINCE ... UNTIL clause specifying which minute to evaluate is controlled by your Evaluation offset setting. Since very recent data may be incomplete, you may want to query data from 3 minutes ago or longer, especially for: Applications that run on multiple hosts. SyntheticCheck data: Timeouts can take 3 minutes, so 5 minutes or more is recommended. Also, if a query will generate intermittent data, consider using the sum of query results option. Condition settings Use the Condition settings to: Configure whether and how open violations are force-closed. Adjust the evaluation offset. Create a concise and descriptive condition name. (NerdGraph API Only) Provide a text description for the condition that will be included in violations and notifications. Troubleshooting procedures Optional: To include your organization's procedures for handling the incident, add the runbook URL to the condition. Limits on conditions See the maximum values. Health status NRQL alert conditions do not affect an entity's health status display. Examples For more information, see: Expected NRQL syntax Examples of NRQL condition queries Alert threshold types When you create a NRQL alert, you can choose from different types of thresholds: NRQL alert threshold types Description Static This is the simplest type of NRQL threshold. It allows you to create a condition based on a NRQL query that returns a numeric value. Optional: Include a FACET clause. Baseline Uses a self-adjusting condition based on the past behavior of the monitored values. Uses the same NRQL query form as the static type, except you cannot use a FACET clause. Outlier Looks for group behavior and values that are outliers from those groups. Uses the same NRQL query form as the static type, but requires a FACET clause. NRQL alert syntax Here is the basic syntax for creating all NRQL alert conditions. Depending on the threshold type, also include a FACET clause as applicable. SELECT function(attribute) FROM Event WHERE attribute [comparison] [AND|OR ...] Clause Notes SELECT function(attribute) Required Supported functions that return numbers include: apdex average count latest max min percentage percentile sum uniqueCount If you use the percentile aggregator in a faceted alert condition with many facets, this may cause the following error to appear: An error occurred while fetching chart data. If you see this error, use average instead. FROM data type Required Only one data type can be targeted. Supported data types: Event Metric (RAW data points will be returned) WHERE attribute [comparison] [AND|OR ...] Optional Use the WHERE clause to specify a series of one or more conditions. All the operators are supported. FACET attribute Static: Optional Baseline: Not allowed Outlier: Required Including a FACET clause in your NRQL syntax depends on the threshold type: static, baseline, or outlier. Use the FACET clause to separate your results by attribute and alert on each attribute independently. Faceted queries can return a maximum of 5000 values for static conditions and a maximum of 500 values for outlier conditions. If the query returns more than this number of values, the alert condition cannot be created. If you create the condition and the query returns more than this number later, the alert will fail. Sum of query results (limited or intermittent data) Available only for static (basic) threshold types. If a query returns intermittent or limited data, it may be difficult to set a meaningful threshold. Missing or limited data will sometimes generate false positives or false negatives. To avoid this problem when using the static threshold type, you can set the selector to sum of query results. This lets you set the alert on an aggregated sum instead of a value from a single harvest cycle. Up to two hours of the one-minute data checks can be aggregated. The duration you select determines the width of the rolling sum, and the preview chart will update accordingly. Offset the query time window Every minute, we evaluate the NRQL query in one-minute time windows. The start time depends on the value you select in the NRQL condition's Advanced settings > Evaluation offset. Example: Using the default time window to evaluate violations With the Evaluation offset at the default setting of three minutes, the NRQL time window applied to your query will be: SINCE 3 minutes ago UNTIL 2 minutes ago If the event type is sourced from an APM language agent and aggregated from many app instances (for example, Transactions, TransactionErrors, etc.), we recommend evaluating data from three minutes ago or longer. An offset of less than 3 minutes will trigger violations sooner, but you might see more false positives and negatives due to data latency. For cloud data, such as AWS integrations, you may need an offset longer than 3 minutes. Check our AWS polling intervals documentation to determine your best setting. NRQL alert threshold examples Here are some common use cases for NRQL alert conditions. These queries will work for static and baseline threshold types. The outlier threshold type will require additional FACET clauses. Alert on specific segments of your data Create constrained alerts that target a specific segment of your data, such as a few key customers or a range of data. Use the WHERE clause to define those conditions. SELECT average(duration) FROM Transaction WHERE account_id in (91290, 102021, 20230) SELECT percentile(duration, 95) FROM Transaction WHERE name LIKE 'Controller/checkout/%' Alert on Nth percentile of your data Create alerts when an Nth percentile of your data hits a specified threshold; for example, maintaining SLA service levels. Since we evaluate the NRQL query in one-minute time windows, percentiles will be calculated for each minute separately. SELECT percentile(duration, 95) FROM Transaction SELECT percentile(databaseDuration, 75) FROM Transaction Alert on max, min, avg of your data Create alerts when your data hits a certain maximum, minimum, or average; for example, ensuring that a duration or response time does not pass a certain threshold. SELECT max(duration) FROM Transaction SELECT average(duration) FROM Transaction Alert on a percentage of your data Create alerts when a proportion of your data goes above or below a certain threshold. SELECT percentage(count(*), WHERE duration > 2) FROM Transaction SELECT percentage(count(*), WHERE httpResponseCode = '500') FROM Transaction Alert on Apdex with any T-value Create alerts on Apdex, applying your own T-value for certain transactions. For example, get an alert notification when your Apdex for a T-value of 500ms on transactions for production apps goes below 0.8. SELECT apdex(duration, t:0.5) FROM Transaction WHERE appName like '%prod%' Create a description You can define a description that passes useful information downstream for better violation responses or for use by downstream systems. For details, see Description. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "info": "The command line tools for performing tasks against New Relic APIs", + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 75.63496, + "_score": 93.1597, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Create NRQL alert conditions", - "sections": "Create NRQL alert conditions", - "info": "How to define thresholds that trigger alert notifications based on your NRQL queries.", - "category_0": "Alerts and Applied intelligence", - "category_1": "New Relic Alerts", - "category_2": "Alert conditions", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions", - "body": "You can create alert conditions using NRQL queries. Create NRQL alert condition To create a NRQL alert condition: When you start to create a condition, where it prompts you to Select a product, click NRQL. Tips for creating and using a NRQL condition: Topic Tips Condition types NRQL condition types", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert conditions" + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" }, - "id": "5f2d992528ccbc489d88dfc1" + "id": "5efa989ee7b9d2024b7bab97" }, { - "category_2": "Understand and use data", - "nodeid": 37981, "sections": [ - "Elastic Container Service integration", - "Get started", - "Install", - "Understand and use data", - "Troubleshooting", - "Recommended ECS alert conditions", - "Recommended alert conditions", - "For more help" + "Query and store data", + "Components overview", + "Query components", + "Mutation components", + "Static methods", + "NrqlQuery" ], - "title": "Recommended ECS alert conditions", - "category_0": "Integrations", - "type": "docs", - "category_1": "Elastic Container Service integration", - "external_id": "304f01e7a5c68e9ef4dc76782eb9ff6847854065", + "title": "Query and store data", + "type": "developer", + "tags": [ + "nerdgraph query components", + "mutation components", + "static methods" + ], + "external_id": "cbbf363393edeefbc4c08f9754b43d38fd911026", "image": "", - "url": "https://docs.newrelic.com/docs/integrations/elastic-container-service-integration/understand-use-data/ecs-integration-recommended-alert-conditions", - "published_at": "2020-09-24T09:58:05Z", - "updated_at": "2020-08-06T00:29:40Z", - "breadcrumb": "Contents / Integrations / Elastic Container Service integration / Understand and use data", + "url": "https://developer.newrelic.com/explore-docs/query-and-store-data/", + "published_at": "2020-09-25T01:51:38Z", + "updated_at": "2020-08-01T01:42:02Z", "document_type": "page", "popularity": 1, - "info": "Tips for useful alert conditions to set for New Relic's Amazon ECS integration. ", - "body": "New Relic's ECS integration reports and displays performance data from your Amazon ECS environment. This document provides some recommended alert conditions for monitoring ECS performance. Recommended alert conditions Here are some recommended ECS alert conditions. To add these alerts, go to the Alerts UI and add the following NRQL alert conditions to an existing or new alert policy: High CPU usage NRQL: FROM ContainerSample SELECT cpuUsed / cpuLimitCores Critical: > 90% for 5 minutes High memory usage NRQL: FROM ContainerSample SELECT memoryUsageBytes / memorySizeLimitBytes Critical: > 80% for 5 minutes Restart count NRQL: FROM ContainerSample SELECT max(restartCount) - min(restartCount) Critical: > 5 for 5 minutes 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.", + "info": "Reference guide for SDK query components using NerdGraph", + "body": "Query and store data 10 min To help you build a New Relic One application, we provide you with the New Relic One SDK. Here you can learn how to use the SDK query components, which allow you to make queries and mutations via NerdGraph, our GraphQL endpoint. Query-related React components can be identified by the Query suffix. Mutation-related components can be identified by the Mutation prefix. Components overview Our data components are based on React Apollo. The most basic component is NerdGraphQuery, which accepts any GraphQL (or GraphQL AST generated by the graphql-tag library as the query parameter, and a set of query variables passed as variables. Over this query, we have created an additional set of queries, which can be divided into four groups: User queries: These allow you to query the current user and its associated accounts. Components in this category: UserStorageQuery and AccountsQuery. Entities queries: Because New Relic One is entity-centric, we use queries to make access to your entities easier. You can count, search, list, query, and favorite them. Components in this category: EntityCountQuery, EntitySearchQuery, EntitiesByDomainTypeQuery, EntitiesByGuidsQuery, EntityByGuidQuery, EntityByNameQuery. Storage queries: New Relic One provides a simple storage mechanism that we call NerdStorage. This can be used by Nerdpack creators to store application configuration setting data, user-specific data, and other small pieces of data. Components in this category: UserStorageQuery, AccountStorageQuery, EntityStorageQuery, UserStorageMutation, AccountStorageMutation, and EntityStorageMutation. For details, see NerdStorage. NRQL queries: To be able to query your New Relic data via NRQL (New Relic Query Language), we provide a NrqlQuery component. This component can return data in different formats, so that you can use it for charting and not only for querying. Query components All query components accept a function as a children prop where the different statuses can be passed. This callback receives an object with the following properties: loading: Boolean that is set to true when data fetching is happening. Our components use the cache-and-network strategy, meaning that after the data has loaded, subsequent data reloads might be triggered first with stale data, then refreshed when the most recent data has arrived. data: Root property where the data requested is retrieved. The structure matches a root structure based on the NerdGraph schema. This is true even for highly nested data structures, which means you’ll have to traverse down to find the desired data. error: Contains an Error instance when the query fails. Set to undefined when data is loading or the fetch was successful. fetchMore: Callback function that can be called when the query is being loaded in chunks. The function will only be present when it’s feasible to do so, more data is available, and no fetchMore has already been triggered. Data is loaded in batches of 200 by default. Other components provided by the platform (like the Dropdown or the List) are capable of accepting fetchMore, meaning you can combine them easily. Mutation components Mutation components also accept a children as a function, like the query ones. The mutation can be preconfigured at the component level, and a function is passed back that you can use in your component. This is the standard React Apollo approach for performing mutations, but you might find it easier to use our static mutation method added to the component. More on this topic below. Static methods All of the described components also expose a static method so that they can be used imperatively rather than declaratively. All Query components have a static Query method, and all Mutation components have a mutation method. These static methods accept the same props as their query component, but passed as an object. For example: // Declarative way (using components). function renderAccountList() { return (
    ({data, error}) => { if (error) { return
  • Failed to retrieve list: {error.message}
  • ; } return data.map((account) => {
  • {account.name}
  • }); }}
); } // Imperative way (using promises). async function getAccountList() { let data = {}; try { data = await AccountsQuery.query(); } catch (error) { console.log('Failed to retrieve list: ' + error.message); return; } return data.actor.accounts.map((account) => { return account.name; }); } Copy Similarly, a mutation can happen either way; either declaratively or imperatively. NrqlQuery NrqlQuery deserves additional explanation, because there are multiple formats in which you can return data from it. To provide maximum functionality, all three are exposed through a formatType property. You can find its different values under NrqlQuery.formatType: NERD_GRAPH: Returns the format in which it arrives from NerdGraph. RAW: The format exposed by default in Insights and dashboards when being plotted as JSON. This format is useful if you have a pre-existing script in this format that you're willing to migrate to or incorporate with. CHART: The format used by the charting engine that we also expose. You can find a more detailed explanation of how to manipulate this format in the guide to chart components, and some examples. If you are willing to push data, we currently do not expose NrqlMutation. To do that, see the Event API for how to add custom events.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 65.28945, + "_score": 81.54899, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Recommended ECS alert conditions", - "sections": "Recommended ECS alert conditions", - "info": "Tips for useful alert conditions to set for New Relic's Amazon ECS integration. ", - "body": " to the Alerts UI and add the following NRQL alert conditions to an existing or new alert policy: High CPU usage NRQL: FROM ContainerSample SELECT cpuUsed / cpuLimitCores Critical: > 90% for 5 minutes High memory usage NRQL: FROM ContainerSample SELECT memoryUsageBytes / memorySizeLimitBytes Critical: > 80" + "title": "Query and store data", + "sections": "Query and store data", + "info": "Reference guide for SDK query components using NerdGraph", + "tags": "nerdgraph query components", + "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": "5ee05e9e28ccbcef4f4c8dda" + "id": "5efa989e28ccbc2f15307deb" }, { - "category_2": "Alert conditions", - "nodeid": 10951, + "image": "", + "url": "https://developer.newrelic.com/collect-data/", "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", - "Create baseline alert conditions", - "How it works", - "Set baseline thresholds", - "Baseline rules and settings", - "For more help" + "Collect data", + "Guides to collect data", + "Add custom attributes", + "Create custom events", + "Collect data - any source", + "Build queries with NerdGraph", + "Query data with NRQL" ], - "title": "Create baseline alert conditions", - "category_0": "Alerts and Applied intelligence", - "type": "docs", - "category_1": "New Relic Alerts", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-baseline-alert-conditions", - "external_id": "0708312e6e3221aa381963e90472d3f7016d4dc6", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-alerts-baseline-thresholds.png", - "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-baseline-alert-conditions", - "published_at": "2020-09-24T08:30:36Z", - "updated_at": "2020-08-15T08:34:17Z", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert conditions", + "published_at": "2020-09-25T01:51:37Z", + "title": "Collect data", + "updated_at": "2020-09-25T01:51:37Z", + "type": "developer", + "external_id": "fb5d6f75b61858b09e3e8c63f3b2af97813f47b6", "document_type": "page", "popularity": 1, - "info": "How to create a baseline alert conditions and set thresholds that adjust to data patterns and fluctuations. ", - "body": "You can use baseline conditions to define violation thresholds that adjust to the behavior of your data. Baseline alerting is useful for creating conditions that: Only notify you when data is behaving abnormally. Dynamically adjust to changing data and trend s, including daily or weekly trends. In addition, baseline alerting works well with new applications when you do not yet have known behaviors. How it works When you choose a data source (for example, an APM metric) for a baseline condition, we'll use the past values of that data to dynamically predict the data's near-future behavior. The line of that predicted future behavior for that value is called a baseline. It appears as a dotted black line on the preview chart in the baseline condition UI. You'll use the baseline alert condition UI to: Adjust how sensitive the condition is to fluctuations in the data source. Set the behavior that will trigger a violation (for example: \"deviating for more than five minutes\"). Set whether you want the condition to check for upper violations, lower violations, or both. When your data escapes the predicted \"normal\" behavior and meets the criteria you've chosen, you'll receive a notification. Set baseline thresholds one.newrelic.com > AI & Alerts > Policies > (create or select policy) > Create alert condition: Baseline alert conditions give you the ability to set intelligent, self-adjusting thresholds that only generate violations when abnormal behavior is detected. To create a baseline condition: When you start to create a condition, choose one of the following data sources: APM: Application metric baseline Browser: Metric baseline NRQL (and then choose a baseline type threshold) Here are some tips for setting baseline thresholds: Set the baseline direction to monitor violations that happen either above or below the baseline. Set the preview chart to either 2 days or 7 days of displayed data. (Not applicable for NRQL alert conditions.) Use the slider bar to adjust the Critical threshold sensitivity, represented in the preview chart by the light gray area around the baseline. The tighter the band around the baseline, the more sensitive it is and the more violations it will generate. Optional: You can create a Warning threshold (the darker gray area around the baseline). For NRQL alerts, see the allowed types of NRQL queries. If the alert condition applies to multiple apps, you can select a choice from the dropdown above the chart to use different metrics. (Not applicable for NRQL alert conditions.) Baseline rules and settings Here are some details about how the UI works: Rules governing creation of baseline The algorithm for baseline conditions is mathematically complex. Here are some of the major rules governing its predictive abilities: Data trait Baseline rules Age of data On initial creation, the baseline is calculated using between 1 to 4 weeks of data, depending on data availability and baseline type. After its creation, the algorithm will take into account ongoing data fluctuations over a long time period, although greater weight is given to more recent data. For data that has only existed for a short time, the baseline will likely fluctuate a good deal and not be very accurate. This is because there is not yet enough data to determine its usual values and behavior. The more history the data has, the more accurate the baseline and thresholds will become. Consistency of data For metric values that remain in a consistent range or that trend slowly and steadily, their more predictable behavior means that their thresholds will become tighter around the baseline. Data that is more varied and unpredictable will have looser (wider) thresholds. Regular fluctuations For shorter-than-one-week cyclical fluctuations (such as weekly Wednesday 1pm deployments or nightly reports), the baseline algorithm looks for these cyclical fluctuations and attempts to adjust to them. Baseline direction: select upper or lower ranges You can choose whether you want the condition to violate for behavior that goes above the baseline (\"upper\") or that goes below the baseline (\"lower\"), or that goes either above or below. You choose these with the Baseline direction selector. Example use cases for this: You might use the Upper setting for a data source like error rate, because you generally are only concerned if it goes up, and aren't concerned if it goes down. You might use the Lower setting for a data source like throughput, because sudden upward fluctuations are quite common, but a large sudden downswing would be a sign of a problem. Here are examples of how large fluctuations in your data would be treated under the different baseline direction settings. The red areas represent violations. Preview chart: select 2 or 7 days When setting thresholds, the preview chart has an option for displaying Since 2 days ago or Since 7 days ago. These selections are not the time period used to compute the baseline; they are only the time range used for a preview display. For more about the time range used to calculate the baseline, see the algorithm rules. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "body": "Collect data Through our opensource agents or APIs, New Relic makes it easy to collect data from any source. The guides in this section provide strategies for collecting and querying data for use in your existing implementation, or in apps you build. The opportunities are endless. Guides to collect data   Add custom attributes Use custom attributes for deeper analysis 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 15 min Collect data - any source APIs, agents, OS emitters - get any data 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 10 min Query data with NRQL Query default data, custom events, and attributes", + "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 63.225777, + "_score": 76.20705, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Create baseline alert conditions", - "sections": "Alert conditions", - "info": "How to create a baseline alert conditions and set thresholds that adjust to data patterns and fluctuations. ", - "category_0": "Alerts and Applied intelligence", - "category_1": "New Relic Alerts", - "category_2": "Alert conditions", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-baseline-alert-conditions", - "body": " that happen either above or below the baseline. Set the preview chart to either 2 days or 7 days of displayed data. (Not applicable for NRQL alert conditions.) Use the slider bar to adjust the Critical threshold sensitivity, represented in the preview chart by the light gray area around the baseline", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert conditions" + "title": "Collect data", + "sections": "Query data with NRQL", + "body": " data   Add custom attributes Use custom attributes for deeper analysis 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 15 min Collect data - any source APIs, agents, OS emitters - get any data 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 10 min Query data with NRQL Query default data, custom events, and attributes" }, - "id": "5f2d847b28ccbc876888e004" + "id": "5efa997328ccbc768c307de2" } ], - "/build-apps/add-time-picker-guide": [ + "/collect-data/custom-events": [ { - "image": "", - "url": "https://developer.newrelic.com/build-apps/", + "category_2": "Custom events", + "nodeid": 13661, "sections": [ - "Build apps", - "Guides to build apps", - "Create a \"Hello, World!\" application", - "Permissions for managing applications", - "Set up your development environment", - "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", - "Publish and deploy apps", - "Create a custom map view" + "Event data sources", + "Default events", + "Custom events", + "Data requirements and limits for custom event data", + "General requirements", + "Reserved words", + "Additional Browser PageAction requirements", + "Additional Event API requirements", + "Event type limits", + "For more help" ], - "published_at": "2020-09-24T02:30:06Z", - "title": "Build apps", - "updated_at": "2020-09-24T01:55:00Z", - "type": "developer", - "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", + "title": "Data requirements and limits for custom event data", + "category_0": "Insights", + "type": "docs", + "category_1": "Event data sources", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", + "external_id": "f5beef0d09bb5918be3f8a1a3ece98c09947cd1e", + "image": "", + "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", + "published_at": "2020-09-24T07:25:32Z", + "updated_at": "2020-09-20T19:39:10Z", + "breadcrumb": "Contents / Insights / Event data sources / Custom events", "document_type": "page", "popularity": 1, - "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   Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 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 Publish and deploy apps Start sharing the apps you build 30 min Create a custom map view Build an app to show page view data on a map", - "info": "", + "info": "For New Relic, general limits and requirements for reporting custom events and attributes. ", + "body": "You can report custom events to New Relic in several ways, including the New Relic Event API, APM agent APIs, Browser agent APIs, and the Mobile SDK. This document contains general requirements and rules for inserting and using custom events and their associated attributes. Additional requirements may apply based on the method you use. General requirements How long custom data is retained depends on your Insights subscription and its associated data retention. When reporting custom events and attributes, follow these general requirements for supported data types, naming syntax, and size: Requirement Description Payload Total maximum size or length: 1 MB maximum per POST. We highly recommend using compression. The Event API has additional HTTP rate limits. Attribute data types Attribute values can be either a string or a numeric integer or float. If your attribute values contain date information, define it as an unformatted Unix timestamp (in seconds or milliseconds) by using the Insights data formatter. Attribute size Maximum name size: 255 bytes. Maximum attribute value size: Custom attributes sent by the agent: 255 bytes Attributes attached to custom events sent using the Event API: 4096 characters Charts may only display the first 255 characters of attribute values. For complete attribute values, use the JSON chart type or Query API. Maximum total attributes per event: 254. Exception: If you use an APM agent API, the max is 64. Maximum total attributes per event type: 48,000. Naming syntax Attribute names can be a combination of alphanumeric characters, colons (:), periods (.), and underscores (_). Event types (using the eventType attribute) can be a combination of alphanumeric characters, colons (:), and underscores (_). Do not use words reserved for use by NRQL. Null values The database does not store any data with a null value. Reserved words Avoid using the following reserved words as names for events and attributes. Otherwise, unexpected results may occur. This is not a complete list. In general, it's a good practice to avoid using MySQL-reserved words to avoid collision with future New Relic functionality. Keyword Description accountId This is a reserved attribute name. If it's included, it will be dropped during ingest. appId Value must be an integer. If it is not an integer, the attribute name and value will be dropped during ingest. eventType The event type as stored in New Relic. New Relic agents and scripts normally report this as eventType. Can be a combination of alphanumeric characters, colons (:), and underscores (_). Be sure to review the prohibited eventType values and eventType limits. Prohibited eventType values For your eventType value, avoid using: Metric, MetricRaw, and strings prefixed with Metric[0-9] (such as Metric2 or Metric1Minute). Public_ and strings prefixed with Public_. These event types are reserved for use by New Relic. Events passed in with these eventType values will be dropped. timestamp Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds. It must be +/-1 day (24 hours) of the current time on the server. Log forwarding terms The following keys are reserved by the Infrastructure agent's log forwarding feature: entity.guid, log, hostname, plugin.type, fb.input. If used, they are dropped during ingest and a warning is added to the logs. NRQL syntax terms If you need to use NRQL syntax terms as attribute names, including dotted attributes, they must be enclosed in backticks; for example, `LIMIT` or `consumer.offset`. Otherwise, avoid using these reserved words: ago, and, as, auto, begin, begintime, compare, day, days, end, endtime, explain, facet, from, hour, hours, in, is, like, limit, minute, minutes, month, months, not, null, offset, or, raw, second, seconds, select, since, timeseries, until, week, weeks, where, with Additional Browser PageAction requirements For additional requirements for using New Relic Browser's custom PageAction event, see Insert custom data via New Relic Browser agent. Additional Event API requirements For more requirements and details for the Event API, see Event API. Event type limits The current limit for total number of eventType values is 250 per sub-account in a given 24-hour time period. If a user exceeds this limit, New Relic may filter or drop data. Event types include: Default events from New Relic agents Custom events from New Relic agents Custom events from Insights custom event inserter 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 161.48932, + "_score": 104.3099, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Build apps", - "sections": "Add a time picker to your app", - "body": " 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 Publish and deploy apps Start sharing the apps you build 30 min Create a custom map view Build an app to show page view data on a map" + "title": "Data requirements and limits for custom event data", + "sections": "Custom events", + "info": "For New Relic, general limits and requirements for reporting custom events and attributes. ", + "category_1": "Event data sources", + "category_2": "Custom events", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", + "body": "You can report custom events to New Relic in several ways, including the New Relic Event API, APM agent APIs, Browser agent APIs, and the Mobile SDK. This document contains general requirements and rules for inserting and using custom events and their associated attributes. Additional requirements", + "breadcrumb": "Contents / Insights / Event data sources / Custom events" }, - "id": "5efa999d64441fc0f75f7e21" + "id": "59f4354f4bb81c2ea8b80d0a" }, { - "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png", - "url": "https://developer.newrelic.com/", + "category_2": "Custom events", + "nodeid": 6256, "sections": [ - "Mark your calendar for Nerd Days 1.0", - "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" + "Event data sources", + "Default events", + "Custom events", + "APM: Report custom events", + "Data considerations", + "Record a custom event", + "Timestamps", + "Limits and restricted characters", + "Reserved words", + "For more help" ], - "published_at": "2020-09-24T02:24:45Z", - "title": "New Relic Developers", - "updated_at": "2020-09-24T01:39:32Z", - "type": "developer", - "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab", + "title": "APM: Report custom events", + "category_0": "Insights", + "type": "docs", + "category_1": "Event data sources", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/event-data-sources/custom-events/apm-report-custom-events", + "external_id": "0c3f09d0d0e04ad50bedcdf7088eed7c171001d8", + "image": "", + "url": "https://docs.newrelic.com/docs/insights/event-data-sources/custom-events/apm-report-custom-events", + "published_at": "2020-09-24T07:10:11Z", + "updated_at": "2020-09-24T07:10:11Z", + "breadcrumb": "Contents / Insights / Event data sources / Custom events", "document_type": "page", "popularity": 1, - "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 19 Days : 14 Hours : 58 Minutes : 8 Seconds Register 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 20 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", - "info": "", + "info": "New Relic APM: how to report custom events and attributes.", + "body": "If you have 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 833 custom events every 5 seconds. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 160.72337, + "_score": 103.46959, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Add a time picker to your app", - "body": " 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" + "title": "APM: Report custom events", + "sections": "Custom events", + "info": "New Relic APM: how to report custom events and attributes.", + "category_1": "Event data sources", + "category_2": "Custom events", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/event-data-sources/custom-events/apm-report-custom-events", + "body": "If you have 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", + "breadcrumb": "Contents / Insights / Event data sources / Custom events" }, - "id": "5d6fe49a64441f8d6100a50f" + "id": "5f480a5a64441f578bfdcdb1" }, { + "category_2": "Custom events", + "nodeid": 13806, "sections": [ - "Add tables to your New Relic One application", - "Before you begin", - "Clone and set up the example application", - "Work with table components", - "Next steps" - ], - "title": "Add tables to your New Relic One application", - "type": "developer", - "tags": [ - "table in app", - "Table component", - "TableHeaderc omponent", - "TableHeaderCell component", - "TableRow component", - "TableRowCell component" + "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" ], - "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-09-24T02:28:37Z", - "updated_at": "2020-09-17T01:48:42Z", + "title": "Report custom event data", + "category_0": "Insights", + "type": "docs", + "category_1": "Event data sources", + "external_id": "afb5f5a81ae06b22935d98c470ed9cabd7c9da6b", + "image": "", + "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/report-custom-event-data", + "published_at": "2020-09-24T03:37:06Z", + "updated_at": "2020-07-26T05:52:23Z", + "breadcrumb": "Contents / Insights / Event data sources / Custom events", "document_type": "page", "popularity": 1, - "info": "Add a table to your New Relic One app.", - "body": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application. In this guide, you are going to build a sample table using various New Relic One components. Before you begin If you haven't already installed the New Relic One CLI, step through the quick start in New Relic One. This process also gets you an API key. In addition, to complete the steps in this guide, you need a GitHub account and Node.js installed on your machine. See Setting up your development environment for more info. Clone and set up the example application Step 1 of 4 Clone the nr1-how-to example application from GitHub to your local machine. Then, navigate to the app directory. The example app lets you experiment with tables. git clone https://github.com/newrelic/nr1-how-to.git` cd nr1-how-to/create-a-table/nerdlets/create-a-table-nerdlet` Copy Step 2 of 4 Edit the index.json file and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install dependencies nr1 nerdpack:serve # Serve the demo app locally Copy Step 4 of 4 Open one.newrelic.com/?nerdpacks=local in your browser. Click Apps, and then in the Your apps section, you should see a Create a table launcher. That's the demo application you're going to work on. Go ahead and select it. Have a good look at the demo app. There's a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You'll use Table components to add a new table in the second row. Work with table components Step 1 of 10 Navigate to the nerdlets/create-a-table-nerdlet subdirectory and open the index.js file. Add the following components to the import statement at the top of the file so that it looks like the example: Table TableHeader TableHeaderCell TableRow TableRowCell import { Table, TableHeader, TableHeaderCell, TableRow, TableRowCell, PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart, } from 'nr1'; Copy Step 2 of 10 Add a basic Table component Locate the empty GridItem in index.js: This is where you start building the table. Add the initial component. The items property collects the data by calling _getItems(), which contains sample values.
; Copy Step 3 of 10 Add the header and rows As the Table component renders a fixed number of header cells and rows, your next step is adding header components, as well as a function that returns the required table rows. Inside of the Table component, add the TableHeader and then a TableHeaderCell child for each heading. Since you don't know how many rows you'll need, your best bet is to call a function to build as many TableRows as items returned by _getItems(). Application Size Company Team Commit ; { ({ item }) => ( {item.name} {item.value} {item.company} {item.team} {item.commit} ); } Copy Step 4 of 10 Take a look at the application running in New Relic One: you should see something similar to the screenshot below. Step 5 of 10 Replace standard table cells with smart cells The New Relic One library includes cell components that can automatically format certain data types, like users, metrics, and entity names. The table you've just created contains columns that can benefit from those components: Application (an entity name) and Size (a metric). Before you can use EntityTitleTableRowCell and MetricTableRowCell, you have to add them to the import statement first. import { EntityTitleTableRowCell, MetricTableRowCell, ... /* All previous components */ } from 'nr1'; Copy Step 6 of 10 Update your table rows by replacing the first and second TableRowCells with entity and metric cells. Notice that EntityTitleTableRowCell and MetricTableRowCell are self-closing tags. { ({ item }) => ( {item.company} {item.team} {item.commit} ); } Copy Step 7 of 10 Time to give your table a second look: The cell components you've added take care of properly formatting the data. Step 8 of 10 Add some action to your table! Tables are great, but interactive tables can be better: As a last update, you are going to allow users to act on each data row. Add the _getActions() method to your index.js file, right before _getItems(). As you may have guessed from the code, _getActions() spawns an alert box when you click Team or Commit cells. _getActions() { return [ { label: 'Alert Team', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__ALERT, onClick: (evt, { item, index }) => { alert(`Alert Team: ${item.team}`); }, }, { label: 'Rollback Version', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__UNDO, onClick: (evt, { item, index }) => { alert(`Rollback from: ${item.commit}`); }, }, ]; } Copy Step 9 of 10 Find the TableRow component in your return statement and point the actions property to _getActions(). The TableRow actions property defines a set of actions that appear when the user hovers over a table row. Actions have a mandatory text and an onClick callback, but can also display an icon or be disabled if needed. Copy Step 10 of 10 Go back to your application and try hovering over any of the rows: Notice how the two available actions appear. When you click them, a function triggers with the selected row data as an argument, and an alert displays in your browser. Next steps You've built a table into a New Relic One application, using components to format data automatically and provide contextual actions. Well done! Keep exploring the Table components, their properties, and how to use them, in our SDK documentation.", + "info": "An overview of the options for sending custom event data to New Relic. ", + "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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 153.27567, + "_score": 56.655544, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Add tables to your New Relic One application", - "sections": "Add tables to your New Relic One application", - "info": "Add a table to your New Relic One app.", - "tags": "table in app", - "body": " as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo" + "title": "Report custom event data", + "sections": "Custom events", + "info": "An overview of the options for sending custom event data to New Relic. ", + "category_1": "Event data sources", + "category_2": "Custom events", + "body": " retention policy. Send custom events and attributes Methods for sending custom events and attributes include: Source How to send custom data APM agent Use APM agent APIs to report custom events and custom attributes. Browser agent Add custom attributes to the PageView event via the Browser API call", + "breadcrumb": "Contents / Insights / Event data sources / Custom events" }, - "id": "5efa989ee7b9d2ad567bab51" + "id": "5e8e7f9de7b9d2aa122cf0f6" }, { "sections": [ - "Intro to New Relic One API components", - "Components of the SDK", - "UI components", - "Chart components", - "Query and storage components", - "Platform APIs" + "Collect data from any source", + "Agent APIs", + "Telemetry SDK", + "Trace API", + "Metric API", + "Event API", + "Log API" ], - "title": "Intro to New Relic One API components", + "title": "Collect data from any source", "type": "developer", "tags": [ - "SDK components", - "New Relic One apps", - "UI components", - "chart components", - "query and storage components", - "Platform APIs" + "Agent API", + "Telemetry SDK", + "Trace API", + "Metric API", + "Event API" ], - "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2", + "external_id": "5bfb043fffe42ea4a78d5a90bf8e92aa8b8f8c33", "image": "", - "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/", - "published_at": "2020-09-24T02:28:37Z", - "updated_at": "2020-08-14T01:47:12Z", + "url": "https://developer.newrelic.com/collect-data/collect-data-from-any-source/", + "published_at": "2020-09-25T01:49:59Z", + "updated_at": "2020-08-14T01:45:09Z", "document_type": "page", "popularity": 1, - "info": "Intro to New Relic One API components", - "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.", + "info": "Open source emitters. APIs. New Relic agents. Get data from anywhere. ", + "body": "Collect data from any source 15 min New Relic products report a lot of data “out of the box.” When you use products like APM, Browser, Mobile, Infrastructure monitoring, or an integration, by default you receive performance data. But you may want to bring data into New Relic that isn't collected by default. Maybe you want an API-based solution that doesn't require install of an agent. Maybe you want to bring telemetry data from another analysis service into New Relic. This page describes several ways to get data into New Relic. Step 1 of 6 Agent APIs If you use our APM, Browser, or Mobile agents to report data, you can use their associated APIs to report custom data. For example, if you monitor your application with the our APM Python agent, you can use the Python agent API to set up custom instrumentation. See the agent APIs. Step 2 of 6 Telemetry SDK Our Telemetry SDKs are language wrappers for our Trace API and Metric API (and eventually our Log API and Event API). These SDKs let you easily send metrics and trace data to New Relic without needing to install an agent. For customers, we offer open-source exporters and integrations that use the Telemetry SDKs to send metrics and trace data: Istio adaptor Prometheus OpenMetrics (for Docker | for Kubernetes) OpenCensus exporter (for Go | for Python) DropWizard exporter Micrometer exporter Want to build your own solution? See our Telemetry SDK docs. Step 3 of 6 Trace API Our Trace API lets you send distributed tracing data to New Relic and consolidate tracing data from multiple sources in one place. We accept trace data in two formats: Zipkin format New Relic format (if you don’t have Zipkin-format data, you’d use this) 1 curl -i -X POST https://trace-api.newrelic.com/trace/v1 \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"Api-Key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -H 'Data-Format: newrelic' \\ 5 -H 'Data-Format-Version: 1' \\ 6 -d '[ 7 { 8 \"common\": { 9 \"attributes\": { 10 \"service.name\": \"Test Service A\", 11 \"host\": \"host123.test.com\" 12 } 13 }, 14 \"spans\": [ 15 { 16 \"trace.id\": \"123456\", 17 \"id\": \"ABC\", 18 \"attributes\": { 19 \"duration.ms\": 12.53, 20 \"name\": \"/home\" 21 } 22 }, 23 { 24 \"trace.id\": \"123456\", 25 \"id\": \"DEF\", 26 \"attributes\": { 27 \"service.name\": \"Test Service A\", 28 \"host\": \"host456.test.com\", 29 \"duration.ms\": 2.97, 30 \"name\": \"/auth\", 31 \"parent.id\": \"ABC\" 32 } 33 } 34 ] 35 } 36 ]' Copy Step 4 of 6 Metric API You can use our Metric API to send metric data to New Relic from any source. 1 curl -i -X POST https://metric-api.newrelic.com/metric/v1 \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"Api-Key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -d '[ 5 { 6 \"metrics\": [ 7 { 8 \"name\": \"memory.heap\", 9 \"type\": \"gauge\", 10 \"value\": 2.3, 11 \"timestamp\": 1531414060739, 12 \"attributes\": { 13 \"host.name\": \"dev.server.com\" 14 } 15 } 16 ] 17 } 18 ]' Copy Step 5 of 6 Event API For sending arbitrary events to New Relic, you can use our Event API. We save these events as a new event type, which can then be queried via NRQL. (Eventually, the Telemetry SDKs will support the Event API.) 1 curl -i -X POST https://insights-collector.newrelic.com/v1/accounts/$ACCOUNT_ID/events \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"x-insert-key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -d '[ 5 { 6 \"eventType\": \"LoginEvent\", 7 \"service\": \"login-service\", 8 \"customerId\": \"xyz\" 9 } 10 ]' Copy Step 6 of 6 Log API If our existing logging integrations don’t meet your needs, you can use our Log API to send any arbitrary log data to New Relic. (Eventually, the Telemetry SDKs will support the Log API.) 1 curl -i -X POST https://log-api.newrelic.com/log/v1 \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"Api-Key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -d '[ 5 \"logs\": [ 6 { 7 \"timestamp\": 1593538496000, 8 \"message\": \"User xyz logged in\", 9 \"service\": \"login-service\", 10 \"hostname\": \"login.example.com\" 11 } 12 ] 13 ]' Copy", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 131.31607, + "_score": 54.783596, "_version": null, "_explanation": null, "sort": null, "highlight": { - "tags": "New Relic One apps", - "body": ". They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet" + "sections": "Agent APIs", + "info": "Open source emitters. APIs. New Relic agents. Get data from anywhere. ", + "tags": "Agent API", + "body": " agents to report data, you can use their associated APIs to report custom data. For example, if you monitor your application with the our APM Python agent, you can use the Python agent API to set up custom instrumentation. See the agent APIs. Step 2 of 6 Telemetry SDK Our Telemetry SDKs are language" }, - "id": "5efa989e28ccbc4071307de5" + "id": "5efa997128ccbc3c9a307dfd" }, { - "image": "", - "url": "https://developer.newrelic.com/components/platform-state-context/", + "category_2": "Logs in context with agent APIs", + "nodeid": 36921, "sections": [ - "PlatformStateContext", - "Usage", - "Props" + "Enable log management", + "New Relic Logs", + "Enable log monitoring", + "Configure logs in context", + "Logs in context for Go", + "Logs in context for Java", + "Logs in context for .NET", + "Logs in context for Node.js", + "Logs in context for PHP", + "Logs in context for Python", + "Logs in context for Ruby", + "Logs in context with agent APIs", + "Annotate logs for logs in context using APM agent APIs", + "APM agent trace metadata and linking metadata APIs", + "Resources for correctly annotating logs", + "For more help" ], - "published_at": "2020-09-24T02:30:05Z", - "title": "PlatformStateContext", - "updated_at": "2020-08-01T01:47:08Z", - "type": "developer", - "external_id": "aa6b86b3dc0dcd7cd758b20655318b108875cce7", + "title": "Annotate logs for logs in context using APM agent APIs", + "category_0": "Log management", + "type": "docs", + "category_1": "Enable log management", + "external_id": "9d737d9f02561f18b47103b62ce11ada3dfae106", + "image": "", + "url": "https://docs.newrelic.com/docs/logs/enable-log-management-new-relic/logs-context-agent-apis/annotate-logs-logs-context-using-apm-agent-apis", + "published_at": "2020-09-24T12:35:13Z", + "updated_at": "2020-08-15T03:15:39Z", + "breadcrumb": "Contents / Log management / Enable log management / Logs in context with agent APIs", "document_type": "page", "popularity": 1, - "info": "A PlatformStateContext component!", - "body": "PlatformStateContext Usage Copy Props There are no props for this component.", + "info": "New Relic's log management: How to use APM agent APIs to manually set up your own logs in context solution. ", + "body": "If you use log management and APM, you can configure logs in context to correlate log data with other New Relic features. If you use a logging framework not covered by our existing logs in context solutions, we provide a way for you to configure your logging libraries to achieve annotated logs necessary for logs in context. APM agent trace metadata and linking metadata APIs To get properly annotated logs for logs in context, use APM agent API calls (listed below). These APIs pass metadata required for linking log data to other New Relic data. This metadata is referred to as trace metadata and linking metadata. For tips on using these, see Resources for correct annotation. APM agent APIs: Go agent APIs: GetTraceMetadata GetLinkingMetadata Java agent APIs: getTraceMetadata getLinkingMetadata .NET agent APIs: TraceMetadata GetLinkingMetadata Node.js agent APIs: getTraceMetadata getLinkingMetadata PHP agent APIs: GetTraceMetadata GetLinkingMetadata Python agent API: get_linking_metadata Ruby agent APIs: linking_metadata current_trace_id current_span_id Resources for correctly annotating logs For more information on using the trace metadata and linking metadata APIs to annotate logs for logs in context, see the following resources: Review the APM agent specifications for getting properly formatted annotated logs for logs in context functionality, which include the required fields and properly formatted output. View the source code for our own logs in context extensions to see how we use these APIs: Go: Logrus extension Java: Log4j2 extension .NET: Serilog extension Node.js: Winston extension Python: see Python agent logging configuration PHP: Monolog extension Ruby: Logging extension For more help", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 102.84624, + "_score": 52.776237, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "PlatformStateContext", - "sections": "PlatformStateContext", - "info": "A PlatformStateContext component!", - "body": "PlatformStateContext Usage Copy Props There are no props for this component." + "title": "Annotate logs for logs in context using APM agent APIs", + "sections": "Logs in context with agent APIs", + "info": "New Relic's log management: How to use APM agent APIs to manually set up your own logs in context solution. ", + "category_2": "Logs in context with agent APIs", + "body": " necessary for logs in context. APM agent trace metadata and linking metadata APIs To get properly annotated logs for logs in context, use APM agent API calls (listed below). These APIs pass metadata required for linking log data to other New Relic data. This metadata is referred to as trace metadata", + "breadcrumb": "Contents / Log management / Enable log management / Logs in context with agent APIs" }, - "id": "5efa997128ccbccc6f307dc0" + "id": "5f37535c196a67c8c055e5ff" + } + ], + "/collect-data/custom-attributes": [ + { + "image": "", + "url": "https://developer.newrelic.com/collect-data/", + "sections": [ + "Collect data", + "Guides to collect data", + "Add custom attributes", + "Create custom events", + "Collect data - any source", + "Build queries with NerdGraph", + "Query data with NRQL" + ], + "published_at": "2020-09-25T01:51:37Z", + "title": "Collect data", + "updated_at": "2020-09-25T01:51:37Z", + "type": "developer", + "external_id": "fb5d6f75b61858b09e3e8c63f3b2af97813f47b6", + "document_type": "page", + "popularity": 1, + "body": "Collect data Through our opensource agents or APIs, New Relic makes it easy to collect data from any source. The guides in this section provide strategies for collecting and querying data for use in your existing implementation, or in apps you build. The opportunities are endless. Guides to collect data   Add custom attributes Use custom attributes for deeper analysis 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 15 min Collect data - any source APIs, agents, OS emitters - get any data 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 10 min Query data with NRQL Query default data, custom events, and attributes", + "info": "", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 154.15201, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "sections": "Add custom attributes", + "body": " data   Add custom attributes Use custom attributes for deeper analysis 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 15 min Collect data - any source APIs, agents, OS emitters - get any data 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 10 min Query data with NRQL Query default data, custom events, and attributes" + }, + "id": "5efa997328ccbc768c307de2" + }, + { + "category_2": "Get started", + "nodeid": 11431, + "sections": [ + "NRQL: New Relic Query Language", + "Get started", + "NRQL query tools", + "NRQL query tutorials", + "Introduction to NRQL, New Relic's query language", + "What is NRQL?", + "Where can you use NRQL?", + "What data can you query with NRQL?", + "Start using NRQL", + "NRQL query examples", + "NRQL syntax", + "For more help" + ], + "title": "Introduction to NRQL, New Relic's query language", + "category_0": "Query your data", + "type": "docs", + "category_1": "NRQL: New Relic Query Language", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", + "external_id": "d44be2c7df7addda8679b4c842015223cfcbd1a3", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-view-chart-nrql-query_0.png", + "url": "https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", + "published_at": "2020-09-24T08:40:21Z", + "updated_at": "2020-09-24T08:40:20Z", + "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started", + "document_type": "page", + "popularity": 1, + "info": "An introduction to New Relic Query Language (NRQL) and how to use it.", + "body": "One way to query your New Relic data is with the New Relic Query Language (NRQL). This resource explains what NRQL is, when and how you can use it, and basic syntax rules. For more detailed information on querying, including a listing of clauses and functions and example queries, see NRQL syntax, clauses, and functions. What is NRQL? NRQL is New Relic's SQL-like query language. You can use NRQL to retrieve detailed New Relic data and get insight into your applications, hosts, and business-important activity. Reasons to use NRQL include: To answer a question for the purpose of troubleshooting or business analysis To create a new chart To make API queries of New Relic data (for example, using our NerdGraph API) NRQL is used behind the scenes to generate some New Relic charts: Some New Relic charts are built using NRQL. One way to start using NRQL is to view a chart's query and then edit it to make your own custom chart. Where can you use NRQL? You can use NRQL in these places: New Relic One query builder: Advanced mode is a NRQL query interface Basic mode provides a simplified query experience that doesn't require knowledge of NRQL but that uses NRQL to generate results New Relic Insights NerdGraph: our GraphQL-format API, which includes options for making NRQL queries one.newrelic.com > Query your data: You can run a NRQL query in both New Relic One and New Relic Insights. This NRQL query shows a count of distributed tracing spans faceted by their entity names. NRQL is one of several ways to query New Relic data. For more on all query options, see Query your data. What data can you query with NRQL? NRQL allows you to query these New Relic data types: Event data from all New Relic products, including: APM events, like Transaction New Relic Browser events, like PageView New Relic Mobile events, like Mobile Infrastructure events, like ProcessSample Synthetics events, like SyntheticCheck Custom events, like those reported by the Event API Metric timeslice data (metrics reported by New Relic APM, Browser, and Mobile) The Metric data type (metrics reported by the Metric API and data sources that use that API) The Span data type (distributed tracing data) The Log data type (data from New Relic Logs) Some data, like relationships between monitored entities, is not available via NRQL but is available using our NerdGraph API. Start using NRQL One way to start using NRQL and to understand what data you have available is to go to a NRQL interface (for example, the New Relic One query builder), type FROM, and press space. The interface will suggest available types of data: To see the attributes available for a specific data type, type FROM DATA_TYPE SELECT and press space. The interface will suggest available attributes. For example: To see the complete JSON associated with a data type, including all of its attributes, use the keyset() attribute. For example: FROM Transaction SELECT keyset() NRQL is used behind the scenes to build some New Relic charts and dashboards. One way to learn NRQL is to find one of these NRQL-generated charts and start playing with the NRQL to create new, customized queries and charts: Charts built with NRQL will have View query as an option. You can then edit and customize that query to see how your changes affect the resulting visualization. To explore your data without having to use NRQL, use the basic mode of New Relic One query builder. NRQL query examples Here's an example NRQL query of Transaction data, which is reported by New Relic APM. FROM Transaction SELECT average(duration) FACET appName TIMESERIES auto This would generate a chart that looks like: Here are some more query examples: Basic NRQL query of Browser data Here's a NRQL query of PageView data, which is reported by New Relic Browser. SELECT uniqueCount(user) FROM PageView WHERE userAgentOS = 'Mac' FACET countryCode SINCE 1 day ago LIMIT 20 Attribute name with a space in it If a custom attribute name has a space in it, use backticks around the attribute name: SELECT count(*) FROM Transaction FACET `Logged-in user` Querying multiple data sources To return data from two data sources, separate their data types with a comma. For example, this query returns a count of all APM transactions and Browser events over the last three days:​ SELECT count(*) FROM Transaction, PageView SINCE 3 days ago Query returning multiple columns To return multiple columns from a dataset, separate the aggregator arguments with a comma: SELECT function(attribute), function(attribute) ... FROM ... This query returns the minimum, average, and maximum duration for New Relic Browser PageView events over the last week: SELECT min(duration), max(duration), average(duration) FROM PageView SINCE 1 week ago See more NRQL query examples. NRQL syntax The syntax of a NRQL query is similar to standard SQL queries. Here is a breakdown of the structure of a NRQL query: SELECT function(attribute) [AS 'label'][, ...] FROM data type [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] Basic rules include: NRQL condition Details Required values The SELECT statement and FROM clause are required. All other clauses are optional. You can start your query with either SELECT or FROM. Query string size The query string must be less than 4 KB. Case sensitivity The data type names and attribute names are case sensitive. NRQL clauses and functions are not case sensitive. Syntax for strings NRQL uses single quotes to designate strings. For example: ... where traceId = '030a573f0df02c57' Attribute names with spaces Use backticks `` to quote a custom attribute name that has a space in it. For example: ... FACET `Logged-in user` Data type coercion Insights does not support data type \"coercion.\" For more information, see Data type conversion. Use of math functions Basic and advanced math functions are supported in the SELECT statement. JOIN functions NRQL does not have the equivalent of the SQL JOIN function, but you can simulate a JOIN with custom attributes. Read more about NRQL syntax and functions. 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.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 101.55498, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "Introduction to NRQL, New Relic's query language", + "sections": "NRQL: New Relic Query Language", + "info": "An introduction to New Relic Query Language (NRQL) and how to use it.", + "category_1": "NRQL: New Relic Query Language", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", + "body": " in the SELECT statement. JOIN functions NRQL does not have the equivalent of the SQL JOIN function, but you can simulate a JOIN with custom attributes. Read more about NRQL syntax and functions. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub", + "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started" + }, + "id": "5f2abd47196a67747343fbe1" + }, + { + "category_2": "Custom events", + "nodeid": 6256, + "sections": [ + "Event data sources", + "Default events", + "Custom events", + "APM: Report custom events", + "Data considerations", + "Record a custom event", + "Timestamps", + "Limits and restricted characters", + "Reserved words", + "For more help" + ], + "title": "APM: Report custom events", + "category_0": "Insights", + "type": "docs", + "category_1": "Event data sources", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/event-data-sources/custom-events/apm-report-custom-events", + "external_id": "0c3f09d0d0e04ad50bedcdf7088eed7c171001d8", + "image": "", + "url": "https://docs.newrelic.com/docs/insights/event-data-sources/custom-events/apm-report-custom-events", + "published_at": "2020-09-24T07:10:11Z", + "updated_at": "2020-09-24T07:10:11Z", + "breadcrumb": "Contents / Insights / Event data sources / Custom events", + "document_type": "page", + "popularity": 1, + "info": "New Relic APM: how to report custom events and attributes.", + "body": "If you have 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 833 custom events every 5 seconds. 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.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 100.3531, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "APM: Report custom events", + "sections": "Custom events", + "info": "New Relic APM: how to report custom events and attributes.", + "category_2": "Custom events", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/event-data-sources/custom-events/apm-report-custom-events", + "body": "If you have 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", + "breadcrumb": "Contents / Insights / Event data sources / Custom events" + }, + "id": "5f480a5a64441f578bfdcdb1" + }, + { + "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png", + "url": "https://developer.newrelic.com/", + "sections": [ + "Mark your calendar for Nerd Days 1.0", + "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" + ], + "published_at": "2020-09-25T01:41:27Z", + "title": "New Relic Developers", + "updated_at": "2020-09-25T01:37:24Z", + "type": "developer", + "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab", + "document_type": "page", + "popularity": 1, + "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 18 Days : 14 Hours : 58 Minutes : 41 Seconds Register 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 20 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", + "info": "", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 97.4762, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "sections": "Add custom attributes", + "body": " custom attributes Use custom attributes for deeper analysis Show 20 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" + }, + "id": "5d6fe49a64441f8d6100a50f" + }, + { + "category_2": "Custom events", + "nodeid": 13661, + "sections": [ + "Event data sources", + "Default events", + "Custom events", + "Data requirements and limits for custom event data", + "General requirements", + "Reserved words", + "Additional Browser PageAction requirements", + "Additional Event API requirements", + "Event type limits", + "For more help" + ], + "title": "Data requirements and limits for custom event data", + "category_0": "Insights", + "type": "docs", + "category_1": "Event data sources", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", + "external_id": "f5beef0d09bb5918be3f8a1a3ece98c09947cd1e", + "image": "", + "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", + "published_at": "2020-09-24T07:25:32Z", + "updated_at": "2020-09-20T19:39:10Z", + "breadcrumb": "Contents / Insights / Event data sources / Custom events", + "document_type": "page", + "popularity": 1, + "info": "For New Relic, general limits and requirements for reporting custom events and attributes. ", + "body": "You can report custom events to New Relic in several ways, including the New Relic Event API, APM agent APIs, Browser agent APIs, and the Mobile SDK. This document contains general requirements and rules for inserting and using custom events and their associated attributes. Additional requirements may apply based on the method you use. General requirements How long custom data is retained depends on your Insights subscription and its associated data retention. When reporting custom events and attributes, follow these general requirements for supported data types, naming syntax, and size: Requirement Description Payload Total maximum size or length: 1 MB maximum per POST. We highly recommend using compression. The Event API has additional HTTP rate limits. Attribute data types Attribute values can be either a string or a numeric integer or float. If your attribute values contain date information, define it as an unformatted Unix timestamp (in seconds or milliseconds) by using the Insights data formatter. Attribute size Maximum name size: 255 bytes. Maximum attribute value size: Custom attributes sent by the agent: 255 bytes Attributes attached to custom events sent using the Event API: 4096 characters Charts may only display the first 255 characters of attribute values. For complete attribute values, use the JSON chart type or Query API. Maximum total attributes per event: 254. Exception: If you use an APM agent API, the max is 64. Maximum total attributes per event type: 48,000. Naming syntax Attribute names can be a combination of alphanumeric characters, colons (:), periods (.), and underscores (_). Event types (using the eventType attribute) can be a combination of alphanumeric characters, colons (:), and underscores (_). Do not use words reserved for use by NRQL. Null values The database does not store any data with a null value. Reserved words Avoid using the following reserved words as names for events and attributes. Otherwise, unexpected results may occur. This is not a complete list. In general, it's a good practice to avoid using MySQL-reserved words to avoid collision with future New Relic functionality. Keyword Description accountId This is a reserved attribute name. If it's included, it will be dropped during ingest. appId Value must be an integer. If it is not an integer, the attribute name and value will be dropped during ingest. eventType The event type as stored in New Relic. New Relic agents and scripts normally report this as eventType. Can be a combination of alphanumeric characters, colons (:), and underscores (_). Be sure to review the prohibited eventType values and eventType limits. Prohibited eventType values For your eventType value, avoid using: Metric, MetricRaw, and strings prefixed with Metric[0-9] (such as Metric2 or Metric1Minute). Public_ and strings prefixed with Public_. These event types are reserved for use by New Relic. Events passed in with these eventType values will be dropped. timestamp Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds. It must be +/-1 day (24 hours) of the current time on the server. Log forwarding terms The following keys are reserved by the Infrastructure agent's log forwarding feature: entity.guid, log, hostname, plugin.type, fb.input. If used, they are dropped during ingest and a warning is added to the logs. NRQL syntax terms If you need to use NRQL syntax terms as attribute names, including dotted attributes, they must be enclosed in backticks; for example, `LIMIT` or `consumer.offset`. Otherwise, avoid using these reserved words: ago, and, as, auto, begin, begintime, compare, day, days, end, endtime, explain, facet, from, hour, hours, in, is, like, limit, minute, minutes, month, months, not, null, offset, or, raw, second, seconds, select, since, timeseries, until, week, weeks, where, with Additional Browser PageAction requirements For additional requirements for using New Relic Browser's custom PageAction event, see Insert custom data via New Relic Browser agent. Additional Event API requirements For more requirements and details for the Event API, see Event API. Event type limits The current limit for total number of eventType values is 250 per sub-account in a given 24-hour time period. If a user exceeds this limit, New Relic may filter or drop data. Event types include: Default events from New Relic agents Custom events from New Relic agents Custom events from Insights custom event inserter 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.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 85.18817, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "Data requirements and limits for custom event data", + "sections": "Custom events", + "info": "For New Relic, general limits and requirements for reporting custom events and attributes. ", + "category_2": "Custom events", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", + "body": "You can report custom events to New Relic in several ways, including the New Relic Event API, APM agent APIs, Browser agent APIs, and the Mobile SDK. This document contains general requirements and rules for inserting and using custom events and their associated attributes. Additional requirements", + "breadcrumb": "Contents / Insights / Event data sources / Custom events" + }, + "id": "59f4354f4bb81c2ea8b80d0a" } ], "/automate-workflows/get-started-terraform": [ @@ -1314,7 +1719,7 @@ "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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 93.32839, + "_score": 89.25568, "_version": null, "_explanation": null, "sort": null, @@ -1350,7 +1755,7 @@ "external_id": "0bec265edc6b4792a80c5a5810e624d5545fbc4e", "image": "", "url": "https://docs.newrelic.com/docs/new-relic-solutions/new-relic-solutions/measure-devops-success/incident-orchestration-align-teams-tools-processes", - "published_at": "2020-09-24T08:12:24Z", + "published_at": "2020-09-25T10:34:11Z", "updated_at": "2020-09-10T10:39:42Z", "breadcrumb": "Contents / New Relic solutions / New Relic solutions / Measure DevOps success", "document_type": "page", @@ -1359,7 +1764,7 @@ "body": "Incident orchestration is the alignment of teams, tools, and processes to prepare for incidents and outages in your software. The goal is to provide your teams a predictable framework and process to: Maximize efficiency in communication and effort. Minimize the overall impact to your business. Prerequisites Before starting this tutorial, be sure to complete these New Relic tutorials: Establish team dashboards Set up proactive alerting 1. Assign first responders to team dashboards Recommendation: For each team dashboard, make sure: It has an owner who assumes responsibility for the health of the applications and features it monitors. There is no ambiguity about who is responsible for attending to and resolving an alert condition. This policy will vary between organizations depending on size, structure, and culture. For example, some teams may prefer to assign dashboards and alerts based on de-facto features or application ownership. Other teams may prefer to adopt an on-call rotation (often referred to as \"pager duty\"). In on-call rotations, designated team members handle all first-line incident responses, and they resolve or delegate responsibilities based on predetermined incident thresholds. 2. Determine incident thresholds for alert conditions For each of your applications: Identify the thresholds for what is officially considered an incident. As you create alert policies with New Relic Alerts, make sure each set of threshold criteria is context-dependent. Document incident evaluation and known remediation procedures in runbooks. Include links to your runbooks when you define conditions and thresholds for your alert policies. For instance, a certain alert condition may be dismissable during low-traffic periods but require active remediation during peak hours. 3. Ensure alerts have auditable notification channels Recommendation: Make sure that communications during critical incidents take place in easily accessible and highly visible channels. A group chat room dedicated to incident communication is usually a great choice. This allows all stakeholders to participate or observe and provides a chronology of notifications, key decisions, and actions for postmortem analysis. Use any of the available notification channels in New Relic Alerts. For example, to set up a notification channel in Slack: Make sure your organization has completed New Relic's integration requirements with Slack. In the Slack app, select the dropdown in the top-left corner of the app, and select Customize Slack. Click Configure apps. From the list of app integrations, select New Relic. Expand the instructions for New Relic Alerts, and follow the steps to configure notifications from New Relic. 4. Automate triage and resolution steps Automation of simple or repeatable incident response tasks will increase efficiency and minimize the impact of incidents. With proper automation in place, you can disable or isolate faulty application components as soon as an alert threshold is reached, rather than after a notification has been issued. For example, a team managing an application for a digital media company wants to be able to remove commenting abilities from the website if the system has errors. In this case, they could: Add an endpoint to their front-end web application that will toggle a feature flag enabling or disabling the UI components associated with posting comments on an article. Create an alert policy with a threshold set on the sustained error rate in the commenting service. Assign a webhook notification channel that will send a POST request to this endpoint, as well as to the standard team notification channels. In this scenario, errors in the commenting system will trigger the webhook and remove the commenting UI from the website. Users can still use core functionality of the site without seeing errors generated by the commenting service. The application will maintain a stable but degraded state, allowing the team to focus on recovery without the pressure of preventing users from accessing the site. You can also use webhooks to create issues and action items in ticketing systems that have REST APIs, such as Zendesk. Use New Relic Alerts to create a webhook notification channel, and customize the webhook payload as needed. New Relic also provides integrations for some common ticketing systems. You can use any of the available integrations to file tickets from New Relic APM. For more help", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 92.66859, + "_score": 87.36634, "_version": null, "_explanation": null, "sort": null, @@ -1405,7 +1810,7 @@ "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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 89.96606, + "_score": 86.0399, "_version": null, "_explanation": null, "sort": null, @@ -1458,7 +1863,7 @@ "body": "You can use alerts to set up notification channels, and attach those channels to policies. Your selected channels provide fast and consistent ways for the right personnel to be notified about incidents. For example, notifications allow you to include charts about the incident to provide context and share them with your team. Alerts offers several notification channels, including webhooks, Slack rooms, email, and more. You'll be notified by your notification channels when incidents are opened, acknowledged, or closed. This document explains the available notification channels and how to set them up. This document is about alerts notifications. For general information about unsubscribing from other New Relic emails, including marketing emails, weekly reports, and announcements, see Unsubscribe from New Relic emails. View notification channels To see all notification channels in your account: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Add or remove notification channels To set up a new notification channel: On the Notification channels, click New notification channel. Select the type of channel and complete other required steps for it. To add or remove a notification policy or channel: Select a specific notification channel, select Alert policies, and add or remove a policy. OR Select a specific policy, select Notification channels, and add or remove a channel. Instructions for specific notification channels These are the available notification channel types. User For your convenience, we automatically load all users and their email addresses for the selected account. If your account has one or more sub-accounts, the notification channel includes only users for the currently selected master or sub-account. Use the User notification channel to select existing account team members and admins. To view the Users list or to add users to alert policies: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. A user channel also sends push notifications to any of the user's registered mobile devices. A device is registered if the user has logged into New Relic using the mobile app on the device. Email We automatically add every individual and their email address on the selected account to the User notification channel and you can select them there. You don't need to add existing New Relic accounts to the Email channel. To add an email channel for other users, follow these guidelines: Field Description Email (required) In general, use the Email notification channel to identify user emails or email aliases that are not already on the selected account. For example, if you have a dev-ops@company.com email alias for your DevOps team, add the email alias to the Email channel. Otherwise, use the User notification channel to select specific users on your DevOps team. For easier maintenance, add a single non-user email address or alias to a single alert notification channel. If you want to use the email channel for more than one email, create an email group or alias outside your account. These email addresses can be the same as or different from email addresses already on your account. Users can unsubscribe from general (non-alerts-related) emails, but they cannot unsubscribe from alerts email notifications. Instead, the account Owner, Admin, or add-on manager must remove users from the policy's email notification channel. Include JSON attachment (optional) To include a JSON attachment with the email notification, select this checkbox. OpsGenie You must have an existing OpsGenie account integrated with New Relic in order to provide the following information: Field Description Channel name (required) A meaningful name for the OpsGenie notification channel (maximum 64 characters). API key (required) The API key generated from your OpsGenie integration used to authenticate API requests. Teams (optional) List of team names that are responsible for the alert. OpsGenie runs team escalation policies to calculate which users will receive notifications. Tags (optional) A comma-separated list of labels attached to the alert. To overwrite the OpsGenie Quiet Hours setting for urgent alerts, add an OverwriteQuietHours tag. Recipients (optional) One or more names of users, groups, on-call schedules, escalation policies, etc., that OpsGenie uses to calculate where to send notifications. PagerDuty You must have an existing PagerDuty account in order to provide the following information: Field Description Service name (required) The name of your service integrating with PagerDuty for notifications. Integration key (required) The unique service identifier used by PagerDuty's Integration API to trigger, acknowledge, and resolve incidents for the service. Slack Before adding Slack notifications, you must create a unique webhook integration using Slack's New Relic integration. If you want web, transaction, server, and mobile alerts to be posted in separate channels, you must set up separate integrations for each one. Field Description Channel name (required) A meaningful name for the Slack notification channel (maximum 64 characters); for example, Network Ops Center. URL (required) Copy and paste the New Relic webhook integration URL that you've set up with Slack. For example: https://hooks.slack.com/services/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 Be sure to include https:// in the URL. Do not use http://. Team channel (optional) If used, include # before the name of the Slack channel where alert notifications are sent; for example, #NOC. VictorOps You must have an existing VictorOps account in order to provide the following required information: Field Description Channel name (required) A meaningful name for this notification channel (maximum 64 characters). For example, if the VictorOps Route key is for your Technical Support team, you could name this channel Tech Support - VictorOps. Key (required) VictorOps generates a unique key for each account. It maps the VictorOps account to its associated integrations. Route key (optional) This key maps the alert or incident to a specific team. Webhook Webhooks are HTTP POST messages containing JSON documents delivered to a destination URL. When an incident is opened, acknowledged, or closed, our webhook feature sends a message to your URL with any relevant information, such as a description of the event and a link back to New Relic. You also have the option to customize the payload in the POST message for further integration into your system. If your endpoint does not acknowledge the POST request within 10 seconds, the Alerts UI may indicate a failed notification event for the related incident. Before adding webhook notifications, you must have an endpoint set up to respond with a status code between 200 and 206 after receiving the following required information: Field Description Channel name (required) A meaningful name for the webhook (maximum 64 characters). Base url (required) The endpoint that will receive the POST message and trigger customized behaviors in your system. If you want to include a port number in the webhook URL, make sure the port is available for requests. Otherwise the webhook will not work. Basic auth (optional) To require basic authentication for the webhook, select Add basic auth, and provide the user name and password to authenticate the webhook. Custom headers (optional) To include headers with webhooks, select Add custom headers, and provide the name and value for each header. Use custom payload (optional) To use the default values, leave blank. To view and edit the default values, select Add custom payload. Payload (for custom payloads only) Your customized POST message code. This field includes: A list of variables you can use Syntax highlighting, based on payload type Payload type (for custom payloads only) Specify the message format: JSON (default) or Form. xMatters You must have an existing xMatters account in order to provide the following information: Field Description Channel name (required) Name your channel so you can identify it easily when associating it with a policy. Integration url (required) The unique integration url provided by xMatters pointing to your xMatters account. Receive mobile push notifications In order to receive mobile push notifications, your device must be registered and listed in (account) > User preferences. If the device is not listed in User preferences, log out of the app, log back in, and check again to see if it is listed. To receive mobile push notifications: Log in to your New Relic account via the mobile app at least once to ensure the device is registered. Add the user channel to the alert policy. Switch push notifications On for the device. Acknowledge alert notifications Anyone in your account can acknowledge notifications through the user interface or email notification. Acknowledging an incident in New Relic also acknowledges any associated incident in PagerDuty. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 88.443146, + "_score": 84.524506, "_version": null, "_explanation": null, "sort": null, @@ -1507,7 +1912,7 @@ "body": "If you delete a channel, you cannot restore it. If you want to keep the notification channel, you can remove it from any associated policy. Delete a channel To delete a channel permanently: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Optional: To find the notification channel easily, search the Notification channels index. From the Notification channels index, select the channel's delete icon, and then select the confirmation prompt to cancel or continue. When you delete (or remove) a channel, any policies associated with it will still remain. You must delete policies separately. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 80.79283, + "_score": 77.214836, "_version": null, "_explanation": null, "sort": null, @@ -1521,45 +1926,210 @@ "id": "5f2dbb3628ccbc65c788dfcb" } ], - "/collect-data/custom-attributes": [ + "/build-apps/add-nerdgraphquery-guide": [ { "image": "", - "url": "https://developer.newrelic.com/collect-data/", + "url": "https://developer.newrelic.com/build-apps/", "sections": [ - "Collect data", - "Guides to collect data", - "Add custom attributes", - "Collect data - any source", - "Build queries with NerdGraph", - "Create custom events", - "Query data with NRQL" + "Build apps", + "Guides to build apps", + "Create a \"Hello, World!\" application", + "Permissions for managing applications", + "Set up your development environment", + "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", + "Publish and deploy apps" ], - "published_at": "2020-09-24T02:30:06Z", - "title": "Collect data", - "updated_at": "2020-09-24T01:56:25Z", + "published_at": "2020-09-25T01:49:59Z", + "title": "Build apps", + "updated_at": "2020-09-25T01:49:59Z", "type": "developer", - "external_id": "fb5d6f75b61858b09e3e8c63f3b2af97813f47b6", + "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", "document_type": "page", "popularity": 1, - "body": "Collect data Through our opensource agents or APIs, New Relic makes it easy to collect data from any source. The guides in this section provide strategies for collecting and querying data for use in your existing implementation, or in apps you build. The opportunities are endless. Guides to collect data   Add custom attributes Use custom attributes for deeper analysis 15 min Collect data - any source APIs, agents, OS emitters - get any data 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 10 min Query data with NRQL Query default data, custom events, and attributes", + "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   Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 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 30 min Publish and deploy apps Start sharing the apps you build", "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 163.577, + "_score": 767.5021, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Add custom attributes", - "body": " data   Add custom attributes Use custom attributes for deeper analysis 15 min Collect data - any source APIs, agents, OS emitters - get any data 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 10 min Query data with NRQL Query default data, custom events, and attributes" + "title": "Build apps", + "sections": "Add the NerdGraphQuery component to an application", + "body": ". 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" }, - "id": "5efa997328ccbc768c307de2" + "id": "5efa999d64441fc0f75f7e21" }, { - "category_2": "Get started", - "nodeid": 11431, "sections": [ - "NRQL: New Relic Query Language", + "Map page views by region in a custom app", + "Before you begin", + "New Relic terminology", + "Build a custom app with a table chart", + "Query your browser data", + "Create and serve a new Nerdpack", + "Review your app files and view your app locally", + "Hard code your account ID", + "Import the TableChart component", + "Add a table with a single row", + "Customize the look of your table (optional)", + "Get your data into that table", + "Make your app interactive with a text field", + "Import the TextField component", + "Add a row for your text field", + "Build the text field object", + "Get your data on a map", + "Install Leaflet", + "Add a webpack config file for Leaflet", + "Import modules from Leaflet", + "Import additional modules from New Relic One", + "Get data for the map", + "Customize the map marker colors", + "Set your map's default center point", + "Add a row for your map", + "Replace \"Hello\" with the Leaflet code" + ], + "title": "Map page views by region in a custom app", + "type": "developer", + "tags": [ + "custom app", + "map", + "page views", + "region", + "nerdpack" + ], + "external_id": "6ff5d696556512bb8d8b33fb31732f22bab455cb", + "image": "https://developer.newrelic.com/static/d87a72e8ee14c52fdfcb91895567d268/0086b/pageview.png", + "url": "https://developer.newrelic.com/build-apps/map-pageviews-by-region/", + "published_at": "2020-09-25T01:51:37Z", + "updated_at": "2020-09-17T01:48:42Z", + "document_type": "page", + "popularity": 1, + "info": "Build a New Relic app showing page view data on a world map.", + "body": "Map page views by region in a custom app 30 min New Relic has powerful and flexible tools for building custom apps and populating them with data. This guide shows you how to build a custom app and populate it with page view data using New Relic's Query Language (NRQL - pronounced 'nurkle'). Then you make your data interactive. And last, if you have a little more time and want to install a third-party React library, you can display the page view data you collect on a map of the world. In this guide, you build an app to display page view data in two ways: In a table On a map Please review the Before you begin section to make sure you have everything you need and don't get stuck halfway through. Before you begin In order to get the most out of this guide, you must have: A New Relic developer account, API key, and the command-line tool. If you don't have these yet, see the steps in Setting up your development environment New Relic Browser page view data to populate the app. Without this data, you won't be able to complete this guide. To add your data to a world map in the second half of the guide: npm, which you'll use during this section of the guide to install Leaflet, a third-party JavaScript React library used to build interactive maps. If you're new to React and npm, you can go here to install Node.js and npm. New Relic terminology The following are some terms used in this guide: New Relic application: The finished product where data is rendered in New Relic One. This might look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One that launches your application. Nerdlets: New Relic React components used to build your application. The three default files are index.js, nr1.json, and styles.scss, but you can customize and add your own. Build a custom app with a table chart Step 1 of 8 Query your browser data Use Query builder to write a NRQL query to see your page view data, as follows. On New Relic One, select Query your data (in the top right corner). That puts you in NRQL mode. You'll use NRQL to test your query before dropping the data into your table. Copy and paste this query into a clear query field, and then select Run. FROM PageView SELECT count(*), average(duration) WHERE appName = 'WebPortal' FACET countryCode, regionCode SINCE 1 week ago LIMIT 1000 Copy If you have PageView data, this query shows a week of average page views broken down by country and limited to a thousand items. The table will be full width and use the \"chart\" class defined in the CSS. If you don't have any results at this point, ensure your query doesn't have any errors. If your query is correct, you might not have the Browser agent installed. Step 2 of 8 Create and serve a new Nerdpack To get started, create a new Nerdpack, and serve it up to New Relic from your local development environment: Create a new Nerdpack for this app: nr1 create --type nerdpack --name pageviews-app Copy Serve the project up to New Relic: cd pageviews-app && nr1 nerdpack:serve Copy Step 3 of 8 Review your app files and view your app locally Navigate to your pageviews-app to see how it's structured. It contains a launcher folder, where you can customize the description and icon that will be displayed on the app's launcher in New Relic One. It also contains nerdlets, which each contain three default files: index.js, nr1.json, and styles.scss. You'll edit some of these files as part of this guide. For more information, see Nerdpack file structure. Now in your browser, open https://one.newrelic.com/?nerdpacks=local, and then click Apps to see the pageview-apps Nerdpack that you served up. When you select the launcher, you see a Hello message. Step 4 of 8 Hard code your account ID For the purposes of this exercise and for your convenience, hard code your account ID. In the pageview-app-nerdlet directory, in the index.js file, add this code between the import and export lines. (Read about finding your account ID here). const accountId = [Replace with your account ID]; Copy Step 5 of 8 Import the TableChart component To show your data in a table chart, import the TableChart component from New Relic One. To do so, in index.js, add this code under import React. import { TableChart } from 'nr1'; Copy Step 6 of 8 Add a table with a single row To add a table with a single row, in the index.js file, replace this line: return

Hello, pageview-app-nerdlet Nerdlet!

; Copy with this export code: export default class PageViewApp extends React.Component { render() { return (
); } } Copy Step 7 of 8 Customize the look of your table (optional) You can use standard CSS to customize the look of your components. In the styles.scss file, add this CSS. Feel free to customize this CSS to your taste. .container { width: 100%; height: 99vh; display: flex; flex-direction: column; .row { margin: 10px; display: flex; flex-direction: row; } .chart { height: 250px; } } Copy Step 8 of 8 Get your data into that table Now that you've got a table, you can drop a TableChart populated with data from the NRQL query you wrote at the very beginning of this guide. Put this code into the row div. ; Copy Go to New Relic One and click your app to see your data in the table. (You might need to serve your app to New Relic again.) Congratulations! You made your app! Continue on to make it interactive and show your data on a map. Make your app interactive with a text field Once you confirm that data is getting to New Relic from your app, you can start customizing it and making it interactive. To do this, you add a text field to filter your data. Later, you use a third-party library called Leaflet to show that data on a world map. Step 1 of 3 Import the TextField component Like you did with the TableChart component, you need to import a TextField component from New Relic One. import { TextField } from 'nr1'; Copy Step 2 of 3 Add a row for your text field To add a text field filter above the table, put this code above the TableChart div. The text field will have a default value of \"US\".
{ this.setState({ countryCode: event.target.value }); }} />
; Copy Step 3 of 3 Build the text field object Above the render() function, add a constructor to build the text field object. constructor(props) { super(props); this.state = { countryCode: null } } Copy Then, add a constructor to your render() function. Above return, add: const { countryCode } = this.state; Copy Now add countryCode to your table chart query. ; Copy Reload your app to try out the text field. Get your data on a map To create the map, you use npm to install Leaflet. Step 1 of 9 Install Leaflet In your terminal, type: npm install --save leaflet react-leaflet Copy In your nerdlets styles.scss file, import the Leaflet CSS: @import `~leaflet/dist/leaflet.css`; Copy While you're in styles.scss, fix the width and height of your map: .containerMap { width: 100%; z-index: 0; height: 70vh; } Copy Step 2 of 9 Add a webpack config file for Leaflet Add a webpack configuration file .extended-webpackrc.js to the top-level folder in your nerdpack. This supports your use of map tiling information data from Leaflet. module.exports = { module: { rules: [ { test: /\\.(png|jpe?g|gif)$/, use: [ { loader: 'file-loader', options: {}, }, { loader: 'url-loader', options: { limit: 25000 }, }, ], }, ], }, }; Copy Step 3 of 9 Import modules from Leaflet In index.js, import modules from Leaflet. import { Map, CircleMarker, TileLayer } from 'react-leaflet'; Copy Step 4 of 9 Import additional modules from New Relic One You need several more modules from New Relic One to make the Leaflet map work well. Import them with this code: import { NerdGraphQuery, Spinner, Button, BlockText } from 'nr1'; Copy NerdGraphQuery lets you make multiple NRQL queries at once and is what will populate the map with data. Spinner adds a loading spinner. Button gives you button components. BlockText give you block text components. Step 5 of 9 Get data for the map Using latitude and longitude with country codes, you can put New Relic data on a map. mapData() { const { countryCode } = this.state; const query = `{ actor { account(id: 1606862) { mapData: nrql(query: \"SELECT count(*) as x, average(duration) as y, sum(asnLatitude)/count(*) as lat, sum(asnLongitude)/count(*) as lng FROM PageView FACET regionCode, countryCode WHERE appName = 'WebPortal' ${countryCode ? ` WHERE countryCode like '%${countryCode}%' ` : ''} LIMIT 1000 \") { results nrql } } } }`; return query; }; Copy Step 6 of 9 Customize the map marker colors Above the mapData function, add this code to customize the map marker colors. getMarkerColor(measure, apdexTarget = 1.7) { if (measure <= apdexTarget) { return '#11A600'; } else if (measure >= apdexTarget && measure <= apdexTarget * 4) { return '#FFD966'; } else { return '#BF0016'; } }; Copy Feel free to change the HTML color code values to your taste. In this example, #11A600 is green, #FFD966 is sort of yellow, and #BF0016 is red. Step 7 of 9 Set your map's default center point Set a default center point for your map using latitude and longitude. const defaultMapCenter = [10.5731, -7.5898]; Copy Step 8 of 9 Add a row for your map Between the text field row and the table chart row, insert a new row for the map content using NerdGraphQuery.
{({ loading, error, data }) => { if (loading) { return ; } if (error) { return 'Error'; } const { results } = data.actor.account.mapData; console.debug(results); return 'Hello'; }}
; Copy Reload your application in New Relic One to test that it works. Step 9 of 9 Replace \"Hello\" with the Leaflet code Replace return \"Hello\"; with: return ( {results.map((pt, i) => { const center = [pt.lat, pt.lng]; return ( { alert(JSON.stringify(pt)); }} /> ); })} ); Copy This code creates a world map centered on the latitude and longitude you chose using OpenStreetMap data and your marker colors. Reload your app to see the pageview data on the map!", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 455.7247, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "Map page views by region in a custom app", + "sections": "Query your browser data", + "info": "Build a New Relic app showing page view data on a world map.", + "tags": "custom app", + "body": " <Spinner fillContainer />; } if (error) { return 'Error'; } const { results } = data.actor.account.mapData; console.debug(results); return 'Hello'; }} </NerdGraphQuery> </div>; Copy Reload your application in New Relic One to test that it works. Step 9 of 9 Replace "Hello" with the Leaflet code Replace" + }, + "id": "5efa993c196a67066b766469" + }, + { + "category_2": "UI and data", + "nodeid": 38701, + "sections": [ + "Log management", + "Get started", + "Enable Logs", + "UI and data", + "Log API", + "Troubleshooting", + "Drop data with drop filter rules", + "Why it matters", + "How drop filter rules work", + "Create drop filter rules", + "Types of drop filter rules", + "Drop log events", + "Drop attributes", + "Cautions when dropping data", + "Delete drop filter rules", + "For more help" + ], + "title": "Drop data with drop filter rules ", + "category_0": "Log management", + "type": "docs", + "category_1": "Log management ", + "external_id": "054102731b07bea12e6877a2314f4114139b1a72", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-logs-create-drop-filter.png", + "url": "https://docs.newrelic.com/docs/logs/log-management/ui-data/drop-data-drop-filter-rules", + "published_at": "2020-09-24T10:19:46Z", + "updated_at": "2020-09-24T10:19:45Z", + "breadcrumb": "Contents / Log management / Log management / UI and data", + "document_type": "page", + "popularity": 1, + "info": "Data retention information for New Relic's log management and logs in context.", + "body": "After log event data has been shipped to New Relic, it can either be stored in our database (NRDB) or dropped (discarded). New Relic can drop both log events and event attributes via drop filter rules. You can manage drop filter rules using New Relic's log management or NerdGraph. Use caution when deciding to drop data. The data you drop is not recoverable. Before using this feature, review Responsibilities and considerations. Why it matters Drop filter rules help you accomplish some very important goals: You lower costs by storing only logs relevant to your account. You protect privacy and security by removing personal identifiable information (PII). You reduce noise by removing irrelevant events and attributes. How drop filter rules work A drop filter rule matches data based on a query. When triggered, the drop filter rule removes the matching data from the ingestion pipeline before it is written to in NRDB. Since the data does not reach the backend, it cannot be queried: the data is gone and cannot be restored. During the ingestion process, log data can be parsed, transformed, or dropped before being stored. Create drop filter rules You must have admin permissions in New Relic to create and edit drop filters, or be a member of a role with create and edit permissions for Logging Parsing Rules. Drop filter rules can be created from one.newrelic.com > Logs using new or existing log queries. To create a new drop filter rule: Filter or query to the specific set of logs which contain the data to be dropped. Once the query is active, click on the + button to show the query options and select Create a new drop filter. You can choose to either drop the entire log event that matches the query or just a specific subset of attributes in the matching events. Save the drop filter rule. Before saving the rule, consider changing its name. Once a drop filter rule is active, it's applied to all log events ingested from that point onwards. Rules are not applied retroactively: logs collected prior to the creation of a rule are not filtered by that rule. Types of drop filter rules Drop log events The default type of drop filter rule is to drop logs. This option drops the entire log events that match the filter query. When creating a rule try to provide a specific query that only matches log data which should be dropped. New Relic won't let you create drop filter rules without values in the matching query: this prevents badly formed rules from dropping all log data. Drop attributes You can specify attributes to be dropped in a log event that matches your query. At least one or more attributes must be selected. Any attribute which is selected will be dropped; all remaining attributes will be kept and stored in NRDB. We recommend this method for removing fields which could contain personal identifiable information (PII) or other sensitive attributes without losing valuable monitoring data. ​ Cautions when dropping data When creating drop rules, you are responsible for ensuring that the rules accurately identify and discard the data that meets the conditions that you have established. You are also responsible for monitoring the rule, as well as the data you disclose to New Relic. New Relic cannot guarantee that this functionality will completely resolve data disclosure concerns you may have. New Relic does not review or monitor how effective the rules you develop are. Creating rules about sensitive data can leak information about what kinds of data you maintain, including the format of your data or systems (for example, through referencing email addresses or specific credit card numbers). Rules you create, including all information in those rules, can be viewed and edited by any user with the relevant role-based access control permissions. Delete drop filter rules Drop filter rules can be deleted from one.newrelic.com > Logs. To delete a drop filter rule: Click on the + button to show the query options and select View all drop filters. Click the delete [trash icon] icon next to the drop filter rule you want to remove. Once deleted, rules no longer filter ingested log events. 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.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 384.6396, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "Drop data with drop filter rules ", + "sections": "Drop data with drop filter rules", + "info": "Data retention information for New Relic's log management and logs in context.", + "category_2": "UI and data", + "body": "After log event data has been shipped to New Relic, it can either be stored in our database (NRDB) or dropped (discarded). New Relic can drop both log events and event attributes via drop filter rules. You can manage drop filter rules using New Relic's log management or NerdGraph. Use caution when", + "breadcrumb": "Contents / Log management / Log management / UI and data" + }, + "id": "5f37d6fb196a67021c55e5eb" + }, + { + "category_2": "Manage data", + "nodeid": 39276, + "sections": [ + "Ingest and manage data", + "Get started", + "Understand data", + "Manage data", + "Ingest APIs", + "Manage data coming into New Relic", + "Data ingestion sources", + "Set alerts for data use", + "Adjust your data ingest", + "For more help" + ], + "title": "Manage data coming into New Relic", + "category_0": "Telemetry Data Platform", + "type": "docs", + "category_1": "Ingest and manage data", + "external_id": "ba12759affe2895e875af1af096d895d09f6d030", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/data-ingest-page_0.png", + "url": "https://docs.newrelic.com/docs/telemetry-data-platform/get-data-new-relic/manage-data/manage-data-coming-new-relic", + "published_at": "2020-09-24T17:20:11Z", + "updated_at": "2020-09-24T17:20:11Z", + "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Manage data", + "document_type": "page", + "popularity": 1, + "info": "For accounts on the New Relic One pricing plan: how we ingest and store and calculate ingested data. ", + "body": "When you connect your data to New Relic, we process what we receive and apply data dropping and transformation rules. Then we count the bytes needed to represent your data in a standard format, like JSON. If you're on our New Relic One pricing plan, this ingest process tells us how many GB you pay for, above and beyond the standard amount that’s free. 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 ingestion page shows your ingest rates for a period you specify on the top-right of the Data management hub. Since 30 days ago is the default setting, but you can also set a custom date span. The page shows your daily average GBs, and the total for the range you set. It also provides the current month-to-date, and the projected end-of-month total ingest rates. With this information, you can proactively drop data or turn off agents in order to manage ingest and, therefore, costs. If you want to take a look at how we query the data, click the ellipsis icon (just above the chart) to slide out the chart query and open it in our query builder. Data ingest page with GB rates for daily average and 30-day total. To open, select your user name > Data management hub > Data ingestion Data ingestion sources The Data ingestion page describes which of your data sources provide the most data on average and during specific data ranges. The sources are described here. Billable data sources Description Timeslices (1-minute) and Metric:Raw Metrics are timeslices + MetricRaw Metric group: MetricsBytes Metric timeslice data averages to one-hour periods after eight days. After 90 days, the permanent metric data continues to be stored in one-hour periods. We currently store the raw metric data for 30 days. You are only billed for the initial ingest volume. You are not billed for subsequent rollups. APM (transactions and errors) APM events Metric group: ApmEventsBytes InfraSamples:Raw Includes multiple Infrastructure events Infrastructure host data Metric group:InfraHostBytes Information related to your servers and virtual machines coming from infrastructure agents, including storage and network data Infrastructure process data stored in ProcessSample. Metric group: InfraProcessBytes Data are metrics related to each process running on the hosts running the Infrastructure agent. This feature is turned off by default. Infrastructure integrations Metric group: InfraIntegrationBytes Performance data related to applications and services, typically managed by the customer, including data related to Docker containers, Windows services, Nagios checks, and cloud integrations such as managed services in AWS, Azure, and GCP. Logging Includes logs and LogExtendedRecord Metric group: LoggingBytes Log messages longer than 4KB are split into multiple events that, when needed, are stitched together to display the original message; this reduces the size of message data. Default Custom events Metric group: CustomEventsBytes Mobile error Mobile general Breadcrumb crash event trails Mobile session Mobile exception Mobile crash Mobile events Metric group: MobileEventsBytes Tracing Metric group: TracingBytes Namespaces that contain all tracing events, including tracing spans and excluding internal tracing. Browser:EventLog Browser Browser:JSErrors PcvPerf (PageView timing) Browser events Metric group: BrowserEventsBytes Lambda Serverless Metric group: ServerlessBytes Set alerts for data use Query and alert on usage data describes how to set alerts to get notified if you're nearing data ingest limits you don't want to cross. For example, you might set an alert on logs, which can stack up quickly in an active system. Adjust your data ingest Drop data for lower retention costs and data compliance On ingest, we apply data dropping rules so you won't be charged for data that's not useful. Learn how to set additional data dropping ​​​​​rules yourself. Use NerdGraph to drop entire data types or drop data attributes from data types so they’re not written to NRDB. This enables you to focus on the data you want, reduces retention costs, and avoids writing sensitive data to the database. For dropping log data, see Drop data with drop filter rules. Turn off agents and integrations If you don’t need data from specific agents or integrations that you have installed, you can uninstall/delete those tools. For instructions, see the specific documentation for an agent or integration. 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.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 365.71722, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "Manage data coming into New Relic", + "sections": "Ingest and manage data", + "info": "For accounts on the New Relic One pricing plan: how we ingest and store and calculate ingested data. ", + "category_0": "Telemetry Data Platform", + "category_1": "Ingest and manage data", + "category_2": "Manage data", + "body": " On ingest, we apply data dropping rules so you won't be charged for data that's not useful. Learn how to set additional data dropping ​​​​​rules yourself. Use NerdGraph to drop entire data types or drop data attributes from data types so they’re not written to NRDB. This enables you to focus on the data", + "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Manage data" + }, + "id": "5f24629ae7b9d251c2c82338" + }, + { + "category_2": "Get started", + "nodeid": 11431, + "sections": [ + "NRQL: New Relic Query Language", "Get started", "NRQL query tools", "NRQL query tutorials", @@ -1589,858 +2159,494 @@ "body": "One way to query your New Relic data is with the New Relic Query Language (NRQL). This resource explains what NRQL is, when and how you can use it, and basic syntax rules. For more detailed information on querying, including a listing of clauses and functions and example queries, see NRQL syntax, clauses, and functions. What is NRQL? NRQL is New Relic's SQL-like query language. You can use NRQL to retrieve detailed New Relic data and get insight into your applications, hosts, and business-important activity. Reasons to use NRQL include: To answer a question for the purpose of troubleshooting or business analysis To create a new chart To make API queries of New Relic data (for example, using our NerdGraph API) NRQL is used behind the scenes to generate some New Relic charts: Some New Relic charts are built using NRQL. One way to start using NRQL is to view a chart's query and then edit it to make your own custom chart. Where can you use NRQL? You can use NRQL in these places: New Relic One query builder: Advanced mode is a NRQL query interface Basic mode provides a simplified query experience that doesn't require knowledge of NRQL but that uses NRQL to generate results New Relic Insights NerdGraph: our GraphQL-format API, which includes options for making NRQL queries one.newrelic.com > Query your data: You can run a NRQL query in both New Relic One and New Relic Insights. This NRQL query shows a count of distributed tracing spans faceted by their entity names. NRQL is one of several ways to query New Relic data. For more on all query options, see Query your data. What data can you query with NRQL? NRQL allows you to query these New Relic data types: Event data from all New Relic products, including: APM events, like Transaction New Relic Browser events, like PageView New Relic Mobile events, like Mobile Infrastructure events, like ProcessSample Synthetics events, like SyntheticCheck Custom events, like those reported by the Event API Metric timeslice data (metrics reported by New Relic APM, Browser, and Mobile) The Metric data type (metrics reported by the Metric API and data sources that use that API) The Span data type (distributed tracing data) The Log data type (data from New Relic Logs) Some data, like relationships between monitored entities, is not available via NRQL but is available using our NerdGraph API. Start using NRQL One way to start using NRQL and to understand what data you have available is to go to a NRQL interface (for example, the New Relic One query builder), type FROM, and press space. The interface will suggest available types of data: To see the attributes available for a specific data type, type FROM DATA_TYPE SELECT and press space. The interface will suggest available attributes. For example: To see the complete JSON associated with a data type, including all of its attributes, use the keyset() attribute. For example: FROM Transaction SELECT keyset() NRQL is used behind the scenes to build some New Relic charts and dashboards. One way to learn NRQL is to find one of these NRQL-generated charts and start playing with the NRQL to create new, customized queries and charts: Charts built with NRQL will have View query as an option. You can then edit and customize that query to see how your changes affect the resulting visualization. To explore your data without having to use NRQL, use the basic mode of New Relic One query builder. NRQL query examples Here's an example NRQL query of Transaction data, which is reported by New Relic APM. FROM Transaction SELECT average(duration) FACET appName TIMESERIES auto This would generate a chart that looks like: Here are some more query examples: Basic NRQL query of Browser data Here's a NRQL query of PageView data, which is reported by New Relic Browser. SELECT uniqueCount(user) FROM PageView WHERE userAgentOS = 'Mac' FACET countryCode SINCE 1 day ago LIMIT 20 Attribute name with a space in it If a custom attribute name has a space in it, use backticks around the attribute name: SELECT count(*) FROM Transaction FACET `Logged-in user` Querying multiple data sources To return data from two data sources, separate their data types with a comma. For example, this query returns a count of all APM transactions and Browser events over the last three days:​ SELECT count(*) FROM Transaction, PageView SINCE 3 days ago Query returning multiple columns To return multiple columns from a dataset, separate the aggregator arguments with a comma: SELECT function(attribute), function(attribute) ... FROM ... This query returns the minimum, average, and maximum duration for New Relic Browser PageView events over the last week: SELECT min(duration), max(duration), average(duration) FROM PageView SINCE 1 week ago See more NRQL query examples. NRQL syntax The syntax of a NRQL query is similar to standard SQL queries. Here is a breakdown of the structure of a NRQL query: SELECT function(attribute) [AS 'label'][, ...] FROM data type [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] Basic rules include: NRQL condition Details Required values The SELECT statement and FROM clause are required. All other clauses are optional. You can start your query with either SELECT or FROM. Query string size The query string must be less than 4 KB. Case sensitivity The data type names and attribute names are case sensitive. NRQL clauses and functions are not case sensitive. Syntax for strings NRQL uses single quotes to designate strings. For example: ... where traceId = '030a573f0df02c57' Attribute names with spaces Use backticks `` to quote a custom attribute name that has a space in it. For example: ... FACET `Logged-in user` Data type coercion Insights does not support data type \"coercion.\" For more information, see Data type conversion. Use of math functions Basic and advanced math functions are supported in the SELECT statement. JOIN functions NRQL does not have the equivalent of the SQL JOIN function, but you can simulate a JOIN with custom attributes. Read more about NRQL syntax and functions. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 117.231415, + "_score": 337.80243, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Introduction to NRQL, New Relic's query language", - "sections": "NRQL: New Relic Query Language", - "info": "An introduction to New Relic Query Language (NRQL) and how to use it.", - "category_1": "NRQL: New Relic Query Language", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", - "body": " in the SELECT statement. JOIN functions NRQL does not have the equivalent of the SQL JOIN function, but you can simulate a JOIN with custom attributes. Read more about NRQL syntax and functions. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub", - "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started" + "title": "Introduction to NRQL, New Relic's query language", + "sections": "What data can you query with NRQL?", + "info": "An introduction to New Relic Query Language (NRQL) and how to use it.", + "category_0": "Query your data", + "category_1": "NRQL: New Relic Query Language", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", + "body": " or business analysis To create a new chart To make API queries of New Relic data (for example, using our NerdGraph API) NRQL is used behind the scenes to generate some New Relic charts: Some New Relic charts are built using NRQL. One way to start using NRQL is to view a chart's query and then edit", + "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started" }, "id": "5f2abd47196a67747343fbe1" - }, + } + ], + "/automate-workflows/get-started-kubernetes": [ { - "category_2": "Custom events", - "nodeid": 6256, - "sections": [ - "Event data sources", - "Default events", - "Custom events", - "APM: Report custom events", - "Data considerations", - "Record a custom event", - "Timestamps", - "Limits and restricted characters", - "Reserved words", - "For more help" - ], - "title": "APM: Report custom events", - "category_0": "Insights", - "type": "docs", - "category_1": "Event data sources", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/event-data-sources/custom-events/apm-report-custom-events", - "external_id": "0c3f09d0d0e04ad50bedcdf7088eed7c171001d8", "image": "", - "url": "https://docs.newrelic.com/docs/insights/event-data-sources/custom-events/apm-report-custom-events", - "published_at": "2020-09-24T07:10:11Z", - "updated_at": "2020-09-24T07:10:11Z", - "breadcrumb": "Contents / Insights / Event data sources / Custom events", - "document_type": "page", - "popularity": 1, - "info": "New Relic APM: how to report custom events and attributes.", - "body": "If you have 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 833 custom events every 5 seconds. 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.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 114.71698, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "APM: Report custom events", - "sections": "Custom events", - "info": "New Relic APM: how to report custom events and attributes.", - "category_2": "Custom events", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/event-data-sources/custom-events/apm-report-custom-events", - "body": "If you have 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", - "breadcrumb": "Contents / Insights / Event data sources / Custom events" - }, - "id": "5f480a5a64441f578bfdcdb1" - }, - { - "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png", - "url": "https://developer.newrelic.com/", + "url": "https://developer.newrelic.com/automate-workflows/", "sections": [ - "Mark your calendar for Nerd Days 1.0", - "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 workflows", + "Guides to automate workflows", + "Quickly tag resources", + "Set up New Relic using Helm charts", + "Automatically tag a simple \"Hello World\" Demo across the entire stack", + "Set up New Relic using the Kubernetes operator", "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" + "Set up New Relic using Terraform" ], - "published_at": "2020-09-24T02:24:45Z", - "title": "New Relic Developers", - "updated_at": "2020-09-24T01:39:32Z", + "published_at": "2020-09-25T01:49:59Z", + "title": "Automate workflows", + "updated_at": "2020-09-25T01:49:59Z", "type": "developer", - "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab", + "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871", "document_type": "page", "popularity": 1, - "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 19 Days : 14 Hours : 58 Minutes : 8 Seconds Register 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 20 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", + "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 30 min Automatically tag a simple \"Hello World\" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform", "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 102.719894, + "_score": 138.67522, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Add custom attributes", - "body": " custom attributes Use custom attributes for deeper analysis Show 20 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" + "sections": "Set up New Relic using the Kubernetes operator", + "body": " it is to leverage automation in your DevOps environment! 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform" }, - "id": "5d6fe49a64441f8d6100a50f" + "id": "5efa999c196a67dfb4766445" }, { - "category_2": "Custom events", - "nodeid": 13661, + "category_2": "New Relic One pricing and users", + "nodeid": 39496, "sections": [ - "Event data sources", - "Default events", - "Custom events", - "Data requirements and limits for custom event data", - "General requirements", - "Reserved words", - "Additional Browser PageAction requirements", - "Additional Event API requirements", - "Event type limits", + "Accounts and billing", + "Account setup", + "Account structure", + "New Relic One pricing and users", + "General account settings", + "SAML single sign on", + "Automated user management", + "Partner install", + "Query and alert on usage data", + "Data types", + "Query examples", + "Data usage queries", + "User count queries", + "Set usage alerts", + "General attributes", "For more help" ], - "title": "Data requirements and limits for custom event data", - "category_0": "Insights", + "title": "Query and alert on usage data", + "category_0": "New Relic accounts", "type": "docs", - "category_1": "Event data sources", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", - "external_id": "f5beef0d09bb5918be3f8a1a3ece98c09947cd1e", + "category_1": "Accounts and billing", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/accounts/accounts-billing/new-relic-one-pricing-users/usage-queries-alerts", + "external_id": "94429d3c0366a8dee43d771c143fc6dacf4c4e31", "image": "", - "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", - "published_at": "2020-09-24T07:25:32Z", - "updated_at": "2020-09-20T19:39:10Z", - "breadcrumb": "Contents / Insights / Event data sources / Custom events", + "url": "https://docs.newrelic.com/docs/accounts/accounts-billing/new-relic-one-pricing-users/usage-queries-alerts", + "published_at": "2020-09-24T19:20:19Z", + "updated_at": "2020-09-24T19:20:19Z", + "breadcrumb": "Contents / New Relic accounts / Accounts and billing / New Relic One pricing and users", "document_type": "page", "popularity": 1, - "info": "For New Relic, general limits and requirements for reporting custom events and attributes. ", - "body": "You can report custom events to New Relic in several ways, including the New Relic Event API, APM agent APIs, Browser agent APIs, and the Mobile SDK. This document contains general requirements and rules for inserting and using custom events and their associated attributes. Additional requirements may apply based on the method you use. General requirements How long custom data is retained depends on your Insights subscription and its associated data retention. When reporting custom events and attributes, follow these general requirements for supported data types, naming syntax, and size: Requirement Description Payload Total maximum size or length: 1 MB maximum per POST. We highly recommend using compression. The Event API has additional HTTP rate limits. Attribute data types Attribute values can be either a string or a numeric integer or float. If your attribute values contain date information, define it as an unformatted Unix timestamp (in seconds or milliseconds) by using the Insights data formatter. Attribute size Maximum name size: 255 bytes. Maximum attribute value size: Custom attributes sent by the agent: 255 bytes Attributes attached to custom events sent using the Event API: 4096 characters Charts may only display the first 255 characters of attribute values. For complete attribute values, use the JSON chart type or Query API. Maximum total attributes per event: 254. Exception: If you use an APM agent API, the max is 64. Maximum total attributes per event type: 48,000. Naming syntax Attribute names can be a combination of alphanumeric characters, colons (:), periods (.), and underscores (_). Event types (using the eventType attribute) can be a combination of alphanumeric characters, colons (:), and underscores (_). Do not use words reserved for use by NRQL. Null values The database does not store any data with a null value. Reserved words Avoid using the following reserved words as names for events and attributes. Otherwise, unexpected results may occur. This is not a complete list. In general, it's a good practice to avoid using MySQL-reserved words to avoid collision with future New Relic functionality. Keyword Description accountId This is a reserved attribute name. If it's included, it will be dropped during ingest. appId Value must be an integer. If it is not an integer, the attribute name and value will be dropped during ingest. eventType The event type as stored in New Relic. New Relic agents and scripts normally report this as eventType. Can be a combination of alphanumeric characters, colons (:), and underscores (_). Be sure to review the prohibited eventType values and eventType limits. Prohibited eventType values For your eventType value, avoid using: Metric, MetricRaw, and strings prefixed with Metric[0-9] (such as Metric2 or Metric1Minute). Public_ and strings prefixed with Public_. These event types are reserved for use by New Relic. Events passed in with these eventType values will be dropped. timestamp Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds. It must be +/-1 day (24 hours) of the current time on the server. Log forwarding terms The following keys are reserved by the Infrastructure agent's log forwarding feature: entity.guid, log, hostname, plugin.type, fb.input. If used, they are dropped during ingest and a warning is added to the logs. NRQL syntax terms If you need to use NRQL syntax terms as attribute names, including dotted attributes, they must be enclosed in backticks; for example, `LIMIT` or `consumer.offset`. Otherwise, avoid using these reserved words: ago, and, as, auto, begin, begintime, compare, day, days, end, endtime, explain, facet, from, hour, hours, in, is, like, limit, minute, minutes, month, months, not, null, offset, or, raw, second, seconds, select, since, timeseries, until, week, weeks, where, with Additional Browser PageAction requirements For additional requirements for using New Relic Browser's custom PageAction event, see Insert custom data via New Relic Browser agent. Additional Event API requirements For more requirements and details for the Event API, see Event API. Event type limits The current limit for total number of eventType values is 250 per sub-account in a given 24-hour time period. If a user exceeds this limit, New Relic may filter or drop data. Event types include: Default events from New Relic agents Custom events from New Relic agents Custom events from Insights custom event inserter 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.", + "info": "How to create queries and alerts for your New Relic billing-related usage. ", + "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 The usage UI displays your data usage and billable user count. But to get more detail, you can use these NRQL queries. For definitions of some of the attributes used in these queries, see Attributes. Data usage queries Here are some data usage query examples: Daily data usage 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 data usage This query shows the current full user count. In other words, it shows how much you'd be billed for your data for that month if you were billed right now. FROM NrMTDConsumption SELECT latest(GigabytesIngested) WHERE productLine = 'DataPlatform' SINCE this month Month-to-date estimated data cost This query shows the estimated cost of your ingested data: FROM NrMTDConsumption SELECT latest(estimatedCost) WHERE productLine = 'DataPlatform' SINCE this month User count queries Here are some user-related query examples. For details on how users are counted, see User count calculations. Month-to-date full users This query shows the billable full users for the month. In other words, it shows how much you'd be billed for your users for that month if you were billed right now. FROM NrMTDConsumption SELECT latest(usersBillable) SINCE this month This query shows how many full users were counted by hour. This is useful for seeing how the full user count changed over time. from NrConsumption SELECT max(FullUsers) SINCE 10 days ago TIMESERIES 1 hour Projected monthly full user count This query shows a projected count of monthly users. This query would not be good for using in a dashboard; it requires values based on a) the days remaining in the month, b) the start of the month. Here's an example querying the projected end-of-month count with 10 days left in that month: FROM NrMTDConsumption SELECT predictLinear(FullUsers, 10 days) SINCE '2020-09-01' Count full users and basic users The usage UI shows the count of full users and basic users. The query used is: FROM NrUsage SELECT max(usage) SINCE 10 days ago WHERE productLine='FullStackObservability' WHERE metric in ('FullUsers', 'BasicUsers') FACET metric To see the count of full and basic users over time: FROM NrUsage SELECT max(usage) SINCE 10 days ago WHERE productLine='FullStackObservability' WHERE metric in ('FullUsers', 'BasicUsers') FACET metric TIMESERIES 1 hour 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. Ingested gigabytes exceed 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 users This query will create an alert when your usage exceeds fixed monthly threshold for billable users: FROM NrMTDConsumption SELECT latest(usersBillable) 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 95.055145, + "_score": 73.345345, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Data requirements and limits for custom event data", - "sections": "Custom events", - "info": "For New Relic, general limits and requirements for reporting custom events and attributes. ", - "category_2": "Custom events", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", - "body": "You can report custom events to New Relic in several ways, including the New Relic Event API, APM agent APIs, Browser agent APIs, and the Mobile SDK. This document contains general requirements and rules for inserting and using custom events and their associated attributes. Additional requirements", - "breadcrumb": "Contents / Insights / Event data sources / Custom events" + "title": "Query and alert on usage data", + "sections": "Query and alert on usage data", + "info": "How to create queries and alerts for your New Relic billing-related usage. ", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/accounts/accounts-billing/new-relic-one-pricing-users/usage-queries-alerts", + "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": "59f4354f4bb81c2ea8b80d0a" - } - ], - "/terms": [ + "id": "5f22f5bd64441f0c9e2a48ea" + }, { - "category_2": "Data privacy", - "nodeid": 1591, + "category_2": "Alert conditions", + "nodeid": 9231, "sections": [ - "Security and Privacy", - "Data privacy", - "Compliance", - "Information security", - "Security bulletins", - "Security controls for privacy", - "Secured content", - "Analytics", - "Data transmission and firewalls", - "Hosting and data storage", - "Data access", - "HTTP parameters disabled by default", + "New Relic Alerts", + "Get started", + "Alert policies", + "Alert conditions", + "Alert violations", + "Alert Incidents", + "Alert notifications", + "Troubleshooting", + "Rules, limits, and glossary", + "Alerts and Nerdgraph", + "REST API alerts", + "Create NRQL alert conditions", + "Create NRQL alert condition", + "Alert threshold types", + "NRQL alert syntax", + "Sum of query results (limited or intermittent data)", + "Offset the query time window", + "NRQL alert threshold examples", + "Create a description", "For more help" ], - "title": "Security controls for privacy", - "category_0": "New Relic Security and Privacy", + "title": "Create NRQL alert conditions", + "category_0": "Alerts and Applied intelligence", "type": "docs", - "category_1": "Security and Privacy", - "external_id": "bc8220cf6b971d3e72dbcd38b006d799a1041cd3", + "category_1": "New Relic Alerts", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions", + "external_id": "956a7a0b84d2afac5e6236df3143085ebc4f7459", "image": "", - "url": "https://docs.newrelic.com/docs/security/security-privacy/data-privacy/security-controls-privacy", - "published_at": "2020-09-24T19:01:05Z", - "updated_at": "2020-09-24T07:44:02Z", - "breadcrumb": "Contents / New Relic Security and Privacy / Security and Privacy / Data privacy", + "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions", + "published_at": "2020-09-24T23:57:53Z", + "updated_at": "2020-09-03T23:54:56Z", + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert conditions", "document_type": "page", "popularity": 1, - "info": "New Relic data security: content, analytics, transmission, hosting and storage, data access, etc. For complete details, see https://newrelic.com/security", - "body": "This document describes how New Relic protects the security of your data. For more information about our security measures, see our data privacy documentation and the New Relic Security website. Secured content Data for New Relic accounts are isolated so that users can only see the data for accounts they own (or have been given permission to see). New Relic also has certain rights regarding customers' data, described in the Terms and Conditions page on the New Relic website. Analytics In order to help us improve our product and user experience, New Relic uses third-party analytics services to better understand the behavior of users on our site. The user data that New Relic collects is used solely by New Relic and is not shared, sold, or rented to any third parties for their own use. For more information, see our Services data privacy notice. Data transmission and firewalls The New Relic agent communicates with two hosts: collector.newrelic.com collector-nnn.newrelic.com, where nnn is a numerical value Typically the numbered host is fixed for your account, and it appears in log/newrelic.agent.log. For required changes when you want to create firewall rules to allow the agent to communicate, see Networks. For more information about security measures for your data in transit to New Relic or at rest in our storage, see Data encryption. Hosting and data storage New Relic is self-hosted with co-location services called Server Central in a Tier 3 data center in Chicago, Illinois and an IBM-hosted data center near Frankfurt, Germany, as well as cloud storage through Amazon AWS. We use standard best practices to maintain a firewall for our servers and to protect our servers from unauthorized login. All data is stored in a cluster of MySQL databases. New Relic data is backed up nightly, and an archive is stored at a secondary data center. Data access Access to account data by New Relic employees is limited to a necessary set of users consistent with their assigned New Relic responsibilities. Except to the extent necessary to provide subscribed services and as documented in our Services data privacy notice, customer account data is not shared with any third parties. All customer account data access is logged and regularly audited. HTTP parameters disabled by default By default, New Relic agents disable collection of HTTP request parameters, such as the query string of a URL. This is an automatic safeguard to protect potentially sensitive data. New Relic collects and displays HTTP parameters only when you explicitly enable them in your agent configuration file. 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.", + "info": "How to define thresholds that trigger alert notifications based on your NRQL queries.", + "body": "You can create alert conditions using NRQL queries. Create NRQL alert condition To create a NRQL alert condition: When you start to create a condition, where it prompts you to Select a product, click NRQL. Tips for creating and using a NRQL condition: Topic Tips Condition types NRQL condition types include static, baseline, and outlier. Create a description For some condition types, you can create a Description. Query results Queries must return a number. The condition works by evaluating that returned number against the thresholds you set. Time period As with all alert conditions, NRQL conditions evaluate one single minute at a time. The implicit SINCE ... UNTIL clause specifying which minute to evaluate is controlled by your Evaluation offset setting. Since very recent data may be incomplete, you may want to query data from 3 minutes ago or longer, especially for: Applications that run on multiple hosts. SyntheticCheck data: Timeouts can take 3 minutes, so 5 minutes or more is recommended. Also, if a query will generate intermittent data, consider using the sum of query results option. Condition settings Use the Condition settings to: Configure whether and how open violations are force-closed. Adjust the evaluation offset. Create a concise and descriptive condition name. (NerdGraph API Only) Provide a text description for the condition that will be included in violations and notifications. Troubleshooting procedures Optional: To include your organization's procedures for handling the incident, add the runbook URL to the condition. Limits on conditions See the maximum values. Health status NRQL alert conditions do not affect an entity's health status display. Examples For more information, see: Expected NRQL syntax Examples of NRQL condition queries Alert threshold types When you create a NRQL alert, you can choose from different types of thresholds: NRQL alert threshold types Description Static This is the simplest type of NRQL threshold. It allows you to create a condition based on a NRQL query that returns a numeric value. Optional: Include a FACET clause. Baseline Uses a self-adjusting condition based on the past behavior of the monitored values. Uses the same NRQL query form as the static type, except you cannot use a FACET clause. Outlier Looks for group behavior and values that are outliers from those groups. Uses the same NRQL query form as the static type, but requires a FACET clause. NRQL alert syntax Here is the basic syntax for creating all NRQL alert conditions. Depending on the threshold type, also include a FACET clause as applicable. SELECT function(attribute) FROM Event WHERE attribute [comparison] [AND|OR ...] Clause Notes SELECT function(attribute) Required Supported functions that return numbers include: apdex average count latest max min percentage percentile sum uniqueCount If you use the percentile aggregator in a faceted alert condition with many facets, this may cause the following error to appear: An error occurred while fetching chart data. If you see this error, use average instead. FROM data type Required Only one data type can be targeted. Supported data types: Event Metric (RAW data points will be returned) WHERE attribute [comparison] [AND|OR ...] Optional Use the WHERE clause to specify a series of one or more conditions. All the operators are supported. FACET attribute Static: Optional Baseline: Not allowed Outlier: Required Including a FACET clause in your NRQL syntax depends on the threshold type: static, baseline, or outlier. Use the FACET clause to separate your results by attribute and alert on each attribute independently. Faceted queries can return a maximum of 5000 values for static conditions and a maximum of 500 values for outlier conditions. If the query returns more than this number of values, the alert condition cannot be created. If you create the condition and the query returns more than this number later, the alert will fail. Sum of query results (limited or intermittent data) Available only for static (basic) threshold types. If a query returns intermittent or limited data, it may be difficult to set a meaningful threshold. Missing or limited data will sometimes generate false positives or false negatives. To avoid this problem when using the static threshold type, you can set the selector to sum of query results. This lets you set the alert on an aggregated sum instead of a value from a single harvest cycle. Up to two hours of the one-minute data checks can be aggregated. The duration you select determines the width of the rolling sum, and the preview chart will update accordingly. Offset the query time window Every minute, we evaluate the NRQL query in one-minute time windows. The start time depends on the value you select in the NRQL condition's Advanced settings > Evaluation offset. Example: Using the default time window to evaluate violations With the Evaluation offset at the default setting of three minutes, the NRQL time window applied to your query will be: SINCE 3 minutes ago UNTIL 2 minutes ago If the event type is sourced from an APM language agent and aggregated from many app instances (for example, Transactions, TransactionErrors, etc.), we recommend evaluating data from three minutes ago or longer. An offset of less than 3 minutes will trigger violations sooner, but you might see more false positives and negatives due to data latency. For cloud data, such as AWS integrations, you may need an offset longer than 3 minutes. Check our AWS polling intervals documentation to determine your best setting. NRQL alert threshold examples Here are some common use cases for NRQL alert conditions. These queries will work for static and baseline threshold types. The outlier threshold type will require additional FACET clauses. Alert on specific segments of your data Create constrained alerts that target a specific segment of your data, such as a few key customers or a range of data. Use the WHERE clause to define those conditions. SELECT average(duration) FROM Transaction WHERE account_id in (91290, 102021, 20230) SELECT percentile(duration, 95) FROM Transaction WHERE name LIKE 'Controller/checkout/%' Alert on Nth percentile of your data Create alerts when an Nth percentile of your data hits a specified threshold; for example, maintaining SLA service levels. Since we evaluate the NRQL query in one-minute time windows, percentiles will be calculated for each minute separately. SELECT percentile(duration, 95) FROM Transaction SELECT percentile(databaseDuration, 75) FROM Transaction Alert on max, min, avg of your data Create alerts when your data hits a certain maximum, minimum, or average; for example, ensuring that a duration or response time does not pass a certain threshold. SELECT max(duration) FROM Transaction SELECT average(duration) FROM Transaction Alert on a percentage of your data Create alerts when a proportion of your data goes above or below a certain threshold. SELECT percentage(count(*), WHERE duration > 2) FROM Transaction SELECT percentage(count(*), WHERE httpResponseCode = '500') FROM Transaction Alert on Apdex with any T-value Create alerts on Apdex, applying your own T-value for certain transactions. For example, get an alert notification when your Apdex for a T-value of 500ms on transactions for production apps goes below 0.8. SELECT apdex(duration, t:0.5) FROM Transaction WHERE appName like '%prod%' Create a description You can define a description that passes useful information downstream for better violation responses or for use by downstream systems. For details, see Description. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 537.183, + "_score": 70.42307, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Security and Privacy", - "info": "New Relic data security: content, analytics, transmission, hosting and storage, data access, etc. For complete details, see https://newrelic.com/security", - "category_0": "New Relic Security and Privacy", - "category_1": "Security and Privacy", - "body": " for accounts they own (or have been given permission to see). New Relic also has certain rights regarding customers' data, described in the Terms and Conditions page on the New Relic website. Analytics In order to help us improve our product and user experience, New Relic uses third-party analytics services" + "title": "Create NRQL alert conditions", + "sections": "Create NRQL alert conditions", + "info": "How to define thresholds that trigger alert notifications based on your NRQL queries.", + "category_0": "Alerts and Applied intelligence", + "category_1": "New Relic Alerts", + "category_2": "Alert conditions", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions", + "body": "You can create alert conditions using NRQL queries. Create NRQL alert condition To create a NRQL alert condition: When you start to create a condition, where it prompts you to Select a product, click NRQL. Tips for creating and using a NRQL condition: Topic Tips Condition types NRQL condition types", + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert conditions" }, - "id": "5e30b8a864441f47ebd05cb0" + "id": "5f2d992528ccbc489d88dfc1" }, { - "category_2": "Product definitions", - "nodeid": 39646, + "category_2": "Understand and use data", + "nodeid": 37981, "sections": [ - "License information", - "General usage licenses", - "Special services licenses", - "Distributed licenses", - "Referenced policies", - "Product definitions", - "Usage plans", - "FAQ", - "New Relic One pricing: Definitions", + "Elastic Container Service integration", + "Get started", + "Install", + "Understand and use data", + "Troubleshooting", + "Recommended ECS alert conditions", + "Recommended alert conditions", "For more help" ], - "title": "New Relic One pricing: Definitions", - "category_0": "Licenses", + "title": "Recommended ECS alert conditions", + "category_0": "Integrations", "type": "docs", - "category_1": "License information", - "external_id": "097fc095ef18942f3af1845237742340e36416b8", + "category_1": "Elastic Container Service integration", + "external_id": "304f01e7a5c68e9ef4dc76782eb9ff6847854065", "image": "", - "url": "https://docs.newrelic.com/docs/licenses/license-information/product-definitions/new-relic-one-pricing-definitions", - "published_at": "2020-09-24T19:28:53Z", - "updated_at": "2020-09-10T14:58:10Z", - "breadcrumb": "Contents / Licenses / License information / Product definitions", + "url": "https://docs.newrelic.com/docs/integrations/elastic-container-service-integration/understand-use-data/ecs-integration-recommended-alert-conditions", + "published_at": "2020-09-24T09:58:05Z", + "updated_at": "2020-08-06T00:29:40Z", + "breadcrumb": "Contents / Integrations / Elastic Container Service integration / Understand and use data", "document_type": "page", "popularity": 1, - "info": "This document provides definitions of terminology you may see in New Relic contracts.", - "body": "This document provides definitions of terminology you may see in the Terms or this site for New Relic One pricing and billing: Account Account refers to the online account or subaccounts that New Relic provides for customers to manage their use of the Products. Commitment Term Commitment Term means the non-cancelable, committed Subscription Term for the Products. Customer Data Customer Data means the data, information, or content that Customer and its users send to an Account from the Software, the Customer Properties, or Third-Party Services. Customer Properties Customer Properties means Customer’s websites, infrastructure, networks, mobile applications, or other systems, as well as Customer accounts on Third-Party Services. Documentation Documentation means the New Relic technical guides and documentation made available from the dedicated ‘Documentation’ page of the New Relic website. GB Ingested A GB Ingested is a measurement of the volume of metrics, events, logs, traces, or other telemetry data sent to or generated by the Products for the benefit of the Customer, including from the Software, the Customer Properties, or Third-Party Services. In this context, a GB is defined as 1 billion bytes. Login Credentials Login Credentials means the username, email address, password, or other personal information that is provided by a Customer user in order to manage an Account. Monthly Provisioned User A Monthly Provisioned User is any user who can log into Customer’s Account(s) and access the New Relic One Product functionality as specified in an Order and the Documentation. Order Order means the purchasing order for access to the Service or related services that: (1) is either executed by the Parties or entered into by you via self-service, and references this Agreement, or (2) is entered into by you and a Channel Partner. Paid Terms of Service Paid Terms of Service means the legal terms and conditions located at: https://newrelic.com/termsandconditions/paid. Product(s) Product(s) mean the purchase of the New Relic subscription products described in the applicable Order and any updates, corrections, bug fixes, modifications, improvements, related services, new features, and functionality (made generally available to New Relic’s customer base) thereto. Software Software means the distributed software, APIs, scripts, or other code proprietary to New Relic provided with the Products. Terms Terms means the underlying Customer-New Relic agreement and the Order. Third-Party Services Third-Party Services means any third party platform, add-on, service, or product not provided by New Relic and that a user integrates or enables for use with the Products, including third-party applications and plug-ins. Unpaid Terms of Service Unpaid Terms of Service means the legal terms and conditions located at: https://newrelic.com/termsandconditions/unpaid. Usage Plan Usage Plan refers to the Service or Product pricing, invoicing related information, and product-specific terms (e.g. concurrent user account sessions) contained within the Documentation. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "info": "Tips for useful alert conditions to set for New Relic's Amazon ECS integration. ", + "body": "New Relic's ECS integration reports and displays performance data from your Amazon ECS environment. This document provides some recommended alert conditions for monitoring ECS performance. Recommended alert conditions Here are some recommended ECS alert conditions. To add these alerts, go to the Alerts UI and add the following NRQL alert conditions to an existing or new alert policy: High CPU usage NRQL: FROM ContainerSample SELECT cpuUsed / cpuLimitCores Critical: > 90% for 5 minutes High memory usage NRQL: FROM ContainerSample SELECT memoryUsageBytes / memorySizeLimitBytes Critical: > 80% for 5 minutes Restart count NRQL: FROM ContainerSample SELECT max(restartCount) - min(restartCount) Critical: > 5 for 5 minutes 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 417.46146, + "_score": 61.321156, "_version": null, "_explanation": null, "sort": null, "highlight": { - "info": "This document provides definitions of terminology you may see in New Relic contracts.", - "body": "This document provides definitions of terminology you may see in the Terms or this site for New Relic One pricing and billing: Account Account refers to the online account or subaccounts that New Relic provides for customers to manage their use of the Products. Commitment Term Commitment Term means" + "title": "Recommended ECS alert conditions", + "sections": "Recommended ECS alert conditions", + "info": "Tips for useful alert conditions to set for New Relic's Amazon ECS integration. ", + "body": " to the Alerts UI and add the following NRQL alert conditions to an existing or new alert policy: High CPU usage NRQL: FROM ContainerSample SELECT cpuUsed / cpuLimitCores Critical: > 90% for 5 minutes High memory usage NRQL: FROM ContainerSample SELECT memoryUsageBytes / memorySizeLimitBytes Critical: > 80" }, - "id": "5f23b039196a67030b94f5c4" + "id": "5ee05e9e28ccbcef4f4c8dda" }, { - "image": "", - "url": "https://opensource.newrelic.com/cla/", + "category_2": "Alert conditions", + "nodeid": 10951, "sections": [ - "NEW RELIC, INC.", - "INDIVIDUAL CONTRIBUTOR LICENSE AGREEMENT", - "Definitions." + "New Relic Alerts", + "Get started", + "Alert policies", + "Alert conditions", + "Alert violations", + "Alert Incidents", + "Alert notifications", + "Troubleshooting", + "Rules, limits, and glossary", + "Alerts and Nerdgraph", + "REST API alerts", + "Create baseline alert conditions", + "How it works", + "Set baseline thresholds", + "Baseline rules and settings", + "For more help" ], - "published_at": "2020-09-24T02:53:09Z", - "title": "New Relic Open Source Contributor License Agreement", - "updated_at": "2020-09-02T02:08:45Z", - "type": "opensource", - "external_id": "478151b2a97835e82c3cd1eaa49610793dc56783", + "title": "Create baseline alert conditions", + "category_0": "Alerts and Applied intelligence", + "type": "docs", + "category_1": "New Relic Alerts", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-baseline-alert-conditions", + "external_id": "0708312e6e3221aa381963e90472d3f7016d4dc6", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-alerts-baseline-thresholds.png", + "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-baseline-alert-conditions", + "published_at": "2020-09-24T08:30:36Z", + "updated_at": "2020-08-15T08:34:17Z", + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert conditions", "document_type": "page", "popularity": 1, - "info": "", - "body": "New Relic Open Source External Projects Highlighted Projects New Relic Projects Menu External Projects Highlighted Projects New Relic Projects NEW RELIC, INC. INDIVIDUAL CONTRIBUTOR LICENSE AGREEMENT Thank you for your interest in contributing to the open source projects of New Relic, Inc. (“New Relic”). In order to clarify the intellectual property license granted with Contributions from any person or entity, New Relic must have a Contributor License Agreement (\"Agreement\") on file that has been signed by each Contributor, indicating agreement to the license terms below. This Agreement is for your protection as a Contributor as well as the protection of New Relic; it does not change your rights to use your own Contributions for any other purpose. You accept and agree to the following terms and conditions for Your present and future Contributions submitted to New Relic. Except for the licenses granted herein to New Relic and recipients of software distributed by New Relic, You reserve all right, title, and interest in and to Your Contributions. Definitions. \"You\" (or \"Your\") shall mean the copyright owner or legal entity authorized by the copyright owner that is entering into this Agreement with New Relic. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. \"Contribution\" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to New Relic for inclusion in, or documentation of, any of the products managed or maintained by New Relic (the \"Work\"). For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to New Relic or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, New Relic for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as \"Not a Contribution.\" Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to New Relic and to recipients of software distributed by New Relic a perpetual, worldwide, non-exclusive, no-charge, royalty-free, transferable, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to New Relic and to recipients of software distributed by New Relic a perpetual, worldwide, non-exclusive, no-charge, royalty-free, transferable, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contributions alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that Your Contribution, or the Work to which You have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed. You represent that You are legally entitled to grant the above licenses. If Your employer(s) has rights to intellectual property that You create that includes Your Contributions, You represent that You have received permission to make Contributions on behalf of that employer, that Your employer has waived such rights for Your Contributions to New Relic, or that Your employer has executed a separate Agreement with New Relic. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which You are personally aware and which are associated with any part of Your Contributions. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. Should You wish to submit work that is not Your original creation, You may submit it to New Relic separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which You are personally aware, and conspicuously marking the work as \"Submitted on behalf of a third-party: [named here] \". You agree to notify New Relic of any facts or circumstances of which You become aware that would make these representations inaccurate in any respect. New Relic Open Source Standards External Projects Highlighted Projects New Relic Projects Edit this page Create an issue Copyright © 2020 New Relic Inc.Version 1.9.2", + "info": "How to create a baseline alert conditions and set thresholds that adjust to data patterns and fluctuations. ", + "body": "You can use baseline conditions to define violation thresholds that adjust to the behavior of your data. Baseline alerting is useful for creating conditions that: Only notify you when data is behaving abnormally. Dynamically adjust to changing data and trend s, including daily or weekly trends. In addition, baseline alerting works well with new applications when you do not yet have known behaviors. How it works When you choose a data source (for example, an APM metric) for a baseline condition, we'll use the past values of that data to dynamically predict the data's near-future behavior. The line of that predicted future behavior for that value is called a baseline. It appears as a dotted black line on the preview chart in the baseline condition UI. You'll use the baseline alert condition UI to: Adjust how sensitive the condition is to fluctuations in the data source. Set the behavior that will trigger a violation (for example: \"deviating for more than five minutes\"). Set whether you want the condition to check for upper violations, lower violations, or both. When your data escapes the predicted \"normal\" behavior and meets the criteria you've chosen, you'll receive a notification. Set baseline thresholds one.newrelic.com > AI & Alerts > Policies > (create or select policy) > Create alert condition: Baseline alert conditions give you the ability to set intelligent, self-adjusting thresholds that only generate violations when abnormal behavior is detected. To create a baseline condition: When you start to create a condition, choose one of the following data sources: APM: Application metric baseline Browser: Metric baseline NRQL (and then choose a baseline type threshold) Here are some tips for setting baseline thresholds: Set the baseline direction to monitor violations that happen either above or below the baseline. Set the preview chart to either 2 days or 7 days of displayed data. (Not applicable for NRQL alert conditions.) Use the slider bar to adjust the Critical threshold sensitivity, represented in the preview chart by the light gray area around the baseline. The tighter the band around the baseline, the more sensitive it is and the more violations it will generate. Optional: You can create a Warning threshold (the darker gray area around the baseline). For NRQL alerts, see the allowed types of NRQL queries. If the alert condition applies to multiple apps, you can select a choice from the dropdown above the chart to use different metrics. (Not applicable for NRQL alert conditions.) Baseline rules and settings Here are some details about how the UI works: Rules governing creation of baseline The algorithm for baseline conditions is mathematically complex. Here are some of the major rules governing its predictive abilities: Data trait Baseline rules Age of data On initial creation, the baseline is calculated using between 1 to 4 weeks of data, depending on data availability and baseline type. After its creation, the algorithm will take into account ongoing data fluctuations over a long time period, although greater weight is given to more recent data. For data that has only existed for a short time, the baseline will likely fluctuate a good deal and not be very accurate. This is because there is not yet enough data to determine its usual values and behavior. The more history the data has, the more accurate the baseline and thresholds will become. Consistency of data For metric values that remain in a consistent range or that trend slowly and steadily, their more predictable behavior means that their thresholds will become tighter around the baseline. Data that is more varied and unpredictable will have looser (wider) thresholds. Regular fluctuations For shorter-than-one-week cyclical fluctuations (such as weekly Wednesday 1pm deployments or nightly reports), the baseline algorithm looks for these cyclical fluctuations and attempts to adjust to them. Baseline direction: select upper or lower ranges You can choose whether you want the condition to violate for behavior that goes above the baseline (\"upper\") or that goes below the baseline (\"lower\"), or that goes either above or below. You choose these with the Baseline direction selector. Example use cases for this: You might use the Upper setting for a data source like error rate, because you generally are only concerned if it goes up, and aren't concerned if it goes down. You might use the Lower setting for a data source like throughput, because sudden upward fluctuations are quite common, but a large sudden downswing would be a sign of a problem. Here are examples of how large fluctuations in your data would be treated under the different baseline direction settings. The red areas represent violations. Preview chart: select 2 or 7 days When setting thresholds, the preview chart has an option for displaying Since 2 days ago or Since 7 days ago. These selections are not the time period used to compute the baseline; they are only the time range used for a preview display. For more about the time range used to calculate the baseline, see the algorithm rules. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 388.04428, + "_score": 59.303543, "_version": null, "_explanation": null, "sort": null, "highlight": { - "body": " is for your protection as a Contributor as well as the protection of New Relic; it does not change your rights to use your own Contributions for any other purpose. You accept and agree to the following terms and conditions for Your present and future Contributions submitted to New Relic. Except" + "title": "Create baseline alert conditions", + "sections": "Alert conditions", + "info": "How to create a baseline alert conditions and set thresholds that adjust to data patterns and fluctuations. ", + "category_0": "Alerts and Applied intelligence", + "category_1": "New Relic Alerts", + "category_2": "Alert conditions", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-baseline-alert-conditions", + "body": " that happen either above or below the baseline. Set the preview chart to either 2 days or 7 days of displayed data. (Not applicable for NRQL alert conditions.) Use the slider bar to adjust the Critical threshold sensitivity, represented in the preview chart by the light gray area around the baseline", + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert conditions" }, - "id": "5f31822264441fcbe056a984" - }, + "id": "5f2d847b28ccbc876888e004" + } + ], + "/collect-data/collect-data-from-any-source": [ { - "category_2": "Developer Edition", - "nodeid": 39641, + "category_2": "Ingest APIs", + "nodeid": 35471, "sections": [ - "Product or service licenses", - "New Relic One", - "APM", - "Browser", - "Developer Edition", - "Infrastructure", - "Insights", - "Logs", - "Mobile", - "Synthetics", - "Mobile apps", - "Plugins", - "Miscellaneous", - "Developer Program Resources", - "For more help" - ], - "title": "Developer Program Resources", - "category_0": "Licenses", - "type": "docs", - "category_1": "Product or service licenses", - "external_id": "98308cfffa652e4c25967e1be5b848b9c28ca410", - "image": "", - "url": "https://docs.newrelic.com/docs/licenses/product-or-service-licenses/new-relic-developer-edition/developer-program-resources", - "published_at": "2020-09-24T19:28:53Z", - "updated_at": "2020-08-08T19:17:02Z", - "breadcrumb": "Contents / Licenses / Product or service licenses / Developer Edition", - "document_type": "page", - "popularity": 1, - "info": "New Relic Developer edition policy", - "body": "As a customer, you are eligible to participate in New Relic’s Developer Program. Additional information and resources are available at New Relic’s Developer Program site. By downloading, accessing, or using the developer resources (including the CLI), you agree that usage of the developer resources is pursuant to the New Relic Developers Terms and Conditions and that you have the authority to bind your organization. Such terms do not have to be signed in order to be binding. If you do not agree to these terms and conditions, your sole remedy is to not use these developer resources. If your use of the New Relic developer resources are covered under a separate agreement, the above does not apply to you. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 367.21695, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "body": " is pursuant to the New Relic Developers Terms and Conditions and that you have the authority to bind your organization. Such terms do not have to be signed in order to be binding. If you do not agree to these terms and conditions, your sole remedy is to not use these developer resources. If your" - }, - "id": "5f338507e7b9d2f670c9de83" - }, - { - "category_2": "New Relic One", - "nodeid": 39366, - "sections": [ - "Product or service licenses", - "New Relic One", - "APM", - "Browser", - "Developer Edition", - "Infrastructure", - "Insights", - "Logs", - "Mobile", - "Synthetics", - "Mobile apps", - "Plugins", - "Miscellaneous", - "Preview access for New Relic One", - "For more help" - ], - "title": "Preview access for New Relic One", - "category_0": "Licenses", - "type": "docs", - "category_1": "Product or service licenses", - "external_id": "eae3865081d3bd8ad2dd8b6eaf0fe0147355360c", - "image": "", - "url": "https://docs.newrelic.com/docs/licenses/product-or-service-licenses/new-relic-one/preview-access-new-relic-one", - "published_at": "2020-09-24T17:25:08Z", - "updated_at": "2020-07-31T04:41:27Z", - "breadcrumb": "Contents / Licenses / Product or service licenses / New Relic One", - "document_type": "page", - "popularity": 1, - "body": "As a customer with a paid subscription to New Relic products, you are eligible to participate in preview access of the New Relic One platform (e.g. Telemetry Data Platform, Full Stack Observability, and Applied Intelligence products) for the period beginning July 31, 2020 and ending December 31, 2020 (“Preview Access”). BY DOWNLOADING, ACCESSING, INDICATING YOUR AGREEMENT TO, OR USING THE PREVIEW ACCESS PRODUCTS, YOU AGREE THAT YOUR PREVIEW ACCESS USAGE IS PURSUANT TO THESE SEPARATE TERMS AND CONDITIONS IN LIEU OF ANY OTHER TERMS. These terms do not have to be signed in order to be binding. If you do not agree to these terms and conditions, your sole remedy is to not participate in Preview Access. New Relic reserves the right to terminate or restrict Preview Access, in whole or in part, at any time. Notwithstanding the foregoing and any other materials provided by New Relic, select customers are ineligible for the Preview Access. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", - "info": "", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 355.65955, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "body": ", 2020 (“Preview Access”). BY DOWNLOADING, ACCESSING, INDICATING YOUR AGREEMENT TO, OR USING THE PREVIEW ACCESS PRODUCTS, YOU AGREE THAT YOUR PREVIEW ACCESS USAGE IS PURSUANT TO THESE SEPARATE TERMS AND CONDITIONS IN LIEU OF ANY OTHER TERMS. These terms do not have to be signed in order to be binding" - }, - "id": "5f23a0f7e7b9d29da9c82305" - } - ], - "/explore-docs/newrelic-cli": [ - { - "image": "", - "url": "https://developer.newrelic.com/automate-workflows/", - "sections": [ - "Automate workflows", - "Guides to automate workflows", - "Quickly tag resources", - "Set up New Relic using Helm charts", - "Set up New Relic using the Kubernetes operator", - "Automatically tag a simple \"Hello World\" Demo across the entire stack", - "Automate common tasks", - "Set up New Relic using Terraform" - ], - "published_at": "2020-09-24T02:30:06Z", - "title": "Automate workflows", - "updated_at": "2020-09-24T01:55:00Z", - "type": "developer", - "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871", - "document_type": "page", - "popularity": 1, - "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 30 min Automatically tag a simple \"Hello World\" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform", - "info": "", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 844.08765, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "sections": "Set up New Relic using Helm charts", - "body": " CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation" - }, - "id": "5efa999c196a67dfb4766445" - }, - { - "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png", - "url": "https://developer.newrelic.com/", - "sections": [ - "Mark your calendar for Nerd Days 1.0", - "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" - ], - "published_at": "2020-09-24T02:24:45Z", - "title": "New Relic Developers", - "updated_at": "2020-09-24T01:39:32Z", - "type": "developer", - "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab", - "document_type": "page", - "popularity": 1, - "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 19 Days : 14 Hours : 58 Minutes : 8 Seconds Register 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 20 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", - "info": "", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 843.3602, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "New Relic Developers", - "sections": "New Relic developer champions", - "body": " 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" - }, - "id": "5d6fe49a64441f8d6100a50f" - }, - { - "sections": [ - "New Relic One CLI reference", - "Installing the New Relic One CLI", - "Tip", - "New Relic One CLI Commands", + "Ingest and manage data", "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", - "type": "developer", - "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-09-24T02:26:06Z", - "updated_at": "2020-09-17T01:51:10Z", - "document_type": "page", - "popularity": 1, - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. 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. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. 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.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 748.79626, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "New Relic One CLI reference", - "sections": "New Relic One CLI reference", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "tags": "New Relic One app", - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use" - }, - "id": "5efa989e28ccbc535a307dd0" - }, - { - "image": "", - "url": "https://developer.newrelic.com/nerd-days/", - "sections": [ - "Nerd Days is a free 1-day event focused on building more perfect software", - "Register for Nerd Days 1.0", - "Save the date & join us online", - "Additional Nerd Days Events", - "Tracks", - "Observability", - "Cloud migration", - "Open source", - "Devops journey", - "Fundamentals", - "Nerd Days AMER Agenda", - "DevOps journey", - "Keynote", - "Instrumenting your service using agents", - "Increased Maturity with Full Stack Observability", - "Deploying an app on Kubernetes", - "Delivering SRE as a Service", - "Building applications on New Relic One", - "Exploring your data using NRQL", - "New Relic AI", - "Going Serverless: Chipping at the monolith", - "Logging for Modern Organizations", - "Grafana and Prometheus with TDP", - "Lunch Break", - "Custom Instrumentation", - "Exploring Data with NerdGraph", - "Tool Consolidation", - "Flex Integration - Build Your First Linux Configuration", - "Open Source powers the New Relic One Catalog", - "Alerts Best Practices", - "The Art & Science of Deciphering Perceived Performance: A look at how user behavior affects your data", - "Kubernetes Observability", - "Measuring code pipelines", - "New Relic CLI Wizardry/ Reducing toil with Terraform", - "True availability using Synthetics", - "How Observability-Driven Development accelerates DevOps transformations", - "CFP Customer Session: Cloud fundamentals", - "Testing in Production", - "NerdStorageVault: ThirdParty Secrets", - "Closing + Swag", - "Engage with the developer community" - ], - "published_at": "2020-09-24T02:28:36Z", - "title": "New Relic Developers", - "updated_at": "2020-09-24T01:52:03Z", - "type": "developer", - "external_id": "0b8374051901a77e242ce296c00eeb3c760439d1", - "document_type": "page", - "popularity": 1, - "body": "Nerd Days is a free 1-day event focused on building more perfect software Register for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region) Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. Save the date & join us online Choose the sessions you're interested in add Nerd Days to your calendar. You’ll hear from fellow engineers who built New Relic solutions and New Relic users from various industries. Whether you’re new or a data nerd, there’s an interactive session for you. Date: October 13, 2020 Time: 9AM PST - 3PM PST We look forward to building with you during Nerd Days! If you have any questions about Nerd Days please emails deco@newrelic.com. Additional Nerd Days Events EMEA RegistrationNov 10, 2020 APJ RegistrationOct 22, 2020 Tracks Tracks will vary by region. All sessions will be recorded and distributed after the event. Observability Cloud migration Open source Devops journey Fundamentals Nerd Days AMER Agenda We’ve got a packed schedule with thought-leaders of their respective industries Fundamentals Observability Cloud migration DevOps journey Open source 9:00 AM Keynote Lew Cirne 10:00 AM Instrumenting your service using agents Increased Maturity with Full Stack Observability Deploying an app on Kubernetes Delivering SRE as a Service Building applications on New Relic One 11:00 AM Exploring your data using NRQL New Relic AI Going Serverless: Chipping at the monolith Logging for Modern Organizations Grafana and Prometheus with TDP 12:00 PM Lunch Break Distant Disco 1:00 PM Custom Instrumentation Exploring Data with NerdGraph Tool Consolidation Flex Integration - Build Your First Linux Configuration Open Source powers the New Relic One Catalog 2:00 PM Alerts Best Practices The Art & Science of Deciphering Perceived Performance: A look at how user behavior affects your data Kubernetes Observability Measuring code pipelines New Relic CLI Wizardry/ Reducing toil with Terraform 3:00 PM True availability using Synthetics How Observability-Driven Development accelerates DevOps transformations CFP Customer Session: Cloud fundamentals Testing in Production NerdStorageVault: ThirdParty Secrets 4:00 PM Closing + Swag Jemiah Sius and Team Engage with the developer community @newrelic New Relic Forum Developers Hopin logo Event powered by Hopin", - "info": "", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 708.3028, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "New Relic Developers", - "sections": "New Relic CLI Wizardry/ Reducing toil with Terraform", - "body": " Integration - Build Your First Linux Configuration Open Source powers the New Relic One Catalog 2:00 PM Alerts Best Practices The Art & Science of Deciphering Perceived Performance: A look at how user behavior affects your data Kubernetes Observability Measuring code pipelines New Relic CLI Wizardry" - }, - "id": "5f3dd5bf28ccbc2349f56e4e" - }, - { - "category_2": "Measure DevOps success", - "nodeid": 34966, - "sections": [ - "New Relic solutions", - "Measure DevOps success", - "Cloud adoption", - "Optimize your cloud native environment", - "Automate instrumentation", - "Prerequisite", - "1. Make instrumentation part of every build", - "2. Take advantage of integrations and existing tools", - "3. Leverage the power of APIs", - "For more help" - ], - "title": "Automate instrumentation", - "category_0": "New Relic solutions", - "type": "docs", - "category_1": "New Relic solutions", - "external_id": "91b25e8572d235c7f95963650848fc6ab6cf4b39", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/NRCLItool.png", - "url": "https://docs.newrelic.com/docs/new-relic-solutions/new-relic-solutions/measure-devops-success/automate-instrumentation", - "published_at": "2020-09-24T13:07:39Z", - "updated_at": "2020-09-10T08:41:00Z", - "breadcrumb": "Contents / New Relic solutions / New Relic solutions / Measure DevOps success", - "document_type": "page", - "popularity": 1, - "info": "Capture tangible, measurable metrics from before and after deployments to optimize your DevOps team. ", - "body": "Replacing manual instrumentation with automated setup benefits you in many ways. Automation can make you faster, and it helps to eliminate fat-finger errors—and more importantly, it improves observability. You'll spend less time instrumenting systems, and reduce toil as your development ecosystem grows. Prerequisite Before starting this tutorial, be sure to complete the Measure code pipeline tutorial. 1. Make instrumentation part of every build Rolling instrumentation into your standard build process makes visibility the default, instead of being viewed as yet another burden on your developers. Modern build tools like Gradle can do almost anything; you can take advantage of that power to instrument your code quickly and efficiently. Read this Best Practices post for more information about automating instrumentation in your pipeline 2. Take advantage of integrations and existing tools It’s always worth taking a little extra time to look for time-saving integrations and tools that can help to achieve your automation goals. For example, you can use IBM’s open-sourced New Relic CLI (command line interface) tool to automate a variety of tasks, such as managing New Relic Synthetics monitors; creating, editing, and deleting New Relic Alerts policies and conditions; and managing user accounts. Use IBM's New Relic CLI tool to manage your Synthetics monitors, alert policies, and user accounts. 3. Leverage the power of APIs Now that you've instrumented your services, you can take advantage of New Relic's REST API to harvest information from your instrumentation and to manage your monitoring process. The New Relic API Explorer can help you to determine the cURL request format, available parameters, potential response status codes, and JSON response structure for each of the available API calls. The New Relic documentation includes a wealth of additional information on APIs that you can use to automate a number of important tasks, including: APIs to set up alert conditions APIs to define synthetic monitors APIs to create dashboards For more help", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 625.1712, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "sections": "New Relic solutions", - "category_0": "New Relic solutions", - "category_1": "New Relic solutions", - "body": " It’s always worth taking a little extra time to look for time-saving integrations and tools that can help to achieve your automation goals. For example, you can use IBM’s open-sourced New Relic CLI (command line interface) tool to automate a variety of tasks, such as managing New Relic Synthetics", - "breadcrumb": "Contents / New Relic solutions / New Relic solutions / Measure DevOps success" - }, - "id": "5f5e0c14196a67e25fce6a8a" - } - ], - "/build-apps/publish-deploy": [ - { - "image": "", - "url": "https://developer.newrelic.com/build-apps/", - "sections": [ - "Build apps", - "Guides to build apps", - "Create a \"Hello, World!\" application", - "Permissions for managing applications", - "Set up your development environment", - "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", - "Publish and deploy apps", - "Create a custom map view" - ], - "published_at": "2020-09-24T02:30:06Z", - "title": "Build apps", - "updated_at": "2020-09-24T01:55:00Z", - "type": "developer", - "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", - "document_type": "page", - "popularity": 1, - "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   Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 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 Publish and deploy apps Start sharing the apps you build 30 min Create a custom map view Build an app to show page view data on a map", - "info": "", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 176.95505, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "Build apps", - "sections": "Publish and deploy apps", - "body": " 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 Publish and deploy apps Start sharing the apps you build 30 min Create a custom map view Build an app to show page view data on a map" - }, - "id": "5efa999d64441fc0f75f7e21" - }, - { - "sections": [ - "Permissions for managing applications", - "New Relic One pricing plan", - "Original product-based pricing" - ], - "title": "Permissions for managing applications", - "type": "developer", - "tags": [ - "nerdpack manager", - "permissions", - "managing apps" + "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" ], - "external_id": "c7f4c7fbd9d093d303c7f8268f8560ff9f435230", + "title": "Telemetry SDKs: Report custom telemetry data", + "category_0": "Telemetry Data Platform", + "type": "docs", + "category_1": "Ingest and manage data", + "external_id": "47a4c8f38c1b1674504ea302d865fd499e90ea39", "image": "", - "url": "https://developer.newrelic.com/build-apps/permission-manage-apps/", - "published_at": "2020-09-24T02:30:05Z", - "updated_at": "2020-09-02T02:04:41Z", + "url": "https://docs.newrelic.com/docs/telemetry-data-platform/get-started/capabilities/telemetry-sdks-send-custom-telemetry-data-new-relic", + "published_at": "2020-09-24T20:03:48Z", + "updated_at": "2020-09-17T14:37:52Z", + "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs", "document_type": "page", "popularity": 1, - "info": "Learn about permissions for subscribing to apps", - "body": "Permissions for managing applications When you create an app, you'll likely want to share it. From New Relic One's Apps page, you can subscribe to apps you create, publish, and deploy, and to other publicly available apps. You must have the Nerdpack manager role to subcribe accounts to apps. Read on to learn about permissions and versions. Permissions for managing applications The Nerdpack manager role is a New Relic add-on role. When you create a Nerdpack, you have the Nerdpack manager role for handling that Nerdpack. New Relic account administrators have the Nerdpack manager role automatically, and can subscribe their accounts to available Nerdpacks. 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.", + "info": "Report custom telemetry data with New Relic's open-source Telemetry SDKs.", + "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 C C library on Github New Relic Traces Rust Rust library on Github 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 67.95098, + "_score": 198.44363, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Permissions for managing applications", - "sections": "Permissions for managing applications", - "info": "Learn about permissions for subscribing to apps", - "tags": "managing apps", - "body": "Permissions for managing applications When you create an app, you'll likely want to share it. From New Relic One's Apps page, you can subscribe to apps you create, publish, and deploy, and to other publicly available apps. You must have the Nerdpack manager role to subcribe accounts to apps. Read" + "title": "Telemetry SDKs: Report custom telemetry data", + "sections": "Telemetry SDKs: Report custom telemetry data", + "info": "Report custom telemetry data with New Relic's open-source Telemetry SDKs.", + "category_0": "Telemetry Data Platform", + "category_2": "Ingest APIs", + "body": " 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", + "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs" }, - "id": "5f45bf2864441ffb4dfdcdbb" + "id": "5d89fefbe7b9d2537ed30dc1" }, { - "category_2": "Hosting services", - "nodeid": 13151, + "category_2": "Get started", + "nodeid": 36051, "sections": [ - "Node.js agent", - "Getting started", - "Installation and configuration", - "Supported features", - "Attributes", - "API guides", - "Hosting services", - "Troubleshooting", - "Install New Relic Node.js agent in GAE flexible environment", - "Use native deploy", - "Build a custom runtime", - "Optional: Disable health checks", - "Get New Relic agent troubleshooting logs from GAE", + "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": "Install New Relic Node.js agent in GAE flexible environment", - "category_0": "APM agents", + "title": "Get data into New Relic", + "category_0": "Telemetry Data Platform", "type": "docs", - "category_1": "Node.js agent", - "external_id": "92a838b215a23bd47fcc8b45abdf347c56f720db", + "category_1": "Ingest and manage data", + "external_id": "7a413b4d7e5bd81088a08507ae4bad64c7e24b2d", "image": "", - "url": "https://docs.newrelic.com/docs/agents/nodejs-agent/hosting-services/install-new-relic-nodejs-agent-gae-flexible-environment", - "published_at": "2020-09-24T06:38:34Z", - "updated_at": "2020-08-18T06:29:37Z", - "breadcrumb": "Contents / APM agents / Node.js agent / Hosting services", + "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-09-24T12:05:28Z", + "updated_at": "2020-08-10T23:16:39Z", + "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Get started", "document_type": "page", "popularity": 1, - "info": "How to install your APM's Node.js app in the Google App Engine (GAE) flexible environment. ", - "body": "With New Relic's Node.js agent, you can monitor applications that reside in the Google App Engine (GAE) flexible environment. Adding New Relic to your GAE flex app gives you insight into the health and performance of your app and extends GAE with metrics you can view in APM and browser monitoring. This document explains how to add New Relic to your GAE flex app using either of these methods: Google App Engine's \"native mode\" installation with a standard GAE runtime Docker installation using a custom runtime Use native deploy To use Google App Engine's \"native mode\" installation with your Node.js app: Follow standard procedures to install New Relic's Node.js agent, including your license key. Be sure to save the newrelic module to the package.json file. Follow Google App Engine procedures for Node.js to create a new Cloud Platform project, create an App Engine application, and complete other prerequisites for the Google Cloud SDK. Optional: Set environment variables to configure the Node.js agent's GAE app.yaml file. Use the Google Cloud SDK's gcloud command line tool to deploy GAE apps. To deploy your Node.js app to your initialized GAE flexible environment, run the following command: gcloud --project new-relic-apm-nodejs app deploy Google App Engine automatically includes your Node.js app's newrelic.js configuration file in the deployed package. Wait until the deployment completes, then view your GAE flex app data in the APM Summary page. Build a custom runtime See Google's documentation for building custom runtimes. This example describes how to add New Relic to your GAE flex app by building a custom runtime for Docker. You can deploy the app without any special configuration. For more information about deploying and configuring your Node.js app in the GAE flexible environment, see: Google App Engine's documentation for Node.js Google App Engine's tutorial to deploy a Node.js app 1. Set up the GAE project and install dependencies Follow standard procedures to install New Relic's Node.js agent, including your license key. Be sure to save the newrelic module to the package.json file. Follow Google App Engine procedures for Node.js to create a new Cloud Platform project, create an App Engine application, and complete other prerequisites for the Google Cloud SDK. The Google Cloud SDK provides the gcloud command line tool to manage and deploy GAE apps. 2. Configure your app.yaml The app.yaml configuration file is required for a GAE flexible environment app with a custom runtime. At a minimum, make sure it contains: runtime: custom env: flex Optional: Set environment variables. 3. Configure and deploy The Dockerfile defines the Docker image to be built and is required for a GAE flexible environment app. To create the Dockerfile, build the container, and deploy your app, follow the GAE procedures for Node.js. Wait until the deployment completes. To view your GAE flex app data in New Relic, go to the APM Summary page. Optional: Disable health checks Google App Engine sends periodic health check requests to confirm that an instance has been successfully deployed, and to check that a running instance maintains a healthy status. A health check is an HTTP request to the URL /_ah/health. If you create a custom runtime, your app must be able to handle a large number of health check requests. Otherwise, your app data may not display correctly in New Relic APM. If you notice performance issues, disable GAE health checks. In your app.yaml, add: health_check: enable_health_check: False Get New Relic agent troubleshooting logs from GAE Use these resources to troubleshoot your GAE flex environment app: To connect to the GAE instance and start a shell in the Docker container running your code, see Debugging an instance. To redirect New Relic Node.js agent logs to Stackdriver in the Cloud Platform Console, change the newrelic.js configuration file to: log_file_name: STDOUT To view the logs, use the Cloud Platform Console's Log Viewer. 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.", + "info": "An introduction to how to get data into New Relic. ", + "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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 34.841015, + "_score": 101.43119, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Use native deploy", - "info": "How to install your APM's Node.js app in the Google App Engine (GAE) flexible environment. ", - "body": ". This document explains how to add New Relic to your GAE flex app using either of these methods: Google App Engine's "native mode" installation with a standard GAE runtime Docker installation using a custom runtime Use native deploy To use Google App Engine's "native mode" installation with your" + "sections": "APIs for sending metrics, traces, logs, and events", + "category_0": "Telemetry Data Platform", + "body": " also have data-ingest APIs: Trace API Event API Metric API Log API To learn about the differences between these data types, see Data types. New Relic One applications You can build entirely custom applications that reside in New Relic One and make use of any data you want. You can use existing open", + "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Get started" }, - "id": "5972fea707552313d3f9ba8d" + "id": "5f24aa60196a67ede394f5f3" }, { - "category_2": "Hosting services", - "nodeid": 13866, + "category_2": "Custom events", + "nodeid": 13806, "sections": [ - "Python agent", - "Getting started", - "Installation", - "Configuration", - "Supported features", - "Back-end services", - "Custom instrumentation", - "API guides", - "Python agent API", - "Web frameworks and servers", - "Hosting services", - "Attributes", - "Troubleshooting", - "Install the Python agent in GAE flexible environment", - "Deploy using GAE's native support", - "Build a custom runtime using Docker", - "Recommendation: Disable health checks", - "Get agent troubleshooting logs from GAE", + "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": "Install the Python agent in GAE flexible environment", - "category_0": "APM agents", + "title": "Report custom event data", + "category_0": "Insights", "type": "docs", - "category_1": "Python agent", - "external_id": "c1ce9a74f2eccba9cf0cd509a6f15f2d02fabb16", + "category_1": "Event data sources", + "external_id": "afb5f5a81ae06b22935d98c470ed9cabd7c9da6b", "image": "", - "url": "https://docs.newrelic.com/docs/agents/python-agent/hosting-services/install-python-agent-gae-flexible-environment", - "published_at": "2020-09-24T08:57:17Z", - "updated_at": "2020-08-30T17:24:26Z", - "breadcrumb": "Contents / APM agents / Python agent / Hosting services", + "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/report-custom-event-data", + "published_at": "2020-09-24T03:37:06Z", + "updated_at": "2020-07-26T05:52:23Z", + "breadcrumb": "Contents / Insights / Event data sources / Custom events", "document_type": "page", "popularity": 1, - "info": "How to install your Python app in the Google App Engine (GAE) flexible environment. ", - "body": "With the Python agent, you can monitor applications that reside in the Google App Engine (GAE) flexible environment. Adding agent data to your GAE flex app gives you insight into the health and performance of your app and extends GAE with metrics you can view in New Relic One. This document explains how to add agent data to your GAE flex app using either of these methods: Google App Engine's \"native mode\" installation with a standard GAE runtime Docker installation using a custom runtime Deploy using GAE's native support When using Google App Engine \"native mode\" installation, you provide your app code and an app.yaml file. Google App Engine then deploys to a standard prebuilt Docker image. For example, to deploy with native support for a Flask/Django app: Follow standard procedures to install the Python agent, including your license key. Set the NEW_RELIC_CONFIG_FILE as an environment variable pointing to newrelic.ini. Once the agent and configuration file have been installed, the Python agent can automatically monitor applications that reside in the GAE flexible environment. Wait until the deployment completes, then view your GAE flex app data in the APM Summary page. Build a custom runtime using Docker See Google's documentation for building custom runtimes. This example describes how to add agent data to your GAE flex app by building a custom runtime for Docker. For more information about deploying and configuring your Node.js app in the GAE flexible environment, see: Our GAE flex examples on Github for Python Google App Engine's documentation for Python Google App Engine's tutorials to deploy a Python app 1. Set up the GAE project and install dependencies When building a custom runtime using Docker, set the NEW_RELIC_CONFIG_FILE as an environment variable pointing to the Dockerfile instead of to your Python app's newrelic.ini. Follow standard procedures to install the Python agent, including your license key. Follow Google App Engine procedures Python to create a Google Cloud Platform project, create an App Engine application, and complete other prerequisites for the Google Cloud SDK. The Google Cloud SDK also provides the gcloud command line tool to manage and deploy GAE apps. 2. Configure your app.yaml The app.yaml configuration file is required for a GAE flexible environment app with a custom runtime. At a minimum, make sure it contains: env: flex runtime: custom 3. Configure a Dockerfile The Dockerfile defines the Docker image to be built and is required for a GAE flexible environment app. The following Dockerfile example shows the Python agent installed for an application served with gunicorn. These procedures are similar to the Python quick start guide. The Dockerfile will contain customer-specific code, including Python version, installation requirements, etc). # [START dockerfile] FROM gcr.io/google_appengine/python # Install the fortunes binary from the debian repositories. RUN apt-get update && apt-get install -y fortunes # Optional: Change the -p argument to use Python 2.7. RUN virtualenv /env -p python3.5 # Set virtualenv environment variables. This is equivalent to running # source /env/bin/activate. ENV VIRTUAL_ENV /env ENV PATH /env/bin:$PATH ADD requirements.txt /app/ RUN pip install -r requirements.txt ADD . /app/ CMD NEW_RELIC_CONFIG_FILE=newrelic.ini newrelic-admin run-program gunicorn -b :$PORT main:app # [END dockerfile] 4. Deploy Docker image to initialized GAE flexible environment To deploy your Docker image to your initialized GAE flexible environment, run the following command: gcloud app deploy Wait until the deployment completes. To open the app in the browser, run the following command: gcloud app browse To view your GAE flex app data, go to the APM Summary page. Recommendation: Disable health checks Google App Engine sends periodic health check requests to confirm that an instance has been successfully deployed, and to check that a running instance maintains a healthy status. A health check is an HTTP request to the URL /_ah/health. If you create a custom runtime, your app must be able to handle a large number of health check requests. Otherwise, your app data may not display correctly in APM. Recommendation: Configure your app.yaml to disable health checks by adding: health_check: enable_health_check: False Get agent troubleshooting logs from GAE Use these resources to troubleshoot your GAE flex environment app: To connect to the GAE instance and start a shell in the Docker container running your code, see Debugging an instance. To redirect Python agent logs to Stackdriver in the Cloud Platform Console, add the following statement to the newrelic.ini configuration: log_file = stderr To view the logs, use the Cloud Platform Console's Log Viewer. 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.", + "info": "An overview of the options for sending custom event data to New Relic. ", + "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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 24.268856, + "_score": 100.029816, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Deploy using GAE's native support", - "info": "How to install your Python app in the Google App Engine (GAE) flexible environment. ", - "body": " explains how to add agent data to your GAE flex app using either of these methods: Google App Engine's "native mode" installation with a standard GAE runtime Docker installation using a custom runtime Deploy using GAE's native support When using Google App Engine "native mode" installation, you provide" + "title": "Report custom event data", + "sections": "Event data sources", + "info": "An overview of the options for sending custom event data to New Relic. ", + "category_1": "Event data sources", + "category_2": "Custom events", + "body": " the Flex integration tool to report your own custom event data. Mobile agent Use the mobile agent API to send custom events and attributes. Synthetics Add custom attributes to the SyntheticCheck event via the $util.insights tools. For ways to report other types of custom data, see: Metric API Logs Trace", + "breadcrumb": "Contents / Insights / Event data sources / Custom events" }, - "id": "5f3fb624196a672fda1cd4a3" + "id": "5e8e7f9de7b9d2aa122cf0f6" }, { - "category_2": "Installation", - "nodeid": 13121, + "category_2": "Custom events", + "nodeid": 13661, "sections": [ - "Go agent", - "Get started", - "Installation", - "Configuration", - "Instrumentation", - "API guides", - "Features", - "Troubleshooting", - "Install the Go agent in GAE flexible environment", - "Build a custom runtime using Docker", - "Recommendation: Disable health checks", - "Get agent troubleshooting logs from GAE", + "Event data sources", + "Default events", + "Custom events", + "Data requirements and limits for custom event data", + "General requirements", + "Reserved words", + "Additional Browser PageAction requirements", + "Additional Event API requirements", + "Event type limits", "For more help" ], - "title": "Install the Go agent in GAE flexible environment", - "category_0": "APM agents", + "title": "Data requirements and limits for custom event data", + "category_0": "Insights", "type": "docs", - "category_1": "Go agent", - "external_id": "d6409627d1a1d951d544a84613ad1709456f4560", + "category_1": "Event data sources", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", + "external_id": "f5beef0d09bb5918be3f8a1a3ece98c09947cd1e", "image": "", - "url": "https://docs.newrelic.com/docs/agents/go-agent/installation/install-go-agent-gae-flexible-environment", - "published_at": "2020-09-24T06:37:14Z", - "updated_at": "2020-08-15T09:48:00Z", - "breadcrumb": "Contents / APM agents / Go agent / Installation", + "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", + "published_at": "2020-09-24T07:25:32Z", + "updated_at": "2020-09-20T19:39:10Z", + "breadcrumb": "Contents / Insights / Event data sources / Custom events", "document_type": "page", "popularity": 1, - "info": "How to install your New Relic's Go app in the Google App Engine (GAE) flexible environment. ", - "body": "With our Go agent, you can monitor applications that reside in the Google App Engine (GAE) flexible environment. Adding New Relic to your GAE flex app gives you insight into the health and performance of your app and extends GAE with metrics you can view in APM and browser monitoring. Here we explain how to add New Relic to your GAE flex app by configuring a custom runtime, and give an example of deploying a Go app with Docker. The Go agent can run in a GAE flexible environment using a custom runtime. Due to limitations of other environments, do not use the GAE standard environment or Google App Engine's \"native mode\" installation. Build a custom runtime using Docker See Google's documentation for building custom runtimes. This example describes how to add New Relic to your GAE flex app by installing the Go agent, building a custom Go runtime for Docker, and deploying a golang application. For more information about deploying and configuring your Go app in the GAE flexible environment, see: Google App Engine's documentation for Go Google App Engine's tutorials to deploy a Go app 1. Set up the GAE project and install dependencies Follow standard procedures to install the Go agent for your specific app server, including your license key. Follow Google App Engine procedures for Go to create a new Cloud Platform project, create an App Engine application, download and install git, and complete other prerequisites for the Google Cloud SDK. The Google Cloud SDK provides the gcloud command line tool to manage and deploy GAE apps. 2. Configure your app.yaml The app.yaml configuration file is required for a GAE flexible environment app with a custom runtime. At a minimum, make sure it contains: runtime: custom env: flex 3. Configure a Dockerfile The Dockerfile defines the Docker image to be built and is required for a GAE flexible environment app. The following Dockerfile example code defines the golang version used. FROM golang:1.8-onbuild CMD go run main.go 4. Build a Docker image To build the Docker image, run the following command. Be sure to include the period at the end of the code, to indicate the current directory contains the build files. docker build --rm -t Docker-image-name . 5. Deploy Docker image to initialized GAE flexible environment To deploy your Docker image to your initialized GAE flexible environment, run the following command: gcloud --project go-app-name app deploy Wait until the deployment completes. To view your GAE flex app data in New Relic, go to the APM Summary page. Recommendation: Disable health checks Google App Engine sends periodic health check requests to confirm that an instance has been successfully deployed, and to check that a running instance maintains a healthy status. A health check is an HTTP request to the URL /_ah/health. If you create a custom runtime, your app must be able to handle a large number of health check requests. Otherwise, your app data may not display correctly in APM. Recommendation: Configure your app.yaml to disable health checks by adding: health_check: enable_health_check: False Get agent troubleshooting logs from GAE Use these resources to troubleshoot your GAE flex environment app: To connect to the GAE instance and start a shell in the Docker container running your code, see GAE's documentation for debugging an instance. To redirect New Relic Go agent logs to Stackdriver in the Cloud Platform Console, change the newrelic.yml file to: log_file_name: STDOUT 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.", + "info": "For New Relic, general limits and requirements for reporting custom events and attributes. ", + "body": "You can report custom events to New Relic in several ways, including the New Relic Event API, APM agent APIs, Browser agent APIs, and the Mobile SDK. This document contains general requirements and rules for inserting and using custom events and their associated attributes. Additional requirements may apply based on the method you use. General requirements How long custom data is retained depends on your Insights subscription and its associated data retention. When reporting custom events and attributes, follow these general requirements for supported data types, naming syntax, and size: Requirement Description Payload Total maximum size or length: 1 MB maximum per POST. We highly recommend using compression. The Event API has additional HTTP rate limits. Attribute data types Attribute values can be either a string or a numeric integer or float. If your attribute values contain date information, define it as an unformatted Unix timestamp (in seconds or milliseconds) by using the Insights data formatter. Attribute size Maximum name size: 255 bytes. Maximum attribute value size: Custom attributes sent by the agent: 255 bytes Attributes attached to custom events sent using the Event API: 4096 characters Charts may only display the first 255 characters of attribute values. For complete attribute values, use the JSON chart type or Query API. Maximum total attributes per event: 254. Exception: If you use an APM agent API, the max is 64. Maximum total attributes per event type: 48,000. Naming syntax Attribute names can be a combination of alphanumeric characters, colons (:), periods (.), and underscores (_). Event types (using the eventType attribute) can be a combination of alphanumeric characters, colons (:), and underscores (_). Do not use words reserved for use by NRQL. Null values The database does not store any data with a null value. Reserved words Avoid using the following reserved words as names for events and attributes. Otherwise, unexpected results may occur. This is not a complete list. In general, it's a good practice to avoid using MySQL-reserved words to avoid collision with future New Relic functionality. Keyword Description accountId This is a reserved attribute name. If it's included, it will be dropped during ingest. appId Value must be an integer. If it is not an integer, the attribute name and value will be dropped during ingest. eventType The event type as stored in New Relic. New Relic agents and scripts normally report this as eventType. Can be a combination of alphanumeric characters, colons (:), and underscores (_). Be sure to review the prohibited eventType values and eventType limits. Prohibited eventType values For your eventType value, avoid using: Metric, MetricRaw, and strings prefixed with Metric[0-9] (such as Metric2 or Metric1Minute). Public_ and strings prefixed with Public_. These event types are reserved for use by New Relic. Events passed in with these eventType values will be dropped. timestamp Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds. It must be +/-1 day (24 hours) of the current time on the server. Log forwarding terms The following keys are reserved by the Infrastructure agent's log forwarding feature: entity.guid, log, hostname, plugin.type, fb.input. If used, they are dropped during ingest and a warning is added to the logs. NRQL syntax terms If you need to use NRQL syntax terms as attribute names, including dotted attributes, they must be enclosed in backticks; for example, `LIMIT` or `consumer.offset`. Otherwise, avoid using these reserved words: ago, and, as, auto, begin, begintime, compare, day, days, end, endtime, explain, facet, from, hour, hours, in, is, like, limit, minute, minutes, month, months, not, null, offset, or, raw, second, seconds, select, since, timeseries, until, week, weeks, where, with Additional Browser PageAction requirements For additional requirements for using New Relic Browser's custom PageAction event, see Insert custom data via New Relic Browser agent. Additional Event API requirements For more requirements and details for the Event API, see Event API. Event type limits The current limit for total number of eventType values is 250 per sub-account in a given 24-hour time period. If a user exceeds this limit, New Relic may filter or drop data. Event types include: Default events from New Relic agents Custom events from New Relic agents Custom events from Insights custom event inserter 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 21.667868, + "_score": 93.40236, "_version": null, "_explanation": null, "sort": null, "highlight": { - "info": "How to install your New Relic's Go app in the Google App Engine (GAE) flexible environment. ", - "body": " command line tool to manage and deploy GAE apps. 2. Configure your app.yaml The app.yaml configuration file is required for a GAE flexible environment app with a custom runtime. At a minimum, make sure it contains: runtime: custom env: flex 3. Configure a Dockerfile The Dockerfile defines the Docker" + "title": "Data requirements and limits for custom event data", + "sections": "Additional Event API requirements", + "info": "For New Relic, general limits and requirements for reporting custom events and attributes. ", + "category_1": "Event data sources", + "category_2": "Custom events", + "body": "You can report custom events to New Relic in several ways, including the New Relic Event API, APM agent APIs, Browser agent APIs, and the Mobile SDK. This document contains general requirements and rules for inserting and using custom events and their associated attributes. Additional requirements", + "breadcrumb": "Contents / Insights / Event data sources / Custom events" }, - "id": "5f37af50196a67d8f955e63e" - } - ], - "/explore-docs/nr1-common": [ + "id": "59f4354f4bb81c2ea8b80d0a" + }, { + "category_2": "Get started", + "nodeid": 11431, "sections": [ - "New Relic One CLI reference", - "Installing the New Relic One CLI", - "Tip", - "New Relic One CLI Commands", + "NRQL: New Relic Query Language", "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", - "type": "developer", - "tags": [ - "New Relic One app", - "nerdpack commands" + "NRQL query tools", + "NRQL query tutorials", + "Introduction to NRQL, New Relic's query language", + "What is NRQL?", + "Where can you use NRQL?", + "What data can you query with NRQL?", + "Start using NRQL", + "NRQL query examples", + "NRQL syntax", + "For more help" ], - "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-09-24T02:26:06Z", - "updated_at": "2020-09-17T01:51:10Z", + "title": "Introduction to NRQL, New Relic's query language", + "category_0": "Query your data", + "type": "docs", + "category_1": "NRQL: New Relic Query Language", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", + "external_id": "d44be2c7df7addda8679b4c842015223cfcbd1a3", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-view-chart-nrql-query_0.png", + "url": "https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", + "published_at": "2020-09-24T08:40:21Z", + "updated_at": "2020-09-24T08:40:20Z", + "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started", "document_type": "page", "popularity": 1, - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. 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. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. 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.", + "info": "An introduction to New Relic Query Language (NRQL) and how to use it.", + "body": "One way to query your New Relic data is with the New Relic Query Language (NRQL). This resource explains what NRQL is, when and how you can use it, and basic syntax rules. For more detailed information on querying, including a listing of clauses and functions and example queries, see NRQL syntax, clauses, and functions. What is NRQL? NRQL is New Relic's SQL-like query language. You can use NRQL to retrieve detailed New Relic data and get insight into your applications, hosts, and business-important activity. Reasons to use NRQL include: To answer a question for the purpose of troubleshooting or business analysis To create a new chart To make API queries of New Relic data (for example, using our NerdGraph API) NRQL is used behind the scenes to generate some New Relic charts: Some New Relic charts are built using NRQL. One way to start using NRQL is to view a chart's query and then edit it to make your own custom chart. Where can you use NRQL? You can use NRQL in these places: New Relic One query builder: Advanced mode is a NRQL query interface Basic mode provides a simplified query experience that doesn't require knowledge of NRQL but that uses NRQL to generate results New Relic Insights NerdGraph: our GraphQL-format API, which includes options for making NRQL queries one.newrelic.com > Query your data: You can run a NRQL query in both New Relic One and New Relic Insights. This NRQL query shows a count of distributed tracing spans faceted by their entity names. NRQL is one of several ways to query New Relic data. For more on all query options, see Query your data. What data can you query with NRQL? NRQL allows you to query these New Relic data types: Event data from all New Relic products, including: APM events, like Transaction New Relic Browser events, like PageView New Relic Mobile events, like Mobile Infrastructure events, like ProcessSample Synthetics events, like SyntheticCheck Custom events, like those reported by the Event API Metric timeslice data (metrics reported by New Relic APM, Browser, and Mobile) The Metric data type (metrics reported by the Metric API and data sources that use that API) The Span data type (distributed tracing data) The Log data type (data from New Relic Logs) Some data, like relationships between monitored entities, is not available via NRQL but is available using our NerdGraph API. Start using NRQL One way to start using NRQL and to understand what data you have available is to go to a NRQL interface (for example, the New Relic One query builder), type FROM, and press space. The interface will suggest available types of data: To see the attributes available for a specific data type, type FROM DATA_TYPE SELECT and press space. The interface will suggest available attributes. For example: To see the complete JSON associated with a data type, including all of its attributes, use the keyset() attribute. For example: FROM Transaction SELECT keyset() NRQL is used behind the scenes to build some New Relic charts and dashboards. One way to learn NRQL is to find one of these NRQL-generated charts and start playing with the NRQL to create new, customized queries and charts: Charts built with NRQL will have View query as an option. You can then edit and customize that query to see how your changes affect the resulting visualization. To explore your data without having to use NRQL, use the basic mode of New Relic One query builder. NRQL query examples Here's an example NRQL query of Transaction data, which is reported by New Relic APM. FROM Transaction SELECT average(duration) FACET appName TIMESERIES auto This would generate a chart that looks like: Here are some more query examples: Basic NRQL query of Browser data Here's a NRQL query of PageView data, which is reported by New Relic Browser. SELECT uniqueCount(user) FROM PageView WHERE userAgentOS = 'Mac' FACET countryCode SINCE 1 day ago LIMIT 20 Attribute name with a space in it If a custom attribute name has a space in it, use backticks around the attribute name: SELECT count(*) FROM Transaction FACET `Logged-in user` Querying multiple data sources To return data from two data sources, separate their data types with a comma. For example, this query returns a count of all APM transactions and Browser events over the last three days:​ SELECT count(*) FROM Transaction, PageView SINCE 3 days ago Query returning multiple columns To return multiple columns from a dataset, separate the aggregator arguments with a comma: SELECT function(attribute), function(attribute) ... FROM ... This query returns the minimum, average, and maximum duration for New Relic Browser PageView events over the last week: SELECT min(duration), max(duration), average(duration) FROM PageView SINCE 1 week ago See more NRQL query examples. NRQL syntax The syntax of a NRQL query is similar to standard SQL queries. Here is a breakdown of the structure of a NRQL query: SELECT function(attribute) [AS 'label'][, ...] FROM data type [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] Basic rules include: NRQL condition Details Required values The SELECT statement and FROM clause are required. All other clauses are optional. You can start your query with either SELECT or FROM. Query string size The query string must be less than 4 KB. Case sensitivity The data type names and attribute names are case sensitive. NRQL clauses and functions are not case sensitive. Syntax for strings NRQL uses single quotes to designate strings. For example: ... where traceId = '030a573f0df02c57' Attribute names with spaces Use backticks `` to quote a custom attribute name that has a space in it. For example: ... FACET `Logged-in user` Data type coercion Insights does not support data type \"coercion.\" For more information, see Data type conversion. Use of math functions Basic and advanced math functions are supported in the SELECT statement. JOIN functions NRQL does not have the equivalent of the SQL JOIN function, but you can simulate a JOIN with custom attributes. Read more about NRQL syntax and functions. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 260.67004, + "_score": 79.749886, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI reference", - "sections": "New Relic One CLI Commands", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "tags": "New Relic One app", - "body": " extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions" + "body": " New Relic Mobile events, like Mobile Infrastructure events, like ProcessSample Synthetics events, like SyntheticCheck Custom events, like those reported by the Event API Metric timeslice data (metrics reported by New Relic APM, Browser, and Mobile) The Metric data type (metrics reported by the Metric" }, - "id": "5efa989e28ccbc535a307dd0" - }, + "id": "5f2abd47196a67747343fbe1" + } + ], + "/explore-docs/newrelic-cli": [ { "image": "", "url": "https://developer.newrelic.com/automate-workflows/", @@ -2449,29 +2655,29 @@ "Guides to automate workflows", "Quickly tag resources", "Set up New Relic using Helm charts", - "Set up New Relic using the Kubernetes operator", "Automatically tag a simple \"Hello World\" Demo across the entire stack", + "Set up New Relic using the Kubernetes operator", "Automate common tasks", "Set up New Relic using Terraform" ], - "published_at": "2020-09-24T02:30:06Z", + "published_at": "2020-09-25T01:49:59Z", "title": "Automate workflows", - "updated_at": "2020-09-24T01:55:00Z", + "updated_at": "2020-09-25T01:49:59Z", "type": "developer", "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871", "document_type": "page", "popularity": 1, - "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 30 min Automatically tag a simple \"Hello World\" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform", + "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 30 min Automatically tag a simple \"Hello World\" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform", "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 172.00714, + "_score": 821.5599, "_version": null, "_explanation": null, "sort": null, "highlight": { "sections": "Set up New Relic using Helm charts", - "body": " CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation" + "body": " CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation" }, "id": "5efa999c196a67dfb4766445" }, @@ -2494,68 +2700,227 @@ "New Relic developer champions", "New Relic Podcasts" ], - "published_at": "2020-09-24T02:24:45Z", + "published_at": "2020-09-25T01:41:27Z", "title": "New Relic Developers", - "updated_at": "2020-09-24T01:39:32Z", + "updated_at": "2020-09-25T01:37:24Z", "type": "developer", "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab", "document_type": "page", "popularity": 1, - "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 19 Days : 14 Hours : 58 Minutes : 8 Seconds Register 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 20 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", + "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 18 Days : 14 Hours : 58 Minutes : 41 Seconds Register 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 20 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", "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 155.65863, + "_score": 820.98395, "_version": null, "_explanation": null, "sort": null, "highlight": { "title": "New Relic Developers", "sections": "New Relic developer champions", - "body": " 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" + "body": " 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" }, "id": "5d6fe49a64441f8d6100a50f" }, { - "nodeid": 37686, "sections": [ - "AWS Lambda monitoring", + "New Relic One CLI reference", + "Installing the New Relic One CLI", + "Tip", + "New Relic One CLI Commands", "Get started", - "Enable Lambda monitoring", - "UI and data", - "Troubleshooting", - "Update serverless monitoring for AWS Lambda", - "Update our Lambda integration via CLI", - "Update Layers via CLI", - "Update a manual Serverless Application Repository install", - "Enabling log management", + "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", + "type": "developer", + "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-09-25T01:49:59Z", + "updated_at": "2020-09-17T01:51:10Z", + "document_type": "page", + "popularity": 1, + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. 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. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. 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.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 705.7642, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "New Relic One CLI reference", + "sections": "New Relic One CLI reference", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use" + }, + "id": "5efa989e28ccbc535a307dd0" + }, + { + "image": "", + "url": "https://developer.newrelic.com/nerd-days/", + "sections": [ + "Nerd Days is a free 1-day event focused on building more perfect software", + "Register for Nerd Days 1.0", + "Save the date & join us online", + "Additional Nerd Days Events", + "Tracks", + "Observability", + "Cloud migration", + "Open source", + "Devops journey", + "Fundamentals", + "Nerd Days AMER Agenda", + "DevOps journey", + "Keynote", + "Instrumenting your service using agents", + "Increased Maturity with Full Stack Observability", + "Deploying an app on Kubernetes", + "Delivering SRE as a Service", + "Building applications on New Relic One", + "Exploring your data using NRQL", + "New Relic AI", + "Going Serverless: Chipping at the monolith", + "Logging for Modern Organizations", + "Grafana and Prometheus with TDP", + "Lunch Break", + "Custom Instrumentation", + "Exploring Data with NerdGraph", + "Tool Consolidation", + "Flex Integration - Build Your First Linux Configuration", + "Open Source powers the New Relic One Catalog", + "Alerts Best Practices", + "The Art & Science of Deciphering Perceived Performance: A look at how user behavior affects your data", + "Kubernetes Observability", + "Measuring code pipelines", + "New Relic CLI Wizardry/ Reducing toil with Terraform", + "True availability using Synthetics", + "How Observability-Driven Development accelerates DevOps transformations", + "CFP Customer Session: Cloud fundamentals", + "Testing in Production", + "NerdStorageVault: ThirdParty Secrets", + "Closing + Swag", + "Engage with the developer community" + ], + "published_at": "2020-09-25T01:52:51Z", + "title": "New Relic Developers", + "updated_at": "2020-09-24T01:52:03Z", + "type": "developer", + "external_id": "0b8374051901a77e242ce296c00eeb3c760439d1", + "document_type": "page", + "popularity": 1, + "body": "Nerd Days is a free 1-day event focused on building more perfect software Register for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region) Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. Save the date & join us online Choose the sessions you're interested in add Nerd Days to your calendar. You’ll hear from fellow engineers who built New Relic solutions and New Relic users from various industries. Whether you’re new or a data nerd, there’s an interactive session for you. Date: October 13, 2020 Time: 9AM PST - 3PM PST We look forward to building with you during Nerd Days! If you have any questions about Nerd Days please emails deco@newrelic.com. Additional Nerd Days Events EMEA RegistrationNov 10, 2020 APJ RegistrationOct 22, 2020 Tracks Tracks will vary by region. All sessions will be recorded and distributed after the event. Observability Cloud migration Open source Devops journey Fundamentals Nerd Days AMER Agenda We’ve got a packed schedule with thought-leaders of their respective industries Fundamentals Observability Cloud migration DevOps journey Open source 9:00 AM Keynote Lew Cirne 10:00 AM Instrumenting your service using agents Increased Maturity with Full Stack Observability Deploying an app on Kubernetes Delivering SRE as a Service Building applications on New Relic One 11:00 AM Exploring your data using NRQL New Relic AI Going Serverless: Chipping at the monolith Logging for Modern Organizations Grafana and Prometheus with TDP 12:00 PM Lunch Break Distant Disco 1:00 PM Custom Instrumentation Exploring Data with NerdGraph Tool Consolidation Flex Integration - Build Your First Linux Configuration Open Source powers the New Relic One Catalog 2:00 PM Alerts Best Practices The Art & Science of Deciphering Perceived Performance: A look at how user behavior affects your data Kubernetes Observability Measuring code pipelines New Relic CLI Wizardry/ Reducing toil with Terraform 3:00 PM True availability using Synthetics How Observability-Driven Development accelerates DevOps transformations CFP Customer Session: Cloud fundamentals Testing in Production NerdStorageVault: ThirdParty Secrets 4:00 PM Closing + Swag Jemiah Sius and Team Engage with the developer community @newrelic New Relic Forum Developers Hopin logo Event powered by Hopin", + "info": "", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 640.1991, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "New Relic Developers", + "sections": "New Relic CLI Wizardry/ Reducing toil with Terraform", + "body": " Integration - Build Your First Linux Configuration Open Source powers the New Relic One Catalog 2:00 PM Alerts Best Practices The Art & Science of Deciphering Perceived Performance: A look at how user behavior affects your data Kubernetes Observability Measuring code pipelines New Relic CLI Wizardry" + }, + "id": "5f3dd5bf28ccbc2349f56e4e" + }, + { + "category_2": "Measure DevOps success", + "nodeid": 34966, + "sections": [ + "New Relic solutions", + "Measure DevOps success", + "Cloud adoption", + "Optimize your cloud native environment", + "Automate instrumentation", + "Prerequisite", + "1. Make instrumentation part of every build", + "2. Take advantage of integrations and existing tools", + "3. Leverage the power of APIs", "For more help" ], - "title": "Update serverless monitoring for AWS Lambda", - "category_0": "Serverless function monitoring", + "title": "Automate instrumentation", + "category_0": "New Relic solutions", "type": "docs", - "category_1": "AWS Lambda monitoring", - "external_id": "9241e43c2db3e0298407449d530fa8fe601c1833", - "image": "", - "url": "https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/update-serverless-monitoring-aws-lambda", - "published_at": "2020-09-24T13:55:00Z", - "updated_at": "2020-09-24T13:54:59Z", - "breadcrumb": "Contents / Serverless function monitoring / AWS Lambda monitoring / Enable Lambda monitoring", + "category_1": "New Relic solutions", + "external_id": "91b25e8572d235c7f95963650848fc6ab6cf4b39", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/NRCLItool.png", + "url": "https://docs.newrelic.com/docs/new-relic-solutions/new-relic-solutions/measure-devops-success/automate-instrumentation", + "published_at": "2020-09-24T13:07:39Z", + "updated_at": "2020-09-10T08:41:00Z", + "breadcrumb": "Contents / New Relic solutions / New Relic solutions / Measure DevOps success", "document_type": "page", "popularity": 1, - "info": "How to update our Serverless monitoring for AWS Lambda. ", - "body": "After enabling our monitoring for AWS Lambda, you should occasionally update our Lambda function that's used to report AWS log data: newrelic-log-ingestion. There are two ways to do this: Update via CLI: Use this if you enabled our Lambda monitoring using our CLI tool. Update via AWS Serverless Application Repository: Use this if you enabled using the manual procedure. These update procedures apply to our serverless monitoring for AWS Lambda, and not to our infrastructure monitoring for AWS Lambda integration. Update our Lambda integration via CLI This section describes how to update if your Lambda monitoring was enabled using our recommended CLI tool. Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following command, replacing YOUR_REGION with your region identifier (for example, us-west-2). newrelic-lambda integrations update \\ --aws-region YOUR_REGION If you do not have our logs enabled, you'll also need to update your AWS CloudWatch log subscription filters with the following command: newrelic-lambda subscriptions install \\ --function installed \\ --aws-region YOUR_REGION Update Layers via CLI This section describes how to update your function's Layer if you installed it with our CLI tool. Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli Pass the --upgrade flag to the install command: newrelic-lambda layers install \\ --function installed \\ --nr-account-id NR_ACCOUNT_ID \\ --upgrade Update a manual Serverless Application Repository install If you manually installed the ingest function from the AWS Serverless Application Repository (and didn't use the CLI), update using this procedure: Run the following, replacing YOUR_REGION with your region (for example, us-west-2)​. aws serverlessrepo create-cloud-formation-change-set \\ --application-id arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion \\ --stack-name NewRelic-log-ingestion \\ --capabilities CAPABILITY_RESOURCE_POLICY \\ --region YOUR_REGION This command outputs several fields, one of which is the ChangeSetId: an ARN for the change set that you just created. Copy that ARN. Use the ARN in this command, which executes the change set: aws cloudformation execute-change-set --change-set-name YOUR_CHANGE_SET_ARN Enabling log management If you currently don't have New Relic's log management enabled, but would like to: Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following command, replacing YOUR_REGION with your region (for example, us-west-2). newrelic-lambda integrations update \\ --enable-logs \\ --aws-region YOUR_REGION Then update your AWS CloudWatch log subscription filters for each region with the following command: newrelic-lambda subscriptions install \\ --function installed \\ --filter-pattern \"\" \\ --aws-region YOUR_REGION 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.", + "info": "Capture tangible, measurable metrics from before and after deployments to optimize your DevOps team. ", + "body": "Replacing manual instrumentation with automated setup benefits you in many ways. Automation can make you faster, and it helps to eliminate fat-finger errors—and more importantly, it improves observability. You'll spend less time instrumenting systems, and reduce toil as your development ecosystem grows. Prerequisite Before starting this tutorial, be sure to complete the Measure code pipeline tutorial. 1. Make instrumentation part of every build Rolling instrumentation into your standard build process makes visibility the default, instead of being viewed as yet another burden on your developers. Modern build tools like Gradle can do almost anything; you can take advantage of that power to instrument your code quickly and efficiently. Read this Best Practices post for more information about automating instrumentation in your pipeline 2. Take advantage of integrations and existing tools It’s always worth taking a little extra time to look for time-saving integrations and tools that can help to achieve your automation goals. For example, you can use IBM’s open-sourced New Relic CLI (command line interface) tool to automate a variety of tasks, such as managing New Relic Synthetics monitors; creating, editing, and deleting New Relic Alerts policies and conditions; and managing user accounts. Use IBM's New Relic CLI tool to manage your Synthetics monitors, alert policies, and user accounts. 3. Leverage the power of APIs Now that you've instrumented your services, you can take advantage of New Relic's REST API to harvest information from your instrumentation and to manage your monitoring process. The New Relic API Explorer can help you to determine the cURL request format, available parameters, potential response status codes, and JSON response structure for each of the available API calls. The New Relic documentation includes a wealth of additional information on APIs that you can use to automate a number of important tasks, including: APIs to set up alert conditions APIs to define synthetic monitors APIs to create dashboards For more help", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 146.85583, + "_score": 597.2904, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Update our Lambda integration via CLI", - "body": " YOUR_CHANGE_SET_ARN Enabling log management If you currently don't have New Relic's log management enabled, but would like to: Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following" + "sections": "New Relic solutions", + "category_0": "New Relic solutions", + "category_1": "New Relic solutions", + "body": " It’s always worth taking a little extra time to look for time-saving integrations and tools that can help to achieve your automation goals. For example, you can use IBM’s open-sourced New Relic CLI (command line interface) tool to automate a variety of tasks, such as managing New Relic Synthetics", + "breadcrumb": "Contents / New Relic solutions / New Relic solutions / Measure DevOps success" }, - "id": "5f6ca534196a67b08750423e" + "id": "5f5e0c14196a67e25fce6a8a" + } + ], + "/explore-docs/nr1-config": [ + { + "sections": [ + "New Relic One CLI reference", + "Installing the New Relic One CLI", + "Tip", + "New Relic One CLI Commands", + "Get started", + "Configure your CLI preferences", + "Set up your Nerdpacks", + "Manage your Nerdpack subscriptions", + "Install and manage plugins", + "Manage catalog information" + ], + "title": "New Relic One CLI reference", + "type": "developer", + "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-09-25T01:49:59Z", + "updated_at": "2020-09-17T01:51:10Z", + "document_type": "page", + "popularity": 1, + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. 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. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. 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.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 294.1635, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "New Relic One CLI reference", + "sections": "New Relic One CLI Commands", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": " extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions" + }, + "id": "5efa989e28ccbc535a307dd0" }, { "sections": [ @@ -2570,7 +2935,7 @@ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", "image": "", "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-09-24T02:31:14Z", + "published_at": "2020-09-25T01:50:00Z", "updated_at": "2020-08-14T01:47:12Z", "document_type": "page", "popularity": 1, @@ -2578,7 +2943,7 @@ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 142.10017, + "_score": 162.87044, "_version": null, "_explanation": null, "sort": null, @@ -2590,279 +2955,271 @@ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" }, "id": "5efa989ee7b9d2024b7bab97" - } - ], - "/collect-data/collect-data-from-any-source": [ + }, { - "category_2": "Ingest APIs", - "nodeid": 35471, + "category_2": "Linux installation", + "nodeid": 13561, "sections": [ - "Ingest and manage data", + "Install and configure the infrastructure agent", "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", + "Linux installation", + "Windows installation", + "Config management tools", + "Configuration", + "Update or uninstall", + "Manage your agent", + "Docker container for infrastructure monitoring", + "What you need", + "Custom setup (recommended)", + "Docker CLI", + "Docker Compose", + "Basic setup", + "Required container privileges", + "Inventory collected", + "Container data", + "Containerized agent image", + "Check the source code", "For more help" ], - "title": "Telemetry SDKs: Report custom telemetry data", - "category_0": "Telemetry Data Platform", + "title": "Docker container for infrastructure monitoring", + "category_0": "Infrastructure monitoring", "type": "docs", - "category_1": "Ingest and manage data", - "external_id": "47a4c8f38c1b1674504ea302d865fd499e90ea39", + "category_1": "Install and configure the infrastructure agent", + "external_id": "045a9c2e9c31218c6ae5fce2e65227165f680634", "image": "", - "url": "https://docs.newrelic.com/docs/telemetry-data-platform/get-started/capabilities/telemetry-sdks-send-custom-telemetry-data-new-relic", - "published_at": "2020-09-24T20:03:48Z", - "updated_at": "2020-09-17T14:37:52Z", - "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs", + "url": "https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/linux-installation/docker-container-infrastructure-monitoring", + "published_at": "2020-09-24T04:26:44Z", + "updated_at": "2020-09-24T04:26:44Z", + "breadcrumb": "Contents / Infrastructure monitoring / Install and configure the infrastructure agent / Linux installation", "document_type": "page", "popularity": 1, - "info": "Report custom telemetry data with New Relic's open-source Telemetry SDKs.", - "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 C C library on Github New Relic Traces Rust Rust library on Github 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.", + "info": "You can run a containerized version of our infrastructure agent, which can monitor metrics for the container itself, as well as the underlying host.", + "body": "The infrastructure agent for Linux supports Docker environments by default. If you're running a container OS or have restrictions that require deploying the agent as a container, you can run a containerized version of our infrastructure agent, which can monitor metrics for the container itself, as well as the underlying host. Using the custom (recommended) or basic setup allows the infrastructure agent to run inside a container environment. A host can only be running one instance of the agent at a time, whether that's the containerized agent or the non-containerized version. What you need The containerized version of the infrastructure agent requires Docker 1.12 or higher. The container must run any of the Linux distributions and versions supported by our agent. Custom setup (recommended) The following are basic instructions for creating a custom Docker Image on Linux, which allows you to deploy the infrastructure agent as a container that can monitor its underlying host. We recommend extending the newrelic/infrastructure image and using your own newrelic-infra.yml agent config file. Once your image is built, you can easily spin up a container without having to provide more launch time configurations. Providing secrets via environment variables with Docker is discouraged. Docker CLI Create the newrelic-infra.yml agent config file with your New Relic license key: license_key: YOUR_LICENSE_KEY Create the Dockerfile extending the newrelic/infrastructure image, and add your config to /etc/newrelic-infra.yml: FROM newrelic/infrastructure:latest ADD newrelic-infra.yml /etc/newrelic-infra.yml Build and tag your image: docker build -t YOUR_IMAGE_NAME . Run the container from the image you built with the required required run flags: docker run \\ -d \\ --name newrelic-infra \\ --network=host \\ --cap-add=SYS_PTRACE \\ --privileged \\ --pid=host \\ -v \"/:/host:ro\" \\ -v \"/var/run/docker.sock:/var/run/docker.sock\" \\ YOUR_IMAGE_NAME Docker Compose Create a folder to store the configuration files: mkdir ~/newrelic-infra-setup Change directory to the one you've just created: cd ~/newrelic-infra-setup Create the newrelic-infra.yml agent config file with your New Relic license key: echo \"license_key: YOUR_LICENSE_KEY\" > newrelic-infra.yml Create the newrelic-infra.dockerfile extending the newrelic/infrastructure image, and add your config to /etc/newrelic-infra.yml: touch newrelic-infra.dockerfile vim newrelic-infra.dockerfile #you can use any text editor Put the following content in the file: FROM newrelic/infrastructure:latest ADD newrelic-infra.yml /etc/newrelic-infra.yml Create docker-compose.yaml: touch docker-compose.yaml vim docker-compose.yaml #you can use any text editor Put following content in the file: version: '3' services: agent: container_name: newrelic-infra build: context: . dockerfile: newrelic-infra.dockerfile cap_add: - SYS_PTRACE network_mode: host pid: host privileged: true volumes: - \"/:/host:ro\" - \"/var/run/docker.sock:/var/run/docker.sock\" restart: unless-stopped Build and start docker-compose: docker-compose -f docker-compose.yaml up -d Basic setup To use the basic setup with a base New Relic infrastructure image: Docker CLI Run the container with the required run flags: docker run \\ -d \\ --name newrelic-infra \\ --network=host \\ --cap-add=SYS_PTRACE \\ --privileged \\ --pid=host \\ -v \"/:/host:ro\" \\ -v \"/var/run/docker.sock:/var/run/docker.sock\" \\ -e NRIA_LICENSE_KEY=YOUR_LICENSE_KEY \\ newrelic/infrastructure:latest Docker Compose Create docker-compose.yaml: touch docker-compose.yaml vim docker-compose.yaml #you can use any text editor Put following content in the file: version: '3' services: agent: container_name: newrelic-infra image: newrelic/infrastructure:latest cap_add: - SYS_PTRACE network_mode: host pid: host privileged: true volumes: - \"/:/host:ro\" - \"/var/run/docker.sock:/var/run/docker.sock\" environment: NRIA_LICENSE_KEY: \"YOUR_LICENSE_KEY\" restart: unless-stopped Build and start docker-compose: docker-compose -f docker-compose.yaml up -d Required container privileges Due to resource isolation from the host and other containers via Linux namespaces, a container has a very restricted view and control of its underlying host's resources by default. Without these extra privileges, the infrastructure agent cannot monitor the host and its containers. The infrastructure agent collects data about its host using system files and system calls. For more information about how the infrastructure agent collects data, see Infrastructure and security. Required privileges include: Privilege Description --network=host Sets the container's network namespace to the host's network namespace. This allows the agent to collect the network metrics about the host. -v \"/:/host:ro\" Bind mounts the host's root volume to the container. This read-only access to the host's root allows the agent to collect process and storage metrics as well as Inventory data from the host. --cap-add=SYS_PTRACE Adds the Linux capability to trace system processes. This allows the agent to gather data about processes running on the host. Read more here. --privileged --pid=host -v \"/var/run/docker.sock:/var/run/docker.sock\" Bind mounts the host's Docker daemon socket to the container. This allows the agent to connect to the Engine API via the Docker daemon socket to collect the host's container data. Inventory collected Inventory is collected from the infrastructure agent's built-in data collectors. The infrastructure agent collects this data for Linux systems running with containers. Category Source Data collected using metadata agent_config Agent's complete config file system uptime -s, /etc/redhat-release, /proc/cpuinfo, /etc/os-release, /proc/sys/kernel/random/boot_id, /proc/sys/kernel/osrelease, /sys/class/dmi/id/product_uuid, /sys/devices/virtual/dmi/id/sys_vendor, /sys/devices/virtual/dmi/id/product_name Container data Once the infrastructure agent is running in a Docker container, it can collect the same host compute data and event data that the infrastructure agent is capable of collecting when running natively on a host. For container data, see Find your Docker data. Containerized agent image The containerized agent image is built from an Alpine base image, but a CentOS based image is also available. Alpine is used as the base image since version 0.0.55 . This is the one pointed by latest tag. Prior versions used CentOS 7 as base image. In order to keep using that legacy image some backports might be included there, you can point to latest-centos tag to fetch latest CentOS 7 based image. Check the source code This integration is open source software. That means you can browse its source code and send improvements, or create your own fork and build it. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 214.6285, + "_score": 133.37144, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Telemetry SDKs: Report custom telemetry data", - "sections": "Telemetry SDKs: Report custom telemetry data", - "info": "Report custom telemetry data with New Relic's open-source Telemetry SDKs.", - "category_0": "Telemetry Data Platform", - "category_2": "Ingest APIs", - "body": " 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", - "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs" + "sections": "Install and configure the infrastructure agent", + "category_1": "Install and configure the infrastructure agent", + "body": " time configurations. Providing secrets via environment variables with Docker is discouraged. Docker CLI Create the newrelic-infra.yml agent config file with your New Relic license key: license_key: YOUR_LICENSE_KEY Create the Dockerfile extending the newrelic/infrastructure image, and add your" }, - "id": "5d89fefbe7b9d2537ed30dc1" + "id": "5f3f9ece196a677cd21cd499" }, { - "category_2": "Get started", - "nodeid": 36051, + "nodeid": 37686, "sections": [ - "Ingest and manage data", + "AWS Lambda monitoring", "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", + "Enable Lambda monitoring", + "UI and data", + "Troubleshooting", + "Update serverless monitoring for AWS Lambda", + "Update our Lambda integration via CLI", + "Update Layers via CLI", + "Update a manual Serverless Application Repository install", + "Enabling log management", "For more help" ], - "title": "Get data into New Relic", - "category_0": "Telemetry Data Platform", + "title": "Update serverless monitoring for AWS Lambda", + "category_0": "Serverless function monitoring", "type": "docs", - "category_1": "Ingest and manage data", - "external_id": "7a413b4d7e5bd81088a08507ae4bad64c7e24b2d", + "category_1": "AWS Lambda monitoring", + "external_id": "9241e43c2db3e0298407449d530fa8fe601c1833", "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-09-24T12:05:28Z", - "updated_at": "2020-08-10T23:16:39Z", - "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Get started", + "url": "https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/update-serverless-monitoring-aws-lambda", + "published_at": "2020-09-24T13:55:00Z", + "updated_at": "2020-09-24T13:54:59Z", + "breadcrumb": "Contents / Serverless function monitoring / AWS Lambda monitoring / Enable Lambda monitoring", "document_type": "page", "popularity": 1, - "info": "An introduction to how to get data into New Relic. ", - "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.", + "info": "How to update our Serverless monitoring for AWS Lambda. ", + "body": "After enabling our monitoring for AWS Lambda, you should occasionally update our Lambda function that's used to report AWS log data: newrelic-log-ingestion. There are two ways to do this: Update via CLI: Use this if you enabled our Lambda monitoring using our CLI tool. Update via AWS Serverless Application Repository: Use this if you enabled using the manual procedure. These update procedures apply to our serverless monitoring for AWS Lambda, and not to our infrastructure monitoring for AWS Lambda integration. Update our Lambda integration via CLI This section describes how to update if your Lambda monitoring was enabled using our recommended CLI tool. Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following command, replacing YOUR_REGION with your region identifier (for example, us-west-2). newrelic-lambda integrations update \\ --aws-region YOUR_REGION If you do not have our logs enabled, you'll also need to update your AWS CloudWatch log subscription filters with the following command: newrelic-lambda subscriptions install \\ --function installed \\ --aws-region YOUR_REGION Update Layers via CLI This section describes how to update your function's Layer if you installed it with our CLI tool. Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli Pass the --upgrade flag to the install command: newrelic-lambda layers install \\ --function installed \\ --nr-account-id NR_ACCOUNT_ID \\ --upgrade Update a manual Serverless Application Repository install If you manually installed the ingest function from the AWS Serverless Application Repository (and didn't use the CLI), update using this procedure: Run the following, replacing YOUR_REGION with your region (for example, us-west-2)​. aws serverlessrepo create-cloud-formation-change-set \\ --application-id arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion \\ --stack-name NewRelic-log-ingestion \\ --capabilities CAPABILITY_RESOURCE_POLICY \\ --region YOUR_REGION This command outputs several fields, one of which is the ChangeSetId: an ARN for the change set that you just created. Copy that ARN. Use the ARN in this command, which executes the change set: aws cloudformation execute-change-set --change-set-name YOUR_CHANGE_SET_ARN Enabling log management If you currently don't have New Relic's log management enabled, but would like to: Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following command, replacing YOUR_REGION with your region (for example, us-west-2). newrelic-lambda integrations update \\ --enable-logs \\ --aws-region YOUR_REGION Then update your AWS CloudWatch log subscription filters for each region with the following command: newrelic-lambda subscriptions install \\ --function installed \\ --filter-pattern \"\" \\ --aws-region YOUR_REGION 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 108.10103, + "_score": 131.67224, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "APIs for sending metrics, traces, logs, and events", - "category_0": "Telemetry Data Platform", - "body": " also have data-ingest APIs: Trace API Event API Metric API Log API To learn about the differences between these data types, see Data types. New Relic One applications You can build entirely custom applications that reside in New Relic One and make use of any data you want. You can use existing open", - "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Get started" + "sections": "Update our Lambda integration via CLI", + "body": " YOUR_CHANGE_SET_ARN Enabling log management If you currently don't have New Relic's log management enabled, but would like to: Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following" }, - "id": "5f24aa60196a67ede394f5f3" + "id": "5f6ca534196a67b08750423e" }, { - "category_2": "Custom events", - "nodeid": 13806, + "image": "", + "url": "https://developer.newrelic.com/explore-docs/nr1-nerdpack/", "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" + "New Relic One CLI Nerdpack commands", + "Command details", + "nr1 nerdpack:build", + "Builds a Nerdpack", + "Usage", + "Options", + "nr1 nerdpack:clone", + "Clone an existing Nerdpack", + "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", + "nr1 nerdpack:clean", + "Removes all built artifacts", + "nr1 nerdpack:validate", + "Validates artifacts inside your Nerdpack", + "nr1 nerdpack:Info", + "Shows the state of your Nerdpack in the New Relic's registry" ], - "title": "Report custom event data", - "category_0": "Insights", - "type": "docs", - "category_1": "Event data sources", - "external_id": "afb5f5a81ae06b22935d98c470ed9cabd7c9da6b", - "image": "", - "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/report-custom-event-data", - "published_at": "2020-09-24T03:37:06Z", - "updated_at": "2020-07-26T05:52:23Z", - "breadcrumb": "Contents / Insights / Event data sources / Custom events", + "published_at": "2020-09-25T01:51:37Z", + "title": "New Relic One CLI Nerdpack commands", + "updated_at": "2020-09-17T01:49:55Z", + "type": "developer", + "external_id": "7c1050a6a8624664b90c15111f7c72e96b2fbe17", "document_type": "page", "popularity": 1, - "info": "An overview of the options for sending custom event data to New Relic. ", - "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.", + "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.", + "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:build Assembles your Nerdpack into bundles 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. nr1 nerdpack:clean Cleans your development folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. Command details nr1 nerdpack:build Builds a Nerdpack Runs a webpack process to assemble your Nerdpack into javascript and CSS bundles. As many other CLI commands, it should be run at the package.json level of your Nerdpack. Usage $ nr1 nerdpack:build OPTION Options --extra-metadata-path=extra-metadata-path Specify a json file path with extra metadata. [default: extra-metadata.json] --prerelease=prerelease If specififed, the value will be appended to the current version of generated files. ie: --prerelease=abc. Then the version will be \"1.2.3-abc\". --profile=profile The authencation profile you want to use. --verbose Adds extra information to the output. 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. nr1 nerdpack:clean Removes all built artifacts Cleans and removes the content and the developtment folders (dist/, tmp/). Usage $ nr1 nerdpack:clean OPTION Options --profile=profile The authentication profile you want to use --verbose Adds extra information to the output. nr1 nerdpack:validate Validates artifacts inside your Nerdpack Validates artifacts inside your Nerdpack. Usage $ nr1 nerdpack:validate OPTION Options -l, --force-local The authentication profile you want to use. -r, --force-remote Force download of new schema files. --profile=profile The authentication profile you want to uset. --verbose Adds extra information to the output. nr1 nerdpack:Info Shows the state of your Nerdpack in the New Relic's registry Shows the state of your Nerdpack in the New Relic's registry. The default amount of versions shown is 10 but all versions can be shown if the --all (or -a) flag is used Usage $ nr1 nerdpack:info OPTION Options -a, --all Show all versions. -i, --nerdpack-id=nerdpack-id Get info from the specified Nerdpack instead of local one. --profile=profile The authentication profile you want to use. --verbose Adds extra information to the output.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 106.447586, + "_score": 130.24953, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Report custom event data", - "sections": "Event data sources", - "info": "An overview of the options for sending custom event data to New Relic. ", - "category_1": "Event data sources", - "category_2": "Custom events", - "body": " the Flex integration tool to report your own custom event data. Mobile agent Use the mobile agent API to send custom events and attributes. Synthetics Add custom attributes to the SyntheticCheck event via the $util.insights tools. For ways to report other types of custom data, see: Metric API Logs Trace", - "breadcrumb": "Contents / Insights / Event data sources / Custom events" + "title": "New Relic One CLI Nerdpack commands", + "sections": "New Relic One CLI Nerdpack commands", + "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.", + "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:build Assembles your Nerdpack into bundles nr1 nerdpack:clone Clones a Nerdpack from" }, - "id": "5e8e7f9de7b9d2aa122cf0f6" - }, + "id": "5f28bd6a64441f9817b11a38" + } + ], + "/explore-docs/nr1-common": [ { - "category_2": "Custom events", - "nodeid": 13661, "sections": [ - "Event data sources", - "Default events", - "Custom events", - "Data requirements and limits for custom event data", - "General requirements", - "Reserved words", - "Additional Browser PageAction requirements", - "Additional Event API requirements", - "Event type limits", - "For more help" + "New Relic One CLI reference", + "Installing the New Relic One CLI", + "Tip", + "New Relic One CLI Commands", + "Get started", + "Configure your CLI preferences", + "Set up your Nerdpacks", + "Manage your Nerdpack subscriptions", + "Install and manage plugins", + "Manage catalog information" ], - "title": "Data requirements and limits for custom event data", - "category_0": "Insights", - "type": "docs", - "category_1": "Event data sources", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", - "external_id": "f5beef0d09bb5918be3f8a1a3ece98c09947cd1e", - "image": "", - "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", - "published_at": "2020-09-24T07:25:32Z", - "updated_at": "2020-09-20T19:39:10Z", - "breadcrumb": "Contents / Insights / Event data sources / Custom events", + "title": "New Relic One CLI reference", + "type": "developer", + "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-09-25T01:49:59Z", + "updated_at": "2020-09-17T01:51:10Z", "document_type": "page", "popularity": 1, - "info": "For New Relic, general limits and requirements for reporting custom events and attributes. ", - "body": "You can report custom events to New Relic in several ways, including the New Relic Event API, APM agent APIs, Browser agent APIs, and the Mobile SDK. This document contains general requirements and rules for inserting and using custom events and their associated attributes. Additional requirements may apply based on the method you use. General requirements How long custom data is retained depends on your Insights subscription and its associated data retention. When reporting custom events and attributes, follow these general requirements for supported data types, naming syntax, and size: Requirement Description Payload Total maximum size or length: 1 MB maximum per POST. We highly recommend using compression. The Event API has additional HTTP rate limits. Attribute data types Attribute values can be either a string or a numeric integer or float. If your attribute values contain date information, define it as an unformatted Unix timestamp (in seconds or milliseconds) by using the Insights data formatter. Attribute size Maximum name size: 255 bytes. Maximum attribute value size: Custom attributes sent by the agent: 255 bytes Attributes attached to custom events sent using the Event API: 4096 characters Charts may only display the first 255 characters of attribute values. For complete attribute values, use the JSON chart type or Query API. Maximum total attributes per event: 254. Exception: If you use an APM agent API, the max is 64. Maximum total attributes per event type: 48,000. Naming syntax Attribute names can be a combination of alphanumeric characters, colons (:), periods (.), and underscores (_). Event types (using the eventType attribute) can be a combination of alphanumeric characters, colons (:), and underscores (_). Do not use words reserved for use by NRQL. Null values The database does not store any data with a null value. Reserved words Avoid using the following reserved words as names for events and attributes. Otherwise, unexpected results may occur. This is not a complete list. In general, it's a good practice to avoid using MySQL-reserved words to avoid collision with future New Relic functionality. Keyword Description accountId This is a reserved attribute name. If it's included, it will be dropped during ingest. appId Value must be an integer. If it is not an integer, the attribute name and value will be dropped during ingest. eventType The event type as stored in New Relic. New Relic agents and scripts normally report this as eventType. Can be a combination of alphanumeric characters, colons (:), and underscores (_). Be sure to review the prohibited eventType values and eventType limits. Prohibited eventType values For your eventType value, avoid using: Metric, MetricRaw, and strings prefixed with Metric[0-9] (such as Metric2 or Metric1Minute). Public_ and strings prefixed with Public_. These event types are reserved for use by New Relic. Events passed in with these eventType values will be dropped. timestamp Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds. It must be +/-1 day (24 hours) of the current time on the server. Log forwarding terms The following keys are reserved by the Infrastructure agent's log forwarding feature: entity.guid, log, hostname, plugin.type, fb.input. If used, they are dropped during ingest and a warning is added to the logs. NRQL syntax terms If you need to use NRQL syntax terms as attribute names, including dotted attributes, they must be enclosed in backticks; for example, `LIMIT` or `consumer.offset`. Otherwise, avoid using these reserved words: ago, and, as, auto, begin, begintime, compare, day, days, end, endtime, explain, facet, from, hour, hours, in, is, like, limit, minute, minutes, month, months, not, null, offset, or, raw, second, seconds, select, since, timeseries, until, week, weeks, where, with Additional Browser PageAction requirements For additional requirements for using New Relic Browser's custom PageAction event, see Insert custom data via New Relic Browser agent. Additional Event API requirements For more requirements and details for the Event API, see Event API. Event type limits The current limit for total number of eventType values is 250 per sub-account in a given 24-hour time period. If a user exceeds this limit, New Relic may filter or drop data. Event types include: Default events from New Relic agents Custom events from New Relic agents Custom events from Insights custom event inserter 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.", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. 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. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 103.54668, + "_score": 249.56543, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Data requirements and limits for custom event data", - "sections": "Additional Event API requirements", - "info": "For New Relic, general limits and requirements for reporting custom events and attributes. ", - "category_1": "Event data sources", - "category_2": "Custom events", - "body": "You can report custom events to New Relic in several ways, including the New Relic Event API, APM agent APIs, Browser agent APIs, and the Mobile SDK. This document contains general requirements and rules for inserting and using custom events and their associated attributes. Additional requirements", - "breadcrumb": "Contents / Insights / Event data sources / Custom events" + "title": "New Relic One CLI reference", + "sections": "New Relic One CLI Commands", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": " extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions" }, - "id": "59f4354f4bb81c2ea8b80d0a" + "id": "5efa989e28ccbc535a307dd0" }, { - "category_2": "Get started", - "nodeid": 11431, + "image": "", + "url": "https://developer.newrelic.com/automate-workflows/", "sections": [ - "NRQL: New Relic Query Language", - "Get started", - "NRQL query tools", - "NRQL query tutorials", - "Introduction to NRQL, New Relic's query language", - "What is NRQL?", - "Where can you use NRQL?", - "What data can you query with NRQL?", - "Start using NRQL", - "NRQL query examples", - "NRQL syntax", - "For more help" + "Automate workflows", + "Guides to automate workflows", + "Quickly tag resources", + "Set up New Relic using Helm charts", + "Automatically tag a simple \"Hello World\" Demo across the entire stack", + "Set up New Relic using the Kubernetes operator", + "Automate common tasks", + "Set up New Relic using Terraform" ], - "title": "Introduction to NRQL, New Relic's query language", - "category_0": "Query your data", - "type": "docs", - "category_1": "NRQL: New Relic Query Language", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", - "external_id": "d44be2c7df7addda8679b4c842015223cfcbd1a3", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-view-chart-nrql-query_0.png", - "url": "https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", - "published_at": "2020-09-24T08:40:21Z", - "updated_at": "2020-09-24T08:40:20Z", - "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started", + "published_at": "2020-09-25T01:49:59Z", + "title": "Automate workflows", + "updated_at": "2020-09-25T01:49:59Z", + "type": "developer", + "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871", "document_type": "page", "popularity": 1, - "info": "An introduction to New Relic Query Language (NRQL) and how to use it.", - "body": "One way to query your New Relic data is with the New Relic Query Language (NRQL). This resource explains what NRQL is, when and how you can use it, and basic syntax rules. For more detailed information on querying, including a listing of clauses and functions and example queries, see NRQL syntax, clauses, and functions. What is NRQL? NRQL is New Relic's SQL-like query language. You can use NRQL to retrieve detailed New Relic data and get insight into your applications, hosts, and business-important activity. Reasons to use NRQL include: To answer a question for the purpose of troubleshooting or business analysis To create a new chart To make API queries of New Relic data (for example, using our NerdGraph API) NRQL is used behind the scenes to generate some New Relic charts: Some New Relic charts are built using NRQL. One way to start using NRQL is to view a chart's query and then edit it to make your own custom chart. Where can you use NRQL? You can use NRQL in these places: New Relic One query builder: Advanced mode is a NRQL query interface Basic mode provides a simplified query experience that doesn't require knowledge of NRQL but that uses NRQL to generate results New Relic Insights NerdGraph: our GraphQL-format API, which includes options for making NRQL queries one.newrelic.com > Query your data: You can run a NRQL query in both New Relic One and New Relic Insights. This NRQL query shows a count of distributed tracing spans faceted by their entity names. NRQL is one of several ways to query New Relic data. For more on all query options, see Query your data. What data can you query with NRQL? NRQL allows you to query these New Relic data types: Event data from all New Relic products, including: APM events, like Transaction New Relic Browser events, like PageView New Relic Mobile events, like Mobile Infrastructure events, like ProcessSample Synthetics events, like SyntheticCheck Custom events, like those reported by the Event API Metric timeslice data (metrics reported by New Relic APM, Browser, and Mobile) The Metric data type (metrics reported by the Metric API and data sources that use that API) The Span data type (distributed tracing data) The Log data type (data from New Relic Logs) Some data, like relationships between monitored entities, is not available via NRQL but is available using our NerdGraph API. Start using NRQL One way to start using NRQL and to understand what data you have available is to go to a NRQL interface (for example, the New Relic One query builder), type FROM, and press space. The interface will suggest available types of data: To see the attributes available for a specific data type, type FROM DATA_TYPE SELECT and press space. The interface will suggest available attributes. For example: To see the complete JSON associated with a data type, including all of its attributes, use the keyset() attribute. For example: FROM Transaction SELECT keyset() NRQL is used behind the scenes to build some New Relic charts and dashboards. One way to learn NRQL is to find one of these NRQL-generated charts and start playing with the NRQL to create new, customized queries and charts: Charts built with NRQL will have View query as an option. You can then edit and customize that query to see how your changes affect the resulting visualization. To explore your data without having to use NRQL, use the basic mode of New Relic One query builder. NRQL query examples Here's an example NRQL query of Transaction data, which is reported by New Relic APM. FROM Transaction SELECT average(duration) FACET appName TIMESERIES auto This would generate a chart that looks like: Here are some more query examples: Basic NRQL query of Browser data Here's a NRQL query of PageView data, which is reported by New Relic Browser. SELECT uniqueCount(user) FROM PageView WHERE userAgentOS = 'Mac' FACET countryCode SINCE 1 day ago LIMIT 20 Attribute name with a space in it If a custom attribute name has a space in it, use backticks around the attribute name: SELECT count(*) FROM Transaction FACET `Logged-in user` Querying multiple data sources To return data from two data sources, separate their data types with a comma. For example, this query returns a count of all APM transactions and Browser events over the last three days:​ SELECT count(*) FROM Transaction, PageView SINCE 3 days ago Query returning multiple columns To return multiple columns from a dataset, separate the aggregator arguments with a comma: SELECT function(attribute), function(attribute) ... FROM ... This query returns the minimum, average, and maximum duration for New Relic Browser PageView events over the last week: SELECT min(duration), max(duration), average(duration) FROM PageView SINCE 1 week ago See more NRQL query examples. NRQL syntax The syntax of a NRQL query is similar to standard SQL queries. Here is a breakdown of the structure of a NRQL query: SELECT function(attribute) [AS 'label'][, ...] FROM data type [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] Basic rules include: NRQL condition Details Required values The SELECT statement and FROM clause are required. All other clauses are optional. You can start your query with either SELECT or FROM. Query string size The query string must be less than 4 KB. Case sensitivity The data type names and attribute names are case sensitive. NRQL clauses and functions are not case sensitive. Syntax for strings NRQL uses single quotes to designate strings. For example: ... where traceId = '030a573f0df02c57' Attribute names with spaces Use backticks `` to quote a custom attribute name that has a space in it. For example: ... FACET `Logged-in user` Data type coercion Insights does not support data type \"coercion.\" For more information, see Data type conversion. Use of math functions Basic and advanced math functions are supported in the SELECT statement. JOIN functions NRQL does not have the equivalent of the SQL JOIN function, but you can simulate a JOIN with custom attributes. Read more about NRQL syntax and functions. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 30 min Automatically tag a simple \"Hello World\" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform", + "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 91.217674, + "_score": 169.17805, "_version": null, "_explanation": null, "sort": null, "highlight": { - "body": " New Relic Mobile events, like Mobile Infrastructure events, like ProcessSample Synthetics events, like SyntheticCheck Custom events, like those reported by the Event API Metric timeslice data (metrics reported by New Relic APM, Browser, and Mobile) The Metric data type (metrics reported by the Metric" + "sections": "Set up New Relic using Helm charts", + "body": " CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation" }, - "id": "5f2abd47196a67747343fbe1" - } - ], - "/explore-docs/nr1-config": [ + "id": "5efa999c196a67dfb4766445" + }, { + "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png", + "url": "https://developer.newrelic.com/", "sections": [ - "New Relic One CLI reference", - "Installing the New Relic One CLI", - "Tip", - "New Relic One CLI Commands", - "Get started", - "Configure your CLI preferences", - "Set up your Nerdpacks", - "Manage your Nerdpack subscriptions", - "Install and manage plugins", - "Manage catalog information" + "Mark your calendar for Nerd Days 1.0", + "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 One CLI reference", + "published_at": "2020-09-25T01:41:27Z", + "title": "New Relic Developers", + "updated_at": "2020-09-25T01:37:24Z", "type": "developer", - "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-09-24T02:26:06Z", - "updated_at": "2020-09-17T01:51:10Z", + "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab", "document_type": "page", "popularity": 1, - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. 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. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.", + "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 18 Days : 14 Hours : 58 Minutes : 41 Seconds Register 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 20 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", + "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 307.83643, + "_score": 153.07962, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI reference", - "sections": "New Relic One CLI Commands", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "tags": "New Relic One app", - "body": " extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions" + "title": "New Relic Developers", + "sections": "New Relic developer champions", + "body": " 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" }, - "id": "5efa989e28ccbc535a307dd0" + "id": "5d6fe49a64441f8d6100a50f" }, { "sections": [ @@ -2877,7 +3234,7 @@ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", "image": "", "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-09-24T02:31:14Z", + "published_at": "2020-09-25T01:50:00Z", "updated_at": "2020-08-14T01:47:12Z", "document_type": "page", "popularity": 1, @@ -2885,7 +3242,7 @@ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 166.44604, + "_score": 139.21071, "_version": null, "_explanation": null, "sort": null, @@ -2898,58 +3255,6 @@ }, "id": "5efa989ee7b9d2024b7bab97" }, - { - "category_2": "Linux installation", - "nodeid": 13561, - "sections": [ - "Install and configure the infrastructure agent", - "Get started", - "Linux installation", - "Windows installation", - "Config management tools", - "Configuration", - "Update or uninstall", - "Manage your agent", - "Docker container for infrastructure monitoring", - "What you need", - "Custom setup (recommended)", - "Docker CLI", - "Docker Compose", - "Basic setup", - "Required container privileges", - "Inventory collected", - "Container data", - "Containerized agent image", - "Check the source code", - "For more help" - ], - "title": "Docker container for infrastructure monitoring", - "category_0": "Infrastructure monitoring", - "type": "docs", - "category_1": "Install and configure the infrastructure agent", - "external_id": "045a9c2e9c31218c6ae5fce2e65227165f680634", - "image": "", - "url": "https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/linux-installation/docker-container-infrastructure-monitoring", - "published_at": "2020-09-24T04:26:44Z", - "updated_at": "2020-09-24T04:26:44Z", - "breadcrumb": "Contents / Infrastructure monitoring / Install and configure the infrastructure agent / Linux installation", - "document_type": "page", - "popularity": 1, - "info": "You can run a containerized version of our infrastructure agent, which can monitor metrics for the container itself, as well as the underlying host.", - "body": "The infrastructure agent for Linux supports Docker environments by default. If you're running a container OS or have restrictions that require deploying the agent as a container, you can run a containerized version of our infrastructure agent, which can monitor metrics for the container itself, as well as the underlying host. Using the custom (recommended) or basic setup allows the infrastructure agent to run inside a container environment. A host can only be running one instance of the agent at a time, whether that's the containerized agent or the non-containerized version. What you need The containerized version of the infrastructure agent requires Docker 1.12 or higher. The container must run any of the Linux distributions and versions supported by our agent. Custom setup (recommended) The following are basic instructions for creating a custom Docker Image on Linux, which allows you to deploy the infrastructure agent as a container that can monitor its underlying host. We recommend extending the newrelic/infrastructure image and using your own newrelic-infra.yml agent config file. Once your image is built, you can easily spin up a container without having to provide more launch time configurations. Providing secrets via environment variables with Docker is discouraged. Docker CLI Create the newrelic-infra.yml agent config file with your New Relic license key: license_key: YOUR_LICENSE_KEY Create the Dockerfile extending the newrelic/infrastructure image, and add your config to /etc/newrelic-infra.yml: FROM newrelic/infrastructure:latest ADD newrelic-infra.yml /etc/newrelic-infra.yml Build and tag your image: docker build -t YOUR_IMAGE_NAME . Run the container from the image you built with the required required run flags: docker run \\ -d \\ --name newrelic-infra \\ --network=host \\ --cap-add=SYS_PTRACE \\ --privileged \\ --pid=host \\ -v \"/:/host:ro\" \\ -v \"/var/run/docker.sock:/var/run/docker.sock\" \\ YOUR_IMAGE_NAME Docker Compose Create a folder to store the configuration files: mkdir ~/newrelic-infra-setup Change directory to the one you've just created: cd ~/newrelic-infra-setup Create the newrelic-infra.yml agent config file with your New Relic license key: echo \"license_key: YOUR_LICENSE_KEY\" > newrelic-infra.yml Create the newrelic-infra.dockerfile extending the newrelic/infrastructure image, and add your config to /etc/newrelic-infra.yml: touch newrelic-infra.dockerfile vim newrelic-infra.dockerfile #you can use any text editor Put the following content in the file: FROM newrelic/infrastructure:latest ADD newrelic-infra.yml /etc/newrelic-infra.yml Create docker-compose.yaml: touch docker-compose.yaml vim docker-compose.yaml #you can use any text editor Put following content in the file: version: '3' services: agent: container_name: newrelic-infra build: context: . dockerfile: newrelic-infra.dockerfile cap_add: - SYS_PTRACE network_mode: host pid: host privileged: true volumes: - \"/:/host:ro\" - \"/var/run/docker.sock:/var/run/docker.sock\" restart: unless-stopped Build and start docker-compose: docker-compose -f docker-compose.yaml up -d Basic setup To use the basic setup with a base New Relic infrastructure image: Docker CLI Run the container with the required run flags: docker run \\ -d \\ --name newrelic-infra \\ --network=host \\ --cap-add=SYS_PTRACE \\ --privileged \\ --pid=host \\ -v \"/:/host:ro\" \\ -v \"/var/run/docker.sock:/var/run/docker.sock\" \\ -e NRIA_LICENSE_KEY=YOUR_LICENSE_KEY \\ newrelic/infrastructure:latest Docker Compose Create docker-compose.yaml: touch docker-compose.yaml vim docker-compose.yaml #you can use any text editor Put following content in the file: version: '3' services: agent: container_name: newrelic-infra image: newrelic/infrastructure:latest cap_add: - SYS_PTRACE network_mode: host pid: host privileged: true volumes: - \"/:/host:ro\" - \"/var/run/docker.sock:/var/run/docker.sock\" environment: NRIA_LICENSE_KEY: \"YOUR_LICENSE_KEY\" restart: unless-stopped Build and start docker-compose: docker-compose -f docker-compose.yaml up -d Required container privileges Due to resource isolation from the host and other containers via Linux namespaces, a container has a very restricted view and control of its underlying host's resources by default. Without these extra privileges, the infrastructure agent cannot monitor the host and its containers. The infrastructure agent collects data about its host using system files and system calls. For more information about how the infrastructure agent collects data, see Infrastructure and security. Required privileges include: Privilege Description --network=host Sets the container's network namespace to the host's network namespace. This allows the agent to collect the network metrics about the host. -v \"/:/host:ro\" Bind mounts the host's root volume to the container. This read-only access to the host's root allows the agent to collect process and storage metrics as well as Inventory data from the host. --cap-add=SYS_PTRACE Adds the Linux capability to trace system processes. This allows the agent to gather data about processes running on the host. Read more here. --privileged --pid=host -v \"/var/run/docker.sock:/var/run/docker.sock\" Bind mounts the host's Docker daemon socket to the container. This allows the agent to connect to the Engine API via the Docker daemon socket to collect the host's container data. Inventory collected Inventory is collected from the infrastructure agent's built-in data collectors. The infrastructure agent collects this data for Linux systems running with containers. Category Source Data collected using metadata agent_config Agent's complete config file system uptime -s, /etc/redhat-release, /proc/cpuinfo, /etc/os-release, /proc/sys/kernel/random/boot_id, /proc/sys/kernel/osrelease, /sys/class/dmi/id/product_uuid, /sys/devices/virtual/dmi/id/sys_vendor, /sys/devices/virtual/dmi/id/product_name Container data Once the infrastructure agent is running in a Docker container, it can collect the same host compute data and event data that the infrastructure agent is capable of collecting when running natively on a host. For container data, see Find your Docker data. Containerized agent image The containerized agent image is built from an Alpine base image, but a CentOS based image is also available. Alpine is used as the base image since version 0.0.55 . This is the one pointed by latest tag. Prior versions used CentOS 7 as base image. In order to keep using that legacy image some backports might be included there, you can point to latest-centos tag to fetch latest CentOS 7 based image. Check the source code This integration is open source software. That means you can browse its source code and send improvements, or create your own fork and build it. 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.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 147.72862, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "sections": "Install and configure the infrastructure agent", - "category_1": "Install and configure the infrastructure agent", - "body": " time configurations. Providing secrets via environment variables with Docker is discouraged. Docker CLI Create the newrelic-infra.yml agent config file with your New Relic license key: license_key: YOUR_LICENSE_KEY Create the Dockerfile extending the newrelic/infrastructure image, and add your" - }, - "id": "5f3f9ece196a677cd21cd499" - }, { "nodeid": 37686, "sections": [ @@ -2981,7 +3286,7 @@ "body": "After enabling our monitoring for AWS Lambda, you should occasionally update our Lambda function that's used to report AWS log data: newrelic-log-ingestion. There are two ways to do this: Update via CLI: Use this if you enabled our Lambda monitoring using our CLI tool. Update via AWS Serverless Application Repository: Use this if you enabled using the manual procedure. These update procedures apply to our serverless monitoring for AWS Lambda, and not to our infrastructure monitoring for AWS Lambda integration. Update our Lambda integration via CLI This section describes how to update if your Lambda monitoring was enabled using our recommended CLI tool. Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following command, replacing YOUR_REGION with your region identifier (for example, us-west-2). newrelic-lambda integrations update \\ --aws-region YOUR_REGION If you do not have our logs enabled, you'll also need to update your AWS CloudWatch log subscription filters with the following command: newrelic-lambda subscriptions install \\ --function installed \\ --aws-region YOUR_REGION Update Layers via CLI This section describes how to update your function's Layer if you installed it with our CLI tool. Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli Pass the --upgrade flag to the install command: newrelic-lambda layers install \\ --function installed \\ --nr-account-id NR_ACCOUNT_ID \\ --upgrade Update a manual Serverless Application Repository install If you manually installed the ingest function from the AWS Serverless Application Repository (and didn't use the CLI), update using this procedure: Run the following, replacing YOUR_REGION with your region (for example, us-west-2)​. aws serverlessrepo create-cloud-formation-change-set \\ --application-id arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion \\ --stack-name NewRelic-log-ingestion \\ --capabilities CAPABILITY_RESOURCE_POLICY \\ --region YOUR_REGION This command outputs several fields, one of which is the ChangeSetId: an ARN for the change set that you just created. Copy that ARN. Use the ARN in this command, which executes the change set: aws cloudformation execute-change-set --change-set-name YOUR_CHANGE_SET_ARN Enabling log management If you currently don't have New Relic's log management enabled, but would like to: Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following command, replacing YOUR_REGION with your region (for example, us-west-2). newrelic-lambda integrations update \\ --enable-logs \\ --aws-region YOUR_REGION Then update your AWS CloudWatch log subscription filters for each region with the following command: newrelic-lambda subscriptions install \\ --function installed \\ --filter-pattern \"\" \\ --aws-region YOUR_REGION 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 146.85583, + "_score": 131.67224, "_version": null, "_explanation": null, "sort": null, @@ -2990,7 +3295,9 @@ "body": " YOUR_CHANGE_SET_ARN Enabling log management If you currently don't have New Relic's log management enabled, but would like to: Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following" }, "id": "5f6ca534196a67b08750423e" - }, + } + ], + "/explore-docs/nr1-cli": [ { "image": "", "url": "https://developer.newrelic.com/explore-docs/nr1-nerdpack/", @@ -3020,28 +3327,195 @@ "nr1 nerdpack:Info", "Shows the state of your Nerdpack in the New Relic's registry" ], - "published_at": "2020-09-24T02:27:37Z", - "title": "New Relic One CLI Nerdpack commands", - "updated_at": "2020-09-17T01:49:55Z", + "published_at": "2020-09-25T01:51:37Z", + "title": "New Relic One CLI Nerdpack commands", + "updated_at": "2020-09-17T01:49:55Z", + "type": "developer", + "external_id": "7c1050a6a8624664b90c15111f7c72e96b2fbe17", + "document_type": "page", + "popularity": 1, + "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.", + "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:build Assembles your Nerdpack into bundles 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. nr1 nerdpack:clean Cleans your development folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. Command details nr1 nerdpack:build Builds a Nerdpack Runs a webpack process to assemble your Nerdpack into javascript and CSS bundles. As many other CLI commands, it should be run at the package.json level of your Nerdpack. Usage $ nr1 nerdpack:build OPTION Options --extra-metadata-path=extra-metadata-path Specify a json file path with extra metadata. [default: extra-metadata.json] --prerelease=prerelease If specififed, the value will be appended to the current version of generated files. ie: --prerelease=abc. Then the version will be \"1.2.3-abc\". --profile=profile The authencation profile you want to use. --verbose Adds extra information to the output. 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. nr1 nerdpack:clean Removes all built artifacts Cleans and removes the content and the developtment folders (dist/, tmp/). Usage $ nr1 nerdpack:clean OPTION Options --profile=profile The authentication profile you want to use --verbose Adds extra information to the output. nr1 nerdpack:validate Validates artifacts inside your Nerdpack Validates artifacts inside your Nerdpack. Usage $ nr1 nerdpack:validate OPTION Options -l, --force-local The authentication profile you want to use. -r, --force-remote Force download of new schema files. --profile=profile The authentication profile you want to uset. --verbose Adds extra information to the output. nr1 nerdpack:Info Shows the state of your Nerdpack in the New Relic's registry Shows the state of your Nerdpack in the New Relic's registry. The default amount of versions shown is 10 but all versions can be shown if the --all (or -a) flag is used Usage $ nr1 nerdpack:info OPTION Options -a, --all Show all versions. -i, --nerdpack-id=nerdpack-id Get info from the specified Nerdpack instead of local one. --profile=profile The authentication profile you want to use. --verbose Adds extra information to the output.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 134.6456, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "New Relic One CLI Nerdpack commands", + "sections": "New Relic One CLI Nerdpack commands", + "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.", + "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:build Assembles your Nerdpack into bundles nr1 nerdpack:clone Clones a Nerdpack from" + }, + "id": "5f28bd6a64441f9817b11a38" + }, + { + "sections": [ + "Intro to NerdStorage", + "Use NerdStorage in your apps", + "Data model", + "Limits", + "Data access", + "Permissions for working with NerdStorage" + ], + "title": "Intro to NerdStorage", + "type": "developer", + "tags": [ + "nerdstorage", + "nerdstorage components", + "new relic one apps", + "data access" + ], + "external_id": "709e06c25376d98b2191ca369b4d139e5084bd62", + "image": "", + "url": "https://developer.newrelic.com/explore-docs/nerdstorage/", + "published_at": "2020-09-25T01:49:59Z", + "updated_at": "2020-09-08T01:50:19Z", + "document_type": "page", + "popularity": 1, + "info": "Intro to NerdStorage on New Relic One", + "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,500 documents, plus storage type. Each document can have a maximum length of 1024 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 113.21823, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "sections": "Use NerdStorage in your apps", + "info": "Intro to NerdStorage on New Relic One", + "tags": "new relic one apps", + "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users" + }, + "id": "5efa989ee7b9d2048e7bab92" + }, + { + "sections": [ + "Intro to New Relic One API components", + "Components of the SDK", + "UI components", + "Chart components", + "Query and storage components", + "Platform APIs" + ], + "title": "Intro to New Relic One API components", + "type": "developer", + "tags": [ + "SDK components", + "New Relic One apps", + "UI components", + "chart components", + "query and storage components", + "Platform APIs" + ], + "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2", + "image": "", + "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/", + "published_at": "2020-09-25T01:48:39Z", + "updated_at": "2020-08-14T01:47:12Z", + "document_type": "page", + "popularity": 1, + "info": "Intro to New Relic One API components", + "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 71.38304, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "Intro to New Relic One API components", + "sections": "Intro to New Relic One API components", + "info": "Intro to New Relic One API components", + "tags": "New Relic One apps", + "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations" + }, + "id": "5efa989e28ccbc4071307de5" + }, + { + "sections": [ + "Set up your development environment", + "Before you begin", + "A note on support", + "Tip", + "Prepare to build or modify apps", + "Start building", + "Contribute to developer.newrelic.com" + ], + "title": "Set up your development environment", + "type": "developer", + "tags": [ + "developer account", + "API key", + "New Relic One CLI" + ], + "external_id": "c45638a9cd548d1ffffc9f1c7708f115a92ae04a", + "image": "", + "url": "https://developer.newrelic.com/build-apps/set-up-dev-env/", + "published_at": "2020-09-25T01:57:48Z", + "updated_at": "2020-08-26T01:47:20Z", + "document_type": "page", + "popularity": 1, + "info": "Prepare to build apps and contribute to this site", + "body": "Set up your development environment 20 min If you've decided to build a custom app or modify one of our open source apps, you need a few essential tools: The New Relic One command line interface (CLI) An API key, which you get when you download the CLI Depending on what you want to do with your app, you might have some additional setup and configuration. This guide covers: Downloading the New Relic One CLI to build or modify apps Contribute content to this website Before you begin You must have: A github account account - While not strictly necessary for building apps, a GitHub account enables you to download and customize our open source apps, and contribute an open source project. A New Relic developer account - if you don't already have one, you can get a free trial account for developing New Relic applications. npm - If you've installed Node.js, then you already have npm, which is used to share, reuse, and update JavaScript code, and is necessary for working with React components that are the framework for New Relic apps and this website. A note on support Building a New Relic One application is the same as building any JavaScript/React application. We offer support to help with our building tools (our CLI and SDK library). However, we don't offer support for basic JavaScript or React coding questions or issues. For common questions and answers about building, see the Explorers Hub page on building on New Relic One. Tip Use the New Relic One VSCode extension to build your apps. Prepare to build or modify apps Step 1 of 1 Download the CLI and API key. On the Build New Relic One applications page, complete the Quick start steps. These six Quick start steps get you an API key for use with developing apps, and the New Relic One CLI, for building and deploying apps. At the end of the Quick start, you have a project consisting of the following: A Nerdpack - The package containing all the files required by your application. It contains two types of files that you customize to build your app: Nerdlets, and the launcher. One or more Nerdlet files - A specific UI view or window. A Nerdlet is a React JavaScript package that includes an index.js file, a stylesheet, and a JSON-format config file. It can contain any JS functionality (charts, interactive fields, tooltips, etc.). A launcher file: This is the basis for the launcher, which is used to open your application from New Relic One after you publish your app. Start building Step 1 of 1 If you're ready to code, cd to your Nerdpack and get started. If you want to learn more about building applications, try these step-by-step guides: Build a \"Hello, World!\" application shows how to create a little application, publish it to New Relic One, and share it with others by subscribing accounts to it. Map pageviews by region takes you through the steps to create one of our popular open source apps. You learn to add a custom query to an app and view it in a table, then add that data to a map. Contribute to developer.newrelic.com This site is open source, and we want your input. Create a pull request if you see a mistake you know how to fix. Drop us a GitHub issue if you see some content gaps you want us to work on. Or write up a whole new guide if you have one you'd like to share. Read on to learn how. Step 1 of 3 Fork the developer-website GithHub repo. Forking the repo enables you to work on your own copy of the developer.newrelic.com files, and build the site locally. It also enables us to more easily manage incomimg pull requests. On the developer-website page in GitHub, select the Fork button on the top right of the page, choose the account you want to fork to, and wait a few seconds while the fork is created. Sync regularly to keep your fork up to date with changes and additions to the main branch upstream. Step 2 of 3 Make a feature or documentation request. On any page, select the GitHub button at the top of the page, and then select the kind of change you want, and fill out the GitHub form. Step 3 of 3 Contribute a new guide. Check out our contributors guidelines, which will walk you through the process.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 55.033997, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "sections": "Prepare to build or modify apps", + "info": "Prepare to build apps and contribute to this site", + "tags": "New Relic One CLI", + "body": "Set up your development environment 20 min If you've decided to build a custom app or modify one of our open source apps, you need a few essential tools: The New Relic One command line interface (CLI) An API key, which you get when you download the CLI Depending on what you want to do with your app" + }, + "id": "5efa9973e7b9d242237bab39" + }, + { + "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", "type": "developer", - "external_id": "7c1050a6a8624664b90c15111f7c72e96b2fbe17", + "tags": [ + "New Relic One CLI", + "nerdpack", + "file structure", + "nerdlets", + "launchers" + ], + "external_id": "c97bcbb0a2b3d32ac93b5b379a1933e7b4e00161", + "image": "", + "url": "https://developer.newrelic.com/explore-docs/nerdpack-file-structure/", + "published_at": "2020-09-25T01:48:40Z", + "updated_at": "2020-08-14T01:49:25Z", "document_type": "page", "popularity": 1, - "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.", - "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:build Assembles your Nerdpack into bundles 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. nr1 nerdpack:clean Cleans your development folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. Command details nr1 nerdpack:build Builds a Nerdpack Runs a webpack process to assemble your Nerdpack into javascript and CSS bundles. As many other CLI commands, it should be run at the package.json level of your Nerdpack. Usage $ nr1 nerdpack:build OPTION Options --extra-metadata-path=extra-metadata-path Specify a json file path with extra metadata. [default: extra-metadata.json] --prerelease=prerelease If specififed, the value will be appended to the current version of generated files. ie: --prerelease=abc. Then the version will be \"1.2.3-abc\". --profile=profile The authencation profile you want to use. --verbose Adds extra information to the output. 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. nr1 nerdpack:clean Removes all built artifacts Cleans and removes the content and the developtment folders (dist/, tmp/). Usage $ nr1 nerdpack:clean OPTION Options --profile=profile The authentication profile you want to use --verbose Adds extra information to the output. nr1 nerdpack:validate Validates artifacts inside your Nerdpack Validates artifacts inside your Nerdpack. Usage $ nr1 nerdpack:validate OPTION Options -l, --force-local The authentication profile you want to use. -r, --force-remote Force download of new schema files. --profile=profile The authentication profile you want to uset. --verbose Adds extra information to the output. nr1 nerdpack:Info Shows the state of your Nerdpack in the New Relic's registry Shows the state of your Nerdpack in the New Relic's registry. The default amount of versions shown is 10 but all versions can be shown if the --all (or -a) flag is used Usage $ nr1 nerdpack:info OPTION Options -a, --all Show all versions. -i, --nerdpack-id=nerdpack-id Get info from the specified Nerdpack instead of local one. --profile=profile The authentication profile you want to use. --verbose Adds extra information to the output.", + "info": "An overview of the Nerdpack File Structure", + "body": "Nerdpack file structure A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. Here we explain: The file structure for a Nerdpack, a Nerdlet, and a launcher How to link a launcher file to a Nerdlet How to link your application with a monitored entity For basic component definitions, see our component reference. Generate Nerdpack components There are two ways to generate a Nerdpack template: Generate a Nerdpack: Use the New Relic One CLI command nr1 create and select Nerdpack to create a Nerdpack template that includes a Nerdlet and a launcher. Generate Nerdlet or launcher individually: Use the New Relic One CLI command nr1 create and choose either Nerdlet or launcher. This can be useful when adding Nerdlets to an existing Nerdpack. For documentation on generating and connecting Nerdpack components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │   └── my-nerdlet-launcher │   ├── icon.png │   └── nr1.json ├── nerdlets │   └── my-nerdlet-nerdlet │   ├── index.js │   ├── nr1.json │   └── styles.scss ├── node_modules │   ├── js-tokens │   ├── loose-envify │   ├── object-assign │   ├── prop-types │   ├── react │   ├── react-dom │   ├── react-is │   └── scheduler ├── nr1.json ├── package-lock.json └── package.json Copy Nerdlet file structure A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files, index.js, nr1.json, and styles.scss. Here is what the default files look like after being generated using the nr1 create command: index.js The JavaScript code of the Nerdlet. import React from 'react'; export default class MyAwesomeNerdpack extends React.Component { render() { return

Hello, my-awesome-nerdpack Nerdlet!

; } } Copy nr1.json The Nerdlet configuration file. { \"schemaType\": \"NERDLET\", \"id\": \"my-awesome-nerdpack-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\" } Copy Besides using the launcher as the access point for your application, you can also associate the application with a monitored entity to get it to appear in the entity explorer. To do this, add two additional fields to the config file of the first-launched Nerdlet: entities and actionCategory. In the following example, the Nerdlet has been associated with all Browser-monitored applications and will appear under the Monitor UI category : { \"schemaType\": \"NERDLET\", \"id\": \"my-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"Custom Data\", \"entities\": [{ \"domain\": \"BROWSER\", \"type\": \"APPLICATION\" }], \"actionCategory\": \"monitor\" } Copy To see this application in the UI, you would go to the entity explorer, select Browser applications, and select a monitored application. styles.scss An empty SCSS file for styling your application. icon.png The launcher icon that appears on the Apps page in New Relic One when an application is deployed. Launcher file structure Launchers have their own file structure. Note that: A launcher is not required; as an alternative to using a launcher, you can associate your application with a monitored entity. An application can have more than one launcher, which might be desired for an application with multiple Nerdlets. After generating a launcher using the nr1 create command, its folder contains two files: nr1.json The configuration file. { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy To connect a launcher to a Nerdlet, the rootNerdletId must match the id in the launched Nerdlet's nr1.json config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet. icon.png The icon displayed on the launcher for the app on the Apps page.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 136.92252, + "_score": 49.782696, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI Nerdpack commands", - "sections": "New Relic One CLI Nerdpack commands", - "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.", - "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:build Assembles your Nerdpack into bundles nr1 nerdpack:clone Clones a Nerdpack from" + "title": "Nerdpack file structure", + "sections": "Nerdpack file structure", + "info": "An overview of the Nerdpack File Structure", + "tags": "New Relic One CLI", + "body": " components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │   └── my-nerdlet-launcher │   ├── icon.png" }, - "id": "5f28bd6a64441f9817b11a38" + "id": "5efa989e196a671300766404" } ], "/explore-docs/nr1-nerdpack": [ @@ -3061,7 +3535,7 @@ "nr1 subscription:unset", "Unsubscribe from a Nerdpack" ], - "published_at": "2020-09-24T02:30:06Z", + "published_at": "2020-09-25T01:49:59Z", "title": "New Relic One CLI subscription commands", "updated_at": "2020-08-06T01:44:54Z", "type": "developer", @@ -3072,7 +3546,7 @@ "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", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 823.819, + "_score": 798.1541, "_version": null, "_explanation": null, "sort": null, @@ -3108,7 +3582,7 @@ "nr1 nrql", "Query using NRQL" ], - "published_at": "2020-09-24T02:28:37Z", + "published_at": "2020-09-25T01:49:59Z", "title": "New Relic One CLI common commands", "updated_at": "2020-08-14T01:48:10Z", "type": "developer", @@ -3119,7 +3593,7 @@ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 583.4457, + "_score": 564.9536, "_version": null, "_explanation": null, "sort": null, @@ -3153,7 +3627,7 @@ "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-09-24T02:26:06Z", + "published_at": "2020-09-25T01:49:59Z", "updated_at": "2020-09-17T01:51:10Z", "document_type": "page", "popularity": 1, @@ -3161,7 +3635,7 @@ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. 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. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 368.91898, + "_score": 350.204, "_version": null, "_explanation": null, "sort": null, @@ -3187,7 +3661,7 @@ "nr1 catalog:submit", "Send info to the catalog" ], - "published_at": "2020-09-24T02:27:37Z", + "published_at": "2020-09-25T01:49:59Z", "title": "New Relic One CLI catalog commands", "updated_at": "2020-08-14T01:49:24Z", "type": "developer", @@ -3198,7 +3672,7 @@ "body": "New Relic One CLI catalog commands To manage your catalog, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder. Command details nr1 catalog:info Get catalog details Shows the information about your application that's displayed in the catalog. If run within a specific Nerdpack folder, the info from that Nerdpack will be shown. If you don't want to get info from your local Nerdpack, use the --nerdpack-id=NERDPACK_ID option to query from a specific Nerdpack. Usage $ nr1 catalog:info Options -f, --field=FIELD Specifies which field you want info from. -i, --nerdpack-id=NERDPACK_ID Specifies which Nerdpack to get info from. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 catalog:submit Send info to the catalog Gathers the information you add to the catalog directory for your application and saves it to the catalog. See our catalog docs for details on adding screenshots and metadata to your applications to make them easy to find, attractive, and informative. This command must be run on a Nerdpack folder. The command will search for specific files using convention names. Usage $ nr1 catalog:submit Options -P, --skip-screenshots Skips upload of screenshot assets. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 169.1116, + "_score": 163.78601, "_version": null, "_explanation": null, "sort": null, @@ -3233,7 +3707,7 @@ "external_id": "c97bcbb0a2b3d32ac93b5b379a1933e7b4e00161", "image": "", "url": "https://developer.newrelic.com/explore-docs/nerdpack-file-structure/", - "published_at": "2020-09-24T02:26:06Z", + "published_at": "2020-09-25T01:48:40Z", "updated_at": "2020-08-14T01:49:25Z", "document_type": "page", "popularity": 1, @@ -3241,7 +3715,7 @@ "body": "Nerdpack file structure A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. Here we explain: The file structure for a Nerdpack, a Nerdlet, and a launcher How to link a launcher file to a Nerdlet How to link your application with a monitored entity For basic component definitions, see our component reference. Generate Nerdpack components There are two ways to generate a Nerdpack template: Generate a Nerdpack: Use the New Relic One CLI command nr1 create and select Nerdpack to create a Nerdpack template that includes a Nerdlet and a launcher. Generate Nerdlet or launcher individually: Use the New Relic One CLI command nr1 create and choose either Nerdlet or launcher. This can be useful when adding Nerdlets to an existing Nerdpack. For documentation on generating and connecting Nerdpack components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │   └── my-nerdlet-launcher │   ├── icon.png │   └── nr1.json ├── nerdlets │   └── my-nerdlet-nerdlet │   ├── index.js │   ├── nr1.json │   └── styles.scss ├── node_modules │   ├── js-tokens │   ├── loose-envify │   ├── object-assign │   ├── prop-types │   ├── react │   ├── react-dom │   ├── react-is │   └── scheduler ├── nr1.json ├── package-lock.json └── package.json Copy Nerdlet file structure A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files, index.js, nr1.json, and styles.scss. Here is what the default files look like after being generated using the nr1 create command: index.js The JavaScript code of the Nerdlet. import React from 'react'; export default class MyAwesomeNerdpack extends React.Component { render() { return

Hello, my-awesome-nerdpack Nerdlet!

; } } Copy nr1.json The Nerdlet configuration file. { \"schemaType\": \"NERDLET\", \"id\": \"my-awesome-nerdpack-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\" } Copy Besides using the launcher as the access point for your application, you can also associate the application with a monitored entity to get it to appear in the entity explorer. To do this, add two additional fields to the config file of the first-launched Nerdlet: entities and actionCategory. In the following example, the Nerdlet has been associated with all Browser-monitored applications and will appear under the Monitor UI category : { \"schemaType\": \"NERDLET\", \"id\": \"my-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"Custom Data\", \"entities\": [{ \"domain\": \"BROWSER\", \"type\": \"APPLICATION\" }], \"actionCategory\": \"monitor\" } Copy To see this application in the UI, you would go to the entity explorer, select Browser applications, and select a monitored application. styles.scss An empty SCSS file for styling your application. icon.png The launcher icon that appears on the Apps page in New Relic One when an application is deployed. Launcher file structure Launchers have their own file structure. Note that: A launcher is not required; as an alternative to using a launcher, you can associate your application with a monitored entity. An application can have more than one launcher, which might be desired for an application with multiple Nerdlets. After generating a launcher using the nr1 create command, its folder contains two files: nr1.json The configuration file. { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy To connect a launcher to a Nerdlet, the rootNerdletId must match the id in the launched Nerdlet's nr1.json config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet. icon.png The icon displayed on the launcher for the app on the Apps page.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 158.4358, + "_score": 154.16905, "_version": null, "_explanation": null, "sort": null, @@ -3269,21 +3743,21 @@ "Add the NerdGraphQuery component to an application", "Add a time picker to your app", "Add a table to your app", - "Publish and deploy apps", - "Create a custom map view" + "Create a custom map view", + "Publish and deploy apps" ], - "published_at": "2020-09-24T02:30:06Z", + "published_at": "2020-09-25T01:49:59Z", "title": "Build apps", - "updated_at": "2020-09-24T01:55:00Z", + "updated_at": "2020-09-25T01:49:59Z", "type": "developer", "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", "document_type": "page", "popularity": 1, - "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   Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 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 Publish and deploy apps Start sharing the apps you build 30 min Create a custom map view Build an app to show page view data on a map", + "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   Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 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 30 min Publish and deploy apps Start sharing the apps you build", "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 444.4489, + "_score": 425.0667, "_version": null, "_explanation": null, "sort": null, @@ -3316,7 +3790,7 @@ "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-09-24T02:30:06Z", + "published_at": "2020-09-25T01:48:39Z", "updated_at": "2020-08-30T01:49:16Z", "document_type": "page", "popularity": 1, @@ -3324,7 +3798,7 @@ "body": "Add, query, and mutate data using NerdStorage 45 min NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. Using NerdStorage, you can create individual documents of up to 64kb in size, create different collections of documents, and store data by entity, account, or user level. This guide explains how to add data and documents to NerdStorage. For an introduction to what NerdStorage is and how it works, see Intro to NerdStorage. Before you begin This guide requires that you have an API key and the New Relic One CLI as described in Set up your development environment. Get started First, get the NerdStorage app running successfully inside New Relic One. Step 1 of 3 Clone the example applications from the GitHub repo. Step 2 of 3 Use the New Relic One CLI to update the application UUID and run the application locally. In the terminal, switch to the /nr1-how-to/use-nerdstorage directory: cd / nr1 - how - to / use - nerdstorage; Copy Update the UUID and serve the application: nr1 nerdpack:uuid -gf nr1 nerdpack:serve Copy Step 3 of 3 Once the app is successfully served, your terminal will return the URL to view your running application on New Relic One. Load the URL. Click Apps and under Your apps you'll see the Use Nerdstorage app listed. Click to launch the app. Add data to NerdStorage Once the app is up and running on New Relic One, you can prepare the app and start adding data. On the How To Use NerdStorage app screen, there's a Saved to NerdStorage pane with a field for adding data. However, if you type something you'll get an error message. This is because you need to be set up to store data at the User level. You can do this with the help of the UserStorageMutation component. Step 1 of 3 Open the application’s ./nerdlets/use-nerdstorage-nerdlet/index.js file in the text editor of your choice and find the code for the TextField and Button used to enter data. The Button onClick prop makes a call to a helper method called _addToNerdStorage, and you need to update it to add UserStorageMutation The UserStorage NerdStorage components require a collection and documentId. In the constructor method in the application’s index.js file, you can see the variables being provided. In the .js file, it will look something like this: constructor(props) { super(props) this.collectionId = 'mycollection'; this.documentId = 'learning-nerdstorage'; this.state = { isOpen: true, storage: [], text: '', }; this._addToNerdStorage = this._addToNerdStorage.bind(this); this._removeFromNerdStorage = this._removeFromNerdStorage.bind(this); this._deleteDocument = this._deleteDocument.bind(this); } Copy Step 2 of 3 Import the UserStorageMutation by adding it to your import statement at the top of the index.js file: import { UserStorageMutation } from 'nr1'; Copy Then update the helper with this code beginning with _addToNerdStorage: _addToNerdStorage(){ const { text, storage } = this.state; storage.push(text); this.setState({storage}, () => { UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.WRITE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, document: { storage }, }) .then((res) => { this.setState({text: ''}); Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.NORMAL }); }) .catch((err) => console.log(err)); }); } Copy Step 3 of 3 Return to your running How To Use NerdStorage app screen on New Relic One and reload the page. Add some text in the text entry field and click the check button. This will update NerdStorage and trigger a Toast notification inside the app. You should then see the text you typed displayed as a table row below the text entry field. Query data from NerdStorage Once you get data storage working as described in the section above, you also need to get the app properly reading data from NerdStorage, or the app will reload with an empty state every time you navigate away from the app page and back. To do this, add the UserStorageQuery component and update the componentDidMount method. Step 1 of 3 Import the UserStorageQuery by adding it to the import statement in the application’s ./nerdlets/use-nerdstorage-nerdlet/index.js file. import { UserStorageMutation, UserStorageQuery } from 'nr1'; Copy Step 2 of 3 Then, add the following componentDidMount method to your application: componentDidMount(){ UserStorageQuery.query({ collection: this.collectionId, documentId: this.documentId, }) .then(({ data }) => { if(data !== null) { this.setState({storage: data.storage}); } }) .catch(err => console.log(err)); } Copy Step 3 of 3 Back inside the NerdStorage app, test your changes by adding a few more rows using the text entry field. Then exit and relaunch the application. The application should load and show all the data you entered before you navigated away. Mutate data in NerdStorage Each NerdStorage entry displayed in the table inside the app has a trash button that can be used to update a specific entry. The trash button works by making a call to the _removeFromNerdStorage helper method. Step 1 of 1 To get this process working, update the code in _removeFromNerdStorage: _removeFromNerdStorage(index, data){ const { storage } = this.state; storage.pop(data); this.setState({storage}, () => { UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.WRITE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, document: { storage }, }) .then((res) => { Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.NORMAL }); }) .catch((err) => console.log(err)); }); } Copy Once you do this, clicking the trash button removes the item it's associated with, and the app updates to show the change. Delete collection from NerdStorage While the trash button is a good method for removing specific entries one at a time, you may also want the ability to delete a whole NerdStorage document at once. You can do this by adding the Delete Document button to your app. Step 1 of 2 Add a new GridItem to the application immediately before the closing Grid tag. In the new GridItem add the following code to display your new button: ; Copy Step 2 of 2 Because the new Delete Document button will be calling the _deleteDocument helper method, you'll need to update that using this code: _deleteDocument(){ this.setState({storage: []}); UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.DELETE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, }); Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.CRITICAL }); } Copy Back inside the application, you should now see both the individual trash buttons and the newly added Delete Document button. Next steps Now that you’ve successfully implemented NerdStorage into a New Relic One application, you can store and mutate data connected to your User. For more information on the various NerdStorage components, please visit the New Relic developer website API documentation.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 303.53638, + "_score": 287.94885, "_version": null, "_explanation": null, "sort": null, @@ -3359,7 +3833,7 @@ "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2", "image": "", "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/", - "published_at": "2020-09-24T02:28:37Z", + "published_at": "2020-09-25T01:48:39Z", "updated_at": "2020-08-14T01:47:12Z", "document_type": "page", "popularity": 1, @@ -3367,7 +3841,7 @@ "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 207.85934, + "_score": 201.77205, "_version": null, "_explanation": null, "sort": null, @@ -3393,7 +3867,7 @@ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", "image": "", "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-09-24T02:31:14Z", + "published_at": "2020-09-25T01:50:00Z", "updated_at": "2020-08-14T01:47:12Z", "document_type": "page", "popularity": 1, @@ -3401,7 +3875,7 @@ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 193.9276, + "_score": 184.96358, "_version": null, "_explanation": null, "sort": null, @@ -3420,263 +3894,42 @@ "Installing the New Relic One CLI", "Tip", "New Relic One CLI Commands", - "Get started", - "Configure your CLI preferences", - "Set up your Nerdpacks", - "Manage your Nerdpack subscriptions", - "Install and manage plugins", - "Manage catalog information" - ], - "title": "New Relic One CLI reference", - "type": "developer", - "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-09-24T02:26:06Z", - "updated_at": "2020-09-17T01:51:10Z", - "document_type": "page", - "popularity": 1, - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. 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. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. 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.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 181.77759, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "New Relic One CLI reference", - "sections": "New Relic One CLI reference", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "tags": "New Relic One app", - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use" - }, - "id": "5efa989e28ccbc535a307dd0" - } - ], - "/explore-docs/nr1-cli": [ - { - "image": "", - "url": "https://developer.newrelic.com/explore-docs/nr1-nerdpack/", - "sections": [ - "New Relic One CLI Nerdpack commands", - "Command details", - "nr1 nerdpack:build", - "Builds a Nerdpack", - "Usage", - "Options", - "nr1 nerdpack:clone", - "Clone an existing Nerdpack", - "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", - "nr1 nerdpack:clean", - "Removes all built artifacts", - "nr1 nerdpack:validate", - "Validates artifacts inside your Nerdpack", - "nr1 nerdpack:Info", - "Shows the state of your Nerdpack in the New Relic's registry" - ], - "published_at": "2020-09-24T02:27:37Z", - "title": "New Relic One CLI Nerdpack commands", - "updated_at": "2020-09-17T01:49:55Z", - "type": "developer", - "external_id": "7c1050a6a8624664b90c15111f7c72e96b2fbe17", - "document_type": "page", - "popularity": 1, - "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.", - "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:build Assembles your Nerdpack into bundles 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. nr1 nerdpack:clean Cleans your development folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. Command details nr1 nerdpack:build Builds a Nerdpack Runs a webpack process to assemble your Nerdpack into javascript and CSS bundles. As many other CLI commands, it should be run at the package.json level of your Nerdpack. Usage $ nr1 nerdpack:build OPTION Options --extra-metadata-path=extra-metadata-path Specify a json file path with extra metadata. [default: extra-metadata.json] --prerelease=prerelease If specififed, the value will be appended to the current version of generated files. ie: --prerelease=abc. Then the version will be \"1.2.3-abc\". --profile=profile The authencation profile you want to use. --verbose Adds extra information to the output. 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. nr1 nerdpack:clean Removes all built artifacts Cleans and removes the content and the developtment folders (dist/, tmp/). Usage $ nr1 nerdpack:clean OPTION Options --profile=profile The authentication profile you want to use --verbose Adds extra information to the output. nr1 nerdpack:validate Validates artifacts inside your Nerdpack Validates artifacts inside your Nerdpack. Usage $ nr1 nerdpack:validate OPTION Options -l, --force-local The authentication profile you want to use. -r, --force-remote Force download of new schema files. --profile=profile The authentication profile you want to uset. --verbose Adds extra information to the output. nr1 nerdpack:Info Shows the state of your Nerdpack in the New Relic's registry Shows the state of your Nerdpack in the New Relic's registry. The default amount of versions shown is 10 but all versions can be shown if the --all (or -a) flag is used Usage $ nr1 nerdpack:info OPTION Options -a, --all Show all versions. -i, --nerdpack-id=nerdpack-id Get info from the specified Nerdpack instead of local one. --profile=profile The authentication profile you want to use. --verbose Adds extra information to the output.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 142.55766, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "New Relic One CLI Nerdpack commands", - "sections": "New Relic One CLI Nerdpack commands", - "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.", - "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:build Assembles your Nerdpack into bundles nr1 nerdpack:clone Clones a Nerdpack from" - }, - "id": "5f28bd6a64441f9817b11a38" - }, - { - "sections": [ - "Intro to NerdStorage", - "Use NerdStorage in your apps", - "Data model", - "Limits", - "Data access", - "Permissions for working with NerdStorage" - ], - "title": "Intro to NerdStorage", - "type": "developer", - "tags": [ - "nerdstorage", - "nerdstorage components", - "new relic one apps", - "data access" - ], - "external_id": "709e06c25376d98b2191ca369b4d139e5084bd62", - "image": "", - "url": "https://developer.newrelic.com/explore-docs/nerdstorage/", - "published_at": "2020-09-24T02:28:37Z", - "updated_at": "2020-09-08T01:50:19Z", - "document_type": "page", - "popularity": 1, - "info": "Intro to NerdStorage on New Relic One", - "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,500 documents, plus storage type. Each document can have a maximum length of 1024 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 113.89035, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "sections": "Use NerdStorage in your apps", - "info": "Intro to NerdStorage on New Relic One", - "tags": "new relic one apps", - "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users" - }, - "id": "5efa989ee7b9d2048e7bab92" - }, - { - "sections": [ - "Intro to New Relic One API components", - "Components of the SDK", - "UI components", - "Chart components", - "Query and storage components", - "Platform APIs" - ], - "title": "Intro to New Relic One API components", - "type": "developer", - "tags": [ - "SDK components", - "New Relic One apps", - "UI components", - "chart components", - "query and storage components", - "Platform APIs" - ], - "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2", - "image": "", - "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/", - "published_at": "2020-09-24T02:28:37Z", - "updated_at": "2020-08-14T01:47:12Z", - "document_type": "page", - "popularity": 1, - "info": "Intro to New Relic One API components", - "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 71.012886, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "Intro to New Relic One API components", - "sections": "Intro to New Relic One API components", - "info": "Intro to New Relic One API components", - "tags": "New Relic One apps", - "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations" - }, - "id": "5efa989e28ccbc4071307de5" - }, - { - "sections": [ - "Set up your development environment", - "Before you begin", - "A note on support", - "Tip", - "Prepare to build or modify apps", - "Start building", - "Contribute to developer.newrelic.com" - ], - "title": "Set up your development environment", - "type": "developer", - "tags": [ - "developer account", - "API key", - "New Relic One CLI" - ], - "external_id": "c45638a9cd548d1ffffc9f1c7708f115a92ae04a", - "image": "", - "url": "https://developer.newrelic.com/build-apps/set-up-dev-env/", - "published_at": "2020-09-24T02:30:05Z", - "updated_at": "2020-08-26T01:47:20Z", - "document_type": "page", - "popularity": 1, - "info": "Prepare to build apps and contribute to this site", - "body": "Set up your development environment 20 min If you've decided to build a custom app or modify one of our open source apps, you need a few essential tools: The New Relic One command line interface (CLI) An API key, which you get when you download the CLI Depending on what you want to do with your app, you might have some additional setup and configuration. This guide covers: Downloading the New Relic One CLI to build or modify apps Contribute content to this website Before you begin You must have: A github account account - While not strictly necessary for building apps, a GitHub account enables you to download and customize our open source apps, and contribute an open source project. A New Relic developer account - if you don't already have one, you can get a free trial account for developing New Relic applications. npm - If you've installed Node.js, then you already have npm, which is used to share, reuse, and update JavaScript code, and is necessary for working with React components that are the framework for New Relic apps and this website. A note on support Building a New Relic One application is the same as building any JavaScript/React application. We offer support to help with our building tools (our CLI and SDK library). However, we don't offer support for basic JavaScript or React coding questions or issues. For common questions and answers about building, see the Explorers Hub page on building on New Relic One. Tip Use the New Relic One VSCode extension to build your apps. Prepare to build or modify apps Step 1 of 1 Download the CLI and API key. On the Build New Relic One applications page, complete the Quick start steps. These six Quick start steps get you an API key for use with developing apps, and the New Relic One CLI, for building and deploying apps. At the end of the Quick start, you have a project consisting of the following: A Nerdpack - The package containing all the files required by your application. It contains two types of files that you customize to build your app: Nerdlets, and the launcher. One or more Nerdlet files - A specific UI view or window. A Nerdlet is a React JavaScript package that includes an index.js file, a stylesheet, and a JSON-format config file. It can contain any JS functionality (charts, interactive fields, tooltips, etc.). A launcher file: This is the basis for the launcher, which is used to open your application from New Relic One after you publish your app. Start building Step 1 of 1 If you're ready to code, cd to your Nerdpack and get started. If you want to learn more about building applications, try these step-by-step guides: Build a \"Hello, World!\" application shows how to create a little application, publish it to New Relic One, and share it with others by subscribing accounts to it. Map pageviews by region takes you through the steps to create one of our popular open source apps. You learn to add a custom query to an app and view it in a table, then add that data to a map. Contribute to developer.newrelic.com This site is open source, and we want your input. Create a pull request if you see a mistake you know how to fix. Drop us a GitHub issue if you see some content gaps you want us to work on. Or write up a whole new guide if you have one you'd like to share. Read on to learn how. Step 1 of 3 Fork the developer-website GithHub repo. Forking the repo enables you to work on your own copy of the developer.newrelic.com files, and build the site locally. It also enables us to more easily manage incomimg pull requests. On the developer-website page in GitHub, select the Fork button on the top right of the page, choose the account you want to fork to, and wait a few seconds while the fork is created. Sync regularly to keep your fork up to date with changes and additions to the main branch upstream. Step 2 of 3 Make a feature or documentation request. On any page, select the GitHub button at the top of the page, and then select the kind of change you want, and fill out the GitHub form. Step 3 of 3 Contribute a new guide. Check out our contributors guidelines, which will walk you through the process.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 54.595516, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "sections": "Prepare to build or modify apps", - "info": "Prepare to build apps and contribute to this site", - "tags": "New Relic One CLI", - "body": "Set up your development environment 20 min If you've decided to build a custom app or modify one of our open source apps, you need a few essential tools: The New Relic One command line interface (CLI) An API key, which you get when you download the CLI Depending on what you want to do with your app" - }, - "id": "5efa9973e7b9d242237bab39" - }, - { - "sections": [ - "Nerdpack file structure", - "Generate Nerdpack components", - "Nerdlet file structure", - "index.js", - "nr1.json", - "styles.scss", - "icon.png", - "Launcher file structure" + "Get started", + "Configure your CLI preferences", + "Set up your Nerdpacks", + "Manage your Nerdpack subscriptions", + "Install and manage plugins", + "Manage catalog information" ], - "title": "Nerdpack file structure", + "title": "New Relic One CLI reference", "type": "developer", "tags": [ - "New Relic One CLI", - "nerdpack", - "file structure", - "nerdlets", - "launchers" + "New Relic One app", + "nerdpack commands" ], - "external_id": "c97bcbb0a2b3d32ac93b5b379a1933e7b4e00161", - "image": "", - "url": "https://developer.newrelic.com/explore-docs/nerdpack-file-structure/", - "published_at": "2020-09-24T02:26:06Z", - "updated_at": "2020-08-14T01:49:25Z", + "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-09-25T01:49:59Z", + "updated_at": "2020-09-17T01:51:10Z", "document_type": "page", "popularity": 1, - "info": "An overview of the Nerdpack File Structure", - "body": "Nerdpack file structure A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. Here we explain: The file structure for a Nerdpack, a Nerdlet, and a launcher How to link a launcher file to a Nerdlet How to link your application with a monitored entity For basic component definitions, see our component reference. Generate Nerdpack components There are two ways to generate a Nerdpack template: Generate a Nerdpack: Use the New Relic One CLI command nr1 create and select Nerdpack to create a Nerdpack template that includes a Nerdlet and a launcher. Generate Nerdlet or launcher individually: Use the New Relic One CLI command nr1 create and choose either Nerdlet or launcher. This can be useful when adding Nerdlets to an existing Nerdpack. For documentation on generating and connecting Nerdpack components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │   └── my-nerdlet-launcher │   ├── icon.png │   └── nr1.json ├── nerdlets │   └── my-nerdlet-nerdlet │   ├── index.js │   ├── nr1.json │   └── styles.scss ├── node_modules │   ├── js-tokens │   ├── loose-envify │   ├── object-assign │   ├── prop-types │   ├── react │   ├── react-dom │   ├── react-is │   └── scheduler ├── nr1.json ├── package-lock.json └── package.json Copy Nerdlet file structure A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files, index.js, nr1.json, and styles.scss. Here is what the default files look like after being generated using the nr1 create command: index.js The JavaScript code of the Nerdlet. import React from 'react'; export default class MyAwesomeNerdpack extends React.Component { render() { return

Hello, my-awesome-nerdpack Nerdlet!

; } } Copy nr1.json The Nerdlet configuration file. { \"schemaType\": \"NERDLET\", \"id\": \"my-awesome-nerdpack-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\" } Copy Besides using the launcher as the access point for your application, you can also associate the application with a monitored entity to get it to appear in the entity explorer. To do this, add two additional fields to the config file of the first-launched Nerdlet: entities and actionCategory. In the following example, the Nerdlet has been associated with all Browser-monitored applications and will appear under the Monitor UI category : { \"schemaType\": \"NERDLET\", \"id\": \"my-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"Custom Data\", \"entities\": [{ \"domain\": \"BROWSER\", \"type\": \"APPLICATION\" }], \"actionCategory\": \"monitor\" } Copy To see this application in the UI, you would go to the entity explorer, select Browser applications, and select a monitored application. styles.scss An empty SCSS file for styling your application. icon.png The launcher icon that appears on the Apps page in New Relic One when an application is deployed. Launcher file structure Launchers have their own file structure. Note that: A launcher is not required; as an alternative to using a launcher, you can associate your application with a monitored entity. An application can have more than one launcher, which might be desired for an application with multiple Nerdlets. After generating a launcher using the nr1 create command, its folder contains two files: nr1.json The configuration file. { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy To connect a launcher to a Nerdlet, the rootNerdletId must match the id in the launched Nerdlet's nr1.json config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet. icon.png The icon displayed on the launcher for the app on the Apps page.", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. 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. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 49.29344, + "_score": 177.20117, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Nerdpack file structure", - "sections": "Nerdpack file structure", - "info": "An overview of the Nerdpack File Structure", - "tags": "New Relic One CLI", - "body": " components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │   └── my-nerdlet-launcher │   ├── icon.png" + "title": "New Relic One CLI reference", + "sections": "New Relic One CLI reference", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use" }, - "id": "5efa989e196a671300766404" + "id": "5efa989e28ccbc535a307dd0" } ], "/explore-docs/nr1-catalog": [ @@ -3702,7 +3955,7 @@ "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-09-24T02:26:06Z", + "published_at": "2020-09-25T01:49:59Z", "updated_at": "2020-09-17T01:51:10Z", "document_type": "page", "popularity": 1, @@ -3710,7 +3963,7 @@ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. 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. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 376.41467, + "_score": 360.61557, "_version": null, "_explanation": null, "sort": null, @@ -3742,18 +3995,18 @@ "New Relic developer champions", "New Relic Podcasts" ], - "published_at": "2020-09-24T02:24:45Z", + "published_at": "2020-09-25T01:41:27Z", "title": "New Relic Developers", - "updated_at": "2020-09-24T01:39:32Z", + "updated_at": "2020-09-25T01:37:24Z", "type": "developer", "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab", "document_type": "page", "popularity": 1, - "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 19 Days : 14 Hours : 58 Minutes : 8 Seconds Register 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 20 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", + "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 18 Days : 14 Hours : 58 Minutes : 41 Seconds Register 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 20 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", "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 202.59714, + "_score": 198.85313, "_version": null, "_explanation": null, "sort": null, @@ -3788,7 +4041,7 @@ "nr1 nrql", "Query using NRQL" ], - "published_at": "2020-09-24T02:28:37Z", + "published_at": "2020-09-25T01:49:59Z", "title": "New Relic One CLI common commands", "updated_at": "2020-08-14T01:48:10Z", "type": "developer", @@ -3799,7 +4052,7 @@ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 179.98367, + "_score": 176.21008, "_version": null, "_explanation": null, "sort": null, @@ -3857,7 +4110,7 @@ "Closing + Swag", "Engage with the developer community" ], - "published_at": "2020-09-24T02:28:36Z", + "published_at": "2020-09-25T01:52:51Z", "title": "New Relic Developers", "updated_at": "2020-09-24T01:52:03Z", "type": "developer", @@ -3868,7 +4121,7 @@ "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 170.84108, + "_score": 155.6842, "_version": null, "_explanation": null, "sort": null, @@ -3906,7 +4159,7 @@ "external_id": "63283ee8efdfa419b6a69cb8bd135d4bc2188d2c", "image": "https://developer.newrelic.com/static/175cc6506f7161ebf121129fa87e0789/0086b/apps_catalog.png", "url": "https://developer.newrelic.com/build-apps/publish-deploy/", - "published_at": "2020-09-24T02:32:50Z", + "published_at": "2020-09-25T01:51:37Z", "updated_at": "2020-09-02T02:05:55Z", "document_type": "page", "popularity": 1, @@ -3914,7 +4167,7 @@ "body": "Serve, publish, and deploy your New Relic One app 30 min When you build a New Relic One app, chances are you'll want to share it with others in your organization. You might even want to share it broadly through our open source channel. But first, you probably want to try it out locally to make sure it's working properly. From the New Relic One Apps page, you can review available apps and subscribe to the ones you want for accounts you manage. The Your 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 visualizations 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. Your 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. Here, you learn to: Serve your app locally Add images and metadata to your app Publish it Subscribe and unsubscribe accounts you manage to the app Handle duplicate applications Before you begin This guide requires the following: A New Relic One app or Nerdpack New Relic One CLI A Nerdpack manager role for publishing, deploying, and subscribing apps. Serve your app locally You can locally serve the app you create to New Relic One to test it out. Step 1 of 1 In the parent root folder of your Nerdpack, run nr1 nerdpack:serve. Go to one.newrelic.com/?nerdpacks=local. The ?nerdpacks=local URL suffix will load any locally served Nerdpacks that are available. When you make a change to a locally served Nerdpack, New Relic One will automatically reload it. Add images and metadata to your apps Application creators can include a description of what their 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, custom, or public. 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. Step 1 of 3 Update the New Relic One CLI to ensure you're working with the latest version. nr1 update Copy Step 2 of 3 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 sections for the process to succeed. 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 \\n model that supports location-specific KPI's, custom metadata, drill-down navigation into Entities \\n 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\" } Copy Step 3 of 3 Save the metadata and screenshots to the catalog. This validates the information you added to the catalog directory against the criteria described in the previous step, and saves it to the catalog. nr1 catalog:submit Copy Publish your app Publishing places your Nerdpack in New Relic One. To publish or deploy, you must be a Nerdpack manager. New Relic One requires that only one version (following semantic versioning) of a Nerdpack can be published at a time. Tip If you know what channel you want to deploy to (as described in the Deploy your app section that follows), you can run nr1 nerdpack:publish --channel=STABLE or nr1 nerdpack:publish --channel=BETA. Step 1 of 2 Update the version attribute in the app's package.json file. This follows semantic versioning, and must be updated before you can successfully publish. Step 2 of 2 To publish your Nerdpack, run nr1 nerdpack:publish. Deploy your app Deploying is applying a Nerdpack version to a specific channel (for example, BETA, or STABLE). A channel can only have one Nerdpack version deployed to it at one time. If a channel has an existing Nerdpack associated with it, deploying a new Nerdpack version to that channel will undeploy the previous one. Channels are meant to be an easier way to control application version access than having to be concerned with specific version numbers. Step 1 of 1 To deploy an application, run nr1 nerdpack:deploy. Subscribe or unsubsribe apps Whether you want to subscribe accounts to an app you've created or to apps already available in the catalog, the process is the same. Note that if you subscribe to an app in the catalog, you'll automatically get any updates that are added to the app. To learn about the appropriate permissions for subscribing, see Permissions for managing applications. Step 1 of 2 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 members of the accounts you have subscribed to the app can launch it from New Relic One. Step 2 of 2 Unsubsribe from 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 Your 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. Step 1 of 1 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 155.85696, + "_score": 151.71461, "_version": null, "_explanation": null, "sort": null, @@ -3938,471 +4191,218 @@ "Use NerdGraph to manage license keys and personal API keys", "Feature description", "Create keys", - "Update keys", - "Delete keys", - "Query keys", - "For more help" - ], - "title": "Use NerdGraph to manage license keys and personal API keys", - "category_0": "APIs", - "type": "docs", - "category_1": "NerdGraph", - "external_id": "f4b228fbc3fdc408adc6d7e10a93edd0464b7762", - "image": "", - "url": "https://docs.newrelic.com/docs/apis/nerdgraph/examples/use-nerdgraph-manage-license-keys-personal-api-keys", - "published_at": "2020-09-24T10:26:23Z", - "updated_at": "2020-09-24T10:26:23Z", - "breadcrumb": "Contents / APIs / NerdGraph / Examples", - "document_type": "page", - "popularity": 1, - "info": "Use New Relic NerdGraph (our GraphQL API) to create and manage your New Relic license keys, browser license keys, and personal API keys. ", - "body": "This document contains tutorials on how to use NerdGraph to programmatically create and manage several types of New Relic keys. To build queries and see responses, use our GraphiQL explorer. For more information on our API keys, see API keys. Feature description NerdGraph's ApiAccess field can be used to programmatically create and manage the following types of keys: Personal API keys License keys, including: General license key used for APM Browser license key One common use case for this feature is the ability to create and manage license keys to let you rotate keys for security purposes. Note that you can't use this NerdGraph functionality to manage or delete your original license keys; you can only create additional license keys and manage the ones you've created. General notes about this functionality: All mutations can accept multiple keys as arguments, and will return details about successful changes and errors. See examples below for details. All mutations (create, update and delete) will result in an NrAuditEvent that can be queried for auditing purposes. For details, see Audit events. Some notes about license keys: In the context of using NerdGraph, the license keys are referred to as ingest keys. This feature allows you to create up to 1,000 keys of each license key type, which allows for key rotation. You can't use this NerdGraph functionality to manage or delete your original license keys; you can only create additional license keys and manage the ones you've created. License keys created through NerdGraph can't be found in the New Relic UI. They're only queryable via the API. Some notes about personal API keys: In the context of using NerdGraph, personal API keys are referred to as user keys. User keys are displayed in various UI locations (for example: the User settings UI page). The examples below use license keys (ingest keys), but personal API keys (user keys) are queried in similar ways. We recommend you experiment with queries using the GraphiQL explorer. You can also create, view, and delete personal API keys using the UI. Create keys You can create multiple keys in a single mutation, for multiple accounts and key types. Note that the mutation can return successfully created keys as well as any errors encountered trying to create keys. Example of creating a key: mutation { apiAccessCreateKeys(keys: {ingest: {accountId: YOUR_ACCOUNT_ID, ingestType: BROWSER, name: \"Browser Key\", notes: \"A note.\"}}) { createdKeys { id key name accountId notes type ... on ApiAccessIngestKey { ingestType } } errors { message type ... on ApiAccessIngestKeyError { accountId errorType ingestType } } } } Results will vary depending on your data. Use the GraphiQL explorer to experiment with mutations and queries. Update keys The update mutation takes the key ID, not the key string, to identify keys. mutation { apiAccessUpdateKeys(keys: {ingest: {keyId: KEY_ID, name: \"Updated name\", notes: \"A new note!\"}}) { updatedKeys { id key type name notes } errors { message } } } Results will vary depending on your data. Use the GraphiQL explorer to experiment with mutations and queries. Delete keys The delete mutation takes the key ID, not the key string, to identify keys. Deleted keys will no longer grant access to New Relic systems and will no longer be returned by queries to the API access GraphQL API. mutation { apiAccessDeleteKeys(keys: {ingestKeyIds: INGEST_KEY_ID}) { deletedKeys { id } errors { message } } } Results will vary depending on your data. Use the GraphiQL explorer to experiment with mutations and queries. Query keys You can access ingest and user keys by querying a single key or all keys, scoped to the actor. If querying for a single key, you must provide the key ID and type (INGEST or USER). Querying for multiple keys is done via a key search, which uses a mandatory types list and an optional scope to filter results. User keys belonging to other users will be obfuscated in the results. Single key example query: query { actor { apiAccess { key(id: INGEST_KEY_ID, keyType: INGEST) { key name type ... on ApiAccessIngestKey { ingestType } } } } } Key search example query: query { actor { apiAccess { keySearch(query: {types: INGEST, scope: {ingestTypes: BROWSER}}) { keys { name key type ... on ApiAccessIngestKey { ingestType } } } } } } Results will vary depending on your data. Use the GraphiQL explorer to experiment with mutations and queries. 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.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 375.49478, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "Use NerdGraph to manage license keys and personal API keys", - "sections": "NerdGraph", - "info": "Use New Relic NerdGraph (our GraphQL API) to create and manage your New Relic license keys, browser license keys, and personal API keys. ", - "category_1": "NerdGraph", - "body": ". Note that you can't use this NerdGraph functionality to manage or delete your original license keys; you can only create additional license keys and manage the ones you've created. General notes about this functionality: All mutations can accept multiple keys as arguments, and will return details", - "breadcrumb": "Contents / APIs / NerdGraph / Examples" - }, - "id": "5efe0487196a6710b1766452" - }, - { - "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 ", - "category_0": "Alerts and Applied intelligence", - "type": "docs", - "category_1": "New Relic Alerts", - "external_id": "017d6c34d340b9bc035e91483d675915fa5252eb", - "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-09-24T13:59:00Z", - "updated_at": "2020-08-11T04:59:00Z", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph", - "document_type": "page", - "popularity": 1, - "info": "Read about how you can manage alerts conditions, policies, and muting rules using NerdGraph.", - "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.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 172.07675, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "NerdGraph API: Examples ", - "sections": "Mutations", - "info": "Read about how you can manage alerts conditions, policies, and muting rules using NerdGraph.", - "body": " Use NRQL conditions Muting rules: suppress notifications The easiest way to discover alerts queries and mutations is through the NerdGraph API explorer. NerdGraph API explorer Our NerdGraph API explorer is a GraphiQL editor where you can prototype queries and mutations. Here are some examples showing", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph" - }, - "id": "5f2dbad864441fd15456a9eb" - }, - { - "image": "", - "url": "https://developer.newrelic.com/collect-data/", - "sections": [ - "Collect data", - "Guides to collect data", - "Add custom attributes", - "Collect data - any source", - "Build queries with NerdGraph", - "Create custom events", - "Query data with NRQL" - ], - "published_at": "2020-09-24T02:30:06Z", - "title": "Collect data", - "updated_at": "2020-09-24T01:56:25Z", - "type": "developer", - "external_id": "fb5d6f75b61858b09e3e8c63f3b2af97813f47b6", - "document_type": "page", - "popularity": 1, - "body": "Collect data Through our opensource agents or APIs, New Relic makes it easy to collect data from any source. The guides in this section provide strategies for collecting and querying data for use in your existing implementation, or in apps you build. The opportunities are endless. Guides to collect data   Add custom attributes Use custom attributes for deeper analysis 15 min Collect data - any source APIs, agents, OS emitters - get any data 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 10 min Query data with NRQL Query default data, custom events, and attributes", - "info": "", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 157.57141, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "sections": "Build queries with NerdGraph", - "body": " data   Add custom attributes Use custom attributes for deeper analysis 15 min Collect data - any source APIs, agents, OS emitters - get any data 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 10 min Query data with NRQL Query default data, custom events, and attributes" - }, - "id": "5efa997328ccbc768c307de2" - }, - { - "category_2": "Trace API", - "nodeid": 35381, - "sections": [ - "Distributed tracing", - "Get started", - "Enable and configure", - "Other requirements", - "UI and data", - "Trace API", - "Troubleshooting", - "Report traces via the Trace API (New Relic format)", - "Example: Use your tool’s native sampling", - "Example: Use Infinite Tracing", - "JSON requirements and recommendations", - "Attributes", - "Required attributes", - "Highly recommended attributes", - "Reserved attributes", - "Other attributes", - "Explore more about distributed tracing:", - "For more help" - ], - "title": "Report traces via the Trace API (New Relic format)", - "category_0": "Understand dependencies", - "type": "docs", - "category_1": "Distributed tracing", - "external_id": "ba16f3a71b78e24c23da821b64567398251bb217", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/Infinite_Tracing_GraphiQL_URL_Results_0_0.png", - "url": "https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/trace-api/report-new-relic-format-traces-trace-api", - "published_at": "2020-09-24T12:18:41Z", - "updated_at": "2020-09-24T12:18:40Z", - "breadcrumb": "Contents / Understand dependencies / Distributed tracing / Trace API", - "document_type": "page", - "popularity": 1, - "info": "For New Relic's Trace API: how to report traces using the New Relic format. ", - "body": "You can send traces in the New Relic format to our Trace API without using a New Relic agent or integration. This is useful if you want to integrate with sources that emit tracing data and require a backend for trace storage. Since distributed systems can generate a lot of trace data, telemetry tools rely on data sampling (filtering) to find the most useful subset of that data. When you send us your trace data, you have two options related to sampling: Use your tool’s native sampling: This approach sends the telemetry data directly to the Trace API and assumes you are relying on your telemetry tool to sample the data before the integration passes the data to New Relic. Even though your tool may be sampling data before the New Relic integration sends it, our Trace API may randomly sample out traces that exceed your rate limit. Use Infinite Tracing (limited release): This approach assumes you turn off sampling in your telemetry tool and then send all your data to a New Relic trace observer in AWS. The trace observer selects the most important and actionable traces using tail-based sampling and then sends your traces to our UI. To send Zipkin-formatted data to the Trace API, see our Zipkin instructions. We'll look at two examples for sending your telemetry data to New Relic, as well as how to structure your data: Example: Use your tool’s native sampling Example: Use Infinite Tracing JSON requirements and recommendations Attributes Example: Use your tool’s native sampling If you are using a telemetry tool that is sampling your trace data, you can send the data directly to New Relic. The following procedure explains how to send a test payload to the Trace API using the newrelic format. For details about how to structure your data, see JSON requirements and recommendations. Get an Insert API key: Go to: one.newrelic.com > account dropdown > Account settings > API keys, and select Insights API keys. If you don't have a key, create a new one by selecting Insert keys +. Insert your Insert API key into the following JSON and then send the JSON to our endpoint. curl -i -H \"Content-Type: application/json\" \\ -H \"Api-Key: YOUR_INSERT_API_KEY\" \\ -H 'Data-Format: newrelic' \\ -H 'Data-Format-Version: 1' \\ -X POST \\ -d '[ { \"common\": { \"attributes\": { \"service.name\": \"Test Service A\", \"host\": \"host123.test.com\" } }, \"spans\": [ { \"trace.id\": \"123456\", \"id\": \"ABC\", \"attributes\": { \"duration.ms\": 12.53, \"name\": \"/home\" } }, { \"trace.id\": \"123456\", \"id\": \"DEF\", \"attributes\": { \"service.name\": \"Test Service A\", \"host\": \"host456.test.com\", \"duration.ms\": 2.97, \"name\": \"/auth\", \"parent.id\": \"ABC\" } } ] } ]' 'https://trace-api.newrelic.com/trace/v1' If you're sending more than one POST, change the trace.id to a unique value. Sending the same payload or span id multiple times for the same trace.id may result in fragmented traces in the UI. If your test returned HTTP/1.1 202 Accepted, go to our UI to see a query of your test data using the span attribute service.name = Test Service A. Traces may take up to one minute to be processed by both the trace observer and the Trace API. Example: Use Infinite Tracing Infinite Tracing can examine all of your data and find the most useful traces. To get the biggest benefit from Infinite Tracing, you should turn off sampling in your telemetry tool and send all your trace data to the trace observer. To start using Infinite Tracing, please go to our sign-up page. The following steps show you how to find or create a trace observer endpoint using GraphQL and how to send a test payload using the newrelic format. For details about how to structure your data, see JSON requirements and recommendations. If you send your data to a trace observer in one of our EU provider regions, you'll still need a US-based New Relic account because the tail-based sampling data is reported to data centers in the United States. If you have questions, contact your account representative. Step A. Open NerdGraph API explorer Prepare to execute some GraphQL: Open NerdGraph API explorer. In the API key dropdown next to Tools, select your personal API key for your account under one of these options: Select an existing API Key Create a new API Key Step B. See if anyone in your organization has already created a trace observer endpoint The following steps show you how to execute a GraphQL query to find out if you can use an existing trace observer in your AWS region. If one isn't available, you can go to Step C. Create a new one. Copy the following query into the middle pane of the NerdGraph API explorer and replace YOUR_ACCOUNT_ID with your account ID (the number next to your account name in NerdGraph API explorer): { actor { account(id: YOUR_ACCOUNT_ID) { edge { tracing { traceObservers { errors { message type } traceObservers { endpoints { agent { host port } endpointType https { host port url } status } id name providerRegion } } } } } } } Click the triangle button to execute the query or press Ctrl+Enter. Check the right pane showing the results: In traceObservers, if you see an AWS region (providerRegion) appropriate for your location, copy its associated https: url value to use later as YOUR_TRACE_OBSERVER_URL in Send test data to the trace observer. If you don't see any values in traceObservers as shown below, continue to Step C. Create a new one. Step C. If you can't find an existing trace observer endpoint, create a new one If you didn't find a trace observer after running the query in the previous section, you need to create one. To do this, you execute a GraphQL mutation that passes your configuration details. Copy the following into the middle pane of the NerdGraph API explorer. mutation { edgeCreateTraceObserver(accountId: YOUR_ACCOUNT_ID, traceObserverConfigs: {name: \"YOUR_DESCRIPTIVE_NAME\", providerRegion: YOUR_PROVIDER_REGION}) { responses { errors { message type } traceObserver { endpoints { agent { host port } endpointType https { host port url } status } id name providerRegion } } } } Insert your own values into the mutation: Value Description YOUR_ACCOUNT_ID Replace this with your account ID (the number next to your account name in NerdGraph API explorer). YOUR_DESCRIPTIVE_NAME Replace this with a name that describes the services that report to this trace observer (for example, production or query services). YOUR_PROVIDER_REGION Replace this with the provider region enum value for your location: AWS_EU_WEST_1 AWS_US_EAST_1 AWS_US_WEST_2 Click the triangle button to execute the mutation or press Ctrl+Enter. In the right pane showing the results, copy the value of https: url to a text file so you can use it later as YOUR_TRACE_OBSERVER_URL in Send test data to the trace observer: Step D. Send data to the trace observer Here's a test that includes a sample payload with one trace and two spans from the same service: Test Service A. Follow these steps to send a test request: Get or generate your Insert API key so you can use it later in the test. Copy the following curl request into a text editor: curl request curl -i -H \"Content-Type: application/json\" \\ -H \"Api-Key: YOUR_INSERT_API_KEY\" \\ -H 'Data-Format: newrelic' \\ -H 'Data-Format-Version: 1' \\ -X POST \\ -d '[ { \"common\": { \"attributes\": { \"environment\": \"staging\" } }, \"spans\": [ { \"trace.id\": \"123456\", \"id\": \"ABC\", \"attributes\": { \"duration.ms\": 12.53, \"host\": \"host123.test.com\", \"name\": \"/home\", \"service.name\": \"Test Service A\" } }, { \"trace.id\": \"123456\", \"id\": \"DEF\", \"attributes\": { \"duration.ms\": 2.97, \"host\": \"host456.test.com\", \"error.message\": \"Invalid credentials\", \"name\": \"/auth\", \"parent.id\": \"ABC\", \"service.name\": \"Test Service B\" } } ] } ]' \\ 'YOUR_TRACE_OBSERVER_URL' Insert your own values into the curl request: Value Description YOUR_INSERT_API_KEY Replace this with your Insert API key (not the same as your personal API key for NerdGraph API explorer) YOUR_TRACE_OBSERVER_URL Replace this with the value under https: url from above. Copy the content of the text editor into a terminal, and then execute the request. If the test does not return HTTP/1.1 202 Accepted indicating success, check the following and try again: Confirm that you substituted the url (not host) value for YOUR_TRACE_OBSERVER_URL. Confirm that you only have single quotes around the value you inserted for YOUR_TRACE_OBSERVER_URL. Check that you are using the Insert API Key (not a license). If your test returned HTTP/1.1 202 Accepted, go to our UI to see a query of your test data using the span attribute service.name = Test Service A. Because the sample payload contains an error attribute, the error sampler will mark it for keeping. If you modify the payload to remove the error attributes, the random sampler may not choose to keep this particular trace. Traces may take up to one minute to be processed by both the trace observer and the Trace API. JSON requirements and recommendations Requirements and guidelines for trace JSON using the newrelic format: Each JSON payload is an array of objects. Each object should contain a required spans key. Each object may contain an optional common key. Use this if you want share information across multiple spans in a object. Any keys on a span have precedence over the same key in the common block. The value for spans key is a list of span objects. Certain attributes are required, and must be included either in the optional common block, or in each span. Recommended and custom attributes may be optionally included in a list of key/value pairs under a key named attributes, in the optional common block and/or in each span. In the following example POST, there are two spans, both of which will have the trace.id 12345 and the custom attribute host: host123.test.com. The first span has no parent.id, so that is the root of the trace; the second span's parent.id points to the ID of the first. [ { \"common\": { \"attributes\": { \"host\": \"host123.test.com\" } }, \"spans\": [ { \"trace.id\": \"12345\", \"id\": \"abc\", \"attributes\": { \"user.email\": \"bob@newr.com\", \"service.name\": \"my-service\", \"duration.ms\": 750, \"name\": \"my-span\" } }, { \"trace.id\": \"12345\", \"id\": \"def\", \"attributes\": { \"parent.id\": \"abc\", \"service.name\": \"second-service\", \"duration.ms\": 750, \"name\": \"second-span\" } } ] } ] Attributes Review the sections below describing the attributes for the attributes block of a newrelic formatted JSON POST. Required attributes Requests without these attributes will be rejected, and an NrIntegrationError will be generated. These are the only attributes that don't belong under attributes. attribute description id string Unique identifier for this span. trace.id string Unique identifier shared by all spans within a single trace. Highly recommended attributes While not required, these attributes should be included for the best experience with your data. They are included in the attributes section. attribute default description duration.ms float none Duration of this span in milliseconds. name string none The name of this span. parent.id string none The id of the caller of this span. Value is null if this is the root span. Traces without a root span will not displayed. service.name string none The name of the entity that created this span. timestamp long Defaults to the current time in UTC timezone if not provided. The span's start time in Epoch milliseconds. Reserved attributes These attributes are currently reserved for internal New Relic usage. While they are not explicitly blocked, we recommend not using them. attribute default description entity.name string service.name This is derived from the service.name attribute. entity.type string service The entity type is assumed to be a service. entity.guid string None The entity.guid is a derived value that uniquely identifies the entity in New Relic's backend. Other attributes You can add any arbitrary attributes you want, with the exception of the restricted attributes. For example, you might want to add attributes like customer.id or user.id to help you analyze your trace data. To learn how to control how spans appear in New Relic (for example, adding errors or setting a span as a datastore span), see Decorate spans. Explore more about distributed tracing: Learn where Trace API data shows up in the UI. Learn how to decorate spans for a richer, more detailed UI experience. For example, you can have spans show up as datastore spans or display errors. Learn about general data limits, required metadata, and response validation. If you don't see your trace data, see Troubleshooting. 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.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 148.16756, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "body": " the following query into the middle pane of the NerdGraph API explorer and replace YOUR_ACCOUNT_ID with your account ID (the number next to your account name in NerdGraph API explorer): { actor { account(id: YOUR_ACCOUNT_ID) { edge { tracing { traceObservers { errors { message type } traceObservers" - }, - "id": "5d89dc6028ccbc83ce9cb16f" - }, - { - "category_2": "Get started", - "nodeid": 11431, - "sections": [ - "NRQL: New Relic Query Language", - "Get started", - "NRQL query tools", - "NRQL query tutorials", - "Introduction to NRQL, New Relic's query language", - "What is NRQL?", - "Where can you use NRQL?", - "What data can you query with NRQL?", - "Start using NRQL", - "NRQL query examples", - "NRQL syntax", - "For more help" - ], - "title": "Introduction to NRQL, New Relic's query language", - "category_0": "Query your data", - "type": "docs", - "category_1": "NRQL: New Relic Query Language", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", - "external_id": "d44be2c7df7addda8679b4c842015223cfcbd1a3", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-view-chart-nrql-query_0.png", - "url": "https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", - "published_at": "2020-09-24T08:40:21Z", - "updated_at": "2020-09-24T08:40:20Z", - "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started", - "document_type": "page", - "popularity": 1, - "info": "An introduction to New Relic Query Language (NRQL) and how to use it.", - "body": "One way to query your New Relic data is with the New Relic Query Language (NRQL). This resource explains what NRQL is, when and how you can use it, and basic syntax rules. For more detailed information on querying, including a listing of clauses and functions and example queries, see NRQL syntax, clauses, and functions. What is NRQL? NRQL is New Relic's SQL-like query language. You can use NRQL to retrieve detailed New Relic data and get insight into your applications, hosts, and business-important activity. Reasons to use NRQL include: To answer a question for the purpose of troubleshooting or business analysis To create a new chart To make API queries of New Relic data (for example, using our NerdGraph API) NRQL is used behind the scenes to generate some New Relic charts: Some New Relic charts are built using NRQL. One way to start using NRQL is to view a chart's query and then edit it to make your own custom chart. Where can you use NRQL? You can use NRQL in these places: New Relic One query builder: Advanced mode is a NRQL query interface Basic mode provides a simplified query experience that doesn't require knowledge of NRQL but that uses NRQL to generate results New Relic Insights NerdGraph: our GraphQL-format API, which includes options for making NRQL queries one.newrelic.com > Query your data: You can run a NRQL query in both New Relic One and New Relic Insights. This NRQL query shows a count of distributed tracing spans faceted by their entity names. NRQL is one of several ways to query New Relic data. For more on all query options, see Query your data. What data can you query with NRQL? NRQL allows you to query these New Relic data types: Event data from all New Relic products, including: APM events, like Transaction New Relic Browser events, like PageView New Relic Mobile events, like Mobile Infrastructure events, like ProcessSample Synthetics events, like SyntheticCheck Custom events, like those reported by the Event API Metric timeslice data (metrics reported by New Relic APM, Browser, and Mobile) The Metric data type (metrics reported by the Metric API and data sources that use that API) The Span data type (distributed tracing data) The Log data type (data from New Relic Logs) Some data, like relationships between monitored entities, is not available via NRQL but is available using our NerdGraph API. Start using NRQL One way to start using NRQL and to understand what data you have available is to go to a NRQL interface (for example, the New Relic One query builder), type FROM, and press space. The interface will suggest available types of data: To see the attributes available for a specific data type, type FROM DATA_TYPE SELECT and press space. The interface will suggest available attributes. For example: To see the complete JSON associated with a data type, including all of its attributes, use the keyset() attribute. For example: FROM Transaction SELECT keyset() NRQL is used behind the scenes to build some New Relic charts and dashboards. One way to learn NRQL is to find one of these NRQL-generated charts and start playing with the NRQL to create new, customized queries and charts: Charts built with NRQL will have View query as an option. You can then edit and customize that query to see how your changes affect the resulting visualization. To explore your data without having to use NRQL, use the basic mode of New Relic One query builder. NRQL query examples Here's an example NRQL query of Transaction data, which is reported by New Relic APM. FROM Transaction SELECT average(duration) FACET appName TIMESERIES auto This would generate a chart that looks like: Here are some more query examples: Basic NRQL query of Browser data Here's a NRQL query of PageView data, which is reported by New Relic Browser. SELECT uniqueCount(user) FROM PageView WHERE userAgentOS = 'Mac' FACET countryCode SINCE 1 day ago LIMIT 20 Attribute name with a space in it If a custom attribute name has a space in it, use backticks around the attribute name: SELECT count(*) FROM Transaction FACET `Logged-in user` Querying multiple data sources To return data from two data sources, separate their data types with a comma. For example, this query returns a count of all APM transactions and Browser events over the last three days:​ SELECT count(*) FROM Transaction, PageView SINCE 3 days ago Query returning multiple columns To return multiple columns from a dataset, separate the aggregator arguments with a comma: SELECT function(attribute), function(attribute) ... FROM ... This query returns the minimum, average, and maximum duration for New Relic Browser PageView events over the last week: SELECT min(duration), max(duration), average(duration) FROM PageView SINCE 1 week ago See more NRQL query examples. NRQL syntax The syntax of a NRQL query is similar to standard SQL queries. Here is a breakdown of the structure of a NRQL query: SELECT function(attribute) [AS 'label'][, ...] FROM data type [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] Basic rules include: NRQL condition Details Required values The SELECT statement and FROM clause are required. All other clauses are optional. You can start your query with either SELECT or FROM. Query string size The query string must be less than 4 KB. Case sensitivity The data type names and attribute names are case sensitive. NRQL clauses and functions are not case sensitive. Syntax for strings NRQL uses single quotes to designate strings. For example: ... where traceId = '030a573f0df02c57' Attribute names with spaces Use backticks `` to quote a custom attribute name that has a space in it. For example: ... FACET `Logged-in user` Data type coercion Insights does not support data type \"coercion.\" For more information, see Data type conversion. Use of math functions Basic and advanced math functions are supported in the SELECT statement. JOIN functions NRQL does not have the equivalent of the SQL JOIN function, but you can simulate a JOIN with custom attributes. Read more about NRQL syntax and functions. 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.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 135.7355, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "Introduction to NRQL, New Relic's query language", - "sections": "NRQL: New Relic Query Language", - "info": "An introduction to New Relic Query Language (NRQL) and how to use it.", - "category_0": "Query your data", - "category_1": "NRQL: New Relic Query Language", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", - "body": " or business analysis To create a new chart To make API queries of New Relic data (for example, using our NerdGraph API) NRQL is used behind the scenes to generate some New Relic charts: Some New Relic charts are built using NRQL. One way to start using NRQL is to view a chart's query and then edit", - "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started" - }, - "id": "5f2abd47196a67747343fbe1" - } - ], - "/build-apps/add-nerdgraphquery-guide": [ - { - "image": "", - "url": "https://developer.newrelic.com/build-apps/", - "sections": [ - "Build apps", - "Guides to build apps", - "Create a \"Hello, World!\" application", - "Permissions for managing applications", - "Set up your development environment", - "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", - "Publish and deploy apps", - "Create a custom map view" + "Update keys", + "Delete keys", + "Query keys", + "For more help" ], - "published_at": "2020-09-24T02:30:06Z", - "title": "Build apps", - "updated_at": "2020-09-24T01:55:00Z", - "type": "developer", - "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", + "title": "Use NerdGraph to manage license keys and personal API keys", + "category_0": "APIs", + "type": "docs", + "category_1": "NerdGraph", + "external_id": "f4b228fbc3fdc408adc6d7e10a93edd0464b7762", + "image": "", + "url": "https://docs.newrelic.com/docs/apis/nerdgraph/examples/use-nerdgraph-manage-license-keys-personal-api-keys", + "published_at": "2020-09-24T10:26:23Z", + "updated_at": "2020-09-24T10:26:23Z", + "breadcrumb": "Contents / APIs / NerdGraph / Examples", "document_type": "page", "popularity": 1, - "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   Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 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 Publish and deploy apps Start sharing the apps you build 30 min Create a custom map view Build an app to show page view data on a map", - "info": "", + "info": "Use New Relic NerdGraph (our GraphQL API) to create and manage your New Relic license keys, browser license keys, and personal API keys. ", + "body": "This document contains tutorials on how to use NerdGraph to programmatically create and manage several types of New Relic keys. To build queries and see responses, use our GraphiQL explorer. For more information on our API keys, see API keys. Feature description NerdGraph's ApiAccess field can be used to programmatically create and manage the following types of keys: Personal API keys License keys, including: General license key used for APM Browser license key One common use case for this feature is the ability to create and manage license keys to let you rotate keys for security purposes. Note that you can't use this NerdGraph functionality to manage or delete your original license keys; you can only create additional license keys and manage the ones you've created. General notes about this functionality: All mutations can accept multiple keys as arguments, and will return details about successful changes and errors. See examples below for details. All mutations (create, update and delete) will result in an NrAuditEvent that can be queried for auditing purposes. For details, see Audit events. Some notes about license keys: In the context of using NerdGraph, the license keys are referred to as ingest keys. This feature allows you to create up to 1,000 keys of each license key type, which allows for key rotation. You can't use this NerdGraph functionality to manage or delete your original license keys; you can only create additional license keys and manage the ones you've created. License keys created through NerdGraph can't be found in the New Relic UI. They're only queryable via the API. Some notes about personal API keys: In the context of using NerdGraph, personal API keys are referred to as user keys. User keys are displayed in various UI locations (for example: the User settings UI page). The examples below use license keys (ingest keys), but personal API keys (user keys) are queried in similar ways. We recommend you experiment with queries using the GraphiQL explorer. You can also create, view, and delete personal API keys using the UI. Create keys You can create multiple keys in a single mutation, for multiple accounts and key types. Note that the mutation can return successfully created keys as well as any errors encountered trying to create keys. Example of creating a key: mutation { apiAccessCreateKeys(keys: {ingest: {accountId: YOUR_ACCOUNT_ID, ingestType: BROWSER, name: \"Browser Key\", notes: \"A note.\"}}) { createdKeys { id key name accountId notes type ... on ApiAccessIngestKey { ingestType } } errors { message type ... on ApiAccessIngestKeyError { accountId errorType ingestType } } } } Results will vary depending on your data. Use the GraphiQL explorer to experiment with mutations and queries. Update keys The update mutation takes the key ID, not the key string, to identify keys. mutation { apiAccessUpdateKeys(keys: {ingest: {keyId: KEY_ID, name: \"Updated name\", notes: \"A new note!\"}}) { updatedKeys { id key type name notes } errors { message } } } Results will vary depending on your data. Use the GraphiQL explorer to experiment with mutations and queries. Delete keys The delete mutation takes the key ID, not the key string, to identify keys. Deleted keys will no longer grant access to New Relic systems and will no longer be returned by queries to the API access GraphQL API. mutation { apiAccessDeleteKeys(keys: {ingestKeyIds: INGEST_KEY_ID}) { deletedKeys { id } errors { message } } } Results will vary depending on your data. Use the GraphiQL explorer to experiment with mutations and queries. Query keys You can access ingest and user keys by querying a single key or all keys, scoped to the actor. If querying for a single key, you must provide the key ID and type (INGEST or USER). Querying for multiple keys is done via a key search, which uses a mandatory types list and an optional scope to filter results. User keys belonging to other users will be obfuscated in the results. Single key example query: query { actor { apiAccess { key(id: INGEST_KEY_ID, keyType: INGEST) { key name type ... on ApiAccessIngestKey { ingestType } } } } } Key search example query: query { actor { apiAccess { keySearch(query: {types: INGEST, scope: {ingestTypes: BROWSER}}) { keys { name key type ... on ApiAccessIngestKey { ingestType } } } } } } Results will vary depending on your data. Use the GraphiQL explorer to experiment with mutations and queries. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 793.5133, + "_score": 336.3008, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Build apps", - "sections": "Add the NerdGraphQuery component to an application", - "body": ". 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" + "title": "Use NerdGraph to manage license keys and personal API keys", + "sections": "NerdGraph", + "info": "Use New Relic NerdGraph (our GraphQL API) to create and manage your New Relic license keys, browser license keys, and personal API keys. ", + "category_1": "NerdGraph", + "body": ". Note that you can't use this NerdGraph functionality to manage or delete your original license keys; you can only create additional license keys and manage the ones you've created. General notes about this functionality: All mutations can accept multiple keys as arguments, and will return details", + "breadcrumb": "Contents / APIs / NerdGraph / Examples" }, - "id": "5efa999d64441fc0f75f7e21" + "id": "5efe0487196a6710b1766452" }, { + "nodeid": 37751, "sections": [ - "Map page views by region in a custom app", - "Before you begin", - "New Relic terminology", - "Build a custom app with a table chart", - "Query your browser data", - "Create and serve a new Nerdpack", - "Review your app files and view your app locally", - "Hard code your account ID", - "Import the TableChart component", - "Add a table with a single row", - "Customize the look of your table (optional)", - "Get your data into that table", - "Make your app interactive with a text field", - "Import the TextField component", - "Add a row for your text field", - "Build the text field object", - "Get your data on a map", - "Install Leaflet", - "Add a webpack config file for Leaflet", - "Import modules from Leaflet", - "Import additional modules from New Relic One", - "Get data for the map", - "Customize the map marker colors", - "Set your map's default center point", - "Add a row for your map", - "Replace \"Hello\" with the Leaflet code" - ], - "title": "Map page views by region in a custom app", - "type": "developer", - "tags": [ - "custom app", - "map", - "page views", - "region", - "nerdpack" + "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" ], - "external_id": "6ff5d696556512bb8d8b33fb31732f22bab455cb", - "image": "https://developer.newrelic.com/static/d87a72e8ee14c52fdfcb91895567d268/0086b/pageview.png", - "url": "https://developer.newrelic.com/build-apps/map-pageviews-by-region/", - "published_at": "2020-09-24T02:27:37Z", - "updated_at": "2020-09-17T01:48:42Z", + "title": "NerdGraph API: Examples ", + "category_0": "Alerts and Applied intelligence", + "type": "docs", + "category_1": "New Relic Alerts", + "external_id": "017d6c34d340b9bc035e91483d675915fa5252eb", + "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-09-24T13:59:00Z", + "updated_at": "2020-08-11T04:59:00Z", + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph", "document_type": "page", "popularity": 1, - "info": "Build a New Relic app showing page view data on a world map.", - "body": "Map page views by region in a custom app 30 min New Relic has powerful and flexible tools for building custom apps and populating them with data. This guide shows you how to build a custom app and populate it with page view data using New Relic's Query Language (NRQL - pronounced 'nurkle'). Then you make your data interactive. And last, if you have a little more time and want to install a third-party React library, you can display the page view data you collect on a map of the world. In this guide, you build an app to display page view data in two ways: In a table On a map Please review the Before you begin section to make sure you have everything you need and don't get stuck halfway through. Before you begin In order to get the most out of this guide, you must have: A New Relic developer account, API key, and the command-line tool. If you don't have these yet, see the steps in Setting up your development environment New Relic Browser page view data to populate the app. Without this data, you won't be able to complete this guide. To add your data to a world map in the second half of the guide: npm, which you'll use during this section of the guide to install Leaflet, a third-party JavaScript React library used to build interactive maps. If you're new to React and npm, you can go here to install Node.js and npm. New Relic terminology The following are some terms used in this guide: New Relic application: The finished product where data is rendered in New Relic One. This might look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One that launches your application. Nerdlets: New Relic React components used to build your application. The three default files are index.js, nr1.json, and styles.scss, but you can customize and add your own. Build a custom app with a table chart Step 1 of 8 Query your browser data Use Query builder to write a NRQL query to see your page view data, as follows. On New Relic One, select Query your data (in the top right corner). That puts you in NRQL mode. You'll use NRQL to test your query before dropping the data into your table. Copy and paste this query into a clear query field, and then select Run. FROM PageView SELECT count(*), average(duration) WHERE appName = 'WebPortal' FACET countryCode, regionCode SINCE 1 week ago LIMIT 1000 Copy If you have PageView data, this query shows a week of average page views broken down by country and limited to a thousand items. The table will be full width and use the \"chart\" class defined in the CSS. If you don't have any results at this point, ensure your query doesn't have any errors. If your query is correct, you might not have the Browser agent installed. Step 2 of 8 Create and serve a new Nerdpack To get started, create a new Nerdpack, and serve it up to New Relic from your local development environment: Create a new Nerdpack for this app: nr1 create --type nerdpack --name pageviews-app Copy Serve the project up to New Relic: cd pageviews-app && nr1 nerdpack:serve Copy Step 3 of 8 Review your app files and view your app locally Navigate to your pageviews-app to see how it's structured. It contains a launcher folder, where you can customize the description and icon that will be displayed on the app's launcher in New Relic One. It also contains nerdlets, which each contain three default files: index.js, nr1.json, and styles.scss. You'll edit some of these files as part of this guide. For more information, see Nerdpack file structure. Now in your browser, open https://one.newrelic.com/?nerdpacks=local, and then click Apps to see the pageview-apps Nerdpack that you served up. When you select the launcher, you see a Hello message. Step 4 of 8 Hard code your account ID For the purposes of this exercise and for your convenience, hard code your account ID. In the pageview-app-nerdlet directory, in the index.js file, add this code between the import and export lines. (Read about finding your account ID here). const accountId = [Replace with your account ID]; Copy Step 5 of 8 Import the TableChart component To show your data in a table chart, import the TableChart component from New Relic One. To do so, in index.js, add this code under import React. import { TableChart } from 'nr1'; Copy Step 6 of 8 Add a table with a single row To add a table with a single row, in the index.js file, replace this line: return

Hello, pageview-app-nerdlet Nerdlet!

; Copy with this export code: export default class PageViewApp extends React.Component { render() { return (
); } } Copy Step 7 of 8 Customize the look of your table (optional) You can use standard CSS to customize the look of your components. In the styles.scss file, add this CSS. Feel free to customize this CSS to your taste. .container { width: 100%; height: 99vh; display: flex; flex-direction: column; .row { margin: 10px; display: flex; flex-direction: row; } .chart { height: 250px; } } Copy Step 8 of 8 Get your data into that table Now that you've got a table, you can drop a TableChart populated with data from the NRQL query you wrote at the very beginning of this guide. Put this code into the row div. ; Copy Go to New Relic One and click your app to see your data in the table. (You might need to serve your app to New Relic again.) Congratulations! You made your app! Continue on to make it interactive and show your data on a map. Make your app interactive with a text field Once you confirm that data is getting to New Relic from your app, you can start customizing it and making it interactive. To do this, you add a text field to filter your data. Later, you use a third-party library called Leaflet to show that data on a world map. Step 1 of 3 Import the TextField component Like you did with the TableChart component, you need to import a TextField component from New Relic One. import { TextField } from 'nr1'; Copy Step 2 of 3 Add a row for your text field To add a text field filter above the table, put this code above the TableChart div. The text field will have a default value of \"US\".
{ this.setState({ countryCode: event.target.value }); }} />
; Copy Step 3 of 3 Build the text field object Above the render() function, add a constructor to build the text field object. constructor(props) { super(props); this.state = { countryCode: null } } Copy Then, add a constructor to your render() function. Above return, add: const { countryCode } = this.state; Copy Now add countryCode to your table chart query. ; Copy Reload your app to try out the text field. Get your data on a map To create the map, you use npm to install Leaflet. Step 1 of 9 Install Leaflet In your terminal, type: npm install --save leaflet react-leaflet Copy In your nerdlets styles.scss file, import the Leaflet CSS: @import `~leaflet/dist/leaflet.css`; Copy While you're in styles.scss, fix the width and height of your map: .containerMap { width: 100%; z-index: 0; height: 70vh; } Copy Step 2 of 9 Add a webpack config file for Leaflet Add a webpack configuration file .extended-webpackrc.js to the top-level folder in your nerdpack. This supports your use of map tiling information data from Leaflet. module.exports = { module: { rules: [ { test: /\\.(png|jpe?g|gif)$/, use: [ { loader: 'file-loader', options: {}, }, { loader: 'url-loader', options: { limit: 25000 }, }, ], }, ], }, }; Copy Step 3 of 9 Import modules from Leaflet In index.js, import modules from Leaflet. import { Map, CircleMarker, TileLayer } from 'react-leaflet'; Copy Step 4 of 9 Import additional modules from New Relic One You need several more modules from New Relic One to make the Leaflet map work well. Import them with this code: import { NerdGraphQuery, Spinner, Button, BlockText } from 'nr1'; Copy NerdGraphQuery lets you make multiple NRQL queries at once and is what will populate the map with data. Spinner adds a loading spinner. Button gives you button components. BlockText give you block text components. Step 5 of 9 Get data for the map Using latitude and longitude with country codes, you can put New Relic data on a map. mapData() { const { countryCode } = this.state; const query = `{ actor { account(id: 1606862) { mapData: nrql(query: \"SELECT count(*) as x, average(duration) as y, sum(asnLatitude)/count(*) as lat, sum(asnLongitude)/count(*) as lng FROM PageView FACET regionCode, countryCode WHERE appName = 'WebPortal' ${countryCode ? ` WHERE countryCode like '%${countryCode}%' ` : ''} LIMIT 1000 \") { results nrql } } } }`; return query; }; Copy Step 6 of 9 Customize the map marker colors Above the mapData function, add this code to customize the map marker colors. getMarkerColor(measure, apdexTarget = 1.7) { if (measure <= apdexTarget) { return '#11A600'; } else if (measure >= apdexTarget && measure <= apdexTarget * 4) { return '#FFD966'; } else { return '#BF0016'; } }; Copy Feel free to change the HTML color code values to your taste. In this example, #11A600 is green, #FFD966 is sort of yellow, and #BF0016 is red. Step 7 of 9 Set your map's default center point Set a default center point for your map using latitude and longitude. const defaultMapCenter = [10.5731, -7.5898]; Copy Step 8 of 9 Add a row for your map Between the text field row and the table chart row, insert a new row for the map content using NerdGraphQuery.
{({ loading, error, data }) => { if (loading) { return ; } if (error) { return 'Error'; } const { results } = data.actor.account.mapData; console.debug(results); return 'Hello'; }}
; Copy Reload your application in New Relic One to test that it works. Step 9 of 9 Replace \"Hello\" with the Leaflet code Replace return \"Hello\"; with: return ( {results.map((pt, i) => { const center = [pt.lat, pt.lng]; return ( { alert(JSON.stringify(pt)); }} /> ); })} ); Copy This code creates a world map centered on the latitude and longitude you chose using OpenStreetMap data and your marker colors. Reload your app to see the pageview data on the map!", + "info": "Read about how you can manage alerts conditions, policies, and muting rules using NerdGraph.", + "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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 487.52686, + "_score": 165.95883, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Map page views by region in a custom app", - "sections": "Query your browser data", - "info": "Build a New Relic app showing page view data on a world map.", - "tags": "custom app", - "body": " <Spinner fillContainer />; } if (error) { return 'Error'; } const { results } = data.actor.account.mapData; console.debug(results); return 'Hello'; }} </NerdGraphQuery> </div>; Copy Reload your application in New Relic One to test that it works. Step 9 of 9 Replace "Hello" with the Leaflet code Replace" + "title": "NerdGraph API: Examples ", + "sections": "Mutations", + "info": "Read about how you can manage alerts conditions, policies, and muting rules using NerdGraph.", + "body": " Use NRQL conditions Muting rules: suppress notifications The easiest way to discover alerts queries and mutations is through the NerdGraph API explorer. NerdGraph API explorer Our NerdGraph API explorer is a GraphiQL editor where you can prototype queries and mutations. Here are some examples showing", + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph" }, - "id": "5efa993c196a67066b766469" + "id": "5f2dbad864441fd15456a9eb" }, { - "category_2": "UI and data", - "nodeid": 38701, + "image": "", + "url": "https://developer.newrelic.com/collect-data/", "sections": [ - "Log management", - "Get started", - "Enable Logs", - "UI and data", - "Log API", - "Troubleshooting", - "Drop data with drop filter rules", - "Why it matters", - "How drop filter rules work", - "Create drop filter rules", - "Types of drop filter rules", - "Drop log events", - "Drop attributes", - "Cautions when dropping data", - "Delete drop filter rules", - "For more help" + "Collect data", + "Guides to collect data", + "Add custom attributes", + "Create custom events", + "Collect data - any source", + "Build queries with NerdGraph", + "Query data with NRQL" ], - "title": "Drop data with drop filter rules ", - "category_0": "Log management", - "type": "docs", - "category_1": "Log management ", - "external_id": "054102731b07bea12e6877a2314f4114139b1a72", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-logs-create-drop-filter.png", - "url": "https://docs.newrelic.com/docs/logs/log-management/ui-data/drop-data-drop-filter-rules", - "published_at": "2020-09-24T10:19:46Z", - "updated_at": "2020-09-24T10:19:45Z", - "breadcrumb": "Contents / Log management / Log management / UI and data", + "published_at": "2020-09-25T01:51:37Z", + "title": "Collect data", + "updated_at": "2020-09-25T01:51:37Z", + "type": "developer", + "external_id": "fb5d6f75b61858b09e3e8c63f3b2af97813f47b6", "document_type": "page", "popularity": 1, - "info": "Data retention information for New Relic's log management and logs in context.", - "body": "After log event data has been shipped to New Relic, it can either be stored in our database (NRDB) or dropped (discarded). New Relic can drop both log events and event attributes via drop filter rules. You can manage drop filter rules using New Relic's log management or NerdGraph. Use caution when deciding to drop data. The data you drop is not recoverable. Before using this feature, review Responsibilities and considerations. Why it matters Drop filter rules help you accomplish some very important goals: You lower costs by storing only logs relevant to your account. You protect privacy and security by removing personal identifiable information (PII). You reduce noise by removing irrelevant events and attributes. How drop filter rules work A drop filter rule matches data based on a query. When triggered, the drop filter rule removes the matching data from the ingestion pipeline before it is written to in NRDB. Since the data does not reach the backend, it cannot be queried: the data is gone and cannot be restored. During the ingestion process, log data can be parsed, transformed, or dropped before being stored. Create drop filter rules You must have admin permissions in New Relic to create and edit drop filters, or be a member of a role with create and edit permissions for Logging Parsing Rules. Drop filter rules can be created from one.newrelic.com > Logs using new or existing log queries. To create a new drop filter rule: Filter or query to the specific set of logs which contain the data to be dropped. Once the query is active, click on the + button to show the query options and select Create a new drop filter. You can choose to either drop the entire log event that matches the query or just a specific subset of attributes in the matching events. Save the drop filter rule. Before saving the rule, consider changing its name. Once a drop filter rule is active, it's applied to all log events ingested from that point onwards. Rules are not applied retroactively: logs collected prior to the creation of a rule are not filtered by that rule. Types of drop filter rules Drop log events The default type of drop filter rule is to drop logs. This option drops the entire log events that match the filter query. When creating a rule try to provide a specific query that only matches log data which should be dropped. New Relic won't let you create drop filter rules without values in the matching query: this prevents badly formed rules from dropping all log data. Drop attributes You can specify attributes to be dropped in a log event that matches your query. At least one or more attributes must be selected. Any attribute which is selected will be dropped; all remaining attributes will be kept and stored in NRDB. We recommend this method for removing fields which could contain personal identifiable information (PII) or other sensitive attributes without losing valuable monitoring data. ​ Cautions when dropping data When creating drop rules, you are responsible for ensuring that the rules accurately identify and discard the data that meets the conditions that you have established. You are also responsible for monitoring the rule, as well as the data you disclose to New Relic. New Relic cannot guarantee that this functionality will completely resolve data disclosure concerns you may have. New Relic does not review or monitor how effective the rules you develop are. Creating rules about sensitive data can leak information about what kinds of data you maintain, including the format of your data or systems (for example, through referencing email addresses or specific credit card numbers). Rules you create, including all information in those rules, can be viewed and edited by any user with the relevant role-based access control permissions. Delete drop filter rules Drop filter rules can be deleted from one.newrelic.com > Logs. To delete a drop filter rule: Click on the + button to show the query options and select View all drop filters. Click the delete [trash icon] icon next to the drop filter rule you want to remove. Once deleted, rules no longer filter ingested log events. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "body": "Collect data Through our opensource agents or APIs, New Relic makes it easy to collect data from any source. The guides in this section provide strategies for collecting and querying data for use in your existing implementation, or in apps you build. The opportunities are endless. Guides to collect data   Add custom attributes Use custom attributes for deeper analysis 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 15 min Collect data - any source APIs, agents, OS emitters - get any data 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 10 min Query data with NRQL Query default data, custom events, and attributes", + "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 430.94583, + "_score": 153.80525, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Drop data with drop filter rules ", - "sections": "Drop data with drop filter rules", - "info": "Data retention information for New Relic's log management and logs in context.", - "category_2": "UI and data", - "body": "After log event data has been shipped to New Relic, it can either be stored in our database (NRDB) or dropped (discarded). New Relic can drop both log events and event attributes via drop filter rules. You can manage drop filter rules using New Relic's log management or NerdGraph. Use caution when", - "breadcrumb": "Contents / Log management / Log management / UI and data" + "sections": "Build queries with NerdGraph", + "body": " data   Add custom attributes Use custom attributes for deeper analysis 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 15 min Collect data - any source APIs, agents, OS emitters - get any data 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 10 min Query data with NRQL Query default data, custom events, and attributes" }, - "id": "5f37d6fb196a67021c55e5eb" + "id": "5efa997328ccbc768c307de2" }, { - "category_2": "Manage data", - "nodeid": 39276, + "category_2": "Trace API", + "nodeid": 35381, "sections": [ - "Ingest and manage data", + "Distributed tracing", "Get started", - "Understand data", - "Manage data", - "Ingest APIs", - "Manage data coming into New Relic", - "Data ingestion sources", - "Set alerts for data use", - "Adjust your data ingest", + "Enable and configure", + "Other requirements", + "UI and data", + "Trace API", + "Troubleshooting", + "Report traces via the Trace API (New Relic format)", + "Example: Use your tool’s native sampling", + "Example: Use Infinite Tracing", + "JSON requirements and recommendations", + "Attributes", + "Required attributes", + "Highly recommended attributes", + "Reserved attributes", + "Other attributes", + "Explore more about distributed tracing:", "For more help" ], - "title": "Manage data coming into New Relic", - "category_0": "Telemetry Data Platform", + "title": "Report traces via the Trace API (New Relic format)", + "category_0": "Understand dependencies", "type": "docs", - "category_1": "Ingest and manage data", - "external_id": "ba12759affe2895e875af1af096d895d09f6d030", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/data-ingest-page_0.png", - "url": "https://docs.newrelic.com/docs/telemetry-data-platform/get-data-new-relic/manage-data/manage-data-coming-new-relic", - "published_at": "2020-09-24T17:20:11Z", - "updated_at": "2020-09-24T17:20:11Z", - "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Manage data", + "category_1": "Distributed tracing", + "external_id": "ba16f3a71b78e24c23da821b64567398251bb217", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/Infinite_Tracing_GraphiQL_URL_Results_0_0.png", + "url": "https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/trace-api/report-new-relic-format-traces-trace-api", + "published_at": "2020-09-24T12:18:41Z", + "updated_at": "2020-09-24T12:18:40Z", + "breadcrumb": "Contents / Understand dependencies / Distributed tracing / Trace API", "document_type": "page", "popularity": 1, - "info": "For accounts on the New Relic One pricing plan: how we ingest and store and calculate ingested data. ", - "body": "When you connect your data to New Relic, we process what we receive and apply data dropping and transformation rules. Then we count the bytes needed to represent your data in a standard format, like JSON. If you're on our New Relic One pricing plan, this ingest process tells us how many GB you pay for, above and beyond the standard amount that’s free. 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 ingestion page shows your ingest rates for a period you specify on the top-right of the Data management hub. Since 30 days ago is the default setting, but you can also set a custom date span. The page shows your daily average GBs, and the total for the range you set. It also provides the current month-to-date, and the projected end-of-month total ingest rates. With this information, you can proactively drop data or turn off agents in order to manage ingest and, therefore, costs. If you want to take a look at how we query the data, click the ellipsis icon (just above the chart) to slide out the chart query and open it in our query builder. Data ingest page with GB rates for daily average and 30-day total. To open, select your user name > Data management hub > Data ingestion Data ingestion sources The Data ingestion page describes which of your data sources provide the most data on average and during specific data ranges. The sources are described here. Billable data sources Description Timeslices (1-minute) and Metric:Raw Metrics are timeslices + MetricRaw Metric group: MetricsBytes Metric timeslice data averages to one-hour periods after eight days. After 90 days, the permanent metric data continues to be stored in one-hour periods. We currently store the raw metric data for 30 days. You are only billed for the initial ingest volume. You are not billed for subsequent rollups. APM (transactions and errors) APM events Metric group: ApmEventsBytes InfraSamples:Raw Includes multiple Infrastructure events Infrastructure host data Metric group:InfraHostBytes Information related to your servers and virtual machines coming from infrastructure agents, including storage and network data Infrastructure process data stored in ProcessSample. Metric group: InfraProcessBytes Data are metrics related to each process running on the hosts running the Infrastructure agent. This feature is turned off by default. Infrastructure integrations Metric group: InfraIntegrationBytes Performance data related to applications and services, typically managed by the customer, including data related to Docker containers, Windows services, Nagios checks, and cloud integrations such as managed services in AWS, Azure, and GCP. Logging Includes logs and LogExtendedRecord Metric group: LoggingBytes Log messages longer than 4KB are split into multiple events that, when needed, are stitched together to display the original message; this reduces the size of message data. Default Custom events Metric group: CustomEventsBytes Mobile error Mobile general Breadcrumb crash event trails Mobile session Mobile exception Mobile crash Mobile events Metric group: MobileEventsBytes Tracing Metric group: TracingBytes Namespaces that contain all tracing events, including tracing spans and excluding internal tracing. Browser:EventLog Browser Browser:JSErrors PcvPerf (PageView timing) Browser events Metric group: BrowserEventsBytes Lambda Serverless Metric group: ServerlessBytes Set alerts for data use Query and alert on usage data describes how to set alerts to get notified if you're nearing data ingest limits you don't want to cross. For example, you might set an alert on logs, which can stack up quickly in an active system. Adjust your data ingest Drop data for lower retention costs and data compliance On ingest, we apply data dropping rules so you won't be charged for data that's not useful. Learn how to set additional data dropping ​​​​​rules yourself. Use NerdGraph to drop entire data types or drop data attributes from data types so they’re not written to NRDB. This enables you to focus on the data you want, reduces retention costs, and avoids writing sensitive data to the database. For dropping log data, see Drop data with drop filter rules. Turn off agents and integrations If you don’t need data from specific agents or integrations that you have installed, you can uninstall/delete those tools. For instructions, see the specific documentation for an agent or integration. 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.", + "info": "For New Relic's Trace API: how to report traces using the New Relic format. ", + "body": "You can send traces in the New Relic format to our Trace API without using a New Relic agent or integration. This is useful if you want to integrate with sources that emit tracing data and require a backend for trace storage. Since distributed systems can generate a lot of trace data, telemetry tools rely on data sampling (filtering) to find the most useful subset of that data. When you send us your trace data, you have two options related to sampling: Use your tool’s native sampling: This approach sends the telemetry data directly to the Trace API and assumes you are relying on your telemetry tool to sample the data before the integration passes the data to New Relic. Even though your tool may be sampling data before the New Relic integration sends it, our Trace API may randomly sample out traces that exceed your rate limit. Use Infinite Tracing (limited release): This approach assumes you turn off sampling in your telemetry tool and then send all your data to a New Relic trace observer in AWS. The trace observer selects the most important and actionable traces using tail-based sampling and then sends your traces to our UI. To send Zipkin-formatted data to the Trace API, see our Zipkin instructions. We'll look at two examples for sending your telemetry data to New Relic, as well as how to structure your data: Example: Use your tool’s native sampling Example: Use Infinite Tracing JSON requirements and recommendations Attributes Example: Use your tool’s native sampling If you are using a telemetry tool that is sampling your trace data, you can send the data directly to New Relic. The following procedure explains how to send a test payload to the Trace API using the newrelic format. For details about how to structure your data, see JSON requirements and recommendations. Get an Insert API key: Go to: one.newrelic.com > account dropdown > Account settings > API keys, and select Insights API keys. If you don't have a key, create a new one by selecting Insert keys +. Insert your Insert API key into the following JSON and then send the JSON to our endpoint. curl -i -H \"Content-Type: application/json\" \\ -H \"Api-Key: YOUR_INSERT_API_KEY\" \\ -H 'Data-Format: newrelic' \\ -H 'Data-Format-Version: 1' \\ -X POST \\ -d '[ { \"common\": { \"attributes\": { \"service.name\": \"Test Service A\", \"host\": \"host123.test.com\" } }, \"spans\": [ { \"trace.id\": \"123456\", \"id\": \"ABC\", \"attributes\": { \"duration.ms\": 12.53, \"name\": \"/home\" } }, { \"trace.id\": \"123456\", \"id\": \"DEF\", \"attributes\": { \"service.name\": \"Test Service A\", \"host\": \"host456.test.com\", \"duration.ms\": 2.97, \"name\": \"/auth\", \"parent.id\": \"ABC\" } } ] } ]' 'https://trace-api.newrelic.com/trace/v1' If you're sending more than one POST, change the trace.id to a unique value. Sending the same payload or span id multiple times for the same trace.id may result in fragmented traces in the UI. If your test returned HTTP/1.1 202 Accepted, go to our UI to see a query of your test data using the span attribute service.name = Test Service A. Traces may take up to one minute to be processed by both the trace observer and the Trace API. Example: Use Infinite Tracing Infinite Tracing can examine all of your data and find the most useful traces. To get the biggest benefit from Infinite Tracing, you should turn off sampling in your telemetry tool and send all your trace data to the trace observer. To start using Infinite Tracing, please go to our sign-up page. The following steps show you how to find or create a trace observer endpoint using GraphQL and how to send a test payload using the newrelic format. For details about how to structure your data, see JSON requirements and recommendations. If you send your data to a trace observer in one of our EU provider regions, you'll still need a US-based New Relic account because the tail-based sampling data is reported to data centers in the United States. If you have questions, contact your account representative. Step A. Open NerdGraph API explorer Prepare to execute some GraphQL: Open NerdGraph API explorer. In the API key dropdown next to Tools, select your personal API key for your account under one of these options: Select an existing API Key Create a new API Key Step B. See if anyone in your organization has already created a trace observer endpoint The following steps show you how to execute a GraphQL query to find out if you can use an existing trace observer in your AWS region. If one isn't available, you can go to Step C. Create a new one. Copy the following query into the middle pane of the NerdGraph API explorer and replace YOUR_ACCOUNT_ID with your account ID (the number next to your account name in NerdGraph API explorer): { actor { account(id: YOUR_ACCOUNT_ID) { edge { tracing { traceObservers { errors { message type } traceObservers { endpoints { agent { host port } endpointType https { host port url } status } id name providerRegion } } } } } } } Click the triangle button to execute the query or press Ctrl+Enter. Check the right pane showing the results: In traceObservers, if you see an AWS region (providerRegion) appropriate for your location, copy its associated https: url value to use later as YOUR_TRACE_OBSERVER_URL in Send test data to the trace observer. If you don't see any values in traceObservers as shown below, continue to Step C. Create a new one. Step C. If you can't find an existing trace observer endpoint, create a new one If you didn't find a trace observer after running the query in the previous section, you need to create one. To do this, you execute a GraphQL mutation that passes your configuration details. Copy the following into the middle pane of the NerdGraph API explorer. mutation { edgeCreateTraceObserver(accountId: YOUR_ACCOUNT_ID, traceObserverConfigs: {name: \"YOUR_DESCRIPTIVE_NAME\", providerRegion: YOUR_PROVIDER_REGION}) { responses { errors { message type } traceObserver { endpoints { agent { host port } endpointType https { host port url } status } id name providerRegion } } } } Insert your own values into the mutation: Value Description YOUR_ACCOUNT_ID Replace this with your account ID (the number next to your account name in NerdGraph API explorer). YOUR_DESCRIPTIVE_NAME Replace this with a name that describes the services that report to this trace observer (for example, production or query services). YOUR_PROVIDER_REGION Replace this with the provider region enum value for your location: AWS_EU_WEST_1 AWS_US_EAST_1 AWS_US_WEST_2 Click the triangle button to execute the mutation or press Ctrl+Enter. In the right pane showing the results, copy the value of https: url to a text file so you can use it later as YOUR_TRACE_OBSERVER_URL in Send test data to the trace observer: Step D. Send data to the trace observer Here's a test that includes a sample payload with one trace and two spans from the same service: Test Service A. Follow these steps to send a test request: Get or generate your Insert API key so you can use it later in the test. Copy the following curl request into a text editor: curl request curl -i -H \"Content-Type: application/json\" \\ -H \"Api-Key: YOUR_INSERT_API_KEY\" \\ -H 'Data-Format: newrelic' \\ -H 'Data-Format-Version: 1' \\ -X POST \\ -d '[ { \"common\": { \"attributes\": { \"environment\": \"staging\" } }, \"spans\": [ { \"trace.id\": \"123456\", \"id\": \"ABC\", \"attributes\": { \"duration.ms\": 12.53, \"host\": \"host123.test.com\", \"name\": \"/home\", \"service.name\": \"Test Service A\" } }, { \"trace.id\": \"123456\", \"id\": \"DEF\", \"attributes\": { \"duration.ms\": 2.97, \"host\": \"host456.test.com\", \"error.message\": \"Invalid credentials\", \"name\": \"/auth\", \"parent.id\": \"ABC\", \"service.name\": \"Test Service B\" } } ] } ]' \\ 'YOUR_TRACE_OBSERVER_URL' Insert your own values into the curl request: Value Description YOUR_INSERT_API_KEY Replace this with your Insert API key (not the same as your personal API key for NerdGraph API explorer) YOUR_TRACE_OBSERVER_URL Replace this with the value under https: url from above. Copy the content of the text editor into a terminal, and then execute the request. If the test does not return HTTP/1.1 202 Accepted indicating success, check the following and try again: Confirm that you substituted the url (not host) value for YOUR_TRACE_OBSERVER_URL. Confirm that you only have single quotes around the value you inserted for YOUR_TRACE_OBSERVER_URL. Check that you are using the Insert API Key (not a license). If your test returned HTTP/1.1 202 Accepted, go to our UI to see a query of your test data using the span attribute service.name = Test Service A. Because the sample payload contains an error attribute, the error sampler will mark it for keeping. If you modify the payload to remove the error attributes, the random sampler may not choose to keep this particular trace. Traces may take up to one minute to be processed by both the trace observer and the Trace API. JSON requirements and recommendations Requirements and guidelines for trace JSON using the newrelic format: Each JSON payload is an array of objects. Each object should contain a required spans key. Each object may contain an optional common key. Use this if you want share information across multiple spans in a object. Any keys on a span have precedence over the same key in the common block. The value for spans key is a list of span objects. Certain attributes are required, and must be included either in the optional common block, or in each span. Recommended and custom attributes may be optionally included in a list of key/value pairs under a key named attributes, in the optional common block and/or in each span. In the following example POST, there are two spans, both of which will have the trace.id 12345 and the custom attribute host: host123.test.com. The first span has no parent.id, so that is the root of the trace; the second span's parent.id points to the ID of the first. [ { \"common\": { \"attributes\": { \"host\": \"host123.test.com\" } }, \"spans\": [ { \"trace.id\": \"12345\", \"id\": \"abc\", \"attributes\": { \"user.email\": \"bob@newr.com\", \"service.name\": \"my-service\", \"duration.ms\": 750, \"name\": \"my-span\" } }, { \"trace.id\": \"12345\", \"id\": \"def\", \"attributes\": { \"parent.id\": \"abc\", \"service.name\": \"second-service\", \"duration.ms\": 750, \"name\": \"second-span\" } } ] } ] Attributes Review the sections below describing the attributes for the attributes block of a newrelic formatted JSON POST. Required attributes Requests without these attributes will be rejected, and an NrIntegrationError will be generated. These are the only attributes that don't belong under attributes. attribute description id string Unique identifier for this span. trace.id string Unique identifier shared by all spans within a single trace. Highly recommended attributes While not required, these attributes should be included for the best experience with your data. They are included in the attributes section. attribute default description duration.ms float none Duration of this span in milliseconds. name string none The name of this span. parent.id string none The id of the caller of this span. Value is null if this is the root span. Traces without a root span will not displayed. service.name string none The name of the entity that created this span. timestamp long Defaults to the current time in UTC timezone if not provided. The span's start time in Epoch milliseconds. Reserved attributes These attributes are currently reserved for internal New Relic usage. While they are not explicitly blocked, we recommend not using them. attribute default description entity.name string service.name This is derived from the service.name attribute. entity.type string service The entity type is assumed to be a service. entity.guid string None The entity.guid is a derived value that uniquely identifies the entity in New Relic's backend. Other attributes You can add any arbitrary attributes you want, with the exception of the restricted attributes. For example, you might want to add attributes like customer.id or user.id to help you analyze your trace data. To learn how to control how spans appear in New Relic (for example, adding errors or setting a span as a datastore span), see Decorate spans. Explore more about distributed tracing: Learn where Trace API data shows up in the UI. Learn how to decorate spans for a richer, more detailed UI experience. For example, you can have spans show up as datastore spans or display errors. Learn about general data limits, required metadata, and response validation. If you don't see your trace data, see Troubleshooting. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 408.62268, + "_score": 133.59958, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Manage data coming into New Relic", - "sections": "Ingest and manage data", - "info": "For accounts on the New Relic One pricing plan: how we ingest and store and calculate ingested data. ", - "category_0": "Telemetry Data Platform", - "category_1": "Ingest and manage data", - "category_2": "Manage data", - "body": " On ingest, we apply data dropping rules so you won't be charged for data that's not useful. Learn how to set additional data dropping ​​​​​rules yourself. Use NerdGraph to drop entire data types or drop data attributes from data types so they’re not written to NRDB. This enables you to focus on the data", - "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Manage data" + "body": " the following query into the middle pane of the NerdGraph API explorer and replace YOUR_ACCOUNT_ID with your account ID (the number next to your account name in NerdGraph API explorer): { actor { account(id: YOUR_ACCOUNT_ID) { edge { tracing { traceObservers { errors { message type } traceObservers" }, - "id": "5f24629ae7b9d251c2c82338" + "id": "5d89dc6028ccbc83ce9cb16f" }, { - "category_2": "Get started", - "nodeid": 11431, + "category_2": "Examples", + "nodeid": 17141, "sections": [ - "NRQL: New Relic Query Language", + "NerdGraph", "Get started", - "NRQL query tools", - "NRQL query tutorials", - "Introduction to NRQL, New Relic's query language", - "What is NRQL?", - "Where can you use NRQL?", - "What data can you query with NRQL?", - "Start using NRQL", - "NRQL query examples", - "NRQL syntax", + "Examples", + "NerdGraph cloud integrations API tutorial", + "Requirements", + "Access the NerdGraph GraphiQL explorer", + "Query examples", + "Mutation examples", + "Enable an Amazon AWS integration", + "Change polling interval for Amazon AWS integration", + "Disable Amazon AWS integration", "For more help" - ], - "title": "Introduction to NRQL, New Relic's query language", - "category_0": "Query your data", - "type": "docs", - "category_1": "NRQL: New Relic Query Language", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", - "external_id": "d44be2c7df7addda8679b4c842015223cfcbd1a3", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-view-chart-nrql-query_0.png", - "url": "https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", - "published_at": "2020-09-24T08:40:21Z", - "updated_at": "2020-09-24T08:40:20Z", - "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started", + ], + "title": "NerdGraph cloud integrations API tutorial", + "category_0": "APIs", + "type": "docs", + "category_1": "NerdGraph", + "external_id": "15caa0b35be84f2e6245826a5c9ac8e49cad6a89", + "image": "", + "url": "https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-cloud-integrations-api-tutorial", + "published_at": "2020-09-24T09:36:12Z", + "updated_at": "2020-08-10T23:22:01Z", + "breadcrumb": "Contents / APIs / NerdGraph / Examples", "document_type": "page", "popularity": 1, - "info": "An introduction to New Relic Query Language (NRQL) and how to use it.", - "body": "One way to query your New Relic data is with the New Relic Query Language (NRQL). This resource explains what NRQL is, when and how you can use it, and basic syntax rules. For more detailed information on querying, including a listing of clauses and functions and example queries, see NRQL syntax, clauses, and functions. What is NRQL? NRQL is New Relic's SQL-like query language. You can use NRQL to retrieve detailed New Relic data and get insight into your applications, hosts, and business-important activity. Reasons to use NRQL include: To answer a question for the purpose of troubleshooting or business analysis To create a new chart To make API queries of New Relic data (for example, using our NerdGraph API) NRQL is used behind the scenes to generate some New Relic charts: Some New Relic charts are built using NRQL. One way to start using NRQL is to view a chart's query and then edit it to make your own custom chart. Where can you use NRQL? You can use NRQL in these places: New Relic One query builder: Advanced mode is a NRQL query interface Basic mode provides a simplified query experience that doesn't require knowledge of NRQL but that uses NRQL to generate results New Relic Insights NerdGraph: our GraphQL-format API, which includes options for making NRQL queries one.newrelic.com > Query your data: You can run a NRQL query in both New Relic One and New Relic Insights. This NRQL query shows a count of distributed tracing spans faceted by their entity names. NRQL is one of several ways to query New Relic data. For more on all query options, see Query your data. What data can you query with NRQL? NRQL allows you to query these New Relic data types: Event data from all New Relic products, including: APM events, like Transaction New Relic Browser events, like PageView New Relic Mobile events, like Mobile Infrastructure events, like ProcessSample Synthetics events, like SyntheticCheck Custom events, like those reported by the Event API Metric timeslice data (metrics reported by New Relic APM, Browser, and Mobile) The Metric data type (metrics reported by the Metric API and data sources that use that API) The Span data type (distributed tracing data) The Log data type (data from New Relic Logs) Some data, like relationships between monitored entities, is not available via NRQL but is available using our NerdGraph API. Start using NRQL One way to start using NRQL and to understand what data you have available is to go to a NRQL interface (for example, the New Relic One query builder), type FROM, and press space. The interface will suggest available types of data: To see the attributes available for a specific data type, type FROM DATA_TYPE SELECT and press space. The interface will suggest available attributes. For example: To see the complete JSON associated with a data type, including all of its attributes, use the keyset() attribute. For example: FROM Transaction SELECT keyset() NRQL is used behind the scenes to build some New Relic charts and dashboards. One way to learn NRQL is to find one of these NRQL-generated charts and start playing with the NRQL to create new, customized queries and charts: Charts built with NRQL will have View query as an option. You can then edit and customize that query to see how your changes affect the resulting visualization. To explore your data without having to use NRQL, use the basic mode of New Relic One query builder. NRQL query examples Here's an example NRQL query of Transaction data, which is reported by New Relic APM. FROM Transaction SELECT average(duration) FACET appName TIMESERIES auto This would generate a chart that looks like: Here are some more query examples: Basic NRQL query of Browser data Here's a NRQL query of PageView data, which is reported by New Relic Browser. SELECT uniqueCount(user) FROM PageView WHERE userAgentOS = 'Mac' FACET countryCode SINCE 1 day ago LIMIT 20 Attribute name with a space in it If a custom attribute name has a space in it, use backticks around the attribute name: SELECT count(*) FROM Transaction FACET `Logged-in user` Querying multiple data sources To return data from two data sources, separate their data types with a comma. For example, this query returns a count of all APM transactions and Browser events over the last three days:​ SELECT count(*) FROM Transaction, PageView SINCE 3 days ago Query returning multiple columns To return multiple columns from a dataset, separate the aggregator arguments with a comma: SELECT function(attribute), function(attribute) ... FROM ... This query returns the minimum, average, and maximum duration for New Relic Browser PageView events over the last week: SELECT min(duration), max(duration), average(duration) FROM PageView SINCE 1 week ago See more NRQL query examples. NRQL syntax The syntax of a NRQL query is similar to standard SQL queries. Here is a breakdown of the structure of a NRQL query: SELECT function(attribute) [AS 'label'][, ...] FROM data type [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] Basic rules include: NRQL condition Details Required values The SELECT statement and FROM clause are required. All other clauses are optional. You can start your query with either SELECT or FROM. Query string size The query string must be less than 4 KB. Case sensitivity The data type names and attribute names are case sensitive. NRQL clauses and functions are not case sensitive. Syntax for strings NRQL uses single quotes to designate strings. For example: ... where traceId = '030a573f0df02c57' Attribute names with spaces Use backticks `` to quote a custom attribute name that has a space in it. For example: ... FACET `Logged-in user` Data type coercion Insights does not support data type \"coercion.\" For more information, see Data type conversion. Use of math functions Basic and advanced math functions are supported in the SELECT statement. JOIN functions NRQL does not have the equivalent of the SQL JOIN function, but you can simulate a JOIN with custom attributes. Read more about NRQL syntax and functions. 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.", + "info": "Use New Relic's NerdGraph (our GraphQL API) to query your New Relic Infrastructure cloud integration data. ", + "body": "This document provides examples of how to use New Relic NerdGraph to query and modify your cloud integration configuration data, including Amazon AWS, Microsoft Azure, and Google Cloud Platform (GCP). Using the NerdGraph GraphiQL explorer, you can also query NRQL data. These examples for querying cloud integration configuration data use GraphQL queries and mutations: Queries: requests that are intended to only fetch data Mutations: requests that create or update data on the server Requirements Before querying cloud integration data with NerdGraph, ensure you have: Followed the instructions to connect cloud integrations with New Relic. Created an API key. Access the NerdGraph GraphiQL explorer To access the NerdGraph GraphiQL explorer: Go to https://api.newrelic.com/graphiql. Add any of the following examples. Query examples Queries are requests that are intended to only fetch data (no side effects). Queries in NerdGraph are not static, meaning that you can ask for more or less data depending on your needs. For each query, you can specify exactly what data you want to retrieve, as long as it is supported by the schema. Available provider accounts This query returns a list of all provider accounts available in your infrastructure data. Depending on the provider, additional properties can be requested. For example, for GCP, you can also ask for the serviceAccountId property, which is needed when linking a new GCP project to New Relic. Anonymous: { actor { account(id: ) { cloud { providers { id name slug ... on CloudGcpProvider { serviceAccountId } } } } } } Named: query cloudProviders { actor { account(id: ) { cloud { providers { id name slug } } } } } Specific provider account information This query returns information about a specific provider account for your Amazon AWS integration. The properties id, name, slug are requested, along with a list of integrations available to be monitored. { actor { account(id: ) { cloud { provider(slug: \"aws\") { id slug name services { id slug name } } } } } } Specific integration data from a specific cloud provider This query returns information about a specific cloud service integration of a provider. In this example, the integration is the Amazon AWS ALB monitoring integration and the provider is AWS. The properties id, name, slug, and isAllowed are requested with the available configuration parameters. { actor { account(id: ) { cloud { provider(slug: \"aws\") { service(slug: \"alb\") { id name slug isEnabled } } } } } } List of enabled cloud accounts This query returns the list of cloud accounts enabled with your New Relic account. (Your cloud account associates your New Relic account and a specific provider account with your integration.) You can enable multiple cloud provider accounts in the same New Relic account, even with the same cloud provider. { actor { account(id: ) { cloud { linkedAccounts { id name createdAt provider { id name } } } } } } Specific linked account data This query returns information about a linked account, including the properties name, providerId, and a list of the cloud integrations enabled for monitoring. { actor { account(id: ) { cloud { linkedAccount(id: ) { name provider { id name } integrations { id name createdAt updatedAt } } } } } } Enabled cloud integrations for all linked accounts This query returns all monitored integrations for all the provider cloud accounts. { actor { account(id: ) { cloud { linkedAccounts { name provider { id name } integrations { id name service { id name } createdAt updatedAt } } } } } } Specific cloud integration data for a specific linked account This query returns information about a specific integration from a specific linked account. { actor { account(id: ) { cloud { linkedAccount(id: ) { name provider { id name } integration(id: ) { id name service { id name } createdAt updatedAt } } } } } } Mutation examples Mutations are requests that are intended to have side effects, such as creating or updating data on the server. Mutations require the keyword mutation and the name of the mutation. NerdGraph mutations are restricted to a subset of all possible mutations. Link an account This mutation allows linking cloud provider accounts to a New Relic account, creating one or more linked accounts. It can link one specific cloud provider account (for example aws) to the New Relic account or multiple cloud provider accounts to one New Relic account. Required: The parameter is required and cannot be empty. It must be unique in your New Relic account. Other parameters are specific to the provider (AWS, GCP, and Azure) and are also required. In the following sections, you can see which parameters are required for each provider account. After linking an account the createdAt and updatedAt values are equal. mutation { cloudLinkAccount( accounts: { accountId: , aws: [{ name: , }] azure: [{ name: , }] gcp: [{ name: , }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } } } } Link an Amazon AWS account This mutation links an Amazon AWS provider account to your New Relic account. mutation { cloudLinkAccount( accountId: , accounts: { aws: [{ name: , arn: }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } } } } Link a Microsoft Azure account This mutation links a Microsoft Azure cloud subscription to the New Relic account. mutation { cloudLinkAccount( accountId: , accounts: { azure: [{ name: , applicationId: , clientSecret: , tenantId: , subscriptionId: }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } } } Link a Google Cloud Platform (GCP) project This mutation links a GCP project to the New Relic account. mutation { cloudLinkAccount( accountId: , accounts: { gcp: [{ name: , projectId: }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } } } Rename one or more cloud accounts This mutation allows you to rename one or more linked provider accounts. The name parameter is required, cannot be empty, and must be unique within your New Relic account. mutation { cloudRenameAccount( accountId: , accounts: [ { id: , name: }, { id: , name: } ] ) { linkedAccounts { id name } } } Enable an integration in a cloud account This mutation allows you to enable the monitoring of one or more specific cloud integrations in an existing cloud account. With this mutation, New Relic records data for the enabled integration from the provider account. For each provider account you have access to different input parameters, matching each available service. mutation { cloudConfigureIntegration ( accountId: , integrations: { : { : [{ linkedAccountId: , }] } } ) { integrations { id name integration { id slug } ... on SqsIntegration { awsRegions } } } } Enable an integration in multiple cloud accounts If you have many provider accounts linked, you can enable the same integration in the many cloud accounts at the same time. For the output of the operation, you can use GraphQL fragments for integration specific configuration parameters. mutation { cloudConfigureIntegration ( accountId: , integrations: { : { : [ { linkedAccountId: }, { linkedAccountId: } ] } } ) { integrations { id name integration { id name } ... on SqsIntegration { awsRegions } } } } Enable multiple integrations in multiple cloud accounts If you have multiple cloud accounts linked, you can also enable multiple integrations in multiple linked cloud accounts at the same time. For the output of the operation, you can use GraphQL fragments to ask for integration specific configuration parameters. mutation { cloudConfigureIntegration ( accountId: , integrations: { : { : [ { linkedAccountId: } ] : [ { linkedAccountId: } ] }, : { : [ { linkedAccountId: }, { linkedAccountId: } ] } } ) { integrations { id name service { id name } ... on SqsIntegration { awsRegions } } } } Modify an integration's configuration (regions, polling intervals, etc.) This mutation also allows you to modify one or more cloud integrations and change one or more configuration parameters. Each service will have specific parameters that you can modify. For parameters of a type list (for example, awsRegion) supply the full list. For the output of the operation, you can use GraphQL fragments to ask for integration specific configuration parameters. mutation { cloudConfigureIntegration ( accountId: , integrations: { : { : [{ linkedAccountId: , metricsPollingInterval: , : , : , }] } } ) { integrations { id name service { id slug } ... on SqsIntegration { metricsPollingInterval, , } } errors { type message } } } Disable (remove) an integration This mutation allows you to disable an integration and stop data collection for the specific cloud integration. mutation { cloudDisableIntegration ( accountId: , integrations: { : { : [ { linkedAccountId: } ] } } ) { disabledIntegrations { id name authLabel provider { id } } errors { type message } } } Unlink account This mutation allows you to unlink cloud provider accounts from New Relic account. This action can not be undone. However, you can link the account again, but account history will still be lost. mutation { cloudUnlinkAccount ( accountId: , accounts: { { linkedAccountId: } } ) { unlinkedAccounts { id name } errors { type message } } } Enable an Amazon AWS integration This example uses an Amazon AWS SQS integration and assumes you have connected an AWS account to New Relic. To enable an Amazon AWS integration: Send query to fetch account data Send a query to fetch data about the account, specifically available providers and already created provider accounts: { actor { account(id: ) { cloud { providers { id name slug } linkedAccounts { name integrations { id name } } } } } } Link AWS provider account Link an AWS provider account, if there is not one already linked or if you want to link another AWS account: Use your New Relic account identifier in the parameter. Provide a name for the provider account in the . Include the ARN of the AWS role used to fetch data from your AWS account. mutation { cloudLinkAccount( accountId: , accounts: { aws: [{ name: , arn: }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } errors { type message } } } Enable Amazon AWS SQS integration Use your New Relic account ID in the parameter and the ID of the provider account in the parameter value. mutation { cloudConfigureIntegration ( accountId: , integrations: { aws: { sqs: [ { linkedAccountId: } ] } } ) { integrations { id name service { id name } } errors { type message } } } Enable integration in multiple provider accounts If you have multiple accounts with the same provider account, you can enable the same integration in multiple provider accounts at the same time. Use your New Relic account ID in the parameter and the ID of the provider accounts in the parameter value. mutation { cloudConfigureIntegration ( accountId: , integrations: { aws: { sqs: [ { linkedAccountId: }, { linkedAccountId: , configuration_param_1: value_1, configuration_param_2: value_2 } ] } } }) { integrations { id name service { id name } } errors { type message } } } Change polling interval for Amazon AWS integration This example uses an Amazon AWS SQS integration and assumes you have connected an AWS account to New Relic. To change the polling interval of an AWS integration: Update the polling interval To update the polling interval for an Amazon AWS SQS integration, use your New Relic account ID in the parameter and the id of the linked provider account in the parameter value: mutation { cloudConfigureIntegration( accountId: , integrations: { aws : { sqs: [ { linkedAccountId: , metricsPollingInterval: 300 } ] } } ) { integrations { id name service { id slug } ... on SqsIntegration { metricsPollingInterval } } errors { type message } } } Disable Amazon AWS integration This example uses an Amazon AWS SQS integration and assumes you have connected an AWS account to New Relic. To disable an AWS integration: Disable the SQS integration Use your New Relic account identifier in the parameter and the ID of the linked cloud account the parameter value. mutation { cloudDisableIntegration ( accountId: , integrations: { aws: { sqs : [ { linkedAccountId: } ] } } ) { disabledIntegrations { id accountId name } errors { type message } } } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 380.28018, + "_score": 129.54114, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Introduction to NRQL, New Relic's query language", - "sections": "What data can you query with NRQL?", - "info": "An introduction to New Relic Query Language (NRQL) and how to use it.", - "category_0": "Query your data", - "category_1": "NRQL: New Relic Query Language", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", - "body": " or business analysis To create a new chart To make API queries of New Relic data (for example, using our NerdGraph API) NRQL is used behind the scenes to generate some New Relic charts: Some New Relic charts are built using NRQL. One way to start using NRQL is to view a chart's query and then edit", - "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started" + "title": "NerdGraph cloud integrations API tutorial", + "sections": "NerdGraph", + "info": "Use New Relic's NerdGraph (our GraphQL API) to query your New Relic Infrastructure cloud integration data. ", + "category_1": "NerdGraph", + "body": "This document provides examples of how to use New Relic NerdGraph to query and modify your cloud integration configuration data, including Amazon AWS, Microsoft Azure, and Google Cloud Platform (GCP). Using the NerdGraph GraphiQL explorer, you can also query NRQL data. These examples for querying", + "breadcrumb": "Contents / APIs / NerdGraph / Examples" }, - "id": "5f2abd47196a67747343fbe1" + "id": "5d83537b28ccbc263a1b7bf7" } ], "/build-apps/howto-use-nrone-table-components": [ @@ -4414,7 +4414,7 @@ "Usage", "Props" ], - "published_at": "2020-09-24T02:32:51Z", + "published_at": "2020-09-25T01:49:59Z", "title": "TableHeaderCell", "updated_at": "2020-08-03T04:46:36Z", "type": "developer", @@ -4425,7 +4425,7 @@ "body": "TableHeaderCell Usage Copy Props There are no props for this component.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 548.6818, + "_score": 529.5301, "_version": null, "_explanation": null, "sort": null, @@ -4445,7 +4445,7 @@ "Usage", "Props" ], - "published_at": "2020-09-24T02:32:50Z", + "published_at": "2020-09-25T01:49:59Z", "title": "TableRow", "updated_at": "2020-08-03T04:45:42Z", "type": "developer", @@ -4456,7 +4456,7 @@ "body": "TableRow Usage Copy Props There are no props for this component.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 448.7978, + "_score": 435.169, "_version": null, "_explanation": null, "sort": null, @@ -4481,28 +4481,28 @@ "Add the NerdGraphQuery component to an application", "Add a time picker to your app", "Add a table to your app", - "Publish and deploy apps", - "Create a custom map view" + "Create a custom map view", + "Publish and deploy apps" ], - "published_at": "2020-09-24T02:30:06Z", + "published_at": "2020-09-25T01:49:59Z", "title": "Build apps", - "updated_at": "2020-09-24T01:55:00Z", + "updated_at": "2020-09-25T01:49:59Z", "type": "developer", "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", "document_type": "page", "popularity": 1, - "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   Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 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 Publish and deploy apps Start sharing the apps you build 30 min Create a custom map view Build an app to show page view data on a map", + "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   Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 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 30 min Publish and deploy apps Start sharing the apps you build", "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 432.56763, + "_score": 424.49606, "_version": null, "_explanation": null, "sort": null, "highlight": { "title": "Build apps", "sections": "Add the NerdGraphQuery component to an application", - "body": " 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 Publish and deploy apps Start sharing the apps you build 30 min Create a custom map view Build an app to show page view data on a map" + "body": " 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 30 min Publish and deploy apps Start sharing the apps you build" }, "id": "5efa999d64441fc0f75f7e21" }, @@ -4547,7 +4547,7 @@ "external_id": "6ff5d696556512bb8d8b33fb31732f22bab455cb", "image": "https://developer.newrelic.com/static/d87a72e8ee14c52fdfcb91895567d268/0086b/pageview.png", "url": "https://developer.newrelic.com/build-apps/map-pageviews-by-region/", - "published_at": "2020-09-24T02:27:37Z", + "published_at": "2020-09-25T01:51:37Z", "updated_at": "2020-09-17T01:48:42Z", "document_type": "page", "popularity": 1, @@ -4555,7 +4555,7 @@ "body": "Map page views by region in a custom app 30 min New Relic has powerful and flexible tools for building custom apps and populating them with data. This guide shows you how to build a custom app and populate it with page view data using New Relic's Query Language (NRQL - pronounced 'nurkle'). Then you make your data interactive. And last, if you have a little more time and want to install a third-party React library, you can display the page view data you collect on a map of the world. In this guide, you build an app to display page view data in two ways: In a table On a map Please review the Before you begin section to make sure you have everything you need and don't get stuck halfway through. Before you begin In order to get the most out of this guide, you must have: A New Relic developer account, API key, and the command-line tool. If you don't have these yet, see the steps in Setting up your development environment New Relic Browser page view data to populate the app. Without this data, you won't be able to complete this guide. To add your data to a world map in the second half of the guide: npm, which you'll use during this section of the guide to install Leaflet, a third-party JavaScript React library used to build interactive maps. If you're new to React and npm, you can go here to install Node.js and npm. New Relic terminology The following are some terms used in this guide: New Relic application: The finished product where data is rendered in New Relic One. This might look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One that launches your application. Nerdlets: New Relic React components used to build your application. The three default files are index.js, nr1.json, and styles.scss, but you can customize and add your own. Build a custom app with a table chart Step 1 of 8 Query your browser data Use Query builder to write a NRQL query to see your page view data, as follows. On New Relic One, select Query your data (in the top right corner). That puts you in NRQL mode. You'll use NRQL to test your query before dropping the data into your table. Copy and paste this query into a clear query field, and then select Run. FROM PageView SELECT count(*), average(duration) WHERE appName = 'WebPortal' FACET countryCode, regionCode SINCE 1 week ago LIMIT 1000 Copy If you have PageView data, this query shows a week of average page views broken down by country and limited to a thousand items. The table will be full width and use the \"chart\" class defined in the CSS. If you don't have any results at this point, ensure your query doesn't have any errors. If your query is correct, you might not have the Browser agent installed. Step 2 of 8 Create and serve a new Nerdpack To get started, create a new Nerdpack, and serve it up to New Relic from your local development environment: Create a new Nerdpack for this app: nr1 create --type nerdpack --name pageviews-app Copy Serve the project up to New Relic: cd pageviews-app && nr1 nerdpack:serve Copy Step 3 of 8 Review your app files and view your app locally Navigate to your pageviews-app to see how it's structured. It contains a launcher folder, where you can customize the description and icon that will be displayed on the app's launcher in New Relic One. It also contains nerdlets, which each contain three default files: index.js, nr1.json, and styles.scss. You'll edit some of these files as part of this guide. For more information, see Nerdpack file structure. Now in your browser, open https://one.newrelic.com/?nerdpacks=local, and then click Apps to see the pageview-apps Nerdpack that you served up. When you select the launcher, you see a Hello message. Step 4 of 8 Hard code your account ID For the purposes of this exercise and for your convenience, hard code your account ID. In the pageview-app-nerdlet directory, in the index.js file, add this code between the import and export lines. (Read about finding your account ID here). const accountId = [Replace with your account ID]; Copy Step 5 of 8 Import the TableChart component To show your data in a table chart, import the TableChart component from New Relic One. To do so, in index.js, add this code under import React. import { TableChart } from 'nr1'; Copy Step 6 of 8 Add a table with a single row To add a table with a single row, in the index.js file, replace this line: return

Hello, pageview-app-nerdlet Nerdlet!

; Copy with this export code: export default class PageViewApp extends React.Component { render() { return (
); } } Copy Step 7 of 8 Customize the look of your table (optional) You can use standard CSS to customize the look of your components. In the styles.scss file, add this CSS. Feel free to customize this CSS to your taste. .container { width: 100%; height: 99vh; display: flex; flex-direction: column; .row { margin: 10px; display: flex; flex-direction: row; } .chart { height: 250px; } } Copy Step 8 of 8 Get your data into that table Now that you've got a table, you can drop a TableChart populated with data from the NRQL query you wrote at the very beginning of this guide. Put this code into the row div. ; Copy Go to New Relic One and click your app to see your data in the table. (You might need to serve your app to New Relic again.) Congratulations! You made your app! Continue on to make it interactive and show your data on a map. Make your app interactive with a text field Once you confirm that data is getting to New Relic from your app, you can start customizing it and making it interactive. To do this, you add a text field to filter your data. Later, you use a third-party library called Leaflet to show that data on a world map. Step 1 of 3 Import the TextField component Like you did with the TableChart component, you need to import a TextField component from New Relic One. import { TextField } from 'nr1'; Copy Step 2 of 3 Add a row for your text field To add a text field filter above the table, put this code above the TableChart div. The text field will have a default value of \"US\".
{ this.setState({ countryCode: event.target.value }); }} />
; Copy Step 3 of 3 Build the text field object Above the render() function, add a constructor to build the text field object. constructor(props) { super(props); this.state = { countryCode: null } } Copy Then, add a constructor to your render() function. Above return, add: const { countryCode } = this.state; Copy Now add countryCode to your table chart query. ; Copy Reload your app to try out the text field. Get your data on a map To create the map, you use npm to install Leaflet. Step 1 of 9 Install Leaflet In your terminal, type: npm install --save leaflet react-leaflet Copy In your nerdlets styles.scss file, import the Leaflet CSS: @import `~leaflet/dist/leaflet.css`; Copy While you're in styles.scss, fix the width and height of your map: .containerMap { width: 100%; z-index: 0; height: 70vh; } Copy Step 2 of 9 Add a webpack config file for Leaflet Add a webpack configuration file .extended-webpackrc.js to the top-level folder in your nerdpack. This supports your use of map tiling information data from Leaflet. module.exports = { module: { rules: [ { test: /\\.(png|jpe?g|gif)$/, use: [ { loader: 'file-loader', options: {}, }, { loader: 'url-loader', options: { limit: 25000 }, }, ], }, ], }, }; Copy Step 3 of 9 Import modules from Leaflet In index.js, import modules from Leaflet. import { Map, CircleMarker, TileLayer } from 'react-leaflet'; Copy Step 4 of 9 Import additional modules from New Relic One You need several more modules from New Relic One to make the Leaflet map work well. Import them with this code: import { NerdGraphQuery, Spinner, Button, BlockText } from 'nr1'; Copy NerdGraphQuery lets you make multiple NRQL queries at once and is what will populate the map with data. Spinner adds a loading spinner. Button gives you button components. BlockText give you block text components. Step 5 of 9 Get data for the map Using latitude and longitude with country codes, you can put New Relic data on a map. mapData() { const { countryCode } = this.state; const query = `{ actor { account(id: 1606862) { mapData: nrql(query: \"SELECT count(*) as x, average(duration) as y, sum(asnLatitude)/count(*) as lat, sum(asnLongitude)/count(*) as lng FROM PageView FACET regionCode, countryCode WHERE appName = 'WebPortal' ${countryCode ? ` WHERE countryCode like '%${countryCode}%' ` : ''} LIMIT 1000 \") { results nrql } } } }`; return query; }; Copy Step 6 of 9 Customize the map marker colors Above the mapData function, add this code to customize the map marker colors. getMarkerColor(measure, apdexTarget = 1.7) { if (measure <= apdexTarget) { return '#11A600'; } else if (measure >= apdexTarget && measure <= apdexTarget * 4) { return '#FFD966'; } else { return '#BF0016'; } }; Copy Feel free to change the HTML color code values to your taste. In this example, #11A600 is green, #FFD966 is sort of yellow, and #BF0016 is red. Step 7 of 9 Set your map's default center point Set a default center point for your map using latitude and longitude. const defaultMapCenter = [10.5731, -7.5898]; Copy Step 8 of 9 Add a row for your map Between the text field row and the table chart row, insert a new row for the map content using NerdGraphQuery.
{({ loading, error, data }) => { if (loading) { return ; } if (error) { return 'Error'; } const { results } = data.actor.account.mapData; console.debug(results); return 'Hello'; }}
; Copy Reload your application in New Relic One to test that it works. Step 9 of 9 Replace \"Hello\" with the Leaflet code Replace return \"Hello\"; with: return ( {results.map((pt, i) => { const center = [pt.lat, pt.lng]; return ( { alert(JSON.stringify(pt)); }} /> ); })} ); Copy This code creates a world map centered on the latitude and longitude you chose using OpenStreetMap data and your marker colors. Reload your app to see the pageview data on the map!", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 371.1719, + "_score": 355.38464, "_version": null, "_explanation": null, "sort": null, @@ -4609,7 +4609,7 @@ "body": "Original pricing plan This doc is for accounts on our original Product-based pricing. If you're on our New Relic One pricing plan, see Manage your data. Not sure which you're on? See Overview of pricing plans. If you're on the original product-based pricing plan, you retain your existing subscriptions and data retention values. You manage these existing retention settings from the Data management hub in New Relic One. To manage your retention settings, in New Relic One, click your user name, select Manage your data, and then select Data retention. You'll see your existing retention settings. Adjust retention values by clicking the Edit retention button. New Relic stores different types of data for different periods of time. The retention period for a type of data will vary depending on the product, the subscription level, and the feature. Limits on editing and deleting data 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. If you sent unwanted data or sensitive data to New Relic that must be removed, contact your account representative at New Relic, or get support at support.newrelic.com. Product and API data retention policies Select a New Relic product to see details about its data retention: APM Specific retention policies apply to each New Relic APM subscription level, including Lite, Essentials, Pro, and Enterprise. This includes metric timeslice data, key metrics, trace data, and event data. In addition to retention limits, your data is subject to aggregation (averaging) after certain elapsed time periods. For more information, see the aggregate metric data description. APM data retention policies For accounts on our original product-based pricing, APM data retention policies depend on your APM product subscription level. Component Lite Essentials Pro Metric timeslice data 24 hours 3 days 90 days Key metrics none forever forever Distributed tracing and logs in context none none 8 days Other trace data * 1 day 3 days 7 days Event data ** 1 day 3 days 8 days * If you view a transaction trace in the New Relic UI, New Relic stores that trace data for up to one year. ** Learn about how to extend the retention of event data. Legacy APM data retention policies Component Standard Startup Small Business Enterprise Metric timeslice data 7 days 14 days 30 days 90 days Key metrics none none none forever Trace data 7 days 7 days 7 days 7 days Event data none 8 days 8 days 8 days Browser For accounts on our original product-based pricing, Browser data is stored depending on your subscription level: Component Lite Pro Metric data 24 hours 90 days Key metrics 24 hours forever Trace data 7 days 7 days Event data * 1 day 8 days SPA data Unavailable 8 days * Learn about how to extend the retention of event data. Infrastructure For accounts on our original product-based pricing, Infrastructure data retention policies depend on your Infrastructure subscription level and your New Relic Infrastructure compute units pricing model. Data retention rules apply the same whether that data is displayed in the UI or queried. Infrastructure data retention is not governed by your Insights subscription. Infrastructure downsampling and data retention Types of data are stored depending on your subscription level: Component Essentials Pro Infrastructure data 3 months 13 months Host count Host count will stop reflecting a host whose agent is no longer reporting after three minutes. However, host data will be available, subject to other retention criteria. 3 minutes 3 minutes Inventory attributes removed Inventory attributes for a host are retained for 24 hours after the agent stops reporting. 24 hours 24 hours Integration data Not available with Essentials Limit of 2275 integration events per compute unit per month In addition, Infrastructure downsamples your data on the fly, as it's generated. All Infrastructure metric data types (including On-Host Integrations metrics) will display different granularity depending on the age of the data and the size of the time window. The following table illustrates when different downsampled buckets will be used, both in the Infrastructure UI and for queries: Bucket Size Used For Time Windows Covering... Data Retained For... Raw (5, 10 or 15 second) 0 to 59 minutes 7 days 1 minute 60 minutes to 6 hours 30 days 10 minutes 6 hours to 3 days Full account retention period 1 hour 3 days to 14 days Full account retention period 3 hours 14+ days Full account retention period Integration compute unit event limits The 2275 limit on integration events per compute unit per month is a limit on total Infrastructure integration events. It's not a limit of 2275 for each integration's events. Additional details and clarifications about this limit: This limit applies to all events from all integrations (cloud integrations and on-host integrations). The events are all handled the same. Default data received by the Infrastructure agent does not count against the 2275 event per compute unit limit. If you exceed your limit, we do not enforce this limit. If you exceed your limit, we'll review pricing options with you to ensure you get the most cost-effective pricing for your organization's integrations. Insights For accounts on our original product-based pricing, an Insights subscription extends your event data retention. An Insights Pro subscription allows you to customize the length of your event data retention. Logs For accounts on our original product-based pricing, log data can be retained for up to 30 days by New Relic. Shorter retention periods of 8 or 15 days are also available. Logs in context data retention New Relic Logs logs in context data retention policy is based on your current APM product subscription level. For more information, see APM data retention. Mobile For accounts on our original product-based pricing, Mobile data retention policies depend on your New Relic Mobile product subscription level. This includes data components such as metric data, aggregate metrics, key metrics, trace data, and event data. For information about your subscription-related data usage, see Mobile subscription usage. Mobile data retention policies Component Lite Enterprise Overview page data 24 hours 90 days Crash data and stack traces 24 hours 90 days HTTP requests (except errors) as metric data Unavailable 90 days HTTP request errors as metric data Unavailable 3 days Interaction traces Unavailable 90 days Custom events * Unavailable 1 day Mobile events * 1 day 8 days MobileBreadcrumb events * Unavailable 3 days MobileCrash events * 1 day 90 days MobileHandledException events * Unavailable 3 days MobileJSError events (React Native beta) * Unavailable 3 days MobileRequest events * Unavailable 3 days MobileRequestError events * Unavailable 3 days MobileSession events * 1 day 90 days * Learn how to extend retention of event data. Standard Mobile (legacy) data retention policies Unless otherwise noted, Insights event data is unavailable for Standard subscriptions. Component Standard Overview page data 7 days Crash data and stack traces 7 days HTTP requests (except errors) as metric data 7 days HTTP request errors as metric data 3 days Interaction traces Unavailable MobileCrash events 8 days MobileSession events 8 days Plugins The retention period for historical data depends on the product and subscription level. The following data retention periods exist for New Relic Plugins. Plugins is not supported with accounts that host data in the EU region data center. Plugins data retention Component Lite Essentials Pro Enterprise Metric data 24 hours 3 days 90 days 90 days Legacy Plugins data retention Component Standard Startup Small Business Metric data 7 days 14 days 30 days Synthetics For accounts on our original product-based pricing, Synthetics data retention policies depend on your Synthetics product subscription level. This includes data components such as metric data, aggregate metrics, key metrics, trace data, and Insights events. Synthetics events do not count against an Insights Pro subscription. Your current subscription level appears in the right column of the Account summary page: Go to synthetics.newrelic.com > (account dropdown) > Account settings > Account > Summary. Synthetics data retention policies Component Lite Pro Synthetics monitor data 2 weeks 13 months Event data 2 weeks 13 months Also see the data retention details for APIs, including: Metric API All raw metric data points will be retained for 30 days. All additional aggregated data derived from the raw metric data points (for example, one-minute rollups) will be retained for 13 months. Any change to the retention period beyond such periods may result in a charge to you. Trace API See Trace API general requirements and limits. Data components For accounts on our original product-based pricing, the section below provides an explanation of some types of data components governed by the data retention rules of specific products: Event data: reported by most products See Event data retention for information on the event data type. Metric timeslice data: reported by APM, Browser, and Mobile Metric timeslice data is a specific type of data that is used for most metric charts and reports in New Relic APM, Mobile, and Browser. Note that metric timeslice data differs from other metric data types. All metric timeslice data is aggregated, but New Relic deals with fresh data and old data in different ways. Fresh data has specific policies applied to the data to keep granular views of performance as aggregate metrics. As data ages and becomes less useful in a granular state, we summarize that data and only keep key metrics. Aggregate metric timeslice data: reported by APM, Browser, and Mobile Aggregate metric timeslice data summarizes calls to specific methods in your application: how many times each one was called and response times. In the New Relic UI, you see the class and method names along with their aggregate numbers. Metric data aggregation depends on your subscription level. Subscription Level Aggregate retention Enterprise Aggregates (averages) to 1-hour periods after 8 days. After 90 days, the permanent metric data continues to be stored in 1-hour periods. This means you cannot obtain data granularity of less than 1 hour after 8 days, and only a subset of metrics are available after 90 days. Pro After 8 days Essentials After 3 days. Legacy Small Business, Startup, and Standard After 3 days. Lite After 2 hours. We retain your most recent data in one-minute increments. We also aggregate permanent metric data to day-size increments after 90 days. When looking at older data in small time windows, you may notice that charts show less detail. As data ages, it is aggregated into larger segments. Key metrics: reported by APM, Browser, and Mobile New Relic retains certain \"key\" metric timeslice data aggregations forever for Enterprise and Pro customers, for any number of applications. New Relic aggregates permanent key metric data to hour-size increments after 90 days. Product Key metrics APM Apdex, for app server Throughput and page views Response time, plus breakdown into tiers or categories on your app's main Overview chart Page load time, plus breakdown into segments Error rate CPU usage Memory usage Browser Apdex, for browser Browser page load time Throughput total. After 90 days, there is no breakout by browser type, and only the combined average value is available for the time range requested. Mobile Crash rate: For iOS and for Android Network throughput Network response time Network error rates Interaction traces Trace data: reported by APM, Browser, and Mobile Depending on the product, New Relic retains different types of trace data: Product Trace data APM Types of trace data: Transaction traces Distributed tracing Slow query samples Error details See APM data retention details. Browser Types of trace data: Session traces Browser traces JavaScript errors* See Browser data retention details. Mobile Types of trace data: App crash stack traces Interaction traces See Mobile data retention details. *JavaScript errors in the stack trace UI are saved as trace data. JS errors are also saved as events. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 339.92877, + "_score": 308.6463, "_version": null, "_explanation": null, "sort": null, @@ -4666,7 +4666,7 @@ "body": "Original user model This doc contains information about how to manage users on our original user model. Not sure which pricing plan or user model you're on? See Overview of pricing plan and user models. View and manage users To see the users on your New Relic account and their current roles: select the account dropdown, select Account settings, and select Users and roles. Some features in the UI are visible only to account Owners and Admins. User types: basic user and full user On the Users and roles UI page, users are categorized as either full users or basic users. This only affects your account once you've switched to the New Relic One pricing plan, released July 2020. Once you've changed your pricing plan, the number of full users is a factor in your billing. Your users on our original user model remain on that user model (and use these original user docs) and additionally have the new full/basic categorization. To learn more, see Transition to new pricing. You can also bulk update changes to user type. Account roles A New Relic account can have only one Owner. To share an account with other users in your organization, create Admins, Users, or Restricted Users. Account role Description Owner The person who initially creates the New Relic account and receives all billing queries. The Owner has complete access to all of the account information. The Owner can also install and configure the New Relic agent, and they can enable or set up features. Admins One or more individuals who can add, edit, and delete account users. Admins can also install and configure the New Relic agent, and they can enable or set up features. Users One or more individuals who use (and optionally set up) the available New Relic features. In general, Admins take responsibility for setting up features, and Users and Restricted Users can use them. Restricted Users One or more individuals who can view (but not set up or change) any New Relic features. The Restricted User role is useful, for example, for demos. You can change your New Relic session settings so that Restricted User logins do not time out, and then set the user interface to Kiosk mode. Add-on roles With add-on roles, you can grant variable levels of access to all users in your account, across the entire platform of New Relic products. This allows you to tailor your account permissions levels to suit the needs of Users and Restricted Users within your account. Giving a User or Restricted User add-on manager access to a product grants them the equivalent of Admin capabilities within the product. They will continue to have User or Restricted User capabilities for all other New Relic products. For example, you could make a software engineer in your company a User in most products, but assign Admin-level access to APM. For another example, you might assign the Nerdpack manager role to a user, and that gives them the ability to subscribe and unsubscribe New Relic One applications to an account. There are two types of add-on roles: Add-on Manager roles are available to grant permissions on a per-product basis. Giving a User or Restricted User managed add-on access to a product grants them the equivalent of Admin capabilities within the product. Custom add-on roles can grant feature-specific permissions across different New Relic products. For example, a group of Users could have the ability to acknowledge incidents and close violations in New Relic Alerts, but not have the ability to modify your existing alert preferences. Individuals on a master account that has sub-accounts automatically have the same level of access for all sub-accounts. Below are options for managing both managed add-on roles and custom add-on roles: View roles To view the list of individuals assigned to your account and their current roles: Go to account dropdown > Account settings > Users and roles. Assign a managed role Owner and Admins Managed add-on roles are available by default for each New Relic product. Adding a managed role for a user grants them Admin-level permissions for the assigned product. They cannot be edited or deleted. To assign a managed add-on role for a User or Restricted User in your account: Go to account dropdown > Account settings > Users and roles. From the list of users associated with your account, select their name. Under Add-on roles, select the type of manager role for the user. To understand which capabilities may be added, use the Capabilities preview chart. Features in the Capabilities preview chart may not exactly match what features are available for your subscription level. You can also add, update, or delete users in bulk by using a CSV file. Create a custom role To create a custom add-on role for your account: Go to account dropdown > Account settings > Users and roles > Roles. Select plus-circle New custom add-on role. Select the capabilities necessary for the new custom role, then Create role. Assign a custom role Owners and Admins You must create a custom role before assigning it to a user. To assign a custom add-on role for a User or Restricted User in your account: Go to account dropdown > Account settings > Users and roles > Users. From the list of users associated with your account, select their name ]. Under Add-on roles, select a custom role for the user. Click Update user. Edit or delete a custom role Owners and Admins You cannot edit or delete New Relic's default roles. However, you can edit or delete custom add-on roles for your account: Go to account dropdown > Account settings > Users and roles > Roles. From the Add-on roles list, select the custom add-on role, then select pencil Edit role or trash-o Delete role as appropriate. Account permissions Here is a summary of basic user rights for your New Relic account. Individuals on a master account with sub-accounts automatically have the same level of access for all sub-accounts. However, they will not receive email notifications for alerts or weekly reports for sub-accounts unless they are explicitly granted permission on these sub-accounts. Function Owner Admin User Restricted Maintain billing information. fa-check Change the account Owner. fa-check Add, update, and delete account Admins, Users, and Restricted Users. When the account Owner and Admins add individuals to the account, New Relic automatically sends them an email message. fa-check fa-check Update users' job titles and roles from Account settings in the New Relic UI. fa-check fa-check Create, modify and delete sub-accounts from Account settings in the New Relic UI. fa-check fa-check Update your own account information (name, password change or password reset request, default account, email preferences, etc.) from User preferences in the New Relic UI. fa-check fa-check fa-check fa-check Change someone else's password. You cannot reset passwords for anyone else on the account, even if you are an Owner or Admin. Instead, follow standard procedures to request a password reset from New Relic. View the list of individuals on the account from (account dropdown) > Account settings > Account > Summary in the New Relic UI. fa-check fa-check fa-check fa-check Manage flexible data retention. fa-check Subscribe and unsubscribe applications to New Relic One fa-check fa-check Alert permissions Here is a summary of Admin and Add-on manager capabilities with New Relic Alerts. To allow a User or Restricted User to execute any of these functions in New Relic Alerts, assign an Alerts add-on manager role. Admin and manager capabilities for Alerts include: Create or name alert policies. Specify incident preferences. Disable or define alert conditions. Provide runbook instructions. Select product targets. Alter alert condition thresholds. Create, modify, or delete notification channels. APM permissions Here is a summary of Admin and Add-on manager capabilities with New Relic APM. To allow a User or Restricted User to execute any of these functions in New Relic APM, assign an APM add-on manager role. Admin and manager capabilities for APM include: Remove applications from the New Relic UI. Delete app traces and error traces. Browser permissions Here is a summary of Admin and Add-on manager capabilities with New Relic Browser. To allow a User or Restricted User to execute any of these functions in New Relic Browser, assign a Browser add-on manager role. Admin and manager capabilities for Browser include: Add, rename, or delete applications. Manage whitelists. Manage domain conditions. Infrastructure permissions Here is a summary of Admin and Add-on manager capabilities with New Relic Infrastructure. To allow a User or Restricted User to execute any of these functions in New Relic Infrastructure, assign an Infrastructure manager role. Admin and manager capabilities for Infrastructure include: Create alert conditions in New Relic Infrastructure, including conditions for host not reporting. Add or modify integrations. Insights permissions Here is a summary of Admin and Add-on manager capabilities with New Relic Insights. To allow a User or Restricted User to execute any of these functions in New Relic Insights, assign an Insights manager role. These functions include: Create, view, modify, or delete Query API keys or Insert API keys. New Relic Insights includes permission levels to share your Insights dashboards with others. Mobile permissions Here is a summary of Admin and Add-on manager capabilities with New Relic Mobile. To allow a User or Restricted User to execute any of these functions in New Relic Mobile, assign a Mobile manager role. Admin and manager capabilities for Mobile include: Delete a mobile application from New Relic. Install New Relic Mobile for Android or iOS. Synthetics permissions Here is a summary of Admin and Add-on manager capabilities with New Relic Synthetics. To allow a User or Restricted User to execute any of these functions in New Relic Synthetics, assign a Synthetics add-on manager role. Admin and manager capabilities for Synthetics include: Create, edit, or delete monitors. Edit monitor scripts. Create, edit, or delete private locations. Create, edit, or delete monitor downtimes. Create, view, edit, or delete secure credentials. For more information, see User roles in Synthetics. Workloads Here's a summary of Admin and Add-on manager capabilities with New Relic One workloads: Create, duplicate, modify, or delete workloads. Link dashboards to workloads and save filters. To allow a User or Restricted User to execute these functions, assign the workloads manager add-on role. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 182.98135, + "_score": 166.2041, "_version": null, "_explanation": null, "sort": null, @@ -4690,21 +4690,21 @@ "Add the NerdGraphQuery component to an application", "Add a time picker to your app", "Add a table to your app", - "Publish and deploy apps", - "Create a custom map view" + "Create a custom map view", + "Publish and deploy apps" ], - "published_at": "2020-09-24T02:30:06Z", + "published_at": "2020-09-25T01:49:59Z", "title": "Build apps", - "updated_at": "2020-09-24T01:55:00Z", + "updated_at": "2020-09-25T01:49:59Z", "type": "developer", "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", "document_type": "page", "popularity": 1, - "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   Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 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 Publish and deploy apps Start sharing the apps you build 30 min Create a custom map view Build an app to show page view data on a map", + "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   Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 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 30 min Publish and deploy apps Start sharing the apps you build", "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 96.5504, + "_score": 94.5817, "_version": null, "_explanation": null, "sort": null, @@ -4724,7 +4724,7 @@ "Prerequisites", "Virtual Training Session List" ], - "published_at": "2020-09-24T01:45:44Z", + "published_at": "2020-09-25T01:39:00Z", "title": "Live Learncast: New Relic One Programmability", "updated_at": "2020-07-31T01:40:49Z", "type": "", @@ -4734,7 +4734,7 @@ "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 94.28528, + "_score": 92.349014, "_version": null, "_explanation": null, "sort": null, @@ -4744,6 +4744,54 @@ }, "id": "5dc618cbe7b9d2a0a8e4649c" }, + { + "sections": [ + "Serve, publish, and deploy your New Relic One app", + "Before you begin", + "Serve your app locally", + "Add images and metadata to your apps", + "screenshots folder", + "documentation.md", + "additionalInfo.md", + "config.json", + "Publish your app", + "Tip", + "Deploy your app", + "Subscribe or unsubsribe apps", + "Handle duplicate applications" + ], + "title": "Serve, publish, and deploy your New Relic One app", + "type": "developer", + "tags": [ + "publish apps", + "deploy apps", + "subscribe apps", + "add metadata apps" + ], + "external_id": "63283ee8efdfa419b6a69cb8bd135d4bc2188d2c", + "image": "https://developer.newrelic.com/static/175cc6506f7161ebf121129fa87e0789/0086b/apps_catalog.png", + "url": "https://developer.newrelic.com/build-apps/publish-deploy/", + "published_at": "2020-09-25T01:51:37Z", + "updated_at": "2020-09-02T02:05:55Z", + "document_type": "page", + "popularity": 1, + "info": "Start sharing and using the custom New Relic One apps you build", + "body": "Serve, publish, and deploy your New Relic One app 30 min When you build a New Relic One app, chances are you'll want to share it with others in your organization. You might even want to share it broadly through our open source channel. But first, you probably want to try it out locally to make sure it's working properly. From the New Relic One Apps page, you can review available apps and subscribe to the ones you want for accounts you manage. The Your 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 visualizations 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. Your 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. Here, you learn to: Serve your app locally Add images and metadata to your app Publish it Subscribe and unsubscribe accounts you manage to the app Handle duplicate applications Before you begin This guide requires the following: A New Relic One app or Nerdpack New Relic One CLI A Nerdpack manager role for publishing, deploying, and subscribing apps. Serve your app locally You can locally serve the app you create to New Relic One to test it out. Step 1 of 1 In the parent root folder of your Nerdpack, run nr1 nerdpack:serve. Go to one.newrelic.com/?nerdpacks=local. The ?nerdpacks=local URL suffix will load any locally served Nerdpacks that are available. When you make a change to a locally served Nerdpack, New Relic One will automatically reload it. Add images and metadata to your apps Application creators can include a description of what their 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, custom, or public. 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. Step 1 of 3 Update the New Relic One CLI to ensure you're working with the latest version. nr1 update Copy Step 2 of 3 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 sections for the process to succeed. 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 \\n model that supports location-specific KPI's, custom metadata, drill-down navigation into Entities \\n 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\" } Copy Step 3 of 3 Save the metadata and screenshots to the catalog. This validates the information you added to the catalog directory against the criteria described in the previous step, and saves it to the catalog. nr1 catalog:submit Copy Publish your app Publishing places your Nerdpack in New Relic One. To publish or deploy, you must be a Nerdpack manager. New Relic One requires that only one version (following semantic versioning) of a Nerdpack can be published at a time. Tip If you know what channel you want to deploy to (as described in the Deploy your app section that follows), you can run nr1 nerdpack:publish --channel=STABLE or nr1 nerdpack:publish --channel=BETA. Step 1 of 2 Update the version attribute in the app's package.json file. This follows semantic versioning, and must be updated before you can successfully publish. Step 2 of 2 To publish your Nerdpack, run nr1 nerdpack:publish. Deploy your app Deploying is applying a Nerdpack version to a specific channel (for example, BETA, or STABLE). A channel can only have one Nerdpack version deployed to it at one time. If a channel has an existing Nerdpack associated with it, deploying a new Nerdpack version to that channel will undeploy the previous one. Channels are meant to be an easier way to control application version access than having to be concerned with specific version numbers. Step 1 of 1 To deploy an application, run nr1 nerdpack:deploy. Subscribe or unsubsribe apps Whether you want to subscribe accounts to an app you've created or to apps already available in the catalog, the process is the same. Note that if you subscribe to an app in the catalog, you'll automatically get any updates that are added to the app. To learn about the appropriate permissions for subscribing, see Permissions for managing applications. Step 1 of 2 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 members of the accounts you have subscribed to the app can launch it from New Relic One. Step 2 of 2 Unsubsribe from 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 Your 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. Step 1 of 1 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.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 84.066574, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "Serve, publish, and deploy your New Relic One app", + "sections": "Add images and metadata to your apps", + "info": "Start sharing and using the custom New Relic One apps you build", + "tags": "publish apps", + "body": " to the app Handle duplicate applications Before you begin This guide requires the following: A New Relic One app or Nerdpack New Relic One CLI A Nerdpack manager role for publishing, deploying, and subscribing apps. Serve your app locally You can locally serve the app you create to New Relic One to test" + }, + "id": "5efa999de7b9d283e67bab8f" + }, { "category_2": "UI and data", "nodeid": 38701, @@ -4781,7 +4829,7 @@ "body": "After log event data has been shipped to New Relic, it can either be stored in our database (NRDB) or dropped (discarded). New Relic can drop both log events and event attributes via drop filter rules. You can manage drop filter rules using New Relic's log management or NerdGraph. Use caution when deciding to drop data. The data you drop is not recoverable. Before using this feature, review Responsibilities and considerations. Why it matters Drop filter rules help you accomplish some very important goals: You lower costs by storing only logs relevant to your account. You protect privacy and security by removing personal identifiable information (PII). You reduce noise by removing irrelevant events and attributes. How drop filter rules work A drop filter rule matches data based on a query. When triggered, the drop filter rule removes the matching data from the ingestion pipeline before it is written to in NRDB. Since the data does not reach the backend, it cannot be queried: the data is gone and cannot be restored. During the ingestion process, log data can be parsed, transformed, or dropped before being stored. Create drop filter rules You must have admin permissions in New Relic to create and edit drop filters, or be a member of a role with create and edit permissions for Logging Parsing Rules. Drop filter rules can be created from one.newrelic.com > Logs using new or existing log queries. To create a new drop filter rule: Filter or query to the specific set of logs which contain the data to be dropped. Once the query is active, click on the + button to show the query options and select Create a new drop filter. You can choose to either drop the entire log event that matches the query or just a specific subset of attributes in the matching events. Save the drop filter rule. Before saving the rule, consider changing its name. Once a drop filter rule is active, it's applied to all log events ingested from that point onwards. Rules are not applied retroactively: logs collected prior to the creation of a rule are not filtered by that rule. Types of drop filter rules Drop log events The default type of drop filter rule is to drop logs. This option drops the entire log events that match the filter query. When creating a rule try to provide a specific query that only matches log data which should be dropped. New Relic won't let you create drop filter rules without values in the matching query: this prevents badly formed rules from dropping all log data. Drop attributes You can specify attributes to be dropped in a log event that matches your query. At least one or more attributes must be selected. Any attribute which is selected will be dropped; all remaining attributes will be kept and stored in NRDB. We recommend this method for removing fields which could contain personal identifiable information (PII) or other sensitive attributes without losing valuable monitoring data. ​ Cautions when dropping data When creating drop rules, you are responsible for ensuring that the rules accurately identify and discard the data that meets the conditions that you have established. You are also responsible for monitoring the rule, as well as the data you disclose to New Relic. New Relic cannot guarantee that this functionality will completely resolve data disclosure concerns you may have. New Relic does not review or monitor how effective the rules you develop are. Creating rules about sensitive data can leak information about what kinds of data you maintain, including the format of your data or systems (for example, through referencing email addresses or specific credit card numbers). Rules you create, including all information in those rules, can be viewed and edited by any user with the relevant role-based access control permissions. Delete drop filter rules Drop filter rules can be deleted from one.newrelic.com > Logs. To delete a drop filter rule: Click on the + button to show the query options and select View all drop filters. Click the delete [trash icon] icon next to the drop filter rule you want to remove. Once deleted, rules no longer filter ingested log events. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 92.53715, + "_score": 83.83354, "_version": null, "_explanation": null, "sort": null, @@ -4793,56 +4841,240 @@ "body": " it is written to in NRDB. Since the data does not reach the backend, it cannot be queried: the data is gone and cannot be restored. During the ingestion process, log data can be parsed, transformed, or dropped before being stored. Create drop filter rules You must have admin permissions in New Relic" }, "id": "5f37d6fb196a67021c55e5eb" + } + ], + "/automate-workflows/get-started-new-relic-cli": [ + { + "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png", + "url": "https://developer.newrelic.com/", + "sections": [ + "Mark your calendar for Nerd Days 1.0", + "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" + ], + "published_at": "2020-09-25T01:41:27Z", + "title": "New Relic Developers", + "updated_at": "2020-09-25T01:37:24Z", + "type": "developer", + "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab", + "document_type": "page", + "popularity": 1, + "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 18 Days : 14 Hours : 58 Minutes : 41 Seconds Register 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 20 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", + "info": "", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 330.266, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "New Relic Developers", + "sections": "New Relic developer champions", + "body": " 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" + }, + "id": "5d6fe49a64441f8d6100a50f" }, { - "nodeid": 9921, + "image": "", + "url": "https://developer.newrelic.com/automate-workflows/", "sections": [ - "Install and configure the infrastructure agent", + "Automate workflows", + "Guides to automate workflows", + "Quickly tag resources", + "Set up New Relic using Helm charts", + "Automatically tag a simple \"Hello World\" Demo across the entire stack", + "Set up New Relic using the Kubernetes operator", + "Automate common tasks", + "Set up New Relic using Terraform" + ], + "published_at": "2020-09-25T01:49:59Z", + "title": "Automate workflows", + "updated_at": "2020-09-25T01:49:59Z", + "type": "developer", + "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871", + "document_type": "page", + "popularity": 1, + "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 30 min Automatically tag a simple \"Hello World\" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform", + "info": "", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 309.71802, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "sections": "Set up New Relic using Helm charts", + "body": " it is to leverage automation in your DevOps environment! 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform" + }, + "id": "5efa999c196a67dfb4766445" + }, + { + "sections": [ + "Quickly tag a set of resources", + "Before you begin", + "Install the New Relic CLI", + "Linux", + "macOS", + "Windows", + "Create your New Relic CLI profile", + "Search for an entity", + "Add tags and tag lists to your entity", + "Note", + "Check that the tags are there", + "Tip", + "Next steps" + ], + "title": "Quickly tag a set of resources", + "type": "developer", + "tags": [ + "tags", + "new relic CLI" + ], + "external_id": "c7c374812f8295e409a9b06d552de51ceefc666b", + "image": "", + "url": "https://developer.newrelic.com/automate-workflows/5-mins-tag-resources/", + "published_at": "2020-09-25T01:51:37Z", + "updated_at": "2020-08-14T01:45:08Z", + "document_type": "page", + "popularity": 1, + "info": "Add tags to applications you instrument for easier filtering and organization.", + "body": "Quickly tag a set of resources 5 min Tags help you group, search, filter, and focus the data about your entities, which can be anything from applications to hosts to services. Tagging entities using the New Relic CLI is a good candidate for automation. In this 5-minute guide, you use the New Relic CLI to add multiple tags to one of your entities. Before you begin For this guide you need your New Relic personal API Key: Create it at the Account settings screen for your account. Step 1 of 6 Install the New Relic CLI You can download the New Relic CLI via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 6 Create your New Relic CLI profile New Relic CLI profiles contain credentials and settings that you can apply to any CLI command. To create your first CLI profile, run the profiles add command. Don't forget to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey API_KEY -r us # Set the profile as default newrelic profiles default -n tutorial Copy Step 3 of 6 Search for an entity Your New Relic account might have hundreds of entities: Have a quick look by opening the Entity explorer. In the terminal, run entity search to retrieve a list of entities from your account as JSON. In the example, you're searching for all entities with \"test\" in their name. # Change the `name` to match any of your existing entities newrelic entity search --name \"test\" Copy Step 4 of 6 If there are matching entities in your account, the query yields data in JSON format, similar to this workload example. Select an entity from the results and look for its guid value; the guid is the unique identifier of the entity. Write it down. { \"accountId\": 123456789, \"domain\": \"NR1\", \"entityType\": \"WORKLOAD_ENTITY\", \"guid\": \"F7B7AE59FDED4204B846FB08423DB18E\", \"name\": \"Test workload\", \"reporting\": true, \"type\": \"WORKLOAD\" }, Copy Step 5 of 6 Add tags and tag lists to your entity With your entity guid, you can add tags right away. You can do so by invoking the entities tags create command. What if you want to add multiple tags? You can use tag sets for that: While tags are key-value pairs separated by colons, tag sets are comma-separated lists of tags. For example: tag1:value1,tag2:value2 Note Adding tags is an asynchronous operation: it could take a little while for the tags to get created. # Adding a single tag newrelic entity tags create --guid GUID --tag key:value # Adding multiple tags newrelic entity tags create --guid GUID --tag tag1:test,tag2:test Copy Step 6 of 6 Check that the tags are there To make sure that the tags have been added to your entities, retrieve them using the entity tags get command. All tags associated with your entity are retrieved as a JSON array. newrelic entity tags get --guid GUID Tip Tags can be deleted at any time by invoking the entity tags delete command followed by the same arguments you used to create them. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Next steps Have a look at all the New Relic CLI commands. For example, you could create a New Relic workflow using workload create. If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 190.61485, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "Quickly tag a set of resources", + "sections": "Install the New Relic CLI", + "info": "Add tags to applications you instrument for easier filtering and organization.", + "tags": "new relic CLI", + "body": " by invoking the entity tags delete command followed by the same arguments you used to create them. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Next steps Have a look at all the New Relic CLI commands. For example" + }, + "id": "5efa999d64441fa74a5f7e2d" + }, + { + "category_2": "Logs in context for Ruby", + "nodeid": 35726, + "sections": [ + "Enable log management", + "New Relic Logs", + "Enable log monitoring", + "Configure logs in context", + "Logs in context for Go", + "Logs in context for Java", + "Logs in context for .NET", + "Logs in context for Node.js", + "Logs in context for PHP", + "Logs in context for Python", + "Logs in context for Ruby", + "Logs in context with agent APIs", + "Configure logs in context for Ruby", + "Compatibility and requirements", + "Configure logs in context with log management", + "Install or update the Ruby agent", + "Configure for Rails", + "Rails advanced configuration", + "Configure for Ruby without Rails", + "Advanced configuration", + "Custom logger configuration", + "Lograge configuration", + "Check for logging data", + "Troubleshooting", + "Incompatible gems", + "What's next?", + "For more help" + ], + "title": "Configure logs in context for Ruby", + "category_0": "Log management", + "type": "docs", + "category_1": "Enable log management", + "external_id": "39429728c3bc0c83479db2ebe30dee4a31efd2b3", + "image": "", + "url": "https://docs.newrelic.com/docs/logs/enable-log-management-new-relic/logs-context-ruby/configure-logs-context-ruby", + "published_at": "2020-09-24T11:09:47Z", + "updated_at": "2020-09-24T11:09:47Z", + "breadcrumb": "Contents / Log management / Enable log management / Logs in context for Ruby", + "document_type": "page", + "popularity": 1, + "info": "A description of the logs in context configuration process for the Ruby agent.", + "body": "Logs in context for the Ruby agent connects your logs and APM data in New Relic, giving full context to high-level events and providing high value data to specific log lines. Read on to learn how to configure logs in context and enrich your log data. Compatibility and requirements To use log management with the Ruby agent, ensure your configuration meets the following requirements: Ruby agent 6.7.0 or higher: Install or update Supported Rails version (for Rails applications) Configure logs in context with log management To configure logs in context with Ruby: Enable log management with a compatible log forwarding plugin. Install or update the Ruby agent. Configure logs in context for Ruby. Optional: Advanced configuration. Check for logging data. Enable log management Confirm that you have log management enabled, with a compatible log forwarding plugin installed to send your application logs to New Relic. Install or update the Ruby agent Install or update to the most recent Ruby agent version, and enable distributed tracing. Configure logs in context for Ruby Configure for Rails Rails logging is controlled by two components: a logger (customizable by setting config.logger) and a log formatter (customizable by setting config.log_formatter). In most cases, logs in context should be configured by setting config.log_formatter to the DecoratingFormatter in your Rails application. For more guidance regarding Rails configuration, see Configuring Rails Applications. In your application's config, require 'newrelic_rpm', then add the following line: module ________ class Application < Rails::Application ... config.log_formatter = ::NewRelic::Agent::Logging::DecoratingFormatter.new end end This will use the New Relic formatter to format log messages, but the rest of the logging configuration will be provided by the other Rails config settings. Please note that Logs in Context for Ruby does not currently support tagged logging; if you are initializing your logger with a log_tags argument, your custom tags may not appear on the final version of your logs. Rails advanced configuration If setting the log_formatter option doesn't meet your needs, replace the entire Rails logger with an instance of the New Relic logger. Provide the parameters to the logger's constructor, like this: module ________ class Application < Rails::Application ... config.logger = ::NewRelic::Agent::Logging::DecoratingLogger.new( \"log/application.log\", #etc... ) end end Configure for Ruby without Rails For non-Rails applications, use the DecoratingLogger in place of the Ruby standard ::Logger, like this: logger = ::NewRelic::Agent::Logging::DecoratingLogger.new( 'log/application.log', #etc... ) ... logger.info(...) The DecoratingLogger is a drop-in replacement for the Ruby standard ::Logger. Their constructors accept the same parameters. Advanced configuration Custom logger configuration To use our logging extension with a different logging implementation, or your own custom logger, use the DecoratingFormatter. Example: module ________ class Application < Rails::Application ... config.logger = ::YourCustomLoggerImplementation.new( $stdout, formatter: ::NewRelic::Agent::Logging::DecoratingFormatter.new ) end end Lograge configuration To configure this extension with the lograge gem, there is no additional configuration required. Check for logging data If you have configured your logging in /config/application.rb, or in /config/environments/development.rb, run your application locally and check its logging output. You should see some output like this: {\"entity.name\":\"your_app_name\",\"entity.type\":\"SERVICE\",\"hostname\":\"79bcbf8d\",\"trace.id\":\"79bcbf8d\",\"span.id\":\"00fc7d46\",\"timestamp\":1567701375543,\"message\":\"example log message one\",\"log.level\":\"DEBUG\"} {\"entity.name\":\"your_app_name\",\"entity.type\":\"SERVICE\",\"hostname\":\"79bcbf8d\",\"trace.id\":\"79bcbf8d\",\"span.id\":\"6754870b\",\"timestamp\":1567702843604,\"message\":\"example log message two\",\"log.level\":\"DEBUG\"} If you have deployed this application to an environment with a log forwarder, your application's logs will appear in the New Relic Logs UI with metadata linking them to a trace and a span. You can find them using a query like this: entity.name:\"your_app_name\" has:trace.id If you see JSON logs in your application's output, but no logs returned by a query like the above, check your log forwarder. Troubleshooting If the logs from your application are not formatted in JSON with fields like trace.id and span.id, there may be a problem with the configuration of the New Relic Logging Extension. Check that: the application is using a supported logging framework. the configuration has been applied to all the environments where you would like to use the New Relic Logging Extension. there is not another logger configured later in the configuration of the application. Incompatible gems The New Relic decorating logger is known to be incompatible with the following gems: logging semantic logger rails_stdout_logger rails_12factor What's next? Now that you've set up APM logs in context, here are some potential next steps: Explore your data using the Logs UI. Troubleshoot errors with distributed tracing, stack traces, application logs, and more. Query your data and create custom dashboards or alerts. For more help", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 165.6371, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "sections": "New Relic Logs", + "body": "Logs in context for the Ruby agent connects your logs and APM data in New Relic, giving full context to high-level events and providing high value data to specific log lines. Read on to learn how to configure logs in context and enrich your log data. Compatibility and requirements To use log" + }, + "id": "5f37c37164441ffb9aa0a5f1" + }, + { + "category_2": "Trace API", + "nodeid": 35381, + "sections": [ + "Distributed tracing", "Get started", - "Linux installation", - "Windows installation", - "Config management tools", - "Configuration", - "Update or uninstall", - "Manage your agent", - "Requirements for the infrastructure agent", - "Processor architectures", - "Operating systems", - "Unique hostname", - "Permissions", - "Libraries", - "Network access", - "Container software", - "CPU, memory, and disk usage", - "Configuration management tools", + "Enable and configure", + "Other requirements", + "UI and data", + "Trace API", + "Troubleshooting", + "Report traces via the Trace API (New Relic format)", + "Example: Use your tool’s native sampling", + "Example: Use Infinite Tracing", + "JSON requirements and recommendations", + "Attributes", + "Required attributes", + "Highly recommended attributes", + "Reserved attributes", + "Other attributes", + "Explore more about distributed tracing:", "For more help" ], - "title": "Requirements for the infrastructure agent", - "category_0": "Infrastructure monitoring", + "title": "Report traces via the Trace API (New Relic format)", + "category_0": "Understand dependencies", "type": "docs", - "category_1": "Install and configure the infrastructure agent", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/infrastructure/install-infrastructure-agent/get-started/requirements-infrastructure-agent", - "external_id": "71d7349826202468aec8827527896e9bd07d0b2b", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/amazon%20linux.png", - "url": "https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/get-started/requirements-infrastructure-agent", - "published_at": "2020-09-24T15:54:12Z", - "updated_at": "2020-09-24T15:54:12Z", - "breadcrumb": "Contents / Infrastructure monitoring / Install and configure the infrastructure agent / Get started", + "category_1": "Distributed tracing", + "external_id": "ba16f3a71b78e24c23da821b64567398251bb217", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/Infinite_Tracing_GraphiQL_URL_Results_0_0.png", + "url": "https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/trace-api/report-new-relic-format-traces-trace-api", + "published_at": "2020-09-24T12:18:41Z", + "updated_at": "2020-09-24T12:18:40Z", + "breadcrumb": "Contents / Understand dependencies / Distributed tracing / Trace API", "document_type": "page", "popularity": 1, - "info": "Compatibility information for infrastructure monitoring, including supported Linux and Windows versions.", - "body": "Before installing our infrastructure agent, make sure your system and any on-host integrations you configure meet the requirements. Processor architectures The infrastructure agent supports only x86 processor architectures: Linux: 64-bit architecture (also requires 64-bit package manager and dependencies) Windows: both 32 and 64-bit architectures ARM: AWS Graviton 2 processor (using the tarball setup instructions). Support is limited to infrastructure monitoring. Integrations, such as log forwarding, may not work as expected. Operating systems The infrastructure agent supports these operating systems: Operating system Supported by the infrastructure agent Amazon Linux All versions CentOS Version 6 or higher Debian Version 8 (\"Jessie\") or higher Docker Docker 1.12 Kubernetes Tested with versions 1.10 to 1.16 Red Hat Enterprise Linux (RHEL) Version 6 or higher SUSE Linux Enterprise Server (SLES) Versions 11.4, 12.1, 12.2, 12.3, and 12.4 Ubuntu LTS versions 14.04.x, 16.04.x, and 18.04.x Windows Server 2012, 2016, and 2019, and their service packs Operating systems are not supported beyond end-of-life. You can monitor Amazon BottleRocket workloads: When running EC2 instances, use the containerized agent. On EKS, install the Kubernetes integration. For ECS clusters, deploy the ECS integration. Unique hostname The infrastructure agent uses the hostname to uniquely identify each server. To avoid inaccurate metrics from combining multiple servers under a single hostname, make sure that each monitored server has a unique hostname. You can use the optional display_name setting to override the default hostname. Servers named localhost are not reported: it's a default name and inherently non-unique. Permissions The infrastructure agent requires these permissions: Linux: By default, the agent runs and installs as root. You can also select privileged or unprivileged run modes. Windows: The agent must be installed from an Administrator account and requires Administrator privileges to run. Libraries For agent versions 1.1.19 or higher, you need the libcap library in order to install Infrastructure. It's available in the official repositories of your distribution. Network access In order to report data to New Relic, our infrastructure agent must have outbound access to certain domains and ports. If your system needs a proxy to connect to these domains, use the proxy setting. Container software The infrastructure agent instruments Docker containers when installed on the host server. We support Docker versions 1.12 or higher. CPU, memory, and disk usage The infrastructure agent is fairly lightweight. For typical CPU, memory, and disk usage, see our page on agent performance overhead. For more information on supported file systems, see Storage sample attributes. Configuration management tools The infrastructure agent can be deployed programmatically using several config management and deploy tools: Ansible Chef Elastic Beanstalk Puppet 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.", + "info": "For New Relic's Trace API: how to report traces using the New Relic format. ", + "body": "You can send traces in the New Relic format to our Trace API without using a New Relic agent or integration. This is useful if you want to integrate with sources that emit tracing data and require a backend for trace storage. Since distributed systems can generate a lot of trace data, telemetry tools rely on data sampling (filtering) to find the most useful subset of that data. When you send us your trace data, you have two options related to sampling: Use your tool’s native sampling: This approach sends the telemetry data directly to the Trace API and assumes you are relying on your telemetry tool to sample the data before the integration passes the data to New Relic. Even though your tool may be sampling data before the New Relic integration sends it, our Trace API may randomly sample out traces that exceed your rate limit. Use Infinite Tracing (limited release): This approach assumes you turn off sampling in your telemetry tool and then send all your data to a New Relic trace observer in AWS. The trace observer selects the most important and actionable traces using tail-based sampling and then sends your traces to our UI. To send Zipkin-formatted data to the Trace API, see our Zipkin instructions. We'll look at two examples for sending your telemetry data to New Relic, as well as how to structure your data: Example: Use your tool’s native sampling Example: Use Infinite Tracing JSON requirements and recommendations Attributes Example: Use your tool’s native sampling If you are using a telemetry tool that is sampling your trace data, you can send the data directly to New Relic. The following procedure explains how to send a test payload to the Trace API using the newrelic format. For details about how to structure your data, see JSON requirements and recommendations. Get an Insert API key: Go to: one.newrelic.com > account dropdown > Account settings > API keys, and select Insights API keys. If you don't have a key, create a new one by selecting Insert keys +. Insert your Insert API key into the following JSON and then send the JSON to our endpoint. curl -i -H \"Content-Type: application/json\" \\ -H \"Api-Key: YOUR_INSERT_API_KEY\" \\ -H 'Data-Format: newrelic' \\ -H 'Data-Format-Version: 1' \\ -X POST \\ -d '[ { \"common\": { \"attributes\": { \"service.name\": \"Test Service A\", \"host\": \"host123.test.com\" } }, \"spans\": [ { \"trace.id\": \"123456\", \"id\": \"ABC\", \"attributes\": { \"duration.ms\": 12.53, \"name\": \"/home\" } }, { \"trace.id\": \"123456\", \"id\": \"DEF\", \"attributes\": { \"service.name\": \"Test Service A\", \"host\": \"host456.test.com\", \"duration.ms\": 2.97, \"name\": \"/auth\", \"parent.id\": \"ABC\" } } ] } ]' 'https://trace-api.newrelic.com/trace/v1' If you're sending more than one POST, change the trace.id to a unique value. Sending the same payload or span id multiple times for the same trace.id may result in fragmented traces in the UI. If your test returned HTTP/1.1 202 Accepted, go to our UI to see a query of your test data using the span attribute service.name = Test Service A. Traces may take up to one minute to be processed by both the trace observer and the Trace API. Example: Use Infinite Tracing Infinite Tracing can examine all of your data and find the most useful traces. To get the biggest benefit from Infinite Tracing, you should turn off sampling in your telemetry tool and send all your trace data to the trace observer. To start using Infinite Tracing, please go to our sign-up page. The following steps show you how to find or create a trace observer endpoint using GraphQL and how to send a test payload using the newrelic format. For details about how to structure your data, see JSON requirements and recommendations. If you send your data to a trace observer in one of our EU provider regions, you'll still need a US-based New Relic account because the tail-based sampling data is reported to data centers in the United States. If you have questions, contact your account representative. Step A. Open NerdGraph API explorer Prepare to execute some GraphQL: Open NerdGraph API explorer. In the API key dropdown next to Tools, select your personal API key for your account under one of these options: Select an existing API Key Create a new API Key Step B. See if anyone in your organization has already created a trace observer endpoint The following steps show you how to execute a GraphQL query to find out if you can use an existing trace observer in your AWS region. If one isn't available, you can go to Step C. Create a new one. Copy the following query into the middle pane of the NerdGraph API explorer and replace YOUR_ACCOUNT_ID with your account ID (the number next to your account name in NerdGraph API explorer): { actor { account(id: YOUR_ACCOUNT_ID) { edge { tracing { traceObservers { errors { message type } traceObservers { endpoints { agent { host port } endpointType https { host port url } status } id name providerRegion } } } } } } } Click the triangle button to execute the query or press Ctrl+Enter. Check the right pane showing the results: In traceObservers, if you see an AWS region (providerRegion) appropriate for your location, copy its associated https: url value to use later as YOUR_TRACE_OBSERVER_URL in Send test data to the trace observer. If you don't see any values in traceObservers as shown below, continue to Step C. Create a new one. Step C. If you can't find an existing trace observer endpoint, create a new one If you didn't find a trace observer after running the query in the previous section, you need to create one. To do this, you execute a GraphQL mutation that passes your configuration details. Copy the following into the middle pane of the NerdGraph API explorer. mutation { edgeCreateTraceObserver(accountId: YOUR_ACCOUNT_ID, traceObserverConfigs: {name: \"YOUR_DESCRIPTIVE_NAME\", providerRegion: YOUR_PROVIDER_REGION}) { responses { errors { message type } traceObserver { endpoints { agent { host port } endpointType https { host port url } status } id name providerRegion } } } } Insert your own values into the mutation: Value Description YOUR_ACCOUNT_ID Replace this with your account ID (the number next to your account name in NerdGraph API explorer). YOUR_DESCRIPTIVE_NAME Replace this with a name that describes the services that report to this trace observer (for example, production or query services). YOUR_PROVIDER_REGION Replace this with the provider region enum value for your location: AWS_EU_WEST_1 AWS_US_EAST_1 AWS_US_WEST_2 Click the triangle button to execute the mutation or press Ctrl+Enter. In the right pane showing the results, copy the value of https: url to a text file so you can use it later as YOUR_TRACE_OBSERVER_URL in Send test data to the trace observer: Step D. Send data to the trace observer Here's a test that includes a sample payload with one trace and two spans from the same service: Test Service A. Follow these steps to send a test request: Get or generate your Insert API key so you can use it later in the test. Copy the following curl request into a text editor: curl request curl -i -H \"Content-Type: application/json\" \\ -H \"Api-Key: YOUR_INSERT_API_KEY\" \\ -H 'Data-Format: newrelic' \\ -H 'Data-Format-Version: 1' \\ -X POST \\ -d '[ { \"common\": { \"attributes\": { \"environment\": \"staging\" } }, \"spans\": [ { \"trace.id\": \"123456\", \"id\": \"ABC\", \"attributes\": { \"duration.ms\": 12.53, \"host\": \"host123.test.com\", \"name\": \"/home\", \"service.name\": \"Test Service A\" } }, { \"trace.id\": \"123456\", \"id\": \"DEF\", \"attributes\": { \"duration.ms\": 2.97, \"host\": \"host456.test.com\", \"error.message\": \"Invalid credentials\", \"name\": \"/auth\", \"parent.id\": \"ABC\", \"service.name\": \"Test Service B\" } } ] } ]' \\ 'YOUR_TRACE_OBSERVER_URL' Insert your own values into the curl request: Value Description YOUR_INSERT_API_KEY Replace this with your Insert API key (not the same as your personal API key for NerdGraph API explorer) YOUR_TRACE_OBSERVER_URL Replace this with the value under https: url from above. Copy the content of the text editor into a terminal, and then execute the request. If the test does not return HTTP/1.1 202 Accepted indicating success, check the following and try again: Confirm that you substituted the url (not host) value for YOUR_TRACE_OBSERVER_URL. Confirm that you only have single quotes around the value you inserted for YOUR_TRACE_OBSERVER_URL. Check that you are using the Insert API Key (not a license). If your test returned HTTP/1.1 202 Accepted, go to our UI to see a query of your test data using the span attribute service.name = Test Service A. Because the sample payload contains an error attribute, the error sampler will mark it for keeping. If you modify the payload to remove the error attributes, the random sampler may not choose to keep this particular trace. Traces may take up to one minute to be processed by both the trace observer and the Trace API. JSON requirements and recommendations Requirements and guidelines for trace JSON using the newrelic format: Each JSON payload is an array of objects. Each object should contain a required spans key. Each object may contain an optional common key. Use this if you want share information across multiple spans in a object. Any keys on a span have precedence over the same key in the common block. The value for spans key is a list of span objects. Certain attributes are required, and must be included either in the optional common block, or in each span. Recommended and custom attributes may be optionally included in a list of key/value pairs under a key named attributes, in the optional common block and/or in each span. In the following example POST, there are two spans, both of which will have the trace.id 12345 and the custom attribute host: host123.test.com. The first span has no parent.id, so that is the root of the trace; the second span's parent.id points to the ID of the first. [ { \"common\": { \"attributes\": { \"host\": \"host123.test.com\" } }, \"spans\": [ { \"trace.id\": \"12345\", \"id\": \"abc\", \"attributes\": { \"user.email\": \"bob@newr.com\", \"service.name\": \"my-service\", \"duration.ms\": 750, \"name\": \"my-span\" } }, { \"trace.id\": \"12345\", \"id\": \"def\", \"attributes\": { \"parent.id\": \"abc\", \"service.name\": \"second-service\", \"duration.ms\": 750, \"name\": \"second-span\" } } ] } ] Attributes Review the sections below describing the attributes for the attributes block of a newrelic formatted JSON POST. Required attributes Requests without these attributes will be rejected, and an NrIntegrationError will be generated. These are the only attributes that don't belong under attributes. attribute description id string Unique identifier for this span. trace.id string Unique identifier shared by all spans within a single trace. Highly recommended attributes While not required, these attributes should be included for the best experience with your data. They are included in the attributes section. attribute default description duration.ms float none Duration of this span in milliseconds. name string none The name of this span. parent.id string none The id of the caller of this span. Value is null if this is the root span. Traces without a root span will not displayed. service.name string none The name of the entity that created this span. timestamp long Defaults to the current time in UTC timezone if not provided. The span's start time in Epoch milliseconds. Reserved attributes These attributes are currently reserved for internal New Relic usage. While they are not explicitly blocked, we recommend not using them. attribute default description entity.name string service.name This is derived from the service.name attribute. entity.type string service The entity type is assumed to be a service. entity.guid string None The entity.guid is a derived value that uniquely identifies the entity in New Relic's backend. Other attributes You can add any arbitrary attributes you want, with the exception of the restricted attributes. For example, you might want to add attributes like customer.id or user.id to help you analyze your trace data. To learn how to control how spans appear in New Relic (for example, adding errors or setting a span as a datastore span), see Decorate spans. Explore more about distributed tracing: Learn where Trace API data shows up in the UI. Learn how to decorate spans for a richer, more detailed UI experience. For example, you can have spans show up as datastore spans or display errors. Learn about general data limits, required metadata, and response validation. If you don't see your trace data, see Troubleshooting. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 90.3975, + "_score": 163.24817, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Permissions", - "body": "Before installing our infrastructure agent, make sure your system and any on-host integrations you configure meet the requirements. Processor architectures The infrastructure agent supports only x86 processor architectures: Linux: 64-bit architecture (also requires 64-bit package manager" + "title": "Report traces via the Trace API (New Relic format)", + "sections": "Report traces via the Trace API (New Relic format)", + "info": "For New Relic's Trace API: how to report traces using the New Relic format. ", + "category_2": "Trace API", + "body": "You can send traces in the New Relic format to our Trace API without using a New Relic agent or integration. This is useful if you want to integrate with sources that emit tracing data and require a backend for trace storage. Since distributed systems can generate a lot of trace data, telemetry", + "breadcrumb": "Contents / Understand dependencies / Distributed tracing / Trace API" }, - "id": "5f57ecf0e7b9d21d5facfd7b" + "id": "5d89dc6028ccbc83ce9cb16f" } ], "/build-apps/build-hello-world-app": [ @@ -4868,7 +5100,7 @@ "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2", "image": "", "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/", - "published_at": "2020-09-24T02:28:37Z", + "published_at": "2020-09-25T01:48:39Z", "updated_at": "2020-08-14T01:47:12Z", "document_type": "page", "popularity": 1, @@ -4876,7 +5108,7 @@ "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 213.04257, + "_score": 205.38774, "_version": null, "_explanation": null, "sort": null, @@ -4912,7 +5144,7 @@ "external_id": "c97bcbb0a2b3d32ac93b5b379a1933e7b4e00161", "image": "", "url": "https://developer.newrelic.com/explore-docs/nerdpack-file-structure/", - "published_at": "2020-09-24T02:26:06Z", + "published_at": "2020-09-25T01:48:40Z", "updated_at": "2020-08-14T01:49:25Z", "document_type": "page", "popularity": 1, @@ -4920,256 +5152,18 @@ "body": "Nerdpack file structure A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. Here we explain: The file structure for a Nerdpack, a Nerdlet, and a launcher How to link a launcher file to a Nerdlet How to link your application with a monitored entity For basic component definitions, see our component reference. Generate Nerdpack components There are two ways to generate a Nerdpack template: Generate a Nerdpack: Use the New Relic One CLI command nr1 create and select Nerdpack to create a Nerdpack template that includes a Nerdlet and a launcher. Generate Nerdlet or launcher individually: Use the New Relic One CLI command nr1 create and choose either Nerdlet or launcher. This can be useful when adding Nerdlets to an existing Nerdpack. For documentation on generating and connecting Nerdpack components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │   └── my-nerdlet-launcher │   ├── icon.png │   └── nr1.json ├── nerdlets │   └── my-nerdlet-nerdlet │   ├── index.js │   ├── nr1.json │   └── styles.scss ├── node_modules │   ├── js-tokens │   ├── loose-envify │   ├── object-assign │   ├── prop-types │   ├── react │   ├── react-dom │   ├── react-is │   └── scheduler ├── nr1.json ├── package-lock.json └── package.json Copy Nerdlet file structure A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files, index.js, nr1.json, and styles.scss. Here is what the default files look like after being generated using the nr1 create command: index.js The JavaScript code of the Nerdlet. import React from 'react'; export default class MyAwesomeNerdpack extends React.Component { render() { return

Hello, my-awesome-nerdpack Nerdlet!

; } } Copy nr1.json The Nerdlet configuration file. { \"schemaType\": \"NERDLET\", \"id\": \"my-awesome-nerdpack-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\" } Copy Besides using the launcher as the access point for your application, you can also associate the application with a monitored entity to get it to appear in the entity explorer. To do this, add two additional fields to the config file of the first-launched Nerdlet: entities and actionCategory. In the following example, the Nerdlet has been associated with all Browser-monitored applications and will appear under the Monitor UI category : { \"schemaType\": \"NERDLET\", \"id\": \"my-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"Custom Data\", \"entities\": [{ \"domain\": \"BROWSER\", \"type\": \"APPLICATION\" }], \"actionCategory\": \"monitor\" } Copy To see this application in the UI, you would go to the entity explorer, select Browser applications, and select a monitored application. styles.scss An empty SCSS file for styling your application. icon.png The launcher icon that appears on the Apps page in New Relic One when an application is deployed. Launcher file structure Launchers have their own file structure. Note that: A launcher is not required; as an alternative to using a launcher, you can associate your application with a monitored entity. An application can have more than one launcher, which might be desired for an application with multiple Nerdlets. After generating a launcher using the nr1 create command, its folder contains two files: nr1.json The configuration file. { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy To connect a launcher to a Nerdlet, the rootNerdletId must match the id in the launched Nerdlet's nr1.json config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet. icon.png The icon displayed on the launcher for the app on the Apps page.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 194.0287, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "Nerdpack file structure", - "sections": "Nerdpack file structure", - "info": "An overview of the Nerdpack File Structure", - "tags": "file structure", - "body": " components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │   └── my-nerdlet-launcher │   ├── icon.png" - }, - "id": "5efa989e196a671300766404" - }, - { - "sections": [ - "Map page views by region in a custom app", - "Before you begin", - "New Relic terminology", - "Build a custom app with a table chart", - "Query your browser data", - "Create and serve a new Nerdpack", - "Review your app files and view your app locally", - "Hard code your account ID", - "Import the TableChart component", - "Add a table with a single row", - "Customize the look of your table (optional)", - "Get your data into that table", - "Make your app interactive with a text field", - "Import the TextField component", - "Add a row for your text field", - "Build the text field object", - "Get your data on a map", - "Install Leaflet", - "Add a webpack config file for Leaflet", - "Import modules from Leaflet", - "Import additional modules from New Relic One", - "Get data for the map", - "Customize the map marker colors", - "Set your map's default center point", - "Add a row for your map", - "Replace \"Hello\" with the Leaflet code" - ], - "title": "Map page views by region in a custom app", - "type": "developer", - "tags": [ - "custom app", - "map", - "page views", - "region", - "nerdpack" - ], - "external_id": "6ff5d696556512bb8d8b33fb31732f22bab455cb", - "image": "https://developer.newrelic.com/static/d87a72e8ee14c52fdfcb91895567d268/0086b/pageview.png", - "url": "https://developer.newrelic.com/build-apps/map-pageviews-by-region/", - "published_at": "2020-09-24T02:27:37Z", - "updated_at": "2020-09-17T01:48:42Z", - "document_type": "page", - "popularity": 1, - "info": "Build a New Relic app showing page view data on a world map.", - "body": "Map page views by region in a custom app 30 min New Relic has powerful and flexible tools for building custom apps and populating them with data. This guide shows you how to build a custom app and populate it with page view data using New Relic's Query Language (NRQL - pronounced 'nurkle'). Then you make your data interactive. And last, if you have a little more time and want to install a third-party React library, you can display the page view data you collect on a map of the world. In this guide, you build an app to display page view data in two ways: In a table On a map Please review the Before you begin section to make sure you have everything you need and don't get stuck halfway through. Before you begin In order to get the most out of this guide, you must have: A New Relic developer account, API key, and the command-line tool. If you don't have these yet, see the steps in Setting up your development environment New Relic Browser page view data to populate the app. Without this data, you won't be able to complete this guide. To add your data to a world map in the second half of the guide: npm, which you'll use during this section of the guide to install Leaflet, a third-party JavaScript React library used to build interactive maps. If you're new to React and npm, you can go here to install Node.js and npm. New Relic terminology The following are some terms used in this guide: New Relic application: The finished product where data is rendered in New Relic One. This might look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One that launches your application. Nerdlets: New Relic React components used to build your application. The three default files are index.js, nr1.json, and styles.scss, but you can customize and add your own. Build a custom app with a table chart Step 1 of 8 Query your browser data Use Query builder to write a NRQL query to see your page view data, as follows. On New Relic One, select Query your data (in the top right corner). That puts you in NRQL mode. You'll use NRQL to test your query before dropping the data into your table. Copy and paste this query into a clear query field, and then select Run. FROM PageView SELECT count(*), average(duration) WHERE appName = 'WebPortal' FACET countryCode, regionCode SINCE 1 week ago LIMIT 1000 Copy If you have PageView data, this query shows a week of average page views broken down by country and limited to a thousand items. The table will be full width and use the \"chart\" class defined in the CSS. If you don't have any results at this point, ensure your query doesn't have any errors. If your query is correct, you might not have the Browser agent installed. Step 2 of 8 Create and serve a new Nerdpack To get started, create a new Nerdpack, and serve it up to New Relic from your local development environment: Create a new Nerdpack for this app: nr1 create --type nerdpack --name pageviews-app Copy Serve the project up to New Relic: cd pageviews-app && nr1 nerdpack:serve Copy Step 3 of 8 Review your app files and view your app locally Navigate to your pageviews-app to see how it's structured. It contains a launcher folder, where you can customize the description and icon that will be displayed on the app's launcher in New Relic One. It also contains nerdlets, which each contain three default files: index.js, nr1.json, and styles.scss. You'll edit some of these files as part of this guide. For more information, see Nerdpack file structure. Now in your browser, open https://one.newrelic.com/?nerdpacks=local, and then click Apps to see the pageview-apps Nerdpack that you served up. When you select the launcher, you see a Hello message. Step 4 of 8 Hard code your account ID For the purposes of this exercise and for your convenience, hard code your account ID. In the pageview-app-nerdlet directory, in the index.js file, add this code between the import and export lines. (Read about finding your account ID here). const accountId = [Replace with your account ID]; Copy Step 5 of 8 Import the TableChart component To show your data in a table chart, import the TableChart component from New Relic One. To do so, in index.js, add this code under import React. import { TableChart } from 'nr1'; Copy Step 6 of 8 Add a table with a single row To add a table with a single row, in the index.js file, replace this line: return

Hello, pageview-app-nerdlet Nerdlet!

; Copy with this export code: export default class PageViewApp extends React.Component { render() { return (
); } } Copy Step 7 of 8 Customize the look of your table (optional) You can use standard CSS to customize the look of your components. In the styles.scss file, add this CSS. Feel free to customize this CSS to your taste. .container { width: 100%; height: 99vh; display: flex; flex-direction: column; .row { margin: 10px; display: flex; flex-direction: row; } .chart { height: 250px; } } Copy Step 8 of 8 Get your data into that table Now that you've got a table, you can drop a TableChart populated with data from the NRQL query you wrote at the very beginning of this guide. Put this code into the row div. ; Copy Go to New Relic One and click your app to see your data in the table. (You might need to serve your app to New Relic again.) Congratulations! You made your app! Continue on to make it interactive and show your data on a map. Make your app interactive with a text field Once you confirm that data is getting to New Relic from your app, you can start customizing it and making it interactive. To do this, you add a text field to filter your data. Later, you use a third-party library called Leaflet to show that data on a world map. Step 1 of 3 Import the TextField component Like you did with the TableChart component, you need to import a TextField component from New Relic One. import { TextField } from 'nr1'; Copy Step 2 of 3 Add a row for your text field To add a text field filter above the table, put this code above the TableChart div. The text field will have a default value of \"US\".
{ this.setState({ countryCode: event.target.value }); }} />
; Copy Step 3 of 3 Build the text field object Above the render() function, add a constructor to build the text field object. constructor(props) { super(props); this.state = { countryCode: null } } Copy Then, add a constructor to your render() function. Above return, add: const { countryCode } = this.state; Copy Now add countryCode to your table chart query. ; Copy Reload your app to try out the text field. Get your data on a map To create the map, you use npm to install Leaflet. Step 1 of 9 Install Leaflet In your terminal, type: npm install --save leaflet react-leaflet Copy In your nerdlets styles.scss file, import the Leaflet CSS: @import `~leaflet/dist/leaflet.css`; Copy While you're in styles.scss, fix the width and height of your map: .containerMap { width: 100%; z-index: 0; height: 70vh; } Copy Step 2 of 9 Add a webpack config file for Leaflet Add a webpack configuration file .extended-webpackrc.js to the top-level folder in your nerdpack. This supports your use of map tiling information data from Leaflet. module.exports = { module: { rules: [ { test: /\\.(png|jpe?g|gif)$/, use: [ { loader: 'file-loader', options: {}, }, { loader: 'url-loader', options: { limit: 25000 }, }, ], }, ], }, }; Copy Step 3 of 9 Import modules from Leaflet In index.js, import modules from Leaflet. import { Map, CircleMarker, TileLayer } from 'react-leaflet'; Copy Step 4 of 9 Import additional modules from New Relic One You need several more modules from New Relic One to make the Leaflet map work well. Import them with this code: import { NerdGraphQuery, Spinner, Button, BlockText } from 'nr1'; Copy NerdGraphQuery lets you make multiple NRQL queries at once and is what will populate the map with data. Spinner adds a loading spinner. Button gives you button components. BlockText give you block text components. Step 5 of 9 Get data for the map Using latitude and longitude with country codes, you can put New Relic data on a map. mapData() { const { countryCode } = this.state; const query = `{ actor { account(id: 1606862) { mapData: nrql(query: \"SELECT count(*) as x, average(duration) as y, sum(asnLatitude)/count(*) as lat, sum(asnLongitude)/count(*) as lng FROM PageView FACET regionCode, countryCode WHERE appName = 'WebPortal' ${countryCode ? ` WHERE countryCode like '%${countryCode}%' ` : ''} LIMIT 1000 \") { results nrql } } } }`; return query; }; Copy Step 6 of 9 Customize the map marker colors Above the mapData function, add this code to customize the map marker colors. getMarkerColor(measure, apdexTarget = 1.7) { if (measure <= apdexTarget) { return '#11A600'; } else if (measure >= apdexTarget && measure <= apdexTarget * 4) { return '#FFD966'; } else { return '#BF0016'; } }; Copy Feel free to change the HTML color code values to your taste. In this example, #11A600 is green, #FFD966 is sort of yellow, and #BF0016 is red. Step 7 of 9 Set your map's default center point Set a default center point for your map using latitude and longitude. const defaultMapCenter = [10.5731, -7.5898]; Copy Step 8 of 9 Add a row for your map Between the text field row and the table chart row, insert a new row for the map content using NerdGraphQuery.
{({ loading, error, data }) => { if (loading) { return ; } if (error) { return 'Error'; } const { results } = data.actor.account.mapData; console.debug(results); return 'Hello'; }}
; Copy Reload your application in New Relic One to test that it works. Step 9 of 9 Replace \"Hello\" with the Leaflet code Replace return \"Hello\"; with: return ( {results.map((pt, i) => { const center = [pt.lat, pt.lng]; return ( { alert(JSON.stringify(pt)); }} /> ); })} ); Copy This code creates a world map centered on the latitude and longitude you chose using OpenStreetMap data and your marker colors. Reload your app to see the pageview data on the map!", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 172.14145, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "sections": "Create and serve a new Nerdpack", - "tags": "nerdpack", - "body": " look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One" - }, - "id": "5efa993c196a67066b766469" - }, - { - "image": "", - "url": "https://developer.newrelic.com/explore-docs/nr1-common/", - "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" - ], - "published_at": "2020-09-24T02:28:37Z", - "title": "New Relic One CLI common commands", - "updated_at": "2020-08-14T01:48:10Z", - "type": "developer", - "external_id": "503e515e1095418f8d19329517344ab209d143a4", - "document_type": "page", - "popularity": 1, - "info": "An overview of common commands you can use with the New Relic One CLI.", - "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 165.17108, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "New Relic One CLI common commands", - "sections": "New Relic One CLI common commands", - "info": "An overview of common commands you can use with the New Relic One CLI.", - "body": " 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" - }, - "id": "5f28bd6ae7b9d267996ade94" - }, - { - "sections": [ - "New Relic One CLI reference", - "Installing the New Relic One CLI", - "Tip", - "New Relic One CLI Commands", - "Get started", - "Configure your CLI preferences", - "Set up your Nerdpacks", - "Manage your Nerdpack subscriptions", - "Install and manage plugins", - "Manage catalog information" - ], - "title": "New Relic One CLI reference", - "type": "developer", - "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-09-24T02:26:06Z", - "updated_at": "2020-09-17T01:51:10Z", - "document_type": "page", - "popularity": 1, - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. 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. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. 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.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 129.03885, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "New Relic One CLI reference", - "sections": "New Relic One CLI reference", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "tags": "New Relic One app", - "body": ". For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet" - }, - "id": "5efa989e28ccbc535a307dd0" - } - ], - "/explore-docs/nerdpack-file-structure": [ - { - "sections": [ - "Create a \"Hello, World!\" application", - "Before you begin", - "Tip", - "Create a local version of the \"Hello, World!\" application", - "Publish your application to New Relic", - "Add details to describe your project", - "Subscribe accounts to your application", - "Summary", - "Related information" - ], - "title": "Create a \"Hello, World!\" application", - "type": "developer", - "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-09-24T02:27:37Z", - "updated_at": "2020-08-21T01:45:19Z", - "document_type": "page", - "popularity": 1, - "info": "Build a \"Hello, World!\" app and publish it to New Relic One", - "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack manager or admin role can subscribe to an application from accounts that they have permission to manage. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 445.89587, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "sections": "Publish your application to New Relic", - "info": "Build a "Hello, World!" app and publish it to New Relic One", - "tags": "Nerdpack file structure", - "body": "!" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit" - }, - "id": "5efa9973196a67d16d76645c" - }, - { - "sections": [ - "New Relic One CLI reference", - "Installing the New Relic One CLI", - "Tip", - "New Relic One CLI Commands", - "Get started", - "Configure your CLI preferences", - "Set up your Nerdpacks", - "Manage your Nerdpack subscriptions", - "Install and manage plugins", - "Manage catalog information" - ], - "title": "New Relic One CLI reference", - "type": "developer", - "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-09-24T02:26:06Z", - "updated_at": "2020-09-17T01:51:10Z", - "document_type": "page", - "popularity": 1, - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. 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. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. 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.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 428.76324, + "_score": 189.15727, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI reference", - "sections": "New Relic One CLI reference", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "tags": "New Relic One app", - "body": " CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build" + "title": "Nerdpack file structure", + "sections": "Nerdpack file structure", + "info": "An overview of the Nerdpack File Structure", + "tags": "file structure", + "body": " components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │   └── my-nerdlet-launcher │   ├── icon.png" }, - "id": "5efa989e28ccbc535a307dd0" + "id": "5efa989e196a671300766404" }, { "sections": [ @@ -5212,7 +5206,7 @@ "external_id": "6ff5d696556512bb8d8b33fb31732f22bab455cb", "image": "https://developer.newrelic.com/static/d87a72e8ee14c52fdfcb91895567d268/0086b/pageview.png", "url": "https://developer.newrelic.com/build-apps/map-pageviews-by-region/", - "published_at": "2020-09-24T02:27:37Z", + "published_at": "2020-09-25T01:51:37Z", "updated_at": "2020-09-17T01:48:42Z", "document_type": "page", "popularity": 1, @@ -5220,59 +5214,17 @@ "body": "Map page views by region in a custom app 30 min New Relic has powerful and flexible tools for building custom apps and populating them with data. This guide shows you how to build a custom app and populate it with page view data using New Relic's Query Language (NRQL - pronounced 'nurkle'). Then you make your data interactive. And last, if you have a little more time and want to install a third-party React library, you can display the page view data you collect on a map of the world. In this guide, you build an app to display page view data in two ways: In a table On a map Please review the Before you begin section to make sure you have everything you need and don't get stuck halfway through. Before you begin In order to get the most out of this guide, you must have: A New Relic developer account, API key, and the command-line tool. If you don't have these yet, see the steps in Setting up your development environment New Relic Browser page view data to populate the app. Without this data, you won't be able to complete this guide. To add your data to a world map in the second half of the guide: npm, which you'll use during this section of the guide to install Leaflet, a third-party JavaScript React library used to build interactive maps. If you're new to React and npm, you can go here to install Node.js and npm. New Relic terminology The following are some terms used in this guide: New Relic application: The finished product where data is rendered in New Relic One. This might look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One that launches your application. Nerdlets: New Relic React components used to build your application. The three default files are index.js, nr1.json, and styles.scss, but you can customize and add your own. Build a custom app with a table chart Step 1 of 8 Query your browser data Use Query builder to write a NRQL query to see your page view data, as follows. On New Relic One, select Query your data (in the top right corner). That puts you in NRQL mode. You'll use NRQL to test your query before dropping the data into your table. Copy and paste this query into a clear query field, and then select Run. FROM PageView SELECT count(*), average(duration) WHERE appName = 'WebPortal' FACET countryCode, regionCode SINCE 1 week ago LIMIT 1000 Copy If you have PageView data, this query shows a week of average page views broken down by country and limited to a thousand items. The table will be full width and use the \"chart\" class defined in the CSS. If you don't have any results at this point, ensure your query doesn't have any errors. If your query is correct, you might not have the Browser agent installed. Step 2 of 8 Create and serve a new Nerdpack To get started, create a new Nerdpack, and serve it up to New Relic from your local development environment: Create a new Nerdpack for this app: nr1 create --type nerdpack --name pageviews-app Copy Serve the project up to New Relic: cd pageviews-app && nr1 nerdpack:serve Copy Step 3 of 8 Review your app files and view your app locally Navigate to your pageviews-app to see how it's structured. It contains a launcher folder, where you can customize the description and icon that will be displayed on the app's launcher in New Relic One. It also contains nerdlets, which each contain three default files: index.js, nr1.json, and styles.scss. You'll edit some of these files as part of this guide. For more information, see Nerdpack file structure. Now in your browser, open https://one.newrelic.com/?nerdpacks=local, and then click Apps to see the pageview-apps Nerdpack that you served up. When you select the launcher, you see a Hello message. Step 4 of 8 Hard code your account ID For the purposes of this exercise and for your convenience, hard code your account ID. In the pageview-app-nerdlet directory, in the index.js file, add this code between the import and export lines. (Read about finding your account ID here). const accountId = [Replace with your account ID]; Copy Step 5 of 8 Import the TableChart component To show your data in a table chart, import the TableChart component from New Relic One. To do so, in index.js, add this code under import React. import { TableChart } from 'nr1'; Copy Step 6 of 8 Add a table with a single row To add a table with a single row, in the index.js file, replace this line: return

Hello, pageview-app-nerdlet Nerdlet!

; Copy with this export code: export default class PageViewApp extends React.Component { render() { return (
); } } Copy Step 7 of 8 Customize the look of your table (optional) You can use standard CSS to customize the look of your components. In the styles.scss file, add this CSS. Feel free to customize this CSS to your taste. .container { width: 100%; height: 99vh; display: flex; flex-direction: column; .row { margin: 10px; display: flex; flex-direction: row; } .chart { height: 250px; } } Copy Step 8 of 8 Get your data into that table Now that you've got a table, you can drop a TableChart populated with data from the NRQL query you wrote at the very beginning of this guide. Put this code into the row div. ; Copy Go to New Relic One and click your app to see your data in the table. (You might need to serve your app to New Relic again.) Congratulations! You made your app! Continue on to make it interactive and show your data on a map. Make your app interactive with a text field Once you confirm that data is getting to New Relic from your app, you can start customizing it and making it interactive. To do this, you add a text field to filter your data. Later, you use a third-party library called Leaflet to show that data on a world map. Step 1 of 3 Import the TextField component Like you did with the TableChart component, you need to import a TextField component from New Relic One. import { TextField } from 'nr1'; Copy Step 2 of 3 Add a row for your text field To add a text field filter above the table, put this code above the TableChart div. The text field will have a default value of \"US\".
{ this.setState({ countryCode: event.target.value }); }} />
; Copy Step 3 of 3 Build the text field object Above the render() function, add a constructor to build the text field object. constructor(props) { super(props); this.state = { countryCode: null } } Copy Then, add a constructor to your render() function. Above return, add: const { countryCode } = this.state; Copy Now add countryCode to your table chart query. ; Copy Reload your app to try out the text field. Get your data on a map To create the map, you use npm to install Leaflet. Step 1 of 9 Install Leaflet In your terminal, type: npm install --save leaflet react-leaflet Copy In your nerdlets styles.scss file, import the Leaflet CSS: @import `~leaflet/dist/leaflet.css`; Copy While you're in styles.scss, fix the width and height of your map: .containerMap { width: 100%; z-index: 0; height: 70vh; } Copy Step 2 of 9 Add a webpack config file for Leaflet Add a webpack configuration file .extended-webpackrc.js to the top-level folder in your nerdpack. This supports your use of map tiling information data from Leaflet. module.exports = { module: { rules: [ { test: /\\.(png|jpe?g|gif)$/, use: [ { loader: 'file-loader', options: {}, }, { loader: 'url-loader', options: { limit: 25000 }, }, ], }, ], }, }; Copy Step 3 of 9 Import modules from Leaflet In index.js, import modules from Leaflet. import { Map, CircleMarker, TileLayer } from 'react-leaflet'; Copy Step 4 of 9 Import additional modules from New Relic One You need several more modules from New Relic One to make the Leaflet map work well. Import them with this code: import { NerdGraphQuery, Spinner, Button, BlockText } from 'nr1'; Copy NerdGraphQuery lets you make multiple NRQL queries at once and is what will populate the map with data. Spinner adds a loading spinner. Button gives you button components. BlockText give you block text components. Step 5 of 9 Get data for the map Using latitude and longitude with country codes, you can put New Relic data on a map. mapData() { const { countryCode } = this.state; const query = `{ actor { account(id: 1606862) { mapData: nrql(query: \"SELECT count(*) as x, average(duration) as y, sum(asnLatitude)/count(*) as lat, sum(asnLongitude)/count(*) as lng FROM PageView FACET regionCode, countryCode WHERE appName = 'WebPortal' ${countryCode ? ` WHERE countryCode like '%${countryCode}%' ` : ''} LIMIT 1000 \") { results nrql } } } }`; return query; }; Copy Step 6 of 9 Customize the map marker colors Above the mapData function, add this code to customize the map marker colors. getMarkerColor(measure, apdexTarget = 1.7) { if (measure <= apdexTarget) { return '#11A600'; } else if (measure >= apdexTarget && measure <= apdexTarget * 4) { return '#FFD966'; } else { return '#BF0016'; } }; Copy Feel free to change the HTML color code values to your taste. In this example, #11A600 is green, #FFD966 is sort of yellow, and #BF0016 is red. Step 7 of 9 Set your map's default center point Set a default center point for your map using latitude and longitude. const defaultMapCenter = [10.5731, -7.5898]; Copy Step 8 of 9 Add a row for your map Between the text field row and the table chart row, insert a new row for the map content using NerdGraphQuery.
{({ loading, error, data }) => { if (loading) { return ; } if (error) { return 'Error'; } const { results } = data.actor.account.mapData; console.debug(results); return 'Hello'; }}
; Copy Reload your application in New Relic One to test that it works. Step 9 of 9 Replace \"Hello\" with the Leaflet code Replace return \"Hello\"; with: return ( {results.map((pt, i) => { const center = [pt.lat, pt.lng]; return ( { alert(JSON.stringify(pt)); }} /> ); })} ); Copy This code creates a world map centered on the latitude and longitude you chose using OpenStreetMap data and your marker colors. Reload your app to see the pageview data on the map!", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 378.1358, + "_score": 162.5816, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Import additional modules from New Relic One", - "info": "Build a New Relic app showing page view data on a world map.", + "sections": "Create and serve a new Nerdpack", "tags": "nerdpack", - "body": " look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One" + "body": " look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One" }, "id": "5efa993c196a67066b766469" }, - { - "sections": [ - "Add tables to your New Relic One application", - "Before you begin", - "Clone and set up the example application", - "Work with table components", - "Next steps" - ], - "title": "Add tables to your New Relic One application", - "type": "developer", - "tags": [ - "table in app", - "Table component", - "TableHeaderc omponent", - "TableHeaderCell component", - "TableRow component", - "TableRowCell component" - ], - "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-09-24T02:28:37Z", - "updated_at": "2020-09-17T01:48:42Z", - "document_type": "page", - "popularity": 1, - "info": "Add a table to your New Relic One app.", - "body": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application. In this guide, you are going to build a sample table using various New Relic One components. Before you begin If you haven't already installed the New Relic One CLI, step through the quick start in New Relic One. This process also gets you an API key. In addition, to complete the steps in this guide, you need a GitHub account and Node.js installed on your machine. See Setting up your development environment for more info. Clone and set up the example application Step 1 of 4 Clone the nr1-how-to example application from GitHub to your local machine. Then, navigate to the app directory. The example app lets you experiment with tables. git clone https://github.com/newrelic/nr1-how-to.git` cd nr1-how-to/create-a-table/nerdlets/create-a-table-nerdlet` Copy Step 2 of 4 Edit the index.json file and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install dependencies nr1 nerdpack:serve # Serve the demo app locally Copy Step 4 of 4 Open one.newrelic.com/?nerdpacks=local in your browser. Click Apps, and then in the Your apps section, you should see a Create a table launcher. That's the demo application you're going to work on. Go ahead and select it. Have a good look at the demo app. There's a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You'll use Table components to add a new table in the second row. Work with table components Step 1 of 10 Navigate to the nerdlets/create-a-table-nerdlet subdirectory and open the index.js file. Add the following components to the import statement at the top of the file so that it looks like the example: Table TableHeader TableHeaderCell TableRow TableRowCell import { Table, TableHeader, TableHeaderCell, TableRow, TableRowCell, PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart, } from 'nr1'; Copy Step 2 of 10 Add a basic Table component Locate the empty GridItem in index.js: This is where you start building the table. Add the initial component. The items property collects the data by calling _getItems(), which contains sample values.
; Copy Step 3 of 10 Add the header and rows As the Table component renders a fixed number of header cells and rows, your next step is adding header components, as well as a function that returns the required table rows. Inside of the Table component, add the TableHeader and then a TableHeaderCell child for each heading. Since you don't know how many rows you'll need, your best bet is to call a function to build as many TableRows as items returned by _getItems(). Application Size Company Team Commit ; { ({ item }) => ( {item.name} {item.value} {item.company} {item.team} {item.commit} ); } Copy Step 4 of 10 Take a look at the application running in New Relic One: you should see something similar to the screenshot below. Step 5 of 10 Replace standard table cells with smart cells The New Relic One library includes cell components that can automatically format certain data types, like users, metrics, and entity names. The table you've just created contains columns that can benefit from those components: Application (an entity name) and Size (a metric). Before you can use EntityTitleTableRowCell and MetricTableRowCell, you have to add them to the import statement first. import { EntityTitleTableRowCell, MetricTableRowCell, ... /* All previous components */ } from 'nr1'; Copy Step 6 of 10 Update your table rows by replacing the first and second TableRowCells with entity and metric cells. Notice that EntityTitleTableRowCell and MetricTableRowCell are self-closing tags. { ({ item }) => ( {item.company} {item.team} {item.commit} ); } Copy Step 7 of 10 Time to give your table a second look: The cell components you've added take care of properly formatting the data. Step 8 of 10 Add some action to your table! Tables are great, but interactive tables can be better: As a last update, you are going to allow users to act on each data row. Add the _getActions() method to your index.js file, right before _getItems(). As you may have guessed from the code, _getActions() spawns an alert box when you click Team or Commit cells. _getActions() { return [ { label: 'Alert Team', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__ALERT, onClick: (evt, { item, index }) => { alert(`Alert Team: ${item.team}`); }, }, { label: 'Rollback Version', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__UNDO, onClick: (evt, { item, index }) => { alert(`Rollback from: ${item.commit}`); }, }, ]; } Copy Step 9 of 10 Find the TableRow component in your return statement and point the actions property to _getActions(). The TableRow actions property defines a set of actions that appear when the user hovers over a table row. Actions have a mandatory text and an onClick callback, but can also display an icon or be disabled if needed. Copy Step 10 of 10 Go back to your application and try hovering over any of the rows: Notice how the two available actions appear. When you click them, a function triggers with the selected row data as an argument, and an alert displays in your browser. Next steps You've built a table into a New Relic One application, using components to format data automatically and provide contextual actions. Well done! Keep exploring the Table components, their properties, and how to use them, in our SDK documentation.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 343.6879, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "Add tables to your New Relic One application", - "sections": "Add tables to your New Relic One application", - "info": "Add a table to your New Relic One app.", - "body": " application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install" - }, - "id": "5efa989ee7b9d2ad567bab51" - }, { "image": "", "url": "https://developer.newrelic.com/explore-docs/nr1-common/", @@ -5297,7 +5249,7 @@ "nr1 nrql", "Query using NRQL" ], - "published_at": "2020-09-24T02:28:37Z", + "published_at": "2020-09-25T01:49:59Z", "title": "New Relic One CLI common commands", "updated_at": "2020-08-14T01:48:10Z", "type": "developer", @@ -5308,251 +5260,60 @@ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 304.35736, + "_score": 161.03578, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI common commands", - "sections": "New Relic One CLI common commands", - "info": "An overview of common commands you can use with the New Relic One CLI.", - "body": " update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL" + "title": "New Relic One CLI common commands", + "sections": "New Relic One CLI common commands", + "info": "An overview of common commands you can use with the New Relic One CLI.", + "body": " 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" }, "id": "5f28bd6ae7b9d267996ade94" - } - ], - "/automate-workflows/get-started-new-relic-cli": [ - { - "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png", - "url": "https://developer.newrelic.com/", - "sections": [ - "Mark your calendar for Nerd Days 1.0", - "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" - ], - "published_at": "2020-09-24T02:24:45Z", - "title": "New Relic Developers", - "updated_at": "2020-09-24T01:39:32Z", - "type": "developer", - "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab", - "document_type": "page", - "popularity": 1, - "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 19 Days : 14 Hours : 58 Minutes : 8 Seconds Register 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 20 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", - "info": "", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 340.13, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "New Relic Developers", - "sections": "New Relic developer champions", - "body": " 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" - }, - "id": "5d6fe49a64441f8d6100a50f" - }, - { - "image": "", - "url": "https://developer.newrelic.com/automate-workflows/", - "sections": [ - "Automate workflows", - "Guides to automate workflows", - "Quickly tag resources", - "Set up New Relic using Helm charts", - "Set up New Relic using the Kubernetes operator", - "Automatically tag a simple \"Hello World\" Demo across the entire stack", - "Automate common tasks", - "Set up New Relic using Terraform" - ], - "published_at": "2020-09-24T02:30:06Z", - "title": "Automate workflows", - "updated_at": "2020-09-24T01:55:00Z", - "type": "developer", - "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871", - "document_type": "page", - "popularity": 1, - "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 30 min Automatically tag a simple \"Hello World\" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform", - "info": "", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 319.20197, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "sections": "Set up New Relic using Helm charts", - "body": " resources using the Kubernetes operator 30 min Automatically tag a simple "Hello World" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform" - }, - "id": "5efa999c196a67dfb4766445" }, { "sections": [ - "Quickly tag a set of resources", - "Before you begin", - "Install the New Relic CLI", - "Linux", - "macOS", - "Windows", - "Create your New Relic CLI profile", - "Search for an entity", - "Add tags and tag lists to your entity", - "Note", - "Check that the tags are there", + "New Relic One CLI reference", + "Installing the New Relic One CLI", "Tip", - "Next steps" - ], - "title": "Quickly tag a set of resources", - "type": "developer", - "tags": [ - "tags", - "new relic CLI" - ], - "external_id": "c7c374812f8295e409a9b06d552de51ceefc666b", - "image": "", - "url": "https://developer.newrelic.com/automate-workflows/5-mins-tag-resources/", - "published_at": "2020-09-24T02:27:37Z", - "updated_at": "2020-08-14T01:45:08Z", - "document_type": "page", - "popularity": 1, - "info": "Add tags to applications you instrument for easier filtering and organization.", - "body": "Quickly tag a set of resources 5 min Tags help you group, search, filter, and focus the data about your entities, which can be anything from applications to hosts to services. Tagging entities using the New Relic CLI is a good candidate for automation. In this 5-minute guide, you use the New Relic CLI to add multiple tags to one of your entities. Before you begin For this guide you need your New Relic personal API Key: Create it at the Account settings screen for your account. Step 1 of 6 Install the New Relic CLI You can download the New Relic CLI via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 6 Create your New Relic CLI profile New Relic CLI profiles contain credentials and settings that you can apply to any CLI command. To create your first CLI profile, run the profiles add command. Don't forget to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey API_KEY -r us # Set the profile as default newrelic profiles default -n tutorial Copy Step 3 of 6 Search for an entity Your New Relic account might have hundreds of entities: Have a quick look by opening the Entity explorer. In the terminal, run entity search to retrieve a list of entities from your account as JSON. In the example, you're searching for all entities with \"test\" in their name. # Change the `name` to match any of your existing entities newrelic entity search --name \"test\" Copy Step 4 of 6 If there are matching entities in your account, the query yields data in JSON format, similar to this workload example. Select an entity from the results and look for its guid value; the guid is the unique identifier of the entity. Write it down. { \"accountId\": 123456789, \"domain\": \"NR1\", \"entityType\": \"WORKLOAD_ENTITY\", \"guid\": \"F7B7AE59FDED4204B846FB08423DB18E\", \"name\": \"Test workload\", \"reporting\": true, \"type\": \"WORKLOAD\" }, Copy Step 5 of 6 Add tags and tag lists to your entity With your entity guid, you can add tags right away. You can do so by invoking the entities tags create command. What if you want to add multiple tags? You can use tag sets for that: While tags are key-value pairs separated by colons, tag sets are comma-separated lists of tags. For example: tag1:value1,tag2:value2 Note Adding tags is an asynchronous operation: it could take a little while for the tags to get created. # Adding a single tag newrelic entity tags create --guid GUID --tag key:value # Adding multiple tags newrelic entity tags create --guid GUID --tag tag1:test,tag2:test Copy Step 6 of 6 Check that the tags are there To make sure that the tags have been added to your entities, retrieve them using the entity tags get command. All tags associated with your entity are retrieved as a JSON array. newrelic entity tags get --guid GUID Tip Tags can be deleted at any time by invoking the entity tags delete command followed by the same arguments you used to create them. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Next steps Have a look at all the New Relic CLI commands. For example, you could create a New Relic workflow using workload create. If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 196.64154, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "Quickly tag a set of resources", - "sections": "Install the New Relic CLI", - "info": "Add tags to applications you instrument for easier filtering and organization.", - "tags": "new relic CLI", - "body": " by invoking the entity tags delete command followed by the same arguments you used to create them. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Next steps Have a look at all the New Relic CLI commands. For example" - }, - "id": "5efa999d64441fa74a5f7e2d" - }, - { - "category_2": "Trace API", - "nodeid": 35381, - "sections": [ - "Distributed tracing", + "New Relic One CLI Commands", "Get started", - "Enable and configure", - "Other requirements", - "UI and data", - "Trace API", - "Troubleshooting", - "Report traces via the Trace API (New Relic format)", - "Example: Use your tool’s native sampling", - "Example: Use Infinite Tracing", - "JSON requirements and recommendations", - "Attributes", - "Required attributes", - "Highly recommended attributes", - "Reserved attributes", - "Other attributes", - "Explore more about distributed tracing:", - "For more help" - ], - "title": "Report traces via the Trace API (New Relic format)", - "category_0": "Understand dependencies", - "type": "docs", - "category_1": "Distributed tracing", - "external_id": "ba16f3a71b78e24c23da821b64567398251bb217", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/Infinite_Tracing_GraphiQL_URL_Results_0_0.png", - "url": "https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/trace-api/report-new-relic-format-traces-trace-api", - "published_at": "2020-09-24T12:18:41Z", - "updated_at": "2020-09-24T12:18:40Z", - "breadcrumb": "Contents / Understand dependencies / Distributed tracing / Trace API", - "document_type": "page", - "popularity": 1, - "info": "For New Relic's Trace API: how to report traces using the New Relic format. ", - "body": "You can send traces in the New Relic format to our Trace API without using a New Relic agent or integration. This is useful if you want to integrate with sources that emit tracing data and require a backend for trace storage. Since distributed systems can generate a lot of trace data, telemetry tools rely on data sampling (filtering) to find the most useful subset of that data. When you send us your trace data, you have two options related to sampling: Use your tool’s native sampling: This approach sends the telemetry data directly to the Trace API and assumes you are relying on your telemetry tool to sample the data before the integration passes the data to New Relic. Even though your tool may be sampling data before the New Relic integration sends it, our Trace API may randomly sample out traces that exceed your rate limit. Use Infinite Tracing (limited release): This approach assumes you turn off sampling in your telemetry tool and then send all your data to a New Relic trace observer in AWS. The trace observer selects the most important and actionable traces using tail-based sampling and then sends your traces to our UI. To send Zipkin-formatted data to the Trace API, see our Zipkin instructions. We'll look at two examples for sending your telemetry data to New Relic, as well as how to structure your data: Example: Use your tool’s native sampling Example: Use Infinite Tracing JSON requirements and recommendations Attributes Example: Use your tool’s native sampling If you are using a telemetry tool that is sampling your trace data, you can send the data directly to New Relic. The following procedure explains how to send a test payload to the Trace API using the newrelic format. For details about how to structure your data, see JSON requirements and recommendations. Get an Insert API key: Go to: one.newrelic.com > account dropdown > Account settings > API keys, and select Insights API keys. If you don't have a key, create a new one by selecting Insert keys +. Insert your Insert API key into the following JSON and then send the JSON to our endpoint. curl -i -H \"Content-Type: application/json\" \\ -H \"Api-Key: YOUR_INSERT_API_KEY\" \\ -H 'Data-Format: newrelic' \\ -H 'Data-Format-Version: 1' \\ -X POST \\ -d '[ { \"common\": { \"attributes\": { \"service.name\": \"Test Service A\", \"host\": \"host123.test.com\" } }, \"spans\": [ { \"trace.id\": \"123456\", \"id\": \"ABC\", \"attributes\": { \"duration.ms\": 12.53, \"name\": \"/home\" } }, { \"trace.id\": \"123456\", \"id\": \"DEF\", \"attributes\": { \"service.name\": \"Test Service A\", \"host\": \"host456.test.com\", \"duration.ms\": 2.97, \"name\": \"/auth\", \"parent.id\": \"ABC\" } } ] } ]' 'https://trace-api.newrelic.com/trace/v1' If you're sending more than one POST, change the trace.id to a unique value. Sending the same payload or span id multiple times for the same trace.id may result in fragmented traces in the UI. If your test returned HTTP/1.1 202 Accepted, go to our UI to see a query of your test data using the span attribute service.name = Test Service A. Traces may take up to one minute to be processed by both the trace observer and the Trace API. Example: Use Infinite Tracing Infinite Tracing can examine all of your data and find the most useful traces. To get the biggest benefit from Infinite Tracing, you should turn off sampling in your telemetry tool and send all your trace data to the trace observer. To start using Infinite Tracing, please go to our sign-up page. The following steps show you how to find or create a trace observer endpoint using GraphQL and how to send a test payload using the newrelic format. For details about how to structure your data, see JSON requirements and recommendations. If you send your data to a trace observer in one of our EU provider regions, you'll still need a US-based New Relic account because the tail-based sampling data is reported to data centers in the United States. If you have questions, contact your account representative. Step A. Open NerdGraph API explorer Prepare to execute some GraphQL: Open NerdGraph API explorer. In the API key dropdown next to Tools, select your personal API key for your account under one of these options: Select an existing API Key Create a new API Key Step B. See if anyone in your organization has already created a trace observer endpoint The following steps show you how to execute a GraphQL query to find out if you can use an existing trace observer in your AWS region. If one isn't available, you can go to Step C. Create a new one. Copy the following query into the middle pane of the NerdGraph API explorer and replace YOUR_ACCOUNT_ID with your account ID (the number next to your account name in NerdGraph API explorer): { actor { account(id: YOUR_ACCOUNT_ID) { edge { tracing { traceObservers { errors { message type } traceObservers { endpoints { agent { host port } endpointType https { host port url } status } id name providerRegion } } } } } } } Click the triangle button to execute the query or press Ctrl+Enter. Check the right pane showing the results: In traceObservers, if you see an AWS region (providerRegion) appropriate for your location, copy its associated https: url value to use later as YOUR_TRACE_OBSERVER_URL in Send test data to the trace observer. If you don't see any values in traceObservers as shown below, continue to Step C. Create a new one. Step C. If you can't find an existing trace observer endpoint, create a new one If you didn't find a trace observer after running the query in the previous section, you need to create one. To do this, you execute a GraphQL mutation that passes your configuration details. Copy the following into the middle pane of the NerdGraph API explorer. mutation { edgeCreateTraceObserver(accountId: YOUR_ACCOUNT_ID, traceObserverConfigs: {name: \"YOUR_DESCRIPTIVE_NAME\", providerRegion: YOUR_PROVIDER_REGION}) { responses { errors { message type } traceObserver { endpoints { agent { host port } endpointType https { host port url } status } id name providerRegion } } } } Insert your own values into the mutation: Value Description YOUR_ACCOUNT_ID Replace this with your account ID (the number next to your account name in NerdGraph API explorer). YOUR_DESCRIPTIVE_NAME Replace this with a name that describes the services that report to this trace observer (for example, production or query services). YOUR_PROVIDER_REGION Replace this with the provider region enum value for your location: AWS_EU_WEST_1 AWS_US_EAST_1 AWS_US_WEST_2 Click the triangle button to execute the mutation or press Ctrl+Enter. In the right pane showing the results, copy the value of https: url to a text file so you can use it later as YOUR_TRACE_OBSERVER_URL in Send test data to the trace observer: Step D. Send data to the trace observer Here's a test that includes a sample payload with one trace and two spans from the same service: Test Service A. Follow these steps to send a test request: Get or generate your Insert API key so you can use it later in the test. Copy the following curl request into a text editor: curl request curl -i -H \"Content-Type: application/json\" \\ -H \"Api-Key: YOUR_INSERT_API_KEY\" \\ -H 'Data-Format: newrelic' \\ -H 'Data-Format-Version: 1' \\ -X POST \\ -d '[ { \"common\": { \"attributes\": { \"environment\": \"staging\" } }, \"spans\": [ { \"trace.id\": \"123456\", \"id\": \"ABC\", \"attributes\": { \"duration.ms\": 12.53, \"host\": \"host123.test.com\", \"name\": \"/home\", \"service.name\": \"Test Service A\" } }, { \"trace.id\": \"123456\", \"id\": \"DEF\", \"attributes\": { \"duration.ms\": 2.97, \"host\": \"host456.test.com\", \"error.message\": \"Invalid credentials\", \"name\": \"/auth\", \"parent.id\": \"ABC\", \"service.name\": \"Test Service B\" } } ] } ]' \\ 'YOUR_TRACE_OBSERVER_URL' Insert your own values into the curl request: Value Description YOUR_INSERT_API_KEY Replace this with your Insert API key (not the same as your personal API key for NerdGraph API explorer) YOUR_TRACE_OBSERVER_URL Replace this with the value under https: url from above. Copy the content of the text editor into a terminal, and then execute the request. If the test does not return HTTP/1.1 202 Accepted indicating success, check the following and try again: Confirm that you substituted the url (not host) value for YOUR_TRACE_OBSERVER_URL. Confirm that you only have single quotes around the value you inserted for YOUR_TRACE_OBSERVER_URL. Check that you are using the Insert API Key (not a license). If your test returned HTTP/1.1 202 Accepted, go to our UI to see a query of your test data using the span attribute service.name = Test Service A. Because the sample payload contains an error attribute, the error sampler will mark it for keeping. If you modify the payload to remove the error attributes, the random sampler may not choose to keep this particular trace. Traces may take up to one minute to be processed by both the trace observer and the Trace API. JSON requirements and recommendations Requirements and guidelines for trace JSON using the newrelic format: Each JSON payload is an array of objects. Each object should contain a required spans key. Each object may contain an optional common key. Use this if you want share information across multiple spans in a object. Any keys on a span have precedence over the same key in the common block. The value for spans key is a list of span objects. Certain attributes are required, and must be included either in the optional common block, or in each span. Recommended and custom attributes may be optionally included in a list of key/value pairs under a key named attributes, in the optional common block and/or in each span. In the following example POST, there are two spans, both of which will have the trace.id 12345 and the custom attribute host: host123.test.com. The first span has no parent.id, so that is the root of the trace; the second span's parent.id points to the ID of the first. [ { \"common\": { \"attributes\": { \"host\": \"host123.test.com\" } }, \"spans\": [ { \"trace.id\": \"12345\", \"id\": \"abc\", \"attributes\": { \"user.email\": \"bob@newr.com\", \"service.name\": \"my-service\", \"duration.ms\": 750, \"name\": \"my-span\" } }, { \"trace.id\": \"12345\", \"id\": \"def\", \"attributes\": { \"parent.id\": \"abc\", \"service.name\": \"second-service\", \"duration.ms\": 750, \"name\": \"second-span\" } } ] } ] Attributes Review the sections below describing the attributes for the attributes block of a newrelic formatted JSON POST. Required attributes Requests without these attributes will be rejected, and an NrIntegrationError will be generated. These are the only attributes that don't belong under attributes. attribute description id string Unique identifier for this span. trace.id string Unique identifier shared by all spans within a single trace. Highly recommended attributes While not required, these attributes should be included for the best experience with your data. They are included in the attributes section. attribute default description duration.ms float none Duration of this span in milliseconds. name string none The name of this span. parent.id string none The id of the caller of this span. Value is null if this is the root span. Traces without a root span will not displayed. service.name string none The name of the entity that created this span. timestamp long Defaults to the current time in UTC timezone if not provided. The span's start time in Epoch milliseconds. Reserved attributes These attributes are currently reserved for internal New Relic usage. While they are not explicitly blocked, we recommend not using them. attribute default description entity.name string service.name This is derived from the service.name attribute. entity.type string service The entity type is assumed to be a service. entity.guid string None The entity.guid is a derived value that uniquely identifies the entity in New Relic's backend. Other attributes You can add any arbitrary attributes you want, with the exception of the restricted attributes. For example, you might want to add attributes like customer.id or user.id to help you analyze your trace data. To learn how to control how spans appear in New Relic (for example, adding errors or setting a span as a datastore span), see Decorate spans. Explore more about distributed tracing: Learn where Trace API data shows up in the UI. Learn how to decorate spans for a richer, more detailed UI experience. For example, you can have spans show up as datastore spans or display errors. Learn about general data limits, required metadata, and response validation. If you don't see your trace data, see Troubleshooting. 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.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 182.85312, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "Report traces via the Trace API (New Relic format)", - "sections": "Report traces via the Trace API (New Relic format)", - "info": "For New Relic's Trace API: how to report traces using the New Relic format. ", - "category_2": "Trace API", - "body": "You can send traces in the New Relic format to our Trace API without using a New Relic agent or integration. This is useful if you want to integrate with sources that emit tracing data and require a backend for trace storage. Since distributed systems can generate a lot of trace data, telemetry", - "breadcrumb": "Contents / Understand dependencies / Distributed tracing / Trace API" - }, - "id": "5d89dc6028ccbc83ce9cb16f" - }, - { - "category_2": "Logs in context for Ruby", - "nodeid": 35726, - "sections": [ - "Enable log management", - "New Relic Logs", - "Enable log monitoring", - "Configure logs in context", - "Logs in context for Go", - "Logs in context for Java", - "Logs in context for .NET", - "Logs in context for Node.js", - "Logs in context for PHP", - "Logs in context for Python", - "Logs in context for Ruby", - "Logs in context with agent APIs", - "Configure logs in context for Ruby", - "Compatibility and requirements", - "Configure logs in context with log management", - "Install or update the Ruby agent", - "Configure for Rails", - "Rails advanced configuration", - "Configure for Ruby without Rails", - "Advanced configuration", - "Custom logger configuration", - "Lograge configuration", - "Check for logging data", - "Troubleshooting", - "Incompatible gems", - "What's next?", - "For more help" + "Configure your CLI preferences", + "Set up your Nerdpacks", + "Manage your Nerdpack subscriptions", + "Install and manage plugins", + "Manage catalog information" ], - "title": "Configure logs in context for Ruby", - "category_0": "Log management", - "type": "docs", - "category_1": "Enable log management", - "external_id": "39429728c3bc0c83479db2ebe30dee4a31efd2b3", - "image": "", - "url": "https://docs.newrelic.com/docs/logs/enable-log-management-new-relic/logs-context-ruby/configure-logs-context-ruby", - "published_at": "2020-09-24T11:09:47Z", - "updated_at": "2020-09-24T11:09:47Z", - "breadcrumb": "Contents / Log management / Enable log management / Logs in context for Ruby", + "title": "New Relic One CLI reference", + "type": "developer", + "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-09-25T01:49:59Z", + "updated_at": "2020-09-17T01:51:10Z", "document_type": "page", "popularity": 1, - "info": "A description of the logs in context configuration process for the Ruby agent.", - "body": "Logs in context for the Ruby agent connects your logs and APM data in New Relic, giving full context to high-level events and providing high value data to specific log lines. Read on to learn how to configure logs in context and enrich your log data. Compatibility and requirements To use log management with the Ruby agent, ensure your configuration meets the following requirements: Ruby agent 6.7.0 or higher: Install or update Supported Rails version (for Rails applications) Configure logs in context with log management To configure logs in context with Ruby: Enable log management with a compatible log forwarding plugin. Install or update the Ruby agent. Configure logs in context for Ruby. Optional: Advanced configuration. Check for logging data. Enable log management Confirm that you have log management enabled, with a compatible log forwarding plugin installed to send your application logs to New Relic. Install or update the Ruby agent Install or update to the most recent Ruby agent version, and enable distributed tracing. Configure logs in context for Ruby Configure for Rails Rails logging is controlled by two components: a logger (customizable by setting config.logger) and a log formatter (customizable by setting config.log_formatter). In most cases, logs in context should be configured by setting config.log_formatter to the DecoratingFormatter in your Rails application. For more guidance regarding Rails configuration, see Configuring Rails Applications. In your application's config, require 'newrelic_rpm', then add the following line: module ________ class Application < Rails::Application ... config.log_formatter = ::NewRelic::Agent::Logging::DecoratingFormatter.new end end This will use the New Relic formatter to format log messages, but the rest of the logging configuration will be provided by the other Rails config settings. Please note that Logs in Context for Ruby does not currently support tagged logging; if you are initializing your logger with a log_tags argument, your custom tags may not appear on the final version of your logs. Rails advanced configuration If setting the log_formatter option doesn't meet your needs, replace the entire Rails logger with an instance of the New Relic logger. Provide the parameters to the logger's constructor, like this: module ________ class Application < Rails::Application ... config.logger = ::NewRelic::Agent::Logging::DecoratingLogger.new( \"log/application.log\", #etc... ) end end Configure for Ruby without Rails For non-Rails applications, use the DecoratingLogger in place of the Ruby standard ::Logger, like this: logger = ::NewRelic::Agent::Logging::DecoratingLogger.new( 'log/application.log', #etc... ) ... logger.info(...) The DecoratingLogger is a drop-in replacement for the Ruby standard ::Logger. Their constructors accept the same parameters. Advanced configuration Custom logger configuration To use our logging extension with a different logging implementation, or your own custom logger, use the DecoratingFormatter. Example: module ________ class Application < Rails::Application ... config.logger = ::YourCustomLoggerImplementation.new( $stdout, formatter: ::NewRelic::Agent::Logging::DecoratingFormatter.new ) end end Lograge configuration To configure this extension with the lograge gem, there is no additional configuration required. Check for logging data If you have configured your logging in /config/application.rb, or in /config/environments/development.rb, run your application locally and check its logging output. You should see some output like this: {\"entity.name\":\"your_app_name\",\"entity.type\":\"SERVICE\",\"hostname\":\"79bcbf8d\",\"trace.id\":\"79bcbf8d\",\"span.id\":\"00fc7d46\",\"timestamp\":1567701375543,\"message\":\"example log message one\",\"log.level\":\"DEBUG\"} {\"entity.name\":\"your_app_name\",\"entity.type\":\"SERVICE\",\"hostname\":\"79bcbf8d\",\"trace.id\":\"79bcbf8d\",\"span.id\":\"6754870b\",\"timestamp\":1567702843604,\"message\":\"example log message two\",\"log.level\":\"DEBUG\"} If you have deployed this application to an environment with a log forwarder, your application's logs will appear in the New Relic Logs UI with metadata linking them to a trace and a span. You can find them using a query like this: entity.name:\"your_app_name\" has:trace.id If you see JSON logs in your application's output, but no logs returned by a query like the above, check your log forwarder. Troubleshooting If the logs from your application are not formatted in JSON with fields like trace.id and span.id, there may be a problem with the configuration of the New Relic Logging Extension. Check that: the application is using a supported logging framework. the configuration has been applied to all the environments where you would like to use the New Relic Logging Extension. there is not another logger configured later in the configuration of the application. Incompatible gems The New Relic decorating logger is known to be incompatible with the following gems: logging semantic logger rails_stdout_logger rails_12factor What's next? Now that you've set up APM logs in context, here are some potential next steps: Explore your data using the Logs UI. Troubleshoot errors with distributed tracing, stack traces, application logs, and more. Query your data and create custom dashboards or alerts. For more help", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. 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. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 182.35138, + "_score": 124.54005, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "New Relic Logs", - "body": "Logs in context for the Ruby agent connects your logs and APM data in New Relic, giving full context to high-level events and providing high value data to specific log lines. Read on to learn how to configure logs in context and enrich your log data. Compatibility and requirements To use log" + "title": "New Relic One CLI reference", + "sections": "New Relic One CLI reference", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": ". For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet" }, - "id": "5f37c37164441ffb9aa0a5f1" + "id": "5efa989e28ccbc535a307dd0" } ], "/explore-docs/query-and-store-data": [ @@ -5576,7 +5337,7 @@ "external_id": "709e06c25376d98b2191ca369b4d139e5084bd62", "image": "", "url": "https://developer.newrelic.com/explore-docs/nerdstorage/", - "published_at": "2020-09-24T02:28:37Z", + "published_at": "2020-09-25T01:49:59Z", "updated_at": "2020-09-08T01:50:19Z", "document_type": "page", "popularity": 1, @@ -5584,7 +5345,7 @@ "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,500 documents, plus storage type. Each document can have a maximum length of 1024 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 159.25009, + "_score": 155.01558, "_version": null, "_explanation": null, "sort": null, @@ -5627,7 +5388,7 @@ "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 48.29859, + "_score": 47.996254, "_version": null, "_explanation": null, "sort": null, @@ -5681,7 +5442,7 @@ "body": "The New Relic Java agent API lets you control, customize, and extend the functionality of the APM Java agent. This API consists of: Static methods on the com.newrelic.api.agent.NewRelic class A @Trace annotation for implementing custom instrumentation A hierarchy of API objects providing additional functionality Use this API to set up custom instrumentation of your Java app and collect more in-depth data. For detailed information about this API, see the complete Javadoc on GitHub. Another way to set up custom instrumentation is to use XML instrumentation. The XML option is simpler and does not require modification of your app code, but it lacks the complete functionality of the Java agent API. For best results when using the API, ensure that you have the latest Java agent release. Several APIs used in the examples require Java agent 3.36.0 or higher. For all available New Relic APIs, see Intro to APIs. Use the API To access the API class, add newrelic-api.jar to your application class path. The jar is in the New Relic Java agent's installation zip file. You can call the API when the Java agent is not running. The API methods are just stubs; the implementation is added when the Java agent loads the class. Transactions To instrument Transactions in your application, use the following APIs. If you want to... Use this Create a Transaction when New Relic does not create one automatically @Trace(dispatcher = true) on the method that encompasses the work to be reported. When this annotation is used on a method within the context of an existing transaction, this will not start a new transaction, but rather include the method in the existing transaction. Capture the duration of a method that New Relic does not automatically trace @Trace() on the method you want to time. Set the name of the current Transaction NewRelic.setTransactionName(...) Start the timer for the response time of the current Transaction and to cause a Transaction you create to be reported as a Web transaction, rather than as an Other transaction NewRelic.setRequestAndReponse(...) Add custom attributes to Transactions and TransactionEvents NewRelic.addCustomParameter(...) Prevent a Transaction from being reported to New Relic NewRelic.ignoreTransaction() Exclude a Transaction when calculating your app's Apdex score NewRelic.ignoreApdex() Instrument asynchronous work For detailed information, see Java agent API for asynchronous applications. If you want to... Use this Trace an asynchronous method if it is linked to an existing Transaction... @Trace(async = true) Link the Transaction associated with the Token on the current thread... Token.link() or Token.linkAndExpire() Expire a Token associated with the current Transaction... Token.expire() Stop timing a Segment and have it report as part of its parent Transaction Segment.end() Stop timing a Segment and not have it report as part of its parent Transaction Segment.ignore() Implement distributed tracing These APIs require distributed tracing to be enabled. Distributed tracing lets you see the path that a request takes as it travels through a distributed system. For general instructions on how to use the calls below to implement distributed tracing, see Use distributed tracing APIs. If you want to... Use this Create a payload to be sent to a called service. Transaction.createDistributedTracePayload() For more on obtaining references to the current transaction and other entities, see Obtain references. Accept a payload sent from the first service; this will link these services together in a trace. Transaction.acceptDistributedTracePayload(...) For more on obtaining references to the current transaction and other entities, see Obtain references. Payload used to connect services. The text() call returns a JSON string representation of the payload. DistributedTracePayload.text() Payload used to connect services. The httpSafe() call returns a base64 encoded JSON string representation of the payload. DistributedTracePayload.httpSafe() Add custom attributes to SpanEvents in distributed traces NewRelic.getAgent().getTracedMethod().addCustomAttribute(...) Implement cross application tracing To track external calls and add cross application tracing, use the following APIs: If you want to... Use this Trace across a custom transport channel that New Relic does not support by default, such as a proprietary RPC transport Transaction.getRequestMetadata(), .processRequestMetadata(...), .getResponseMetadata(), .processResponseMetadata(...) Also refer to the information in this document about using Transaction to obtain references to New Relic entities. View or change the metric name or a rollup metric name of a TracedMethod (A rollup metric name, such as OtherTransaction/all, is not scoped to a specific transaction. It represents all background transactions.) TracedMethod.getMetricName(), .setMetricName(...), .setRollupMetricName(...) Also refer to the information in this document about using TracedMethod to obtain references to New Relic entities. Report a call to an external HTTP service, database server, message queue, or other external resource that is being traced using the Java agent API's @Trace annotation TracedMethod.reportAsExternal(...) passing arguments constructed using ExternalParameters builder. Also refer to the information in this document about using TracedMethod to obtain references to New Relic entities. Enable and add cross application tracing when communicating with an external HTTP or JMS service that is instrumented by New Relic TracedMethod.addOutboundRequestHeaders(...) along with TracedMethod.reportAsExternal(...) Also refer to the information in this document about using TracedMethod to obtain references to New Relic entities. Add timing for an application server or dispatcher that is not supported automatically Transaction.setRequest(...), Transaction.setResponse(...), or NewRelic.setRequestAndResponse(...), and Transaction.markResponseSent() Also refer to the information in this document about using Transaction to obtain references to New Relic entities. Obtain references to New Relic entities Other tasks require the New Relic Agent object. The Agent object exposes multiple objects that give you the following functionality: If you want to... Use this Get a reference to the current Transaction NewRelic.getAgent().getTransaction() Get a Token to link asynchronous work NewRelic.getAgent().getTransaction().getToken() Start and get a reference to a Segment NewRelic.getAgent().getTransaction().startSegment() Get a reference to the method currently being traced NewRelic.getAgent().getTracedMethod() Get a reference to the Agent logger NewRelic.getAgent().getLogger() Get a reference to the Agent configuration NewRelic.getAgent().getConfig() Get a reference to an aggregator for custom metrics NewRelic.getAgent().getAggregator() Get a reference to Insights in order to record custom events NewRelic.getAgent().getInsights() Additional API functionality The following APIs provide additional functionality, such as setting app server info, reporting errors, adding page load timing information, recording custom metrics, and sending custom events to Insights. If you want to... Use this Explicitly set port, name, and version information for an application server or dispatcher and the instance name for a JVM NewRelic.setAppServerPort(...), .setServerInfo(...), and .setInstanceName(...) Report an error that New Relic does not report automatically NewRelic.noticeError(...) When inside a transaction, the first call to noticeError wins. Only 1 error will be reported per transaction. Add browser page load timing for Transactions that New Relic does not add to the header automatically NewRelic.getBrowserTimingHeader(), .getBrowserTimingFooter(), .setUserName(String name), .setAccountName(String name), and .setProductName(String name) Create and accumulate custom metrics NewRelic.recordMetric(...), .recordResponseTimeMetric(...), or .incrementCounter(...) Record custom events Insights.recordCustomEvent(...) Or, use NewRelic.addCustomParameter(...) to add custom attributes to the New Relic-defined TransactionEvent type. Also refer to the information in this document about using Insights to obtain references to New Relic entities. Additional API usage examples For detailed code examples about using the APIs, see New Relic's documentation about custom instrumentation for: External calls, cross application traces, messaging, datastores, and web frameworks Cross application tracing and external datastore calls Apps using custom instrumentation with annotation Custom framework instrumentation API Preventing unwanted instrumentation Inserting custom attributes Inserting custom events Collecting custom metrics For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 36.507217, + "_score": 35.844208, "_version": null, "_explanation": null, "sort": null, @@ -5732,7 +5493,7 @@ "body": "newrelic_add_custom_tracer(string $function_name) Specify functions or methods for the agent to instrument with custom instrumentation. Requirements Compatible with all agent versions. Description Specify functions or methods for the agent to target for custom instrumentation. This is the API equivalent of the newrelic.transaction_tracer.custom setting. You cannot apply custom tracing to internal PHP functions. Parameters Parameter Description $function_name string Required. The name can be formatted either as function_name for procedural functions, or as \"ClassName::method\" for methods. Both static and instance methods will be instrumented if the method syntax is used, and the class name must be fully qualified: it must include the full namespace if the class was defined within a namespace. Return value(s) Returns true if the tracer was added successfully. Example(s) Instrument a function function example_function() { if (extension_loaded('newrelic')) { // Ensure PHP agent is available newrelic_add_custom_tracer(\"example_function\"); } } Instrument a method within a class class ExampleClass { function example_method() { if (extension_loaded('newrelic')) { // Ensure PHP agent is available newrelic_add_custom_tracer(\"ExampleClass::example_method\"); } } } Instrument a method within a namespaced class namespace Foo\\Bar; class ExampleClass { function example_method() { if (extension_loaded('newrelic')) { // Ensure PHP agent is available newrelic_add_custom_tracer(\"Foo\\\\Bar\\\\ExampleClass::example_method\"); } } } Alternatively, on PHP 5.5 or later, the ::class syntax can be used instead: namespace Foo\\Bar { class ExampleClass { function example_method() { // ... } } } namespace { use Foo\\Bar; if (extension_loaded('newrelic')) { // Ensure PHP agent is available newrelic_add_custom_tracer(Bar::class . \"::example_method\"); } } }", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 26.929213, + "_score": 26.759659, "_version": null, "_explanation": null, "sort": null, @@ -5771,14 +5532,251 @@ "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 17.925095, + "_score": 17.768198, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "body": " The SDK can store up to 64 user-defined attributes at a time. If you attempt to store more than 64 attributes, the SDK returns false. Use the following static methods in the NewRelicAgent namespace to send custom attributes and events to New Relic Insights. Methods that return boolean results return" + }, + "id": "5c52cbec8e9c0f0b286080ec" + } + ], + "/explore-docs/nerdpack-file-structure": [ + { + "sections": [ + "Create a \"Hello, World!\" application", + "Before you begin", + "Tip", + "Create a local version of the \"Hello, World!\" application", + "Publish your application to New Relic", + "Add details to describe your project", + "Subscribe accounts to your application", + "Summary", + "Related information" + ], + "title": "Create a \"Hello, World!\" application", + "type": "developer", + "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-09-25T01:51:38Z", + "updated_at": "2020-08-21T01:45:19Z", + "document_type": "page", + "popularity": 1, + "info": "Build a \"Hello, World!\" app and publish it to New Relic One", + "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return

\"Hello, World!\"

; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack manager or admin role can subscribe to an application from accounts that they have permission to manage. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 434.12823, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "sections": "Publish your application to New Relic", + "info": "Build a "Hello, World!" app and publish it to New Relic One", + "tags": "Nerdpack file structure", + "body": "!" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit" + }, + "id": "5efa9973196a67d16d76645c" + }, + { + "sections": [ + "New Relic One CLI reference", + "Installing the New Relic One CLI", + "Tip", + "New Relic One CLI Commands", + "Get started", + "Configure your CLI preferences", + "Set up your Nerdpacks", + "Manage your Nerdpack subscriptions", + "Install and manage plugins", + "Manage catalog information" + ], + "title": "New Relic One CLI reference", + "type": "developer", + "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-09-25T01:49:59Z", + "updated_at": "2020-09-17T01:51:10Z", + "document_type": "page", + "popularity": 1, + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. 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. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. 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.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 404.4538, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "New Relic One CLI reference", + "sections": "New Relic One CLI reference", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": " CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build" + }, + "id": "5efa989e28ccbc535a307dd0" + }, + { + "sections": [ + "Map page views by region in a custom app", + "Before you begin", + "New Relic terminology", + "Build a custom app with a table chart", + "Query your browser data", + "Create and serve a new Nerdpack", + "Review your app files and view your app locally", + "Hard code your account ID", + "Import the TableChart component", + "Add a table with a single row", + "Customize the look of your table (optional)", + "Get your data into that table", + "Make your app interactive with a text field", + "Import the TextField component", + "Add a row for your text field", + "Build the text field object", + "Get your data on a map", + "Install Leaflet", + "Add a webpack config file for Leaflet", + "Import modules from Leaflet", + "Import additional modules from New Relic One", + "Get data for the map", + "Customize the map marker colors", + "Set your map's default center point", + "Add a row for your map", + "Replace \"Hello\" with the Leaflet code" + ], + "title": "Map page views by region in a custom app", + "type": "developer", + "tags": [ + "custom app", + "map", + "page views", + "region", + "nerdpack" + ], + "external_id": "6ff5d696556512bb8d8b33fb31732f22bab455cb", + "image": "https://developer.newrelic.com/static/d87a72e8ee14c52fdfcb91895567d268/0086b/pageview.png", + "url": "https://developer.newrelic.com/build-apps/map-pageviews-by-region/", + "published_at": "2020-09-25T01:51:37Z", + "updated_at": "2020-09-17T01:48:42Z", + "document_type": "page", + "popularity": 1, + "info": "Build a New Relic app showing page view data on a world map.", + "body": "Map page views by region in a custom app 30 min New Relic has powerful and flexible tools for building custom apps and populating them with data. This guide shows you how to build a custom app and populate it with page view data using New Relic's Query Language (NRQL - pronounced 'nurkle'). Then you make your data interactive. And last, if you have a little more time and want to install a third-party React library, you can display the page view data you collect on a map of the world. In this guide, you build an app to display page view data in two ways: In a table On a map Please review the Before you begin section to make sure you have everything you need and don't get stuck halfway through. Before you begin In order to get the most out of this guide, you must have: A New Relic developer account, API key, and the command-line tool. If you don't have these yet, see the steps in Setting up your development environment New Relic Browser page view data to populate the app. Without this data, you won't be able to complete this guide. To add your data to a world map in the second half of the guide: npm, which you'll use during this section of the guide to install Leaflet, a third-party JavaScript React library used to build interactive maps. If you're new to React and npm, you can go here to install Node.js and npm. New Relic terminology The following are some terms used in this guide: New Relic application: The finished product where data is rendered in New Relic One. This might look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One that launches your application. Nerdlets: New Relic React components used to build your application. The three default files are index.js, nr1.json, and styles.scss, but you can customize and add your own. Build a custom app with a table chart Step 1 of 8 Query your browser data Use Query builder to write a NRQL query to see your page view data, as follows. On New Relic One, select Query your data (in the top right corner). That puts you in NRQL mode. You'll use NRQL to test your query before dropping the data into your table. Copy and paste this query into a clear query field, and then select Run. FROM PageView SELECT count(*), average(duration) WHERE appName = 'WebPortal' FACET countryCode, regionCode SINCE 1 week ago LIMIT 1000 Copy If you have PageView data, this query shows a week of average page views broken down by country and limited to a thousand items. The table will be full width and use the \"chart\" class defined in the CSS. If you don't have any results at this point, ensure your query doesn't have any errors. If your query is correct, you might not have the Browser agent installed. Step 2 of 8 Create and serve a new Nerdpack To get started, create a new Nerdpack, and serve it up to New Relic from your local development environment: Create a new Nerdpack for this app: nr1 create --type nerdpack --name pageviews-app Copy Serve the project up to New Relic: cd pageviews-app && nr1 nerdpack:serve Copy Step 3 of 8 Review your app files and view your app locally Navigate to your pageviews-app to see how it's structured. It contains a launcher folder, where you can customize the description and icon that will be displayed on the app's launcher in New Relic One. It also contains nerdlets, which each contain three default files: index.js, nr1.json, and styles.scss. You'll edit some of these files as part of this guide. For more information, see Nerdpack file structure. Now in your browser, open https://one.newrelic.com/?nerdpacks=local, and then click Apps to see the pageview-apps Nerdpack that you served up. When you select the launcher, you see a Hello message. Step 4 of 8 Hard code your account ID For the purposes of this exercise and for your convenience, hard code your account ID. In the pageview-app-nerdlet directory, in the index.js file, add this code between the import and export lines. (Read about finding your account ID here). const accountId = [Replace with your account ID]; Copy Step 5 of 8 Import the TableChart component To show your data in a table chart, import the TableChart component from New Relic One. To do so, in index.js, add this code under import React. import { TableChart } from 'nr1'; Copy Step 6 of 8 Add a table with a single row To add a table with a single row, in the index.js file, replace this line: return

Hello, pageview-app-nerdlet Nerdlet!

; Copy with this export code: export default class PageViewApp extends React.Component { render() { return (
); } } Copy Step 7 of 8 Customize the look of your table (optional) You can use standard CSS to customize the look of your components. In the styles.scss file, add this CSS. Feel free to customize this CSS to your taste. .container { width: 100%; height: 99vh; display: flex; flex-direction: column; .row { margin: 10px; display: flex; flex-direction: row; } .chart { height: 250px; } } Copy Step 8 of 8 Get your data into that table Now that you've got a table, you can drop a TableChart populated with data from the NRQL query you wrote at the very beginning of this guide. Put this code into the row div. ; Copy Go to New Relic One and click your app to see your data in the table. (You might need to serve your app to New Relic again.) Congratulations! You made your app! Continue on to make it interactive and show your data on a map. Make your app interactive with a text field Once you confirm that data is getting to New Relic from your app, you can start customizing it and making it interactive. To do this, you add a text field to filter your data. Later, you use a third-party library called Leaflet to show that data on a world map. Step 1 of 3 Import the TextField component Like you did with the TableChart component, you need to import a TextField component from New Relic One. import { TextField } from 'nr1'; Copy Step 2 of 3 Add a row for your text field To add a text field filter above the table, put this code above the TableChart div. The text field will have a default value of \"US\".
{ this.setState({ countryCode: event.target.value }); }} />
; Copy Step 3 of 3 Build the text field object Above the render() function, add a constructor to build the text field object. constructor(props) { super(props); this.state = { countryCode: null } } Copy Then, add a constructor to your render() function. Above return, add: const { countryCode } = this.state; Copy Now add countryCode to your table chart query. ; Copy Reload your app to try out the text field. Get your data on a map To create the map, you use npm to install Leaflet. Step 1 of 9 Install Leaflet In your terminal, type: npm install --save leaflet react-leaflet Copy In your nerdlets styles.scss file, import the Leaflet CSS: @import `~leaflet/dist/leaflet.css`; Copy While you're in styles.scss, fix the width and height of your map: .containerMap { width: 100%; z-index: 0; height: 70vh; } Copy Step 2 of 9 Add a webpack config file for Leaflet Add a webpack configuration file .extended-webpackrc.js to the top-level folder in your nerdpack. This supports your use of map tiling information data from Leaflet. module.exports = { module: { rules: [ { test: /\\.(png|jpe?g|gif)$/, use: [ { loader: 'file-loader', options: {}, }, { loader: 'url-loader', options: { limit: 25000 }, }, ], }, ], }, }; Copy Step 3 of 9 Import modules from Leaflet In index.js, import modules from Leaflet. import { Map, CircleMarker, TileLayer } from 'react-leaflet'; Copy Step 4 of 9 Import additional modules from New Relic One You need several more modules from New Relic One to make the Leaflet map work well. Import them with this code: import { NerdGraphQuery, Spinner, Button, BlockText } from 'nr1'; Copy NerdGraphQuery lets you make multiple NRQL queries at once and is what will populate the map with data. Spinner adds a loading spinner. Button gives you button components. BlockText give you block text components. Step 5 of 9 Get data for the map Using latitude and longitude with country codes, you can put New Relic data on a map. mapData() { const { countryCode } = this.state; const query = `{ actor { account(id: 1606862) { mapData: nrql(query: \"SELECT count(*) as x, average(duration) as y, sum(asnLatitude)/count(*) as lat, sum(asnLongitude)/count(*) as lng FROM PageView FACET regionCode, countryCode WHERE appName = 'WebPortal' ${countryCode ? ` WHERE countryCode like '%${countryCode}%' ` : ''} LIMIT 1000 \") { results nrql } } } }`; return query; }; Copy Step 6 of 9 Customize the map marker colors Above the mapData function, add this code to customize the map marker colors. getMarkerColor(measure, apdexTarget = 1.7) { if (measure <= apdexTarget) { return '#11A600'; } else if (measure >= apdexTarget && measure <= apdexTarget * 4) { return '#FFD966'; } else { return '#BF0016'; } }; Copy Feel free to change the HTML color code values to your taste. In this example, #11A600 is green, #FFD966 is sort of yellow, and #BF0016 is red. Step 7 of 9 Set your map's default center point Set a default center point for your map using latitude and longitude. const defaultMapCenter = [10.5731, -7.5898]; Copy Step 8 of 9 Add a row for your map Between the text field row and the table chart row, insert a new row for the map content using NerdGraphQuery.
{({ loading, error, data }) => { if (loading) { return ; } if (error) { return 'Error'; } const { results } = data.actor.account.mapData; console.debug(results); return 'Hello'; }}
; Copy Reload your application in New Relic One to test that it works. Step 9 of 9 Replace \"Hello\" with the Leaflet code Replace return \"Hello\"; with: return ( {results.map((pt, i) => { const center = [pt.lat, pt.lng]; return ( { alert(JSON.stringify(pt)); }} /> ); })} ); Copy This code creates a world map centered on the latitude and longitude you chose using OpenStreetMap data and your marker colors. Reload your app to see the pageview data on the map!", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 354.4616, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "sections": "Import additional modules from New Relic One", + "info": "Build a New Relic app showing page view data on a world map.", + "tags": "nerdpack", + "body": " look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One" + }, + "id": "5efa993c196a67066b766469" + }, + { + "sections": [ + "Add tables to your New Relic One application", + "Before you begin", + "Clone and set up the example application", + "Work with table components", + "Next steps" + ], + "title": "Add tables to your New Relic One application", + "type": "developer", + "tags": [ + "table in app", + "Table component", + "TableHeaderc omponent", + "TableHeaderCell component", + "TableRow component", + "TableRowCell component" + ], + "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-09-25T01:48:39Z", + "updated_at": "2020-09-17T01:48:42Z", + "document_type": "page", + "popularity": 1, + "info": "Add a table to your New Relic One app.", + "body": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application. In this guide, you are going to build a sample table using various New Relic One components. Before you begin If you haven't already installed the New Relic One CLI, step through the quick start in New Relic One. This process also gets you an API key. In addition, to complete the steps in this guide, you need a GitHub account and Node.js installed on your machine. See Setting up your development environment for more info. Clone and set up the example application Step 1 of 4 Clone the nr1-how-to example application from GitHub to your local machine. Then, navigate to the app directory. The example app lets you experiment with tables. git clone https://github.com/newrelic/nr1-how-to.git` cd nr1-how-to/create-a-table/nerdlets/create-a-table-nerdlet` Copy Step 2 of 4 Edit the index.json file and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install dependencies nr1 nerdpack:serve # Serve the demo app locally Copy Step 4 of 4 Open one.newrelic.com/?nerdpacks=local in your browser. Click Apps, and then in the Your apps section, you should see a Create a table launcher. That's the demo application you're going to work on. Go ahead and select it. Have a good look at the demo app. There's a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You'll use Table components to add a new table in the second row. Work with table components Step 1 of 10 Navigate to the nerdlets/create-a-table-nerdlet subdirectory and open the index.js file. Add the following components to the import statement at the top of the file so that it looks like the example: Table TableHeader TableHeaderCell TableRow TableRowCell import { Table, TableHeader, TableHeaderCell, TableRow, TableRowCell, PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart, } from 'nr1'; Copy Step 2 of 10 Add a basic Table component Locate the empty GridItem in index.js: This is where you start building the table. Add the initial component. The items property collects the data by calling _getItems(), which contains sample values.
; Copy Step 3 of 10 Add the header and rows As the Table component renders a fixed number of header cells and rows, your next step is adding header components, as well as a function that returns the required table rows. Inside of the Table component, add the TableHeader and then a TableHeaderCell child for each heading. Since you don't know how many rows you'll need, your best bet is to call a function to build as many TableRows as items returned by _getItems(). Application Size Company Team Commit ; { ({ item }) => ( {item.name} {item.value} {item.company} {item.team} {item.commit} ); } Copy Step 4 of 10 Take a look at the application running in New Relic One: you should see something similar to the screenshot below. Step 5 of 10 Replace standard table cells with smart cells The New Relic One library includes cell components that can automatically format certain data types, like users, metrics, and entity names. The table you've just created contains columns that can benefit from those components: Application (an entity name) and Size (a metric). Before you can use EntityTitleTableRowCell and MetricTableRowCell, you have to add them to the import statement first. import { EntityTitleTableRowCell, MetricTableRowCell, ... /* All previous components */ } from 'nr1'; Copy Step 6 of 10 Update your table rows by replacing the first and second TableRowCells with entity and metric cells. Notice that EntityTitleTableRowCell and MetricTableRowCell are self-closing tags. { ({ item }) => ( {item.company} {item.team} {item.commit} ); } Copy Step 7 of 10 Time to give your table a second look: The cell components you've added take care of properly formatting the data. Step 8 of 10 Add some action to your table! Tables are great, but interactive tables can be better: As a last update, you are going to allow users to act on each data row. Add the _getActions() method to your index.js file, right before _getItems(). As you may have guessed from the code, _getActions() spawns an alert box when you click Team or Commit cells. _getActions() { return [ { label: 'Alert Team', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__ALERT, onClick: (evt, { item, index }) => { alert(`Alert Team: ${item.team}`); }, }, { label: 'Rollback Version', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__UNDO, onClick: (evt, { item, index }) => { alert(`Rollback from: ${item.commit}`); }, }, ]; } Copy Step 9 of 10 Find the TableRow component in your return statement and point the actions property to _getActions(). The TableRow actions property defines a set of actions that appear when the user hovers over a table row. Actions have a mandatory text and an onClick callback, but can also display an icon or be disabled if needed. Copy Step 10 of 10 Go back to your application and try hovering over any of the rows: Notice how the two available actions appear. When you click them, a function triggers with the selected row data as an argument, and an alert displays in your browser. Next steps You've built a table into a New Relic One application, using components to format data automatically and provide contextual actions. Well done! Keep exploring the Table components, their properties, and how to use them, in our SDK documentation.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 321.66788, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "Add tables to your New Relic One application", + "sections": "Add tables to your New Relic One application", + "info": "Add a table to your New Relic One app.", + "body": " application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install" + }, + "id": "5efa989ee7b9d2ad567bab51" + }, + { + "image": "", + "url": "https://developer.newrelic.com/explore-docs/nr1-common/", + "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" + ], + "published_at": "2020-09-25T01:49:59Z", + "title": "New Relic One CLI common commands", + "updated_at": "2020-08-14T01:48:10Z", + "type": "developer", + "external_id": "503e515e1095418f8d19329517344ab209d143a4", + "document_type": "page", + "popularity": 1, + "info": "An overview of common commands you can use with the New Relic One CLI.", + "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 294.9304, "_version": null, "_explanation": null, "sort": null, "highlight": { - "body": " The SDK can store up to 64 user-defined attributes at a time. If you attempt to store more than 64 attributes, the SDK returns false. Use the following static methods in the NewRelicAgent namespace to send custom attributes and events to New Relic Insights. Methods that return boolean results return" + "title": "New Relic One CLI common commands", + "sections": "New Relic One CLI common commands", + "info": "An overview of common commands you can use with the New Relic One CLI.", + "body": " update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL" }, - "id": "5c52cbec8e9c0f0b286080ec" + "id": "5f28bd6ae7b9d267996ade94" } ], "/explore-docs/intro-to-sdk": [ @@ -5795,21 +5793,21 @@ "Add the NerdGraphQuery component to an application", "Add a time picker to your app", "Add a table to your app", - "Publish and deploy apps", - "Create a custom map view" + "Create a custom map view", + "Publish and deploy apps" ], - "published_at": "2020-09-24T02:30:06Z", + "published_at": "2020-09-25T01:49:59Z", "title": "Build apps", - "updated_at": "2020-09-24T01:55:00Z", + "updated_at": "2020-09-25T01:49:59Z", "type": "developer", "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d", "document_type": "page", "popularity": 1, - "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   Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 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 Publish and deploy apps Start sharing the apps you build 30 min Create a custom map view Build an app to show page view data on a map", + "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   Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 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 30 min Publish and deploy apps Start sharing the apps you build", "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 906.5304, + "_score": 899.49207, "_version": null, "_explanation": null, "sort": null, @@ -5840,7 +5838,7 @@ "external_id": "709e06c25376d98b2191ca369b4d139e5084bd62", "image": "", "url": "https://developer.newrelic.com/explore-docs/nerdstorage/", - "published_at": "2020-09-24T02:28:37Z", + "published_at": "2020-09-25T01:49:59Z", "updated_at": "2020-09-08T01:50:19Z", "document_type": "page", "popularity": 1, @@ -5848,7 +5846,7 @@ "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,500 documents, plus storage type. Each document can have a maximum length of 1024 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 779.5641, + "_score": 762.1187, "_version": null, "_explanation": null, "sort": null, @@ -5881,7 +5879,7 @@ "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-09-24T02:28:37Z", + "published_at": "2020-09-25T01:48:39Z", "updated_at": "2020-09-17T01:48:42Z", "document_type": "page", "popularity": 1, @@ -5889,7 +5887,7 @@ "body": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application. In this guide, you are going to build a sample table using various New Relic One components. Before you begin If you haven't already installed the New Relic One CLI, step through the quick start in New Relic One. This process also gets you an API key. In addition, to complete the steps in this guide, you need a GitHub account and Node.js installed on your machine. See Setting up your development environment for more info. Clone and set up the example application Step 1 of 4 Clone the nr1-how-to example application from GitHub to your local machine. Then, navigate to the app directory. The example app lets you experiment with tables. git clone https://github.com/newrelic/nr1-how-to.git` cd nr1-how-to/create-a-table/nerdlets/create-a-table-nerdlet` Copy Step 2 of 4 Edit the index.json file and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install dependencies nr1 nerdpack:serve # Serve the demo app locally Copy Step 4 of 4 Open one.newrelic.com/?nerdpacks=local in your browser. Click Apps, and then in the Your apps section, you should see a Create a table launcher. That's the demo application you're going to work on. Go ahead and select it. Have a good look at the demo app. There's a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You'll use Table components to add a new table in the second row. Work with table components Step 1 of 10 Navigate to the nerdlets/create-a-table-nerdlet subdirectory and open the index.js file. Add the following components to the import statement at the top of the file so that it looks like the example: Table TableHeader TableHeaderCell TableRow TableRowCell import { Table, TableHeader, TableHeaderCell, TableRow, TableRowCell, PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart, } from 'nr1'; Copy Step 2 of 10 Add a basic Table component Locate the empty GridItem in index.js: This is where you start building the table. Add the initial component. The items property collects the data by calling _getItems(), which contains sample values.
; Copy Step 3 of 10 Add the header and rows As the Table component renders a fixed number of header cells and rows, your next step is adding header components, as well as a function that returns the required table rows. Inside of the Table component, add the TableHeader and then a TableHeaderCell child for each heading. Since you don't know how many rows you'll need, your best bet is to call a function to build as many TableRows as items returned by _getItems(). Application Size Company Team Commit ; { ({ item }) => ( {item.name} {item.value} {item.company} {item.team} {item.commit} ); } Copy Step 4 of 10 Take a look at the application running in New Relic One: you should see something similar to the screenshot below. Step 5 of 10 Replace standard table cells with smart cells The New Relic One library includes cell components that can automatically format certain data types, like users, metrics, and entity names. The table you've just created contains columns that can benefit from those components: Application (an entity name) and Size (a metric). Before you can use EntityTitleTableRowCell and MetricTableRowCell, you have to add them to the import statement first. import { EntityTitleTableRowCell, MetricTableRowCell, ... /* All previous components */ } from 'nr1'; Copy Step 6 of 10 Update your table rows by replacing the first and second TableRowCells with entity and metric cells. Notice that EntityTitleTableRowCell and MetricTableRowCell are self-closing tags. { ({ item }) => ( {item.company} {item.team} {item.commit} ); } Copy Step 7 of 10 Time to give your table a second look: The cell components you've added take care of properly formatting the data. Step 8 of 10 Add some action to your table! Tables are great, but interactive tables can be better: As a last update, you are going to allow users to act on each data row. Add the _getActions() method to your index.js file, right before _getItems(). As you may have guessed from the code, _getActions() spawns an alert box when you click Team or Commit cells. _getActions() { return [ { label: 'Alert Team', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__ALERT, onClick: (evt, { item, index }) => { alert(`Alert Team: ${item.team}`); }, }, { label: 'Rollback Version', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__UNDO, onClick: (evt, { item, index }) => { alert(`Rollback from: ${item.commit}`); }, }, ]; } Copy Step 9 of 10 Find the TableRow component in your return statement and point the actions property to _getActions(). The TableRow actions property defines a set of actions that appear when the user hovers over a table row. Actions have a mandatory text and an onClick callback, but can also display an icon or be disabled if needed. Copy Step 10 of 10 Go back to your application and try hovering over any of the rows: Notice how the two available actions appear. When you click them, a function triggers with the selected row data as an argument, and an alert displays in your browser. Next steps You've built a table into a New Relic One application, using components to format data automatically and provide contextual actions. Well done! Keep exploring the Table components, their properties, and how to use them, in our SDK documentation.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 748.2388, + "_score": 718.6541, "_version": null, "_explanation": null, "sort": null, @@ -5943,7 +5941,7 @@ "body": "Original pricing plan This doc is for accounts on our original Product-based pricing. If you're on our New Relic One pricing plan, see Manage your data. Not sure which you're on? See Overview of pricing plans. If you're on the original product-based pricing plan, you retain your existing subscriptions and data retention values. You manage these existing retention settings from the Data management hub in New Relic One. To manage your retention settings, in New Relic One, click your user name, select Manage your data, and then select Data retention. You'll see your existing retention settings. Adjust retention values by clicking the Edit retention button. New Relic stores different types of data for different periods of time. The retention period for a type of data will vary depending on the product, the subscription level, and the feature. Limits on editing and deleting data 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. If you sent unwanted data or sensitive data to New Relic that must be removed, contact your account representative at New Relic, or get support at support.newrelic.com. Product and API data retention policies Select a New Relic product to see details about its data retention: APM Specific retention policies apply to each New Relic APM subscription level, including Lite, Essentials, Pro, and Enterprise. This includes metric timeslice data, key metrics, trace data, and event data. In addition to retention limits, your data is subject to aggregation (averaging) after certain elapsed time periods. For more information, see the aggregate metric data description. APM data retention policies For accounts on our original product-based pricing, APM data retention policies depend on your APM product subscription level. Component Lite Essentials Pro Metric timeslice data 24 hours 3 days 90 days Key metrics none forever forever Distributed tracing and logs in context none none 8 days Other trace data * 1 day 3 days 7 days Event data ** 1 day 3 days 8 days * If you view a transaction trace in the New Relic UI, New Relic stores that trace data for up to one year. ** Learn about how to extend the retention of event data. Legacy APM data retention policies Component Standard Startup Small Business Enterprise Metric timeslice data 7 days 14 days 30 days 90 days Key metrics none none none forever Trace data 7 days 7 days 7 days 7 days Event data none 8 days 8 days 8 days Browser For accounts on our original product-based pricing, Browser data is stored depending on your subscription level: Component Lite Pro Metric data 24 hours 90 days Key metrics 24 hours forever Trace data 7 days 7 days Event data * 1 day 8 days SPA data Unavailable 8 days * Learn about how to extend the retention of event data. Infrastructure For accounts on our original product-based pricing, Infrastructure data retention policies depend on your Infrastructure subscription level and your New Relic Infrastructure compute units pricing model. Data retention rules apply the same whether that data is displayed in the UI or queried. Infrastructure data retention is not governed by your Insights subscription. Infrastructure downsampling and data retention Types of data are stored depending on your subscription level: Component Essentials Pro Infrastructure data 3 months 13 months Host count Host count will stop reflecting a host whose agent is no longer reporting after three minutes. However, host data will be available, subject to other retention criteria. 3 minutes 3 minutes Inventory attributes removed Inventory attributes for a host are retained for 24 hours after the agent stops reporting. 24 hours 24 hours Integration data Not available with Essentials Limit of 2275 integration events per compute unit per month In addition, Infrastructure downsamples your data on the fly, as it's generated. All Infrastructure metric data types (including On-Host Integrations metrics) will display different granularity depending on the age of the data and the size of the time window. The following table illustrates when different downsampled buckets will be used, both in the Infrastructure UI and for queries: Bucket Size Used For Time Windows Covering... Data Retained For... Raw (5, 10 or 15 second) 0 to 59 minutes 7 days 1 minute 60 minutes to 6 hours 30 days 10 minutes 6 hours to 3 days Full account retention period 1 hour 3 days to 14 days Full account retention period 3 hours 14+ days Full account retention period Integration compute unit event limits The 2275 limit on integration events per compute unit per month is a limit on total Infrastructure integration events. It's not a limit of 2275 for each integration's events. Additional details and clarifications about this limit: This limit applies to all events from all integrations (cloud integrations and on-host integrations). The events are all handled the same. Default data received by the Infrastructure agent does not count against the 2275 event per compute unit limit. If you exceed your limit, we do not enforce this limit. If you exceed your limit, we'll review pricing options with you to ensure you get the most cost-effective pricing for your organization's integrations. Insights For accounts on our original product-based pricing, an Insights subscription extends your event data retention. An Insights Pro subscription allows you to customize the length of your event data retention. Logs For accounts on our original product-based pricing, log data can be retained for up to 30 days by New Relic. Shorter retention periods of 8 or 15 days are also available. Logs in context data retention New Relic Logs logs in context data retention policy is based on your current APM product subscription level. For more information, see APM data retention. Mobile For accounts on our original product-based pricing, Mobile data retention policies depend on your New Relic Mobile product subscription level. This includes data components such as metric data, aggregate metrics, key metrics, trace data, and event data. For information about your subscription-related data usage, see Mobile subscription usage. Mobile data retention policies Component Lite Enterprise Overview page data 24 hours 90 days Crash data and stack traces 24 hours 90 days HTTP requests (except errors) as metric data Unavailable 90 days HTTP request errors as metric data Unavailable 3 days Interaction traces Unavailable 90 days Custom events * Unavailable 1 day Mobile events * 1 day 8 days MobileBreadcrumb events * Unavailable 3 days MobileCrash events * 1 day 90 days MobileHandledException events * Unavailable 3 days MobileJSError events (React Native beta) * Unavailable 3 days MobileRequest events * Unavailable 3 days MobileRequestError events * Unavailable 3 days MobileSession events * 1 day 90 days * Learn how to extend retention of event data. Standard Mobile (legacy) data retention policies Unless otherwise noted, Insights event data is unavailable for Standard subscriptions. Component Standard Overview page data 7 days Crash data and stack traces 7 days HTTP requests (except errors) as metric data 7 days HTTP request errors as metric data 3 days Interaction traces Unavailable MobileCrash events 8 days MobileSession events 8 days Plugins The retention period for historical data depends on the product and subscription level. The following data retention periods exist for New Relic Plugins. Plugins is not supported with accounts that host data in the EU region data center. Plugins data retention Component Lite Essentials Pro Enterprise Metric data 24 hours 3 days 90 days 90 days Legacy Plugins data retention Component Standard Startup Small Business Metric data 7 days 14 days 30 days Synthetics For accounts on our original product-based pricing, Synthetics data retention policies depend on your Synthetics product subscription level. This includes data components such as metric data, aggregate metrics, key metrics, trace data, and Insights events. Synthetics events do not count against an Insights Pro subscription. Your current subscription level appears in the right column of the Account summary page: Go to synthetics.newrelic.com > (account dropdown) > Account settings > Account > Summary. Synthetics data retention policies Component Lite Pro Synthetics monitor data 2 weeks 13 months Event data 2 weeks 13 months Also see the data retention details for APIs, including: Metric API All raw metric data points will be retained for 30 days. All additional aggregated data derived from the raw metric data points (for example, one-minute rollups) will be retained for 13 months. Any change to the retention period beyond such periods may result in a charge to you. Trace API See Trace API general requirements and limits. Data components For accounts on our original product-based pricing, the section below provides an explanation of some types of data components governed by the data retention rules of specific products: Event data: reported by most products See Event data retention for information on the event data type. Metric timeslice data: reported by APM, Browser, and Mobile Metric timeslice data is a specific type of data that is used for most metric charts and reports in New Relic APM, Mobile, and Browser. Note that metric timeslice data differs from other metric data types. All metric timeslice data is aggregated, but New Relic deals with fresh data and old data in different ways. Fresh data has specific policies applied to the data to keep granular views of performance as aggregate metrics. As data ages and becomes less useful in a granular state, we summarize that data and only keep key metrics. Aggregate metric timeslice data: reported by APM, Browser, and Mobile Aggregate metric timeslice data summarizes calls to specific methods in your application: how many times each one was called and response times. In the New Relic UI, you see the class and method names along with their aggregate numbers. Metric data aggregation depends on your subscription level. Subscription Level Aggregate retention Enterprise Aggregates (averages) to 1-hour periods after 8 days. After 90 days, the permanent metric data continues to be stored in 1-hour periods. This means you cannot obtain data granularity of less than 1 hour after 8 days, and only a subset of metrics are available after 90 days. Pro After 8 days Essentials After 3 days. Legacy Small Business, Startup, and Standard After 3 days. Lite After 2 hours. We retain your most recent data in one-minute increments. We also aggregate permanent metric data to day-size increments after 90 days. When looking at older data in small time windows, you may notice that charts show less detail. As data ages, it is aggregated into larger segments. Key metrics: reported by APM, Browser, and Mobile New Relic retains certain \"key\" metric timeslice data aggregations forever for Enterprise and Pro customers, for any number of applications. New Relic aggregates permanent key metric data to hour-size increments after 90 days. Product Key metrics APM Apdex, for app server Throughput and page views Response time, plus breakdown into tiers or categories on your app's main Overview chart Page load time, plus breakdown into segments Error rate CPU usage Memory usage Browser Apdex, for browser Browser page load time Throughput total. After 90 days, there is no breakout by browser type, and only the combined average value is available for the time range requested. Mobile Crash rate: For iOS and for Android Network throughput Network response time Network error rates Interaction traces Trace data: reported by APM, Browser, and Mobile Depending on the product, New Relic retains different types of trace data: Product Trace data APM Types of trace data: Transaction traces Distributed tracing Slow query samples Error details See APM data retention details. Browser Types of trace data: Session traces Browser traces JavaScript errors* See Browser data retention details. Mobile Types of trace data: App crash stack traces Interaction traces See Mobile data retention details. *JavaScript errors in the stack trace UI are saved as trace data. JS errors are also saved as events. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 659.6816, + "_score": 606.5817, "_version": null, "_explanation": null, "sort": null, @@ -5980,7 +5978,7 @@ "external_id": "3c7bdf7f49e0dee169430c4d141b1988eb29d1b9", "image": "", "url": "https://docs.newrelic.com/docs/security/security-privacy/compliance/key-management-encryption-rest", - "published_at": "2020-09-24T14:05:46Z", + "published_at": "2020-09-25T15:58:21Z", "updated_at": "2020-09-24T14:05:46Z", "breadcrumb": "Contents / New Relic Security and Privacy / Security and Privacy / Compliance", "document_type": "page", @@ -5989,7 +5987,7 @@ "body": "For customers with heightened regulatory or privacy needs, New Relic offers account-based, FIPS-compliant encryption-at-rest capabilities with unique keys per account. This protects data from inadvertent or intentional exposure, even if the attacker has access to the filesystem. To achieve a high level of protection while maintaining high performance and long-term storage and retrieval of data, we use a two-tier system consisting of a data encryption key (DEK) and a master key, each with separate usage, storage, and rotation policies. For an overview of how we handle your data in transit and at rest, see our data encryption documentation. This document describes the key management process for data encryption in more detail. Encryption and decryption process When encryption at rest is enabled for an account, each new file is encrypted (AES-GCM with 256 bit keys) with a data encryption key that is unique to the account and the server writing the data. Each DEK is generated locally using a FIPS 140-2 validated cryptographic module on the server. Each account’s DEK is rotated every 24 hours or when it has been used to encrypt 64 GB of data. It can also be rotated manually, as-needed. The DEK that is used to encrypt a file is subsequently encrypted with the Master Key and appended in this wrapped format onto the encrypted data file. The key is encrypted remotely on our key management service (KMS), which is provided by AWS. In order to read a file, the process is reversed: First, the NRDB host on which the data resides extracts the wrapped DEK from the file and sends it to the KMS to be decrypted (unwrapped). Finally, the host decrypts the data file and processes it. Key rotation To prevent ciphertext attacks, a new data encryption key is generated per account every 24 hours or when the existing DEK has been used to encrypt 64 GB of data. The master key is used only to encrypt DEKs, so a ciphertext attack against it is improbable. In compliance with FIPS guidelines, the KMS automatically rotates the master key once a year. Each New Relic region contains a single master key, which is never transmitted out of the KMS. Key handling New Relic servers generate each DEK locally, and the plain text DEK is never written to disk. If an attacker gained access to process memory, they could retrieve the unencrypted DEK for that server and time period, but they would be unable to read data from other time periods. The Master key is generated, stored, and used within a FIPS 140-2 validated hardware security module (HSM) on the KMS. Neither New Relic nor AWS employees can retrieve the plaintext of the master key. Secure generation, management, backup, storage, and destruction are all handled and guaranteed by the KMS. Administrator access to key management functions is controlled and audited using AWS permissions and CloudTrail. FedRAMP authorization In addition to our usual review process for security-critical components, New Relic’s encryption system has been reviewed by a third party and found to meet all requirements of NIST SC-28(1) Protection of Information at Rest, SC-12(3) Cryptographic Key Establishment and Management, and SC-13 Cryptographic Protection. It is approved as part of our authorization for FedRAMP Moderate impact. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 633.92615, + "_score": 585.3221, "_version": null, "_explanation": null, "sort": null, @@ -6013,29 +6011,29 @@ "Guides to automate workflows", "Quickly tag resources", "Set up New Relic using Helm charts", - "Set up New Relic using the Kubernetes operator", "Automatically tag a simple \"Hello World\" Demo across the entire stack", + "Set up New Relic using the Kubernetes operator", "Automate common tasks", "Set up New Relic using Terraform" ], - "published_at": "2020-09-24T02:30:06Z", + "published_at": "2020-09-25T01:49:59Z", "title": "Automate workflows", - "updated_at": "2020-09-24T01:55:00Z", + "updated_at": "2020-09-25T01:49:59Z", "type": "developer", "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871", "document_type": "page", "popularity": 1, - "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 30 min Automatically tag a simple \"Hello World\" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform", + "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 30 min Automatically tag a simple \"Hello World\" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform", "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 6429.412, + "_score": 6304.5967, "_version": null, "_explanation": null, "sort": null, "highlight": { "sections": "Set up New Relic using Helm charts", - "body": " solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic" + "body": " solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 30 min Automatically tag a simple "Hello World" Demo across the entire stack See how easy" }, "id": "5efa999c196a67dfb4766445" }, @@ -6043,198 +6041,447 @@ "category_2": "Private locations", "nodeid": 23821, "sections": [ - "Synthetic monitoring", - "Getting started", - "Guides", - "Using monitors", - "Monitor scripting", - "Administration", - "Private locations", - "UI pages", - "Synthetics API", - "Troubleshooting", - "Install containerized private minions (CPMs)", - "General private minion features", - "Kubernetes-specific features", - "System requirements and compatibility", - "Private location key", - "Sandboxing and Docker dependencies", - "Install and update CPM versions", - "Start the CPM", - "Stop or delete the CPM", - "Show help and examples", - "Show license information", - "Configure CPM", - "Networks", - "Security, sandboxing, and running as non-root", - "Docker image repository", - "Additional considerations for CPM connection", + "Synthetic monitoring", + "Getting started", + "Guides", + "Using monitors", + "Monitor scripting", + "Administration", + "Private locations", + "UI pages", + "Synthetics API", + "Troubleshooting", + "Install containerized private minions (CPMs)", + "General private minion features", + "Kubernetes-specific features", + "System requirements and compatibility", + "Private location key", + "Sandboxing and Docker dependencies", + "Install and update CPM versions", + "Start the CPM", + "Stop or delete the CPM", + "Show help and examples", + "Show license information", + "Configure CPM", + "Networks", + "Security, sandboxing, and running as non-root", + "Docker image repository", + "Additional considerations for CPM connection", + "For more help" + ], + "title": "Install containerized private minions (CPMs)", + "category_0": "Synthetic monitoring", + "type": "docs", + "category_1": "Synthetic monitoring", + "external_id": "63c77c4ba313098967f23929294f2cbc2f8d31d3", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/img-integration-k8s@2x.png", + "url": "https://docs.newrelic.com/docs/synthetics/synthetic-monitoring/private-locations/install-containerized-private-minions-cpms", + "published_at": "2020-09-24T17:51:57Z", + "updated_at": "2020-08-13T23:22:19Z", + "breadcrumb": "Contents / Synthetic monitoring / Synthetic monitoring / Private locations", + "document_type": "page", + "popularity": 1, + "info": "Install New Relic's Docker-based private minion that accepts and runs the jobs assigned to your private locations", + "body": "You may not modify any CPM files and New Relic is not liable for any modifications you make. For more information, contact your account representative or a New Relic technical sales rep. Read on to learn about the New Relic containerized private minion (CPM), a Docker container-based private minion that accepts and executes synthetic monitors against your private locations. The CPM can operate in a Docker container system environment or a Kubernetes container orchestration system environment. The CPM will auto-detect its environment to select the appropriate operating mode. General private minion features Because the CPM operates as a container instead of a virtual machine, it delivers many features: Easy to install, start, and update Runs on: Linux macOS Windows Enhanced security and support for non-root user execution Ability to leverage a Docker container as a sandbox environment Customizable monitor check timeout Custom provided modules for scripted monitor types Kubernetes-specific features Also, the CPM delivers the following features in a Kubernetes environment: Integrates with the Kubernetes API to delegate runtime lifecycle management to Kubernetes Does not require privileged access to the Docker socket Supports hosted and on-premise Kubernetes clusters Supports various container engines such as Docker and Containerd Deployable via Helm charts as well as configuration YAMLs Allows job (ping vs. non-ping checks) based resource allocation for optimum resource management Observability offered via the New Relic One Kubernetes cluster explorer System requirements and compatibility To host CPMs, your system must meet the minimum requirements for the chosen system environment. Docker container system environment requirements Compatibility for Requirements Operating system Linux kernel: 3.10 or higher macOS: 10.11 or higher Windows: Windows 10 64-bit or higher Processor A modern, multi-core CPU Memory 2.5 GB of RAM per CPU core (dedicated) Disk space A minimum of 10 GB per host Docker version Docker 17.12.1-ce or higher Private location key You must have a private location key Kubernetes container orchestration system environment requirements (CPM v3.0.0 or higher) Compatibility for Requirements Operating system Linux kernel: 3.10 or higher macOS: 10.11 or higher Windows: Windows 10 64-bit or higher Processor A modern, multi-core CPU Minion pod CPU (vCPU/Core): 0.5 up to 0.75 Memory: 800 Mi up to 1.6 Gi Resources allocated to a Minion pod are user configurable. Runner pod CPU (vCPU/Core): 0.5 up to 1 Memory: 1.25 Gi up to 3 Gi For a Scripted API check, 1.25 Gi will be requested with a limit of 2.5 Gi. For a Simple Browser or Scripted Browser check, 2 Gi will be requested with a limit of 3 Gi. Additional considerations: Resources allocated to a Runner pod are not user configurable. The maximum limit-request resource ratio for both CPU and Memory is 2. Disk space Persistent volume (PV) of at least 10 Gi in size Note that if a ReadWriteOnce (RWO) PV is provided to the minion, an implicit node affinity will be established to ensure the minion and the runner containers are scheduled on the same node. This is required to allow the minion and the associated runners access to the PV, as an RWO PV can be accessed only by a single node in the cluster. Kubernetes version We recommend that your Kubernetes cluster supports Kubernetes v1.15. Private location key You must have a private location key Helm Follow installation instructions for Helm v3 for your OS. Kubectl Follow installation instructions for Kubectl for your OS. To view versions, dependencies, default values for how many runner pods start with each minion, the Persistent volume access mode, and more, please see Show help and examples below. Private location key Before launching CPMs, you must have a private location key. Your CPM uses the key to authenticate against New Relic and run monitors associated with that private location. To find the key for existing private location: Go to one.newrelic.com > Synthetics > Private locations. In the Private locations index, locate the private location you want your CPM to be assigned to. Note the key associated with the private location with the key key icon. Sandboxing and Docker dependencies Sandboxing and Docker dependencies are applicable to the CPM in a Docker container system environment. Docker dependencies The CPM runs in Docker and is able to leverage Docker as a sandboxing technology. This ensures complete isolation of the monitor execution, which improves security, reliability, and repeatability. Every time a scripted or browser monitor is executed, the CPM creates a brand new Docker container to run it in called a runner. The minion container needs to be configured to communicate with the Docker engine in order to spawn additional runner containers. Each spawned container is then dedicated to run a check associated with the synthetic monitor running on the private location the minion container is associated with. There are two crucial dependencies at launch. To enable sandboxing, ensure that: Your writable and executable directory is mounted at /tmp. The writable directory can be any directory you want the CPM to write into, but New Relic recommends the system's own /tmp to make things easy. Your writable Docker UNIX socket is mounted at /var/run/docker.sock or DOCKER_HOST environment variable. For more information, see Docker's Daemon socket option. Core count on the host determines how many runner containers the CPM can run concurrently on the host. Since memory requirements are scaled to the expected count of runner containers, we recommend not running multiple CPMs on the same host to avoid resource contention. For additional information on sandboxing and running as a root or non-root user, see Security, sandboxing, and running as non-root. Install and update CPM versions Both installing and updating the CPM use the same command to pull the latest Docker image from the Quay.io repository where the CPM Docker image is hosted. Go to quay.io/repository/newrelic/synthetics-minion for a list of all the releases. CPM images are also hosted on Docker Hub. Go to hub.docker.com/r/newrelic/synthetics-minion/tags for a list of all the releases. Start the CPM To start the CPM, follow the applicable Docker or Kubernetes instructions. Docker start procedure Locate your private location key. Ensure you've enabled Docker dependencies for sandboxing and installed CPM on your system. Run the appropriate script for your system. Tailor the common defaults for /tmp and /var/run/docker.sock in the following examples to match your system. Linux/macOS: docker run \\ --name YOUR_CONTAINER_NAME \\ -e \"MINION_PRIVATE_LOCATION_KEY=YOUR_PRIVATE_LOCATION_KEY\" \\ -v /tmp:/tmp:rw \\ -v /var/run/docker.sock:/var/run/docker.sock:rw \\ quay.io/newrelic/synthetics-minion:latest Windows: docker run ^ --name YOUR_CONTAINER_NAME ^ -e \"MINION_PRIVATE_LOCATION_KEY=YOUR_PRIVATE_LOCATION_KEY\" ^ -v /tmp:/tmp:rw ^ -v /var/run/docker.sock:/var/run/docker.sock:rw ^ quay.io/newrelic/synthetics-minion:latest When a message similar to Synthetics Minion is ready and servicing location YOUR_PRIVATE_LOCATION_LABEL appears, your CPM is up and ready to run monitors assigned to that location. Kubernetes start procedure Locate your private location key. Set up the a namespace for the CPM in your Kubernetes cluster: kubectl create namespace YOUR_NAMESPACE Copy the Helm charts from the New Relic Helm repo. If you are copying the charts for the first time: helm repo add YOUR_REPO_NAME https://helm-charts.newrelic.com/charts If you previously copied the Helm charts from the New Relic Helm repo, then get the latest: helm repo update Install the CPM with the following Helm command: For a fresh installation of the CPM: helm install YOUR_CPM_NAME YOUR_REPO_NAME/synthetics-minion -n YOUR_NAMESPACE --set synthetics.privateLocationKey=YOUR_PRIVATE_LOCATION_KEY To update an existing CPM installation: helm upgrade YOUR_CPM_NAME YOUR_REPO_NAME/synthetics-minion -n YOUR_NAMESPACE --set synthetics.privateLocationKey=YOUR_PRIVATE_LOCATION_KEY Check if the minion pod is up and running: kubectl get -n YOUR_NAMESPACE pods Once the status attribute of each pod is shown as running, your CPM is up and ready to run monitors assigned to your private location. Stop or delete the CPM On a Docker container system environment, use the Docker stop procedure to stop the CPM from running. On a Kubernetes container orchestration system environment, use the Kubernetes delete procedure to stop the CPM from running. Docker stop procedure You can stop a Docker container either by the container name, or the container ID. Container name stop for Linux, macOS, and Windows: docker stop YOUR_CONTAINER_NAME docker rm YOUR_CONTAINER_NAME Container ID stop for Linux/macOS: In the examples the container is stopped and removed. To only stop the container, omit docker rm $CONTAINER_ID. CONTAINER_ID=$(docker ps -aqf name=YOUR_CONTAINER_NAME) docker stop $CONTAINER_ID docker rm $CONTAINER_ID Container ID stop for Windows: In the examples the container is stopped and removed. To only stop the container, omit docker rm $CONTAINER_ID. FOR /F \"tokens=*\" %%CID IN ('docker ps -aqf name=YOUR_CONTAINER_NAME') do (SET CONTAINER_ID=%%CID) docker stop %CONTAINER_ID% docker rm %CONTAINER_ID% Kubernetes delete procedure Get the MINION_POD_INSTALLATION_NAME of the minion pod you want to delete: helm list -n YOUR_NAMESPACE Delete the minion pod: helm uninstall -n YOUR_NAMESPACE MINION_POD_INSTALLATION_NAME Delete the namespace set up for the CPM in your Kubernetes cluster: kubectl delete namespace YOUR_NAMESPACE Show help and examples Use these options as applicable: To get a list of the most commonly used run options directly in the command line interface, run the show help command. To show CPM usage examples as well as the list of all the available run options, run this command: docker run quay.io/newrelic/synthetics-minion:latest help To keep track of Docker logs and verify the health of your monitors, see Containerized private minion (CPM) maintenance and monitoring. For a CPM in the Kubernetes container orchestration system environment, the following Helm show commands can be used to view the chart.yaml and the values.yaml, respectively: helm show chart YOUR_REPO_NAME/synthetics-minion helm show values YOUR_REPO_NAME/synthetics-minion Show license information To show the licensing information for the open source software that we use in the CPM, run the LICENSE command. Run this command to view license information for CPM versions 2.2.27 or higher: docker run quay.io/newrelic/synthetics-minion:latest LICENSE Some of our open-source software is listed under multiple software licenses, and in that case we have listed the license we've chosen to use. Our license information is also available in the our licenses documentation. Configure CPM You can configure the containerized private minion with custom npm modules, preserve data between launches, use environment variables, and more. For more information, see CPM configuration. Networks For both Docker and Kubernetes, the CPM and its runner containers will inherit network settings from the host. For an example of this on a Docker container system environment, see the Docker site. A new bridge network is created for each runner container. This means networking command options like --network and --dns passed to the CPM container at launch (such as through Docker run commands on a Docker container system environment) are not inherited or used by the runner containers. When these networks are created, they pull from the default IP address pool configured for daemon. For an example of this on a Docker container system environment, see the Docker site. Typically, the runner network is removed after the check is completed. However, if a CPM exits while a check is still running, or exits in another unexpected circumstance, these networks may get orphaned. This can potentially use up IP address space that is available to the Docker daemon. If this happens, you may see INTERNAL ENGINE ERROR code: 31 entries in your CPM logging when trying to create a new runner container. To clean these up in Docker container system environments only, run docker network prune. Security, sandboxing, and running as non-root By default, the software running inside a CPM is executed with root user privileges. This is suitable for most scenarios, as the execution is sandboxed. In a Docker container system environment: To change the default AppArmor profile used by containers that CPM spawns to run monitors, see the environment variable MINION_RUNNER_APPARMOR (CPM version 3.0.3 or higher) or MINION_DOCKER_RUNNER_APPARMOR (CPM version up to v3.0.2). To run the CPM as a non-root user, additional steps are required: Run as non-root user for Docker For more information, see Docker's official documentation about security and AppArmor security profiles. If your environment requires you to run the CPM as a non-root user, follow this procedure. In the following example, the non-root user is my_user. Ensure that my_user can use the Docker engine on the host: Verify that my_user belongs to the \"docker\" system group. OR Enable the Docker TCP socket option, and pass the DOCKER_HOST environment variable to CPM. Verify that my_user has read/write permissions to all the directories and volumes passed to CPM. To set these permission, use the chmod command. Get the uid of my_user for use in the run command: id -u my_user. Once these conditions are met, use the option \"-u :\" when launching CPM: docker run ... -u 1002 ... OR docker run ... -u 1002 -e DOCKER_HOST=http://localhost:2375 ... Docker image repository A single CPM Docker image serves both the Docker container system environment and Kubernetes container orchestration system environment. The Docker image is hosted on quay.io. To make sure your Docker image is up-to-date, see the quay.io newrelic/synthetics-minion repository. Additional considerations for CPM connection Connection Description CPMs without Internet access A CPM can operate without access to the internet, but with some exceptions. The public internet health check can be disabled using the environment variables named MINION_NETWORK_HEALTHCHECK_DISABLED for a Docker container system environment or synthetics.minionNetworkHealthCheckDisabled for a Kubernetes container orchestration system environment. The CPM needs to be able to contact the \"synthetics-horde.nr-data.net\" domain. This is necessary for it to report data to New Relic and to receive monitors to execute. Ask your network administration if this is a problem and how to set up exceptions. Communicate with Synthetics via a proxy To set up communication with New Relic by proxy, use the environment variables named MINION_API_PROXY*. Arguments passed at launch This applies to a Docker container environment only. Arguments passed to the CPM container at launch do not get passed on to the containers spawned by the CPM. Docker has no concept of \"inheritance\" or a \"hierarchy\" of containers, and we don't copy the configuration that is passed from CPM to the monitor-running containers. The only shared configuration between them is the one set at the Docker daemon level. 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.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 119.129, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "sections": "Using monitors", + "info": "Install New Relic's Docker-based private minion that accepts and runs the jobs assigned to your private locations", + "body": " appears, your CPM is up and ready to run monitors assigned to that location. Kubernetes start procedure Locate your private location key. Set up the a namespace for the CPM in your Kubernetes cluster: kubectl create namespace YOUR_NAMESPACE Copy the Helm charts from the New Relic Helm repo. If you" + }, + "id": "5f31d981196a678103fbd731" + }, + { + "category_2": "Get started", + "nodeid": 27301, + "sections": [ + "Kubernetes integration", + "Get started", + "Installation", + "Understand and use data", + "Link apps and services", + "Kubernetes events", + "Logs", + "Troubleshooting", + "Introduction to the Kubernetes integration", + "Get started: Install the Kubernetes integration", + "Why it matters", + "Navigate all your Kubernetes events", + "Bring your cluster logs to New Relic", + "Check the source code", + "For more help" + ], + "title": "Introduction to the Kubernetes integration", + "category_0": "Integrations", + "type": "docs", + "category_1": "Kubernetes integration", + "external_id": "4ad996d529753d173874d752239ece44c8e6d43f", + "image": "", + "url": "https://docs.newrelic.com/docs/integrations/kubernetes-integration/get-started/introduction-kubernetes-integration", + "published_at": "2020-09-24T18:09:37Z", + "updated_at": "2020-08-05T01:57:55Z", + "breadcrumb": "Contents / Integrations / Kubernetes integration / Get started", + "document_type": "page", + "popularity": 1, + "info": "New Relic's Kubernetes integration: features, requirements, and getting started. ", + "body": "New Relic's Kubernetes integration gives you full observability into the health and performance of your environment, no matter whether you run Kubernetes on-premises or in the cloud. With our cluster explorer, you can cut through layers of complexity to see how your cluster is performing, from the heights of the control plane down to applications running on a single pod. one.newrelic.com > Kubernetes cluster explorer: The cluster explorer is our powerful, fully visual answer to the challenges associated with running Kubernetes at a large scale. You can see the power of the Kubernetes integration in the cluster explorer, where the full picture of a cluster is made available on a single screen: nodes and pods are visualized according to their health and performance, with pending and alerting nodes in the innermost circles. Predefined alert conditions help you troubleshoot issues right from the start. Clicking each node reveals its status and how each app is performing. Get started: Install the Kubernetes integration We have an automated installer to help you with many types of installations: servers, virtual machines, and unprivileged environments. It can also help you with installations in managed services or platforms, but you'll need to review a few preliminary notes before getting started. Here's what the automated installer does: Asks for the cluster name and namespace of the integration. Asks for additional setup options, such as Kube state metrics. Asks for the installation method: manifest file or Helm. Generates either the manifest or Helm chart. Read the install docs Start the installer If your New Relic account is in the EU region, access the automated installer from one.eu.newrelic.com. Why it matters Governing the complexity of Kubernetes can be challenging; there's so much going on at any given moment, with containers being created and deleted in a matter of minutes, applications crashing, and resources being consumed unexpectedly. Our integration helps you navigate Kubernetes abstractions across on-premises, cloud, and hybrid deployments. In New Relic, you can build your own charts and query all your Kubernetes data, which our integration collects by instrumenting the container orchestration layer. This gives you additional insight into nodes, namespaces, deployments, replica sets, pods, and containers. one.newrelic.com > Dashboards: Using the chart builder you can turn any query on Kubernetes data to clear visuals. With the Kubernetes integration you can also: Link your APM data to Kubernetes to measure the performance of your web and mobile applications, with metrics such as request rate, throughput, error rate, and availability. Monitor services running on Kubernetes, such as Apache, NGINX, Cassandra, and many more (see our tutorial for monitoring Redis on Kubernetes). Create new alert policies and alert conditions based on your Kubernetes data, or extend the predefined alert conditions. These features are in addition to the data New Relic already reports for containerized processes running on instrumented hosts. Navigate all your Kubernetes events The Kubernetes events integration, which is installed separately, watches for events happening in your Kubernetes clusters and sends those events to New Relic. Events data is then visualized in the cluster explorer. To set it up, check the Kubernetes events box in step 3 of our install wizard, or follow the instructions. one.newrelic.com > Kubernetes cluster explorer > Events: Browse and filter all your Kubernetes events, and dig into application logs and infrastructure data. Bring your cluster logs to New Relic Our Kubernetes plugin for log monitoring can collect all your cluster's logs and send them to our platform, so that you can set up new alerts and charts. To set it up, check the Log data box in step 3 of our install wizard, or follow the instructions. Check the source code This integration is open source software. That means you can browse its source code and send improvements, or you can create your own fork and build it. For more information, see the README. 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.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 100.26596, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "sections": "Bring your cluster logs to New Relic", + "info": "New Relic's Kubernetes integration: features, requirements, and getting started. ", + "body": " data. Bring your cluster logs to New Relic Our Kubernetes plugin for log monitoring can collect all your cluster's logs and send them to our platform, so that you can set up new alerts and charts. To set it up, check the Log data box in step 3 of our install wizard, or follow the instructions. Check" + }, + "id": "5cf9564164441f8f472a9169" + }, + { + "image": "https://developer.newrelic.com/static/kubecon-europe-2020-b989ec0e7b4ed71a89666c35fe934433.jpg", + "url": "https://developer.newrelic.com/kubecon-europe-2020/", + "sections": [ + "KubeCon and CloudNativeCon Europe 2020", + "New Relic welcomes you at Virtual Kubecon and CloudNativeCon Europe 2020!", + "Attend one of our lightning talks", + "Note", + "We handle Prometheus, you keep Grafana", + "How to use and customize Helm charts", + "Kubernetes observability with context", + "What is OpenTelemetry and how to get started?", + "OpenTelemetry Architecture", + "Kubernetes in the wild: best practices", + "Want some action now? Check out the following videos!", + "How to use the Kubernetes cluster explorer", + "What is OpenTelemetry?", + "Connecting Prometheus and Grafana to New Relic" + ], + "published_at": "2020-09-25T01:51:37Z", + "title": "New Relic Developers", + "updated_at": "2020-08-15T01:43:38Z", + "type": "developer", + "external_id": "53cb6afa4f4062ba359559e9fb3bb2406ece2ad4", + "document_type": "page", + "popularity": 1, + "body": "KubeCon and CloudNativeCon Europe 2020 New Relic welcomes you at Virtual Kubecon and CloudNativeCon Europe 2020! Learn more about the New Relic One platform, the only observability platform that provides open, connected and programmable observability for cloud-native environments. Join us to dive into the New Relic One platform and our Kubernetes cluster explorer. Register here Attend one of our lightning talks Note Go to the virtual expo tab, and find New Relic in Silver Hall B to attend a lightning talk. We handle Prometheus, you keep Grafana Mon Aug 17 @ 14:35 CEST Samuel Vandamme How to use and customize Helm charts Mon Aug 17 @ 16:25 CEST Douglas Camata Kubernetes observability with context Tue Aug 18 @ 15:05 CEST Stijn Polfliet What is OpenTelemetry and how to get started? Tue Aug 18 @ 17:15 CEST Lavanya Chockaligam How to use and customize Helm charts Wed Aug 19 @ 15:05 CEST Douglas Camata OpenTelemetry Architecture Wed Aug 19 @ 16:25 CEST John Watson Kubernetes in the wild: best practices Thu Aug 20 @ 15:05 CEST Martin Fuentes Kubernetes observability with context Thu Aug 20 @ 16:50 CEST Stijn Polfliet Want some action now? Check out the following videos! How to use the Kubernetes cluster explorer What is OpenTelemetry? Connecting Prometheus and Grafana to New Relic", + "info": "", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 99.03407, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "New Relic Developers", + "sections": "How to use and customize Helm charts", + "body": " to use and customize Helm charts Mon Aug 17 @ 16:25 CEST Douglas Camata Kubernetes observability with context Tue Aug 18 @ 15:05 CEST Stijn Polfliet What is OpenTelemetry and how to get started? Tue Aug 18 @ 17:15 CEST Lavanya Chockaligam How to use and customize Helm charts Wed Aug 19 @ 15:05 CEST" + }, + "id": "5f373dcae7b9d20949909274" + }, + { + "category_2": "Installation", + "nodeid": 14966, + "sections": [ + "Kubernetes integration", + "Get started", + "Installation", + "Understand and use data", + "Link apps and services", + "Kubernetes events", + "Logs", + "Troubleshooting", + "Kubernetes integration: install and configure", + "Installs for managed services and platforms", + "Custom manifest", + "Make sure New Relic pods can be scheduled", + "Unprivileged installs of the Kubernetes integration", + "Configure the integration", + "Update to the latest version", + "Uninstall the Kubernetes integration", + "For more help" + ], + "title": "Kubernetes integration: install and configure", + "category_0": "Integrations", + "type": "docs", + "category_1": "Kubernetes integration", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/integrations/kubernetes-integration/installation/kubernetes-integration-install-configure", + "external_id": "e2a0aea9a0c2461e833148e95859ee34f03bce95", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/cke.jpeg", + "url": "https://docs.newrelic.com/docs/integrations/kubernetes-integration/installation/kubernetes-integration-install-configure", + "published_at": "2020-09-24T06:58:23Z", + "updated_at": "2020-09-24T06:58:23Z", + "breadcrumb": "Contents / Integrations / Kubernetes integration / Installation", + "document_type": "page", + "popularity": 1, + "info": "New Relic's Kubernetes integration: How to install and activate the integration, and what data is reported.", + "body": "The easiest way to install the Kubernetes integration is to use our automated installer to generate a manifest. It bundles not just the integration DaemonSets, but also other New Relic Kubernetes configurations, like Kubernetes events, Prometheus OpenMetrics, and New Relic log monitoring. You can use the automated installer for servers, VMs, and unprivileged environments. The installer can also help you with managed services or platforms after you review a few preliminary notes. We also have separate instructions if you need a custom manifest or prefer to do a manual unprivileged installation. Start the installer If your New Relic account is in the EU region, access the installer from one.eu.newrelic.com. Installs for managed services and platforms Before starting our automated installer, check out these notes for your managed services or platforms: Amazon EKS The Kubernetes integration monitors worker nodes. In Amazon EKS, master nodes are managed by Amazon and abstracted from the Kubernetes platforms. Before starting our automated installer to deploy the Kubernetes integration in Amazon EKS, make sure you are using the version of kubectl provided by AWS. Google Kubernetes Engine (GKE) The Kubernetes integration monitors worker nodes. In GKE, master nodes are managed by Google and abstracted from the Kubernetes platforms. Before starting our automated installer to deploy the Kubernetes integration on GKE, ensure you have sufficient permissions: Go to https://console.cloud.google.com/iam-admin/iam and find your username. Click edit. Ensure you have permissions to create Roles and ClusterRoles: If you are not sure, add the Kubernetes Engine Cluster Admin role. If you cannot edit your user role, ask the owner of the GCP project to give you the necessary permissions. Ensure you have a RoleBinding that grants you the same permissions to create Roles and ClusterRoles: kubectl create clusterrolebinding YOUR_USERNAME-cluster-admin-binding --clusterrole=cluster-admin --user=YOUR_GCP_EMAIL Creating a RoleBinding is necessary because of a known RBAC issue in Kubernetes and Kubernetes Engine versions 1.6 or higher. For more information, see Google Cloud's documentation on defining permissions in a role. OpenShift container platform To deploy the Kubernetes integration with OpenShift: Add the newrelic service account to your privileged Security Context Constraints: oc adm policy add-scc-to-user privileged \\ system:serviceaccount: :newrelic Complete the steps in our automated installer. If you're using signed certificates, make sure they are properly configured by using the following variables to set the .pem file: - name: NRIA_CA_BUNDLE_DIR value: YOUR_CA_BUNDLE_DIR - name: NRIA_CA_BUNDLE_FILE value: YOUR_CA_BUNDLE_NAME Save your changes. Azure Kubernetes Service (AKS) The Kubernetes integration monitors worker nodes. In Azure Kubernetes Service, master nodes are managed by Azure and abstracted from the Kubernetes platforms. To deploy in Azure Kubernetes Service (AKS), complete the steps in our automated installer. Pivotal Container Service (PKS / VMware Tanzu) To deploy in PKS, we recommend that you use the automated installer, or you can follow the manual instructions provided in Install the Kubernetes integration using Helm. Custom manifest If the Kubernetes automated installer doesn't provide the settings you need, you can download our manifest template and install the integration manually. To activate the Kubernetes integration, you must deploy the newrelic-infra agent onto a Kubernetes cluster as a DaemonSet: Install kube-state-metrics and get it running on the cluster. For example: curl -L -o kube-state-metrics- 1.9.5 .zip https://github.com/kubernetes/kube-state-metrics/archive/v 1.9.5 .zip && unzip kube-state-metrics- 1.9.5 .zip && kubectl apply -f kube-state-metrics- 1.9.5 /examples/standard Download the manifest file: curl -O https://download.newrelic.com/infrastructure_agent/integrations/kubernetes/newrelic-infrastructure-k8s-latest.yaml In the manifest, add your New Relic license key and a cluster name to identify your Kubernetes cluster. Both values are required. Recommendation: Do not change the NRIA_PASSTHROUGH_ENVIRONMENT or NRIA_DISPLAY_NAME value in your manifest. env: - name: NRIA_LICENSE_KEY value: YOUR_LICENSE_KEY - name: CLUSTER_NAME value: YOUR_CLUSTER_NAME Review the Configure section of this docs in case you need to adapt the manifest to fit your environment. Confirm that kube-state-metrics is installed. kubectl get pods --all-namespaces | grep kube-state-metrics Create the DaemonSet: kubectl create -f newrelic-infrastructure-k8s-latest.yaml Confirm that the DaemonSet has been created successfully by looking for newrelic-infra in the results generated by this command: kubectl get daemonsets To confirm that the integration is working: wait a few minutes, then look for data in the New Relic Kubernetes cluster explorer. If you don't see data, review the configuration procedures again, then follow the troubleshooting procedures. In the future, the number of labels collected on Kubernetes objects will be limited per object type (containers, pods, nodes, etc.) . If objects have labels above the limit, you will be able to configure important labels that should always be sent to New Relic. When the limitation is in place, this documentation will be updated. Make sure New Relic pods can be scheduled Some of the New Relic pods are set up as DaemonSet in the manifest file so that they can run on every host. These include newrelic-infrastructure and newrelic-logging. In rare circumstances, it is possible for other pods to be scheduled first and starve the New Relic pods of resources. Since each of these pods have to run on a specific host, they will stay in pending status until that host has enough resources, even if there are other hosts available. This could end up occurring for long periods of time and result in reporting gaps. To prevent this scenario you can configure the Kubernetes scheduler to give New Relic pods a higher priority. Using the default scheduler: Ensure kube-scheduler flag disablePreemption is not set to true (by default it is false). Create a PriorityClass for the New Relic DaemonSet pods. Set the appropriate priority value, which should generally be higher than your other pods. preemptionPolicy is set to PreemptLowerPriority by default. This allows New Relic pods assigned this priority class to remove lower-priority pods that are taking up resources. Edit the manifest file to add priorityClassName to any DaemonSet specs. In the example below, the highlighted line sets the priority class for newrelic-infrastructure: apiVersion: apps/v1 kind: DaemonSet metadata: namespace: default labels: app: newrelic-infrastructure chart: newrelic-infrastructure-1.0.0 release: nri-bundle mode: privileged name: nri-bundle-newrelic-infrastructure spec: priorityClassName: your-priority-class ... If you have already deployed the New Relic pods, re-deploy them and confirm they have been created: kubectl delete -f newrelic-infrastructure-k8s-latest.yaml kubectl create -f newrelic-infrastructure-k8s-latest.yaml kubectl get daemonsets Unprivileged installs of the Kubernetes integration For platforms that have stringent security requirements, we provide an unprivileged version of the Kubernetes integration. Changes from the standard Kubernetes integration are: Runs the infrastructure agent and the Kubernetes integration as a standard user instead of root No access to the underlying host filesystem No access to /var/run/docker.sock Container's root filesystem mounted as read-only allowPrivilegeEscalation is set to false hostnetwork is set to false The tradeoff is that the solution will only collect metrics from Kubernetes, but it will not collect any metric from the underlying hosts directly. Kubernetes provides some data (metrics and metadata) about its nodes (hosts). Optional: To collect the underlying host metrics, the non-containerized infrastructure agent can be deployed on the underlying host. The infrastructure agent already supports running as non-root. The combination of the Kubernetes integration in its unprivileged version and the agent running on the host will report all the metrics that our standard solution for monitoring Kubernetes receives. Steps to complete an unprivileged install Install kube-state-metrics and get it running on the cluster. For example: curl -L -o kube-state-metrics- 1.9.5 .zip https://github.com/kubernetes/kube-state-metrics/archive/v 1.9.5 .zip && unzip kube-state-metrics- 1.9.5 .zip && kubectl apply -f kube-state-metrics- 1.9.5 /examples/standard Download the integration manifest: curl -O https://download.newrelic.com/infrastructure_agent/integrations/kubernetes/newrelic-infrastructure-k8s-unprivileged-latest.yaml In the manifest, add your New Relic license key and a cluster name to identify your Kubernetes cluster. Both values are required. env: - name: NRIA_LICENSE_KEY value: YOUR_LICENSE_KEY - name: CLUSTER_NAME value: YOUR_CLUSTER_NAME Confirm that kube-state-metrics is installed. kubectl get pods --all-namespaces | grep kube-state-metrics Create the DaemonSet: kubectl create -f newrelic-infrastructure-k8s-unprivileged-latest.yaml Confirm that the DaemonSet has been created successfully by looking for newrelic-infra in the results generated by this command: kubectl get daemonsets To confirm that the integration has been configured correctly, wait a few minutes, then run this NRQL query to see if data has been reported: SELECT * FROM K8sPodSample since 5 minutes ago Configure the integration The Kubernetes integration comes with a default configuration that should work in most environments. To change the configuration, modify the manifest file: Select which processes should send their data to New Relic By default, data about the processes running on your pods is not sent to New Relic. You can enable it by setting enable_process_metrics to true. To choose what metric data you want to send to New Relic, configure the include_matching_metrics environment variable in your manifest. Specify the Kubernetes API host and port This is necessary when you are using SSL and not using the default FQDN. The Kubernetes API FQDN needs to match the FQDN of the SSL certificate. You do not need to specify both variables. For example, if you only specify the HOST, the default PORT will be used. - name: \"KUBERNETES_SERVICE_HOST\" value: \"KUBERNETES_API_HOST\" - name: \"KUBERNETES_SERVICE_PORT\" value: \"KUBERNETES_API_TCP_PORT\" Kubernetes versions 1.6 to 1.7.5: Edit manifest file For Kubernetes versions 1.6 to 1.7.5, uncomment these two lines in the manifest file: - name: \"CADVISOR_PORT\" # Enable direct connection to cAdvisor by specifying the port. Needed for Kubernetes versions prior to 1.7.6. value: \"4194\" Use environment variables Use environment variables that can be passed to the Kubernetes integration if you use a proxy to configure its URL. Disable kube-state-metrics parsing You can disable kube-state-metrics parsing for the DaemonSet by using the following configuration: - name: \"DISABLE_KUBE_STATE_METRICS\" value: \"true\" Disabling kube-state-metrics also disables data collection for the following: ReplicaSets DaemonSets StatefulSets Namespaces Deployments Services Endpoints Pods (that are pending) Additionally, disabling this affects the Kubernetes Cluster Explorer in the following ways: No pending pods are shown. No filters based on services. Specify the kube-state-metrics URL If several instances of kube-state-metrics are present in the cluster, uncomment and configure the following lines to specify which one to use: - name: \"KUBE_STATE_METRICS_URL\" value: \"http://KUBE_STATE_METRICS_IP_OR_FQDN:PORT\" Even though a KUBE_STATE_METRICS_URL is defined, the KSM service should contain one of the following labels for the auto-discovery process: k8s-app=kube-state-metrics OR app=kube-state-metrics This configuration option overrides KUBE_STATE_METRICS_POD_LABEL. If you have both defined, KUBE_STATE_METRICS_POD_LABEL has no effect. Discover kube-state-metrics pods using a label If several instances of kube-state-metrics are present in the cluster, another option to easily target one of these instances with the Kubernetes integration is to use label-based discovery. - name: \"KUBE_STATE_METRICS_POD_LABEL\" value: \"LABEL_NAME\" When a KUBE_STATE_METRICS_POD_LABEL is defined, the label should have a value equal to true. For example, if the label name is my-ksm, ensure that my-ksm=true. This configuration option is incompatible with KUBE_STATE_METRICS_URL. If you have both defined, KUBE_STATE_METRICS_URL is used. Query kube-state-metrics behind RBAC If your instance of kube-state-metrics is behind kube-rbac-proxy, the integration can be configured in a compatible way using the combination of the label-based discovery and two other environment variables: - name: \"KUBE_STATE_METRICS_SCHEME\" value: \"https\" - name: \"KUBE_STATE_METRICS_PORT\" value: \"KSM_RBAC_PROXY_PORT\" To confirm which port should be used as the value of KUBE_STATE_METRICS_PORT, we recommend running a describe command on the kube-state-metrics pod and look for the port exposed by the container named kube-rbac-proxy-main. These two configuration options only work when using the KUBE_STATE_METRICS_POD_LABEL ​configuration described above. kube-state-metrics timeout: Increase the client timeout To increase the client timeout of kube-state-metrics, add a new environment variable, TIMEOUT, to the manifest file: env: - name: TIMEOUT value: 5000 # The default client timeout when calling kube-state-metrics, in milliseconds Then, add this new environment variable to the NRIA_PASSTHROUGH_ENVIRONMENT Non-default namespace deployments: Edit config file If you want to deploy in a different namespace from default, change all values of namespace in the manifest. Set the TTL for the Kubernetes API responses cache By default, the integration will cache any retrieved information from the Kubernetes API for 5 minutes. Use the API_SERVER_CACHE_TTL environment variable to set a custom cache duration for responses from the API server. Valid time unit values are: ns, us, ms, s, m, and h. To disable caching, set to 0s. env: - name: API_SERVER_CACHE_TTL value: \"1m\" Specify base URLs for control plane component endpoints Use the following environment variables if any of the Kubernetes control plane components export metrics on base URLs that are different from the defaults. This is necessary for environments such as OpenShift when a control plane component metrics endpoint is using SSL or an alternate port. Values of these environment variables must be base URLs of the form [scheme]://[host]:[port]. URLs should not include a path component. For example: - name: \"SCHEDULER_ENDPOINT_URL\" value: \"https://localhost:10259 - name: \"ETCD_ENDPOINT_URL\" value: \"https://localhost:9979\" - name: \"CONTROLLER_MANAGER_ENDPOINT_URL\" value: \"https://localhost:10257\" - name: \"API_SERVER_ENDPOINT_URL\" value: \"https://localhost:6443\" The /metrics path segment is added automatically. In addition, if the https scheme is used, authentication to the control plane component pod(s) is accomplished via service accounts. If a FQDN (fully qualified domain name) is used in a multi-master cluster, inconsistent results may be returned. Therefore, it is recommended to use localhost only. Even though a custom base URL is defined for a given control plane component, the control plane component pod(s) must contain one of the labels supported by the auto-discovery process. Even though a custom ETCD_ENDPOINT_URL can be defined, ETCD will always require https and mTLS authentication to be configured. Here are some additional configurations to consider: Do more configuration for control plane monitoring Link New Relic APM to the Kubernetes integration Monitor services that run on Kubernetes Update to the latest version To improve our unified experience, starting from Wednesday, August 12, 2020, Kubernetes integrations that use v1.7 or older will be deprecated. If you are using v1.7 or older, you will need to update your integration in order to continue viewing Kubernetes performance data. For more information, see the Kubernetes v1.7 or older deprecation notice. If you are already running the Kubernetes integration and want to update the newrelic-infra agent to the latest agent version: Run this NRQL query to check which version you are currently running (this will return the image name by cluster): SELECT latest(containerImage) FROM K8sContainerSample WHERE containerImage LIKE '%newrelic/infrastructure%' FACET clusterName SINCE 1 day ago If you've set a name other than newrelic/infrastructure for the integration's container image, the above query won't yield results: to make it work, edit the name in the query. Download the integration manifest file: curl -O https://download.newrelic.com/infrastructure_agent/integrations/kubernetes/newrelic-infrastructure-k8s-latest.yaml Copy the changes you made to the manifest. At a minimum, include CLUSTER_NAME and NRIA_LICENSE_KEY, and paste your changes in the manifest you downloaded. Install the latest DaemonSet with the following command (Kubernetes will automatically do a rollout upgrade for the integration's pods): kubectl apply -f newrelic-infrastructure-k8s-latest.yaml Uninstall the Kubernetes integration To uninstall the Kubernetes integration: Verify that newrelic-infrastructure-k8s-latest.yaml corresponds to the filename of the manifest as you have saved it. Example: If you are using the unprivileged version of the integration, the default filename will be newrelic-infrastructure-k8s-unprivileged-latest.yaml. After you verify the filename, use the following command: kubectl delete -f newrelic-infrastructure-k8s-latest.yaml You only need to execute this command once, regardless of the number of nodes in your cluster. 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.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 94.341736, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "sections": "Make sure New Relic pods can be scheduled", + "info": "New Relic's Kubernetes integration: How to install and activate the integration, and what data is reported.", + "body": " pods can be scheduled Some of the New Relic pods are set up as DaemonSet in the manifest file so that they can run on every host. These include newrelic-infrastructure and newrelic-logging. In rare circumstances, it is possible for other pods to be scheduled first and starve the New Relic pods" + }, + "id": "5efd3b2e64441fd60f5f7e49" + } + ], + "/collect-data/query-data-nrql": [ + { + "category_2": "Get started", + "nodeid": 11431, + "sections": [ + "NRQL: New Relic Query Language", + "Get started", + "NRQL query tools", + "NRQL query tutorials", + "Introduction to NRQL, New Relic's query language", + "What is NRQL?", + "Where can you use NRQL?", + "What data can you query with NRQL?", + "Start using NRQL", + "NRQL query examples", + "NRQL syntax", + "For more help" + ], + "title": "Introduction to NRQL, New Relic's query language", + "category_0": "Query your data", + "type": "docs", + "category_1": "NRQL: New Relic Query Language", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", + "external_id": "d44be2c7df7addda8679b4c842015223cfcbd1a3", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-view-chart-nrql-query_0.png", + "url": "https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", + "published_at": "2020-09-24T08:40:21Z", + "updated_at": "2020-09-24T08:40:20Z", + "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started", + "document_type": "page", + "popularity": 1, + "info": "An introduction to New Relic Query Language (NRQL) and how to use it.", + "body": "One way to query your New Relic data is with the New Relic Query Language (NRQL). This resource explains what NRQL is, when and how you can use it, and basic syntax rules. For more detailed information on querying, including a listing of clauses and functions and example queries, see NRQL syntax, clauses, and functions. What is NRQL? NRQL is New Relic's SQL-like query language. You can use NRQL to retrieve detailed New Relic data and get insight into your applications, hosts, and business-important activity. Reasons to use NRQL include: To answer a question for the purpose of troubleshooting or business analysis To create a new chart To make API queries of New Relic data (for example, using our NerdGraph API) NRQL is used behind the scenes to generate some New Relic charts: Some New Relic charts are built using NRQL. One way to start using NRQL is to view a chart's query and then edit it to make your own custom chart. Where can you use NRQL? You can use NRQL in these places: New Relic One query builder: Advanced mode is a NRQL query interface Basic mode provides a simplified query experience that doesn't require knowledge of NRQL but that uses NRQL to generate results New Relic Insights NerdGraph: our GraphQL-format API, which includes options for making NRQL queries one.newrelic.com > Query your data: You can run a NRQL query in both New Relic One and New Relic Insights. This NRQL query shows a count of distributed tracing spans faceted by their entity names. NRQL is one of several ways to query New Relic data. For more on all query options, see Query your data. What data can you query with NRQL? NRQL allows you to query these New Relic data types: Event data from all New Relic products, including: APM events, like Transaction New Relic Browser events, like PageView New Relic Mobile events, like Mobile Infrastructure events, like ProcessSample Synthetics events, like SyntheticCheck Custom events, like those reported by the Event API Metric timeslice data (metrics reported by New Relic APM, Browser, and Mobile) The Metric data type (metrics reported by the Metric API and data sources that use that API) The Span data type (distributed tracing data) The Log data type (data from New Relic Logs) Some data, like relationships between monitored entities, is not available via NRQL but is available using our NerdGraph API. Start using NRQL One way to start using NRQL and to understand what data you have available is to go to a NRQL interface (for example, the New Relic One query builder), type FROM, and press space. The interface will suggest available types of data: To see the attributes available for a specific data type, type FROM DATA_TYPE SELECT and press space. The interface will suggest available attributes. For example: To see the complete JSON associated with a data type, including all of its attributes, use the keyset() attribute. For example: FROM Transaction SELECT keyset() NRQL is used behind the scenes to build some New Relic charts and dashboards. One way to learn NRQL is to find one of these NRQL-generated charts and start playing with the NRQL to create new, customized queries and charts: Charts built with NRQL will have View query as an option. You can then edit and customize that query to see how your changes affect the resulting visualization. To explore your data without having to use NRQL, use the basic mode of New Relic One query builder. NRQL query examples Here's an example NRQL query of Transaction data, which is reported by New Relic APM. FROM Transaction SELECT average(duration) FACET appName TIMESERIES auto This would generate a chart that looks like: Here are some more query examples: Basic NRQL query of Browser data Here's a NRQL query of PageView data, which is reported by New Relic Browser. SELECT uniqueCount(user) FROM PageView WHERE userAgentOS = 'Mac' FACET countryCode SINCE 1 day ago LIMIT 20 Attribute name with a space in it If a custom attribute name has a space in it, use backticks around the attribute name: SELECT count(*) FROM Transaction FACET `Logged-in user` Querying multiple data sources To return data from two data sources, separate their data types with a comma. For example, this query returns a count of all APM transactions and Browser events over the last three days:​ SELECT count(*) FROM Transaction, PageView SINCE 3 days ago Query returning multiple columns To return multiple columns from a dataset, separate the aggregator arguments with a comma: SELECT function(attribute), function(attribute) ... FROM ... This query returns the minimum, average, and maximum duration for New Relic Browser PageView events over the last week: SELECT min(duration), max(duration), average(duration) FROM PageView SINCE 1 week ago See more NRQL query examples. NRQL syntax The syntax of a NRQL query is similar to standard SQL queries. Here is a breakdown of the structure of a NRQL query: SELECT function(attribute) [AS 'label'][, ...] FROM data type [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] Basic rules include: NRQL condition Details Required values The SELECT statement and FROM clause are required. All other clauses are optional. You can start your query with either SELECT or FROM. Query string size The query string must be less than 4 KB. Case sensitivity The data type names and attribute names are case sensitive. NRQL clauses and functions are not case sensitive. Syntax for strings NRQL uses single quotes to designate strings. For example: ... where traceId = '030a573f0df02c57' Attribute names with spaces Use backticks `` to quote a custom attribute name that has a space in it. For example: ... FACET `Logged-in user` Data type coercion Insights does not support data type \"coercion.\" For more information, see Data type conversion. Use of math functions Basic and advanced math functions are supported in the SELECT statement. JOIN functions NRQL does not have the equivalent of the SQL JOIN function, but you can simulate a JOIN with custom attributes. Read more about NRQL syntax and functions. 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.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 176.63052, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "title": "Introduction to NRQL, New Relic's query language", + "sections": "What data can you query with NRQL?", + "info": "An introduction to New Relic Query Language (NRQL) and how to use it.", + "category_0": "Query your data", + "category_1": "NRQL: New Relic Query Language", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", + "body": "One way to query your New Relic data is with the New Relic Query Language (NRQL). This resource explains what NRQL is, when and how you can use it, and basic syntax rules. For more detailed information on querying, including a listing of clauses and functions and example queries, see NRQL syntax", + "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started" + }, + "id": "5f2abd47196a67747343fbe1" + }, + { + "category_2": "Custom events", + "nodeid": 13661, + "sections": [ + "Event data sources", + "Default events", + "Custom events", + "Data requirements and limits for custom event data", + "General requirements", + "Reserved words", + "Additional Browser PageAction requirements", + "Additional Event API requirements", + "Event type limits", "For more help" ], - "title": "Install containerized private minions (CPMs)", - "category_0": "Synthetic monitoring", + "title": "Data requirements and limits for custom event data", + "category_0": "Insights", "type": "docs", - "category_1": "Synthetic monitoring", - "external_id": "63c77c4ba313098967f23929294f2cbc2f8d31d3", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/img-integration-k8s@2x.png", - "url": "https://docs.newrelic.com/docs/synthetics/synthetic-monitoring/private-locations/install-containerized-private-minions-cpms", - "published_at": "2020-09-24T17:51:57Z", - "updated_at": "2020-08-13T23:22:19Z", - "breadcrumb": "Contents / Synthetic monitoring / Synthetic monitoring / Private locations", + "category_1": "Event data sources", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", + "external_id": "f5beef0d09bb5918be3f8a1a3ece98c09947cd1e", + "image": "", + "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", + "published_at": "2020-09-24T07:25:32Z", + "updated_at": "2020-09-20T19:39:10Z", + "breadcrumb": "Contents / Insights / Event data sources / Custom events", "document_type": "page", "popularity": 1, - "info": "Install New Relic's Docker-based private minion that accepts and runs the jobs assigned to your private locations", - "body": "You may not modify any CPM files and New Relic is not liable for any modifications you make. For more information, contact your account representative or a New Relic technical sales rep. Read on to learn about the New Relic containerized private minion (CPM), a Docker container-based private minion that accepts and executes synthetic monitors against your private locations. The CPM can operate in a Docker container system environment or a Kubernetes container orchestration system environment. The CPM will auto-detect its environment to select the appropriate operating mode. General private minion features Because the CPM operates as a container instead of a virtual machine, it delivers many features: Easy to install, start, and update Runs on: Linux macOS Windows Enhanced security and support for non-root user execution Ability to leverage a Docker container as a sandbox environment Customizable monitor check timeout Custom provided modules for scripted monitor types Kubernetes-specific features Also, the CPM delivers the following features in a Kubernetes environment: Integrates with the Kubernetes API to delegate runtime lifecycle management to Kubernetes Does not require privileged access to the Docker socket Supports hosted and on-premise Kubernetes clusters Supports various container engines such as Docker and Containerd Deployable via Helm charts as well as configuration YAMLs Allows job (ping vs. non-ping checks) based resource allocation for optimum resource management Observability offered via the New Relic One Kubernetes cluster explorer System requirements and compatibility To host CPMs, your system must meet the minimum requirements for the chosen system environment. Docker container system environment requirements Compatibility for Requirements Operating system Linux kernel: 3.10 or higher macOS: 10.11 or higher Windows: Windows 10 64-bit or higher Processor A modern, multi-core CPU Memory 2.5 GB of RAM per CPU core (dedicated) Disk space A minimum of 10 GB per host Docker version Docker 17.12.1-ce or higher Private location key You must have a private location key Kubernetes container orchestration system environment requirements (CPM v3.0.0 or higher) Compatibility for Requirements Operating system Linux kernel: 3.10 or higher macOS: 10.11 or higher Windows: Windows 10 64-bit or higher Processor A modern, multi-core CPU Minion pod CPU (vCPU/Core): 0.5 up to 0.75 Memory: 800 Mi up to 1.6 Gi Resources allocated to a Minion pod are user configurable. Runner pod CPU (vCPU/Core): 0.5 up to 1 Memory: 1.25 Gi up to 3 Gi For a Scripted API check, 1.25 Gi will be requested with a limit of 2.5 Gi. For a Simple Browser or Scripted Browser check, 2 Gi will be requested with a limit of 3 Gi. Additional considerations: Resources allocated to a Runner pod are not user configurable. The maximum limit-request resource ratio for both CPU and Memory is 2. Disk space Persistent volume (PV) of at least 10 Gi in size Note that if a ReadWriteOnce (RWO) PV is provided to the minion, an implicit node affinity will be established to ensure the minion and the runner containers are scheduled on the same node. This is required to allow the minion and the associated runners access to the PV, as an RWO PV can be accessed only by a single node in the cluster. Kubernetes version We recommend that your Kubernetes cluster supports Kubernetes v1.15. Private location key You must have a private location key Helm Follow installation instructions for Helm v3 for your OS. Kubectl Follow installation instructions for Kubectl for your OS. To view versions, dependencies, default values for how many runner pods start with each minion, the Persistent volume access mode, and more, please see Show help and examples below. Private location key Before launching CPMs, you must have a private location key. Your CPM uses the key to authenticate against New Relic and run monitors associated with that private location. To find the key for existing private location: Go to one.newrelic.com > Synthetics > Private locations. In the Private locations index, locate the private location you want your CPM to be assigned to. Note the key associated with the private location with the key key icon. Sandboxing and Docker dependencies Sandboxing and Docker dependencies are applicable to the CPM in a Docker container system environment. Docker dependencies The CPM runs in Docker and is able to leverage Docker as a sandboxing technology. This ensures complete isolation of the monitor execution, which improves security, reliability, and repeatability. Every time a scripted or browser monitor is executed, the CPM creates a brand new Docker container to run it in called a runner. The minion container needs to be configured to communicate with the Docker engine in order to spawn additional runner containers. Each spawned container is then dedicated to run a check associated with the synthetic monitor running on the private location the minion container is associated with. There are two crucial dependencies at launch. To enable sandboxing, ensure that: Your writable and executable directory is mounted at /tmp. The writable directory can be any directory you want the CPM to write into, but New Relic recommends the system's own /tmp to make things easy. Your writable Docker UNIX socket is mounted at /var/run/docker.sock or DOCKER_HOST environment variable. For more information, see Docker's Daemon socket option. Core count on the host determines how many runner containers the CPM can run concurrently on the host. Since memory requirements are scaled to the expected count of runner containers, we recommend not running multiple CPMs on the same host to avoid resource contention. For additional information on sandboxing and running as a root or non-root user, see Security, sandboxing, and running as non-root. Install and update CPM versions Both installing and updating the CPM use the same command to pull the latest Docker image from the Quay.io repository where the CPM Docker image is hosted. Go to quay.io/repository/newrelic/synthetics-minion for a list of all the releases. CPM images are also hosted on Docker Hub. Go to hub.docker.com/r/newrelic/synthetics-minion/tags for a list of all the releases. Start the CPM To start the CPM, follow the applicable Docker or Kubernetes instructions. Docker start procedure Locate your private location key. Ensure you've enabled Docker dependencies for sandboxing and installed CPM on your system. Run the appropriate script for your system. Tailor the common defaults for /tmp and /var/run/docker.sock in the following examples to match your system. Linux/macOS: docker run \\ --name YOUR_CONTAINER_NAME \\ -e \"MINION_PRIVATE_LOCATION_KEY=YOUR_PRIVATE_LOCATION_KEY\" \\ -v /tmp:/tmp:rw \\ -v /var/run/docker.sock:/var/run/docker.sock:rw \\ quay.io/newrelic/synthetics-minion:latest Windows: docker run ^ --name YOUR_CONTAINER_NAME ^ -e \"MINION_PRIVATE_LOCATION_KEY=YOUR_PRIVATE_LOCATION_KEY\" ^ -v /tmp:/tmp:rw ^ -v /var/run/docker.sock:/var/run/docker.sock:rw ^ quay.io/newrelic/synthetics-minion:latest When a message similar to Synthetics Minion is ready and servicing location YOUR_PRIVATE_LOCATION_LABEL appears, your CPM is up and ready to run monitors assigned to that location. Kubernetes start procedure Locate your private location key. Set up the a namespace for the CPM in your Kubernetes cluster: kubectl create namespace YOUR_NAMESPACE Copy the Helm charts from the New Relic Helm repo. If you are copying the charts for the first time: helm repo add YOUR_REPO_NAME https://helm-charts.newrelic.com/charts If you previously copied the Helm charts from the New Relic Helm repo, then get the latest: helm repo update Install the CPM with the following Helm command: For a fresh installation of the CPM: helm install YOUR_CPM_NAME YOUR_REPO_NAME/synthetics-minion -n YOUR_NAMESPACE --set synthetics.privateLocationKey=YOUR_PRIVATE_LOCATION_KEY To update an existing CPM installation: helm upgrade YOUR_CPM_NAME YOUR_REPO_NAME/synthetics-minion -n YOUR_NAMESPACE --set synthetics.privateLocationKey=YOUR_PRIVATE_LOCATION_KEY Check if the minion pod is up and running: kubectl get -n YOUR_NAMESPACE pods Once the status attribute of each pod is shown as running, your CPM is up and ready to run monitors assigned to your private location. Stop or delete the CPM On a Docker container system environment, use the Docker stop procedure to stop the CPM from running. On a Kubernetes container orchestration system environment, use the Kubernetes delete procedure to stop the CPM from running. Docker stop procedure You can stop a Docker container either by the container name, or the container ID. Container name stop for Linux, macOS, and Windows: docker stop YOUR_CONTAINER_NAME docker rm YOUR_CONTAINER_NAME Container ID stop for Linux/macOS: In the examples the container is stopped and removed. To only stop the container, omit docker rm $CONTAINER_ID. CONTAINER_ID=$(docker ps -aqf name=YOUR_CONTAINER_NAME) docker stop $CONTAINER_ID docker rm $CONTAINER_ID Container ID stop for Windows: In the examples the container is stopped and removed. To only stop the container, omit docker rm $CONTAINER_ID. FOR /F \"tokens=*\" %%CID IN ('docker ps -aqf name=YOUR_CONTAINER_NAME') do (SET CONTAINER_ID=%%CID) docker stop %CONTAINER_ID% docker rm %CONTAINER_ID% Kubernetes delete procedure Get the MINION_POD_INSTALLATION_NAME of the minion pod you want to delete: helm list -n YOUR_NAMESPACE Delete the minion pod: helm uninstall -n YOUR_NAMESPACE MINION_POD_INSTALLATION_NAME Delete the namespace set up for the CPM in your Kubernetes cluster: kubectl delete namespace YOUR_NAMESPACE Show help and examples Use these options as applicable: To get a list of the most commonly used run options directly in the command line interface, run the show help command. To show CPM usage examples as well as the list of all the available run options, run this command: docker run quay.io/newrelic/synthetics-minion:latest help To keep track of Docker logs and verify the health of your monitors, see Containerized private minion (CPM) maintenance and monitoring. For a CPM in the Kubernetes container orchestration system environment, the following Helm show commands can be used to view the chart.yaml and the values.yaml, respectively: helm show chart YOUR_REPO_NAME/synthetics-minion helm show values YOUR_REPO_NAME/synthetics-minion Show license information To show the licensing information for the open source software that we use in the CPM, run the LICENSE command. Run this command to view license information for CPM versions 2.2.27 or higher: docker run quay.io/newrelic/synthetics-minion:latest LICENSE Some of our open-source software is listed under multiple software licenses, and in that case we have listed the license we've chosen to use. Our license information is also available in the our licenses documentation. Configure CPM You can configure the containerized private minion with custom npm modules, preserve data between launches, use environment variables, and more. For more information, see CPM configuration. Networks For both Docker and Kubernetes, the CPM and its runner containers will inherit network settings from the host. For an example of this on a Docker container system environment, see the Docker site. A new bridge network is created for each runner container. This means networking command options like --network and --dns passed to the CPM container at launch (such as through Docker run commands on a Docker container system environment) are not inherited or used by the runner containers. When these networks are created, they pull from the default IP address pool configured for daemon. For an example of this on a Docker container system environment, see the Docker site. Typically, the runner network is removed after the check is completed. However, if a CPM exits while a check is still running, or exits in another unexpected circumstance, these networks may get orphaned. This can potentially use up IP address space that is available to the Docker daemon. If this happens, you may see INTERNAL ENGINE ERROR code: 31 entries in your CPM logging when trying to create a new runner container. To clean these up in Docker container system environments only, run docker network prune. Security, sandboxing, and running as non-root By default, the software running inside a CPM is executed with root user privileges. This is suitable for most scenarios, as the execution is sandboxed. In a Docker container system environment: To change the default AppArmor profile used by containers that CPM spawns to run monitors, see the environment variable MINION_RUNNER_APPARMOR (CPM version 3.0.3 or higher) or MINION_DOCKER_RUNNER_APPARMOR (CPM version up to v3.0.2). To run the CPM as a non-root user, additional steps are required: Run as non-root user for Docker For more information, see Docker's official documentation about security and AppArmor security profiles. If your environment requires you to run the CPM as a non-root user, follow this procedure. In the following example, the non-root user is my_user. Ensure that my_user can use the Docker engine on the host: Verify that my_user belongs to the \"docker\" system group. OR Enable the Docker TCP socket option, and pass the DOCKER_HOST environment variable to CPM. Verify that my_user has read/write permissions to all the directories and volumes passed to CPM. To set these permission, use the chmod command. Get the uid of my_user for use in the run command: id -u my_user. Once these conditions are met, use the option \"-u :\" when launching CPM: docker run ... -u 1002 ... OR docker run ... -u 1002 -e DOCKER_HOST=http://localhost:2375 ... Docker image repository A single CPM Docker image serves both the Docker container system environment and Kubernetes container orchestration system environment. The Docker image is hosted on quay.io. To make sure your Docker image is up-to-date, see the quay.io newrelic/synthetics-minion repository. Additional considerations for CPM connection Connection Description CPMs without Internet access A CPM can operate without access to the internet, but with some exceptions. The public internet health check can be disabled using the environment variables named MINION_NETWORK_HEALTHCHECK_DISABLED for a Docker container system environment or synthetics.minionNetworkHealthCheckDisabled for a Kubernetes container orchestration system environment. The CPM needs to be able to contact the \"synthetics-horde.nr-data.net\" domain. This is necessary for it to report data to New Relic and to receive monitors to execute. Ask your network administration if this is a problem and how to set up exceptions. Communicate with Synthetics via a proxy To set up communication with New Relic by proxy, use the environment variables named MINION_API_PROXY*. Arguments passed at launch This applies to a Docker container environment only. Arguments passed to the CPM container at launch do not get passed on to the containers spawned by the CPM. Docker has no concept of \"inheritance\" or a \"hierarchy\" of containers, and we don't copy the configuration that is passed from CPM to the monitor-running containers. The only shared configuration between them is the one set at the Docker daemon level. 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.", + "info": "For New Relic, general limits and requirements for reporting custom events and attributes. ", + "body": "You can report custom events to New Relic in several ways, including the New Relic Event API, APM agent APIs, Browser agent APIs, and the Mobile SDK. This document contains general requirements and rules for inserting and using custom events and their associated attributes. Additional requirements may apply based on the method you use. General requirements How long custom data is retained depends on your Insights subscription and its associated data retention. When reporting custom events and attributes, follow these general requirements for supported data types, naming syntax, and size: Requirement Description Payload Total maximum size or length: 1 MB maximum per POST. We highly recommend using compression. The Event API has additional HTTP rate limits. Attribute data types Attribute values can be either a string or a numeric integer or float. If your attribute values contain date information, define it as an unformatted Unix timestamp (in seconds or milliseconds) by using the Insights data formatter. Attribute size Maximum name size: 255 bytes. Maximum attribute value size: Custom attributes sent by the agent: 255 bytes Attributes attached to custom events sent using the Event API: 4096 characters Charts may only display the first 255 characters of attribute values. For complete attribute values, use the JSON chart type or Query API. Maximum total attributes per event: 254. Exception: If you use an APM agent API, the max is 64. Maximum total attributes per event type: 48,000. Naming syntax Attribute names can be a combination of alphanumeric characters, colons (:), periods (.), and underscores (_). Event types (using the eventType attribute) can be a combination of alphanumeric characters, colons (:), and underscores (_). Do not use words reserved for use by NRQL. Null values The database does not store any data with a null value. Reserved words Avoid using the following reserved words as names for events and attributes. Otherwise, unexpected results may occur. This is not a complete list. In general, it's a good practice to avoid using MySQL-reserved words to avoid collision with future New Relic functionality. Keyword Description accountId This is a reserved attribute name. If it's included, it will be dropped during ingest. appId Value must be an integer. If it is not an integer, the attribute name and value will be dropped during ingest. eventType The event type as stored in New Relic. New Relic agents and scripts normally report this as eventType. Can be a combination of alphanumeric characters, colons (:), and underscores (_). Be sure to review the prohibited eventType values and eventType limits. Prohibited eventType values For your eventType value, avoid using: Metric, MetricRaw, and strings prefixed with Metric[0-9] (such as Metric2 or Metric1Minute). Public_ and strings prefixed with Public_. These event types are reserved for use by New Relic. Events passed in with these eventType values will be dropped. timestamp Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds. It must be +/-1 day (24 hours) of the current time on the server. Log forwarding terms The following keys are reserved by the Infrastructure agent's log forwarding feature: entity.guid, log, hostname, plugin.type, fb.input. If used, they are dropped during ingest and a warning is added to the logs. NRQL syntax terms If you need to use NRQL syntax terms as attribute names, including dotted attributes, they must be enclosed in backticks; for example, `LIMIT` or `consumer.offset`. Otherwise, avoid using these reserved words: ago, and, as, auto, begin, begintime, compare, day, days, end, endtime, explain, facet, from, hour, hours, in, is, like, limit, minute, minutes, month, months, not, null, offset, or, raw, second, seconds, select, since, timeseries, until, week, weeks, where, with Additional Browser PageAction requirements For additional requirements for using New Relic Browser's custom PageAction event, see Insert custom data via New Relic Browser agent. Additional Event API requirements For more requirements and details for the Event API, see Event API. Event type limits The current limit for total number of eventType values is 250 per sub-account in a given 24-hour time period. If a user exceeds this limit, New Relic may filter or drop data. Event types include: Default events from New Relic agents Custom events from New Relic agents Custom events from Insights custom event inserter 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 122.34217, + "_score": 128.89432, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Using monitors", - "info": "Install New Relic's Docker-based private minion that accepts and runs the jobs assigned to your private locations", - "body": " appears, your CPM is up and ready to run monitors assigned to that location. Kubernetes start procedure Locate your private location key. Set up the a namespace for the CPM in your Kubernetes cluster: kubectl create namespace YOUR_NAMESPACE Copy the Helm charts from the New Relic Helm repo. If you" + "title": "Data requirements and limits for custom event data", + "sections": "Event data sources", + "category_1": "Event data sources", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", + "body": " may apply based on the method you use. General requirements How long custom data is retained depends on your Insights subscription and its associated data retention. When reporting custom events and attributes, follow these general requirements for supported data types, naming syntax, and size", + "breadcrumb": "Contents / Insights / Event data sources / Custom events" }, - "id": "5f31d981196a678103fbd731" + "id": "59f4354f4bb81c2ea8b80d0a" }, { - "category_2": "Installation", - "nodeid": 14966, + "category_2": "Alert conditions", + "nodeid": 9231, "sections": [ - "Kubernetes integration", + "New Relic Alerts", "Get started", - "Installation", - "Understand and use data", - "Link apps and services", - "Kubernetes events", - "Logs", + "Alert policies", + "Alert conditions", + "Alert violations", + "Alert Incidents", + "Alert notifications", "Troubleshooting", - "Kubernetes integration: install and configure", - "Installs for managed services and platforms", - "Custom manifest", - "Make sure New Relic pods can be scheduled", - "Unprivileged installs of the Kubernetes integration", - "Configure the integration", - "Update to the latest version", - "Uninstall the Kubernetes integration", + "Rules, limits, and glossary", + "Alerts and Nerdgraph", + "REST API alerts", + "Create NRQL alert conditions", + "Create NRQL alert condition", + "Alert threshold types", + "NRQL alert syntax", + "Sum of query results (limited or intermittent data)", + "Offset the query time window", + "NRQL alert threshold examples", + "Create a description", "For more help" ], - "title": "Kubernetes integration: install and configure", - "category_0": "Integrations", + "title": "Create NRQL alert conditions", + "category_0": "Alerts and Applied intelligence", "type": "docs", - "category_1": "Kubernetes integration", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/integrations/kubernetes-integration/installation/kubernetes-integration-install-configure", - "external_id": "e2a0aea9a0c2461e833148e95859ee34f03bce95", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/cke.jpeg", - "url": "https://docs.newrelic.com/docs/integrations/kubernetes-integration/installation/kubernetes-integration-install-configure", - "published_at": "2020-09-24T06:58:23Z", - "updated_at": "2020-09-24T06:58:23Z", - "breadcrumb": "Contents / Integrations / Kubernetes integration / Installation", + "category_1": "New Relic Alerts", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions", + "external_id": "956a7a0b84d2afac5e6236df3143085ebc4f7459", + "image": "", + "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions", + "published_at": "2020-09-24T23:57:53Z", + "updated_at": "2020-09-03T23:54:56Z", + "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert conditions", "document_type": "page", "popularity": 1, - "info": "New Relic's Kubernetes integration: How to install and activate the integration, and what data is reported.", - "body": "The easiest way to install the Kubernetes integration is to use our automated installer to generate a manifest. It bundles not just the integration DaemonSets, but also other New Relic Kubernetes configurations, like Kubernetes events, Prometheus OpenMetrics, and New Relic log monitoring. You can use the automated installer for servers, VMs, and unprivileged environments. The installer can also help you with managed services or platforms after you review a few preliminary notes. We also have separate instructions if you need a custom manifest or prefer to do a manual unprivileged installation. Start the installer If your New Relic account is in the EU region, access the installer from one.eu.newrelic.com. Installs for managed services and platforms Before starting our automated installer, check out these notes for your managed services or platforms: Amazon EKS The Kubernetes integration monitors worker nodes. In Amazon EKS, master nodes are managed by Amazon and abstracted from the Kubernetes platforms. Before starting our automated installer to deploy the Kubernetes integration in Amazon EKS, make sure you are using the version of kubectl provided by AWS. Google Kubernetes Engine (GKE) The Kubernetes integration monitors worker nodes. In GKE, master nodes are managed by Google and abstracted from the Kubernetes platforms. Before starting our automated installer to deploy the Kubernetes integration on GKE, ensure you have sufficient permissions: Go to https://console.cloud.google.com/iam-admin/iam and find your username. Click edit. Ensure you have permissions to create Roles and ClusterRoles: If you are not sure, add the Kubernetes Engine Cluster Admin role. If you cannot edit your user role, ask the owner of the GCP project to give you the necessary permissions. Ensure you have a RoleBinding that grants you the same permissions to create Roles and ClusterRoles: kubectl create clusterrolebinding YOUR_USERNAME-cluster-admin-binding --clusterrole=cluster-admin --user=YOUR_GCP_EMAIL Creating a RoleBinding is necessary because of a known RBAC issue in Kubernetes and Kubernetes Engine versions 1.6 or higher. For more information, see Google Cloud's documentation on defining permissions in a role. OpenShift container platform To deploy the Kubernetes integration with OpenShift: Add the newrelic service account to your privileged Security Context Constraints: oc adm policy add-scc-to-user privileged \\ system:serviceaccount: :newrelic Complete the steps in our automated installer. If you're using signed certificates, make sure they are properly configured by using the following variables to set the .pem file: - name: NRIA_CA_BUNDLE_DIR value: YOUR_CA_BUNDLE_DIR - name: NRIA_CA_BUNDLE_FILE value: YOUR_CA_BUNDLE_NAME Save your changes. Azure Kubernetes Service (AKS) The Kubernetes integration monitors worker nodes. In Azure Kubernetes Service, master nodes are managed by Azure and abstracted from the Kubernetes platforms. To deploy in Azure Kubernetes Service (AKS), complete the steps in our automated installer. Pivotal Container Service (PKS / VMware Tanzu) To deploy in PKS, we recommend that you use the automated installer, or you can follow the manual instructions provided in Install the Kubernetes integration using Helm. Custom manifest If the Kubernetes automated installer doesn't provide the settings you need, you can download our manifest template and install the integration manually. To activate the Kubernetes integration, you must deploy the newrelic-infra agent onto a Kubernetes cluster as a DaemonSet: Install kube-state-metrics and get it running on the cluster. For example: curl -L -o kube-state-metrics- 1.9.5 .zip https://github.com/kubernetes/kube-state-metrics/archive/v 1.9.5 .zip && unzip kube-state-metrics- 1.9.5 .zip && kubectl apply -f kube-state-metrics- 1.9.5 /examples/standard Download the manifest file: curl -O https://download.newrelic.com/infrastructure_agent/integrations/kubernetes/newrelic-infrastructure-k8s-latest.yaml In the manifest, add your New Relic license key and a cluster name to identify your Kubernetes cluster. Both values are required. Recommendation: Do not change the NRIA_PASSTHROUGH_ENVIRONMENT or NRIA_DISPLAY_NAME value in your manifest. env: - name: NRIA_LICENSE_KEY value: YOUR_LICENSE_KEY - name: CLUSTER_NAME value: YOUR_CLUSTER_NAME Review the Configure section of this docs in case you need to adapt the manifest to fit your environment. Confirm that kube-state-metrics is installed. kubectl get pods --all-namespaces | grep kube-state-metrics Create the DaemonSet: kubectl create -f newrelic-infrastructure-k8s-latest.yaml Confirm that the DaemonSet has been created successfully by looking for newrelic-infra in the results generated by this command: kubectl get daemonsets To confirm that the integration is working: wait a few minutes, then look for data in the New Relic Kubernetes cluster explorer. If you don't see data, review the configuration procedures again, then follow the troubleshooting procedures. In the future, the number of labels collected on Kubernetes objects will be limited per object type (containers, pods, nodes, etc.) . If objects have labels above the limit, you will be able to configure important labels that should always be sent to New Relic. When the limitation is in place, this documentation will be updated. Make sure New Relic pods can be scheduled Some of the New Relic pods are set up as DaemonSet in the manifest file so that they can run on every host. These include newrelic-infrastructure and newrelic-logging. In rare circumstances, it is possible for other pods to be scheduled first and starve the New Relic pods of resources. Since each of these pods have to run on a specific host, they will stay in pending status until that host has enough resources, even if there are other hosts available. This could end up occurring for long periods of time and result in reporting gaps. To prevent this scenario you can configure the Kubernetes scheduler to give New Relic pods a higher priority. Using the default scheduler: Ensure kube-scheduler flag disablePreemption is not set to true (by default it is false). Create a PriorityClass for the New Relic DaemonSet pods. Set the appropriate priority value, which should generally be higher than your other pods. preemptionPolicy is set to PreemptLowerPriority by default. This allows New Relic pods assigned this priority class to remove lower-priority pods that are taking up resources. Edit the manifest file to add priorityClassName to any DaemonSet specs. In the example below, the highlighted line sets the priority class for newrelic-infrastructure: apiVersion: apps/v1 kind: DaemonSet metadata: namespace: default labels: app: newrelic-infrastructure chart: newrelic-infrastructure-1.0.0 release: nri-bundle mode: privileged name: nri-bundle-newrelic-infrastructure spec: priorityClassName: your-priority-class ... If you have already deployed the New Relic pods, re-deploy them and confirm they have been created: kubectl delete -f newrelic-infrastructure-k8s-latest.yaml kubectl create -f newrelic-infrastructure-k8s-latest.yaml kubectl get daemonsets Unprivileged installs of the Kubernetes integration For platforms that have stringent security requirements, we provide an unprivileged version of the Kubernetes integration. Changes from the standard Kubernetes integration are: Runs the infrastructure agent and the Kubernetes integration as a standard user instead of root No access to the underlying host filesystem No access to /var/run/docker.sock Container's root filesystem mounted as read-only allowPrivilegeEscalation is set to false hostnetwork is set to false The tradeoff is that the solution will only collect metrics from Kubernetes, but it will not collect any metric from the underlying hosts directly. Kubernetes provides some data (metrics and metadata) about its nodes (hosts). Optional: To collect the underlying host metrics, the non-containerized infrastructure agent can be deployed on the underlying host. The infrastructure agent already supports running as non-root. The combination of the Kubernetes integration in its unprivileged version and the agent running on the host will report all the metrics that our standard solution for monitoring Kubernetes receives. Steps to complete an unprivileged install Install kube-state-metrics and get it running on the cluster. For example: curl -L -o kube-state-metrics- 1.9.5 .zip https://github.com/kubernetes/kube-state-metrics/archive/v 1.9.5 .zip && unzip kube-state-metrics- 1.9.5 .zip && kubectl apply -f kube-state-metrics- 1.9.5 /examples/standard Download the integration manifest: curl -O https://download.newrelic.com/infrastructure_agent/integrations/kubernetes/newrelic-infrastructure-k8s-unprivileged-latest.yaml In the manifest, add your New Relic license key and a cluster name to identify your Kubernetes cluster. Both values are required. env: - name: NRIA_LICENSE_KEY value: YOUR_LICENSE_KEY - name: CLUSTER_NAME value: YOUR_CLUSTER_NAME Confirm that kube-state-metrics is installed. kubectl get pods --all-namespaces | grep kube-state-metrics Create the DaemonSet: kubectl create -f newrelic-infrastructure-k8s-unprivileged-latest.yaml Confirm that the DaemonSet has been created successfully by looking for newrelic-infra in the results generated by this command: kubectl get daemonsets To confirm that the integration has been configured correctly, wait a few minutes, then run this NRQL query to see if data has been reported: SELECT * FROM K8sPodSample since 5 minutes ago Configure the integration The Kubernetes integration comes with a default configuration that should work in most environments. To change the configuration, modify the manifest file: Select which processes should send their data to New Relic By default, data about the processes running on your pods is not sent to New Relic. You can enable it by setting enable_process_metrics to true. To choose what metric data you want to send to New Relic, configure the include_matching_metrics environment variable in your manifest. Specify the Kubernetes API host and port This is necessary when you are using SSL and not using the default FQDN. The Kubernetes API FQDN needs to match the FQDN of the SSL certificate. You do not need to specify both variables. For example, if you only specify the HOST, the default PORT will be used. - name: \"KUBERNETES_SERVICE_HOST\" value: \"KUBERNETES_API_HOST\" - name: \"KUBERNETES_SERVICE_PORT\" value: \"KUBERNETES_API_TCP_PORT\" Kubernetes versions 1.6 to 1.7.5: Edit manifest file For Kubernetes versions 1.6 to 1.7.5, uncomment these two lines in the manifest file: - name: \"CADVISOR_PORT\" # Enable direct connection to cAdvisor by specifying the port. Needed for Kubernetes versions prior to 1.7.6. value: \"4194\" Use environment variables Use environment variables that can be passed to the Kubernetes integration if you use a proxy to configure its URL. Disable kube-state-metrics parsing You can disable kube-state-metrics parsing for the DaemonSet by using the following configuration: - name: \"DISABLE_KUBE_STATE_METRICS\" value: \"true\" Disabling kube-state-metrics also disables data collection for the following: ReplicaSets DaemonSets StatefulSets Namespaces Deployments Services Endpoints Pods (that are pending) Additionally, disabling this affects the Kubernetes Cluster Explorer in the following ways: No pending pods are shown. No filters based on services. Specify the kube-state-metrics URL If several instances of kube-state-metrics are present in the cluster, uncomment and configure the following lines to specify which one to use: - name: \"KUBE_STATE_METRICS_URL\" value: \"http://KUBE_STATE_METRICS_IP_OR_FQDN:PORT\" Even though a KUBE_STATE_METRICS_URL is defined, the KSM service should contain one of the following labels for the auto-discovery process: k8s-app=kube-state-metrics OR app=kube-state-metrics This configuration option overrides KUBE_STATE_METRICS_POD_LABEL. If you have both defined, KUBE_STATE_METRICS_POD_LABEL has no effect. Discover kube-state-metrics pods using a label If several instances of kube-state-metrics are present in the cluster, another option to easily target one of these instances with the Kubernetes integration is to use label-based discovery. - name: \"KUBE_STATE_METRICS_POD_LABEL\" value: \"LABEL_NAME\" When a KUBE_STATE_METRICS_POD_LABEL is defined, the label should have a value equal to true. For example, if the label name is my-ksm, ensure that my-ksm=true. This configuration option is incompatible with KUBE_STATE_METRICS_URL. If you have both defined, KUBE_STATE_METRICS_URL is used. Query kube-state-metrics behind RBAC If your instance of kube-state-metrics is behind kube-rbac-proxy, the integration can be configured in a compatible way using the combination of the label-based discovery and two other environment variables: - name: \"KUBE_STATE_METRICS_SCHEME\" value: \"https\" - name: \"KUBE_STATE_METRICS_PORT\" value: \"KSM_RBAC_PROXY_PORT\" To confirm which port should be used as the value of KUBE_STATE_METRICS_PORT, we recommend running a describe command on the kube-state-metrics pod and look for the port exposed by the container named kube-rbac-proxy-main. These two configuration options only work when using the KUBE_STATE_METRICS_POD_LABEL ​configuration described above. kube-state-metrics timeout: Increase the client timeout To increase the client timeout of kube-state-metrics, add a new environment variable, TIMEOUT, to the manifest file: env: - name: TIMEOUT value: 5000 # The default client timeout when calling kube-state-metrics, in milliseconds Then, add this new environment variable to the NRIA_PASSTHROUGH_ENVIRONMENT Non-default namespace deployments: Edit config file If you want to deploy in a different namespace from default, change all values of namespace in the manifest. Set the TTL for the Kubernetes API responses cache By default, the integration will cache any retrieved information from the Kubernetes API for 5 minutes. Use the API_SERVER_CACHE_TTL environment variable to set a custom cache duration for responses from the API server. Valid time unit values are: ns, us, ms, s, m, and h. To disable caching, set to 0s. env: - name: API_SERVER_CACHE_TTL value: \"1m\" Specify base URLs for control plane component endpoints Use the following environment variables if any of the Kubernetes control plane components export metrics on base URLs that are different from the defaults. This is necessary for environments such as OpenShift when a control plane component metrics endpoint is using SSL or an alternate port. Values of these environment variables must be base URLs of the form [scheme]://[host]:[port]. URLs should not include a path component. For example: - name: \"SCHEDULER_ENDPOINT_URL\" value: \"https://localhost:10259 - name: \"ETCD_ENDPOINT_URL\" value: \"https://localhost:9979\" - name: \"CONTROLLER_MANAGER_ENDPOINT_URL\" value: \"https://localhost:10257\" - name: \"API_SERVER_ENDPOINT_URL\" value: \"https://localhost:6443\" The /metrics path segment is added automatically. In addition, if the https scheme is used, authentication to the control plane component pod(s) is accomplished via service accounts. If a FQDN (fully qualified domain name) is used in a multi-master cluster, inconsistent results may be returned. Therefore, it is recommended to use localhost only. Even though a custom base URL is defined for a given control plane component, the control plane component pod(s) must contain one of the labels supported by the auto-discovery process. Even though a custom ETCD_ENDPOINT_URL can be defined, ETCD will always require https and mTLS authentication to be configured. Here are some additional configurations to consider: Do more configuration for control plane monitoring Link New Relic APM to the Kubernetes integration Monitor services that run on Kubernetes Update to the latest version To improve our unified experience, starting from Wednesday, August 12, 2020, Kubernetes integrations that use v1.7 or older will be deprecated. If you are using v1.7 or older, you will need to update your integration in order to continue viewing Kubernetes performance data. For more information, see the Kubernetes v1.7 or older deprecation notice. If you are already running the Kubernetes integration and want to update the newrelic-infra agent to the latest agent version: Run this NRQL query to check which version you are currently running (this will return the image name by cluster): SELECT latest(containerImage) FROM K8sContainerSample WHERE containerImage LIKE '%newrelic/infrastructure%' FACET clusterName SINCE 1 day ago If you've set a name other than newrelic/infrastructure for the integration's container image, the above query won't yield results: to make it work, edit the name in the query. Download the integration manifest file: curl -O https://download.newrelic.com/infrastructure_agent/integrations/kubernetes/newrelic-infrastructure-k8s-latest.yaml Copy the changes you made to the manifest. At a minimum, include CLUSTER_NAME and NRIA_LICENSE_KEY, and paste your changes in the manifest you downloaded. Install the latest DaemonSet with the following command (Kubernetes will automatically do a rollout upgrade for the integration's pods): kubectl apply -f newrelic-infrastructure-k8s-latest.yaml Uninstall the Kubernetes integration To uninstall the Kubernetes integration: Verify that newrelic-infrastructure-k8s-latest.yaml corresponds to the filename of the manifest as you have saved it. Example: If you are using the unprivileged version of the integration, the default filename will be newrelic-infrastructure-k8s-unprivileged-latest.yaml. After you verify the filename, use the following command: kubectl delete -f newrelic-infrastructure-k8s-latest.yaml You only need to execute this command once, regardless of the number of nodes in your cluster. 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.", + "info": "How to define thresholds that trigger alert notifications based on your NRQL queries.", + "body": "You can create alert conditions using NRQL queries. Create NRQL alert condition To create a NRQL alert condition: When you start to create a condition, where it prompts you to Select a product, click NRQL. Tips for creating and using a NRQL condition: Topic Tips Condition types NRQL condition types include static, baseline, and outlier. Create a description For some condition types, you can create a Description. Query results Queries must return a number. The condition works by evaluating that returned number against the thresholds you set. Time period As with all alert conditions, NRQL conditions evaluate one single minute at a time. The implicit SINCE ... UNTIL clause specifying which minute to evaluate is controlled by your Evaluation offset setting. Since very recent data may be incomplete, you may want to query data from 3 minutes ago or longer, especially for: Applications that run on multiple hosts. SyntheticCheck data: Timeouts can take 3 minutes, so 5 minutes or more is recommended. Also, if a query will generate intermittent data, consider using the sum of query results option. Condition settings Use the Condition settings to: Configure whether and how open violations are force-closed. Adjust the evaluation offset. Create a concise and descriptive condition name. (NerdGraph API Only) Provide a text description for the condition that will be included in violations and notifications. Troubleshooting procedures Optional: To include your organization's procedures for handling the incident, add the runbook URL to the condition. Limits on conditions See the maximum values. Health status NRQL alert conditions do not affect an entity's health status display. Examples For more information, see: Expected NRQL syntax Examples of NRQL condition queries Alert threshold types When you create a NRQL alert, you can choose from different types of thresholds: NRQL alert threshold types Description Static This is the simplest type of NRQL threshold. It allows you to create a condition based on a NRQL query that returns a numeric value. Optional: Include a FACET clause. Baseline Uses a self-adjusting condition based on the past behavior of the monitored values. Uses the same NRQL query form as the static type, except you cannot use a FACET clause. Outlier Looks for group behavior and values that are outliers from those groups. Uses the same NRQL query form as the static type, but requires a FACET clause. NRQL alert syntax Here is the basic syntax for creating all NRQL alert conditions. Depending on the threshold type, also include a FACET clause as applicable. SELECT function(attribute) FROM Event WHERE attribute [comparison] [AND|OR ...] Clause Notes SELECT function(attribute) Required Supported functions that return numbers include: apdex average count latest max min percentage percentile sum uniqueCount If you use the percentile aggregator in a faceted alert condition with many facets, this may cause the following error to appear: An error occurred while fetching chart data. If you see this error, use average instead. FROM data type Required Only one data type can be targeted. Supported data types: Event Metric (RAW data points will be returned) WHERE attribute [comparison] [AND|OR ...] Optional Use the WHERE clause to specify a series of one or more conditions. All the operators are supported. FACET attribute Static: Optional Baseline: Not allowed Outlier: Required Including a FACET clause in your NRQL syntax depends on the threshold type: static, baseline, or outlier. Use the FACET clause to separate your results by attribute and alert on each attribute independently. Faceted queries can return a maximum of 5000 values for static conditions and a maximum of 500 values for outlier conditions. If the query returns more than this number of values, the alert condition cannot be created. If you create the condition and the query returns more than this number later, the alert will fail. Sum of query results (limited or intermittent data) Available only for static (basic) threshold types. If a query returns intermittent or limited data, it may be difficult to set a meaningful threshold. Missing or limited data will sometimes generate false positives or false negatives. To avoid this problem when using the static threshold type, you can set the selector to sum of query results. This lets you set the alert on an aggregated sum instead of a value from a single harvest cycle. Up to two hours of the one-minute data checks can be aggregated. The duration you select determines the width of the rolling sum, and the preview chart will update accordingly. Offset the query time window Every minute, we evaluate the NRQL query in one-minute time windows. The start time depends on the value you select in the NRQL condition's Advanced settings > Evaluation offset. Example: Using the default time window to evaluate violations With the Evaluation offset at the default setting of three minutes, the NRQL time window applied to your query will be: SINCE 3 minutes ago UNTIL 2 minutes ago If the event type is sourced from an APM language agent and aggregated from many app instances (for example, Transactions, TransactionErrors, etc.), we recommend evaluating data from three minutes ago or longer. An offset of less than 3 minutes will trigger violations sooner, but you might see more false positives and negatives due to data latency. For cloud data, such as AWS integrations, you may need an offset longer than 3 minutes. Check our AWS polling intervals documentation to determine your best setting. NRQL alert threshold examples Here are some common use cases for NRQL alert conditions. These queries will work for static and baseline threshold types. The outlier threshold type will require additional FACET clauses. Alert on specific segments of your data Create constrained alerts that target a specific segment of your data, such as a few key customers or a range of data. Use the WHERE clause to define those conditions. SELECT average(duration) FROM Transaction WHERE account_id in (91290, 102021, 20230) SELECT percentile(duration, 95) FROM Transaction WHERE name LIKE 'Controller/checkout/%' Alert on Nth percentile of your data Create alerts when an Nth percentile of your data hits a specified threshold; for example, maintaining SLA service levels. Since we evaluate the NRQL query in one-minute time windows, percentiles will be calculated for each minute separately. SELECT percentile(duration, 95) FROM Transaction SELECT percentile(databaseDuration, 75) FROM Transaction Alert on max, min, avg of your data Create alerts when your data hits a certain maximum, minimum, or average; for example, ensuring that a duration or response time does not pass a certain threshold. SELECT max(duration) FROM Transaction SELECT average(duration) FROM Transaction Alert on a percentage of your data Create alerts when a proportion of your data goes above or below a certain threshold. SELECT percentage(count(*), WHERE duration > 2) FROM Transaction SELECT percentage(count(*), WHERE httpResponseCode = '500') FROM Transaction Alert on Apdex with any T-value Create alerts on Apdex, applying your own T-value for certain transactions. For example, get an alert notification when your Apdex for a T-value of 500ms on transactions for production apps goes below 0.8. SELECT apdex(duration, t:0.5) FROM Transaction WHERE appName like '%prod%' Create a description You can define a description that passes useful information downstream for better violation responses or for use by downstream systems. For details, see Description. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 102.74112, + "_score": 91.566635, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Make sure New Relic pods can be scheduled", - "info": "New Relic's Kubernetes integration: How to install and activate the integration, and what data is reported.", - "body": " pods can be scheduled Some of the New Relic pods are set up as DaemonSet in the manifest file so that they can run on every host. These include newrelic-infrastructure and newrelic-logging. In rare circumstances, it is possible for other pods to be scheduled first and starve the New Relic pods" + "title": "Create NRQL alert conditions", + "sections": "NRQL alert syntax", + "info": "How to define thresholds that trigger alert notifications based on your NRQL queries.", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions", + "body": " for handling the incident, add the runbook URL to the condition. Limits on conditions See the maximum values. Health status NRQL alert conditions do not affect an entity's health status display. Examples For more information, see: Expected NRQL syntax Examples of NRQL condition queries Alert threshold" }, - "id": "5efd3b2e64441fd60f5f7e49" + "id": "5f2d992528ccbc489d88dfc1" }, { "category_2": "Get started", - "nodeid": 27301, + "nodeid": 1136, "sections": [ - "Kubernetes integration", + "NRQL: New Relic Query Language", "Get started", - "Installation", - "Understand and use data", - "Link apps and services", - "Kubernetes events", - "Logs", - "Troubleshooting", - "Introduction to the Kubernetes integration", - "Get started: Install the Kubernetes integration", - "Why it matters", - "Navigate all your Kubernetes events", - "Bring your cluster logs to New Relic", - "Check the source code", + "NRQL query tools", + "NRQL query tutorials", + "NRQL syntax, clauses, and functions", + "Syntax", + "Query components", + "Query metric data", + "Aggregator functions", + "Type conversion", "For more help" ], - "title": "Introduction to the Kubernetes integration", - "category_0": "Integrations", + "title": "NRQL syntax, clauses, and functions", + "category_0": "Query your data", "type": "docs", - "category_1": "Kubernetes integration", - "external_id": "4ad996d529753d173874d752239ece44c8e6d43f", - "image": "", - "url": "https://docs.newrelic.com/docs/integrations/kubernetes-integration/get-started/introduction-kubernetes-integration", - "published_at": "2020-09-24T18:09:37Z", - "updated_at": "2020-08-05T01:57:55Z", - "breadcrumb": "Contents / Integrations / Kubernetes integration / Get started", + "category_1": "NRQL: New Relic Query Language", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/nrql-syntax-clauses-functions", + "external_id": "a748f594f32d72e0cbd0bca97e4cedc4e398dbab", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/percentile_0.png", + "url": "https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/nrql-syntax-clauses-functions", + "published_at": "2020-09-24T08:39:09Z", + "updated_at": "2020-09-20T16:38:51Z", + "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started", "document_type": "page", "popularity": 1, - "info": "New Relic's Kubernetes integration: features, requirements, and getting started. ", - "body": "New Relic's Kubernetes integration gives you full observability into the health and performance of your environment, no matter whether you run Kubernetes on-premises or in the cloud. With our cluster explorer, you can cut through layers of complexity to see how your cluster is performing, from the heights of the control plane down to applications running on a single pod. one.newrelic.com > Kubernetes cluster explorer: The cluster explorer is our powerful, fully visual answer to the challenges associated with running Kubernetes at a large scale. You can see the power of the Kubernetes integration in the cluster explorer, where the full picture of a cluster is made available on a single screen: nodes and pods are visualized according to their health and performance, with pending and alerting nodes in the innermost circles. Predefined alert conditions help you troubleshoot issues right from the start. Clicking each node reveals its status and how each app is performing. Get started: Install the Kubernetes integration We have an automated installer to help you with many types of installations: servers, virtual machines, and unprivileged environments. It can also help you with installations in managed services or platforms, but you'll need to review a few preliminary notes before getting started. Here's what the automated installer does: Asks for the cluster name and namespace of the integration. Asks for additional setup options, such as Kube state metrics. Asks for the installation method: manifest file or Helm. Generates either the manifest or Helm chart. Read the install docs Start the installer If your New Relic account is in the EU region, access the automated installer from one.eu.newrelic.com. Why it matters Governing the complexity of Kubernetes can be challenging; there's so much going on at any given moment, with containers being created and deleted in a matter of minutes, applications crashing, and resources being consumed unexpectedly. Our integration helps you navigate Kubernetes abstractions across on-premises, cloud, and hybrid deployments. In New Relic, you can build your own charts and query all your Kubernetes data, which our integration collects by instrumenting the container orchestration layer. This gives you additional insight into nodes, namespaces, deployments, replica sets, pods, and containers. one.newrelic.com > Dashboards: Using the chart builder you can turn any query on Kubernetes data to clear visuals. With the Kubernetes integration you can also: Link your APM data to Kubernetes to measure the performance of your web and mobile applications, with metrics such as request rate, throughput, error rate, and availability. Monitor services running on Kubernetes, such as Apache, NGINX, Cassandra, and many more (see our tutorial for monitoring Redis on Kubernetes). Create new alert policies and alert conditions based on your Kubernetes data, or extend the predefined alert conditions. These features are in addition to the data New Relic already reports for containerized processes running on instrumented hosts. Navigate all your Kubernetes events The Kubernetes events integration, which is installed separately, watches for events happening in your Kubernetes clusters and sends those events to New Relic. Events data is then visualized in the cluster explorer. To set it up, check the Kubernetes events box in step 3 of our install wizard, or follow the instructions. one.newrelic.com > Kubernetes cluster explorer > Events: Browse and filter all your Kubernetes events, and dig into application logs and infrastructure data. Bring your cluster logs to New Relic Our Kubernetes plugin for log monitoring can collect all your cluster's logs and send them to our platform, so that you can set up new alerts and charts. To set it up, check the Log data box in step 3 of our install wizard, or follow the instructions. Check the source code This integration is open source software. That means you can browse its source code and send improvements, or you can create your own fork and build it. For more information, see the README. 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.", + "info": "New Relic Query Language (NRQL) dictionary of clauses and aggregator functions. ", + "body": "NRQL is a query language you can use to query the New Relic database. This document explains NRQL syntax, clauses, components, and functions. Syntax This document is a reference for the functions and clauses used in a NRQL query. Other resources for understanding NRQL: Intro to NRQL: explains what NRQL is used for, what data you can query with it, and basic NRQL syntax Examine NRQL queries used to build New Relic charts Simulate SQL JOIN functions Use funnels to evaluate a series of related data Format NRQL for querying with the Event API Query components Every NRQL query will begin with a SELECT statement or a FROM clause. All other clauses are optional. The clause definitions below also contain example NRQL queries. Required: SELECT statement SELECT attribute ... SELECT function(attribute) ... The SELECT specifies what portion of a data type you want to query by specifying an attribute or a function. It's followed by one or more arguments separated by commas. In each argument you can: Get the values of all available attributes by using * as a wildcard. For example: SELECT * from Transaction. Get values associated with a specified attribute or multiple attributes specified in a comma separated list. Get aggregated values from specified attributes by selecting an aggregator function. Label the results returned in each argument with the AS clause. You can also use SELECT with basic math functions. Avg response time since last week This query returns the average response time since last week. SELECT average(duration) FROM PageView SINCE 1 week ago Required: FROM clause SELECT ... FROM data type ... Use the FROM clause to specify the data type you wish to query. You can start your query with FROM or with SELECT. You can merge values for the same attributes across multiple data types in a comma separated list. Query one data type This query returns the count of all APM transactions over the last three days: SELECT count(*) FROM Transaction SINCE 3 days ago Query multiple data types This query returns the count of all APM transactions and Browser events over the last three days: SELECT count(*) FROM Transaction, PageView SINCE 3 days ago SHOW EVENT TYPES clause SHOW EVENT TYPES... SHOW EVENT TYPES will return a list of all the data types present in your account for a specific time range. It is used as the first clause in a query instead of SELECT. In this context, \"event types\" refers to the data types you can access with a NRQL query. Data types in the last day This query will return all the data types present over the past day: SHOW EVENT TYPES SINCE 1 day ago WHERE clause Use the WHERE clause to filter results. NRQL returns the results that fulfill the condition(s) you specify in the clause. SELECT function(attribute) ... WHERE attribute [operator 'value' | IN ('value' [, 'value]) | IS [NOT] NULL ] [AND|OR ...] ... If you specify more than one condition, separate the conditions by the operators AND or OR. If you want to simulate a SQL join, use custom attributes in a WHERE or FACET clause. Operators that the WHERE clause accepts Description =, !=, <, <=, >, >= NRQL accepts standard comparison operators. Example: state = 'WA' AND Used to define an intersection of two conditions. OR Used to define a union of two conditions. IS NULL Determines if an attribute has a null value. IS NOT NULL Determines if an attribute does not have a null value. IN Determines if the string value of an attribute is in a specified set. Using this method yields better performance than stringing together multiple WHERE clauses. Example: animalType IN ('cat', 'dog', 'fish') NOT IN Determines if the string value of an attribute is not in a specified set. Using this method yields better performance than stringing together multiple WHERE clauses. Values must be in parentheses, separated by commas. For example: SELECT * FROM PageView WHERE countryCode NOT IN ('CA', 'WA') LIKE Determines if an attribute contains a specified sub-string. The string argument for the LIKE operator accepts the percent sign (%) as a wildcard anywhere in the string. If the substring does not begin or end the string you are matching against, the wildcard must begin or end the string. Examples: userAgentName LIKE 'IE%' IE IE Mobile userAgentName LIKE 'o%a%' Opera Opera Mini userAgentName LIKE 'o%a' Opera userAgentName LIKE '%o%a%' Opera Opera Mini Mozilla Gecko NOT LIKE Determines if an attribute does not contain a specified sub-string. RLIKE Determines if an attribute contains a specified Regex sub-string. Uses RE2 syntax. Examples: appName RLIKE 'z.*|q.*'' z-app q-app hostname RLIKE 'ip-10-351-[0-2]?[0-9]-.*' ip-10-351-19-237 ip-10-351-2-41 ip-10-351-24-238 ip-10-351-14-15 Note: Slashes must be escaped in the Regex pattern. For example, \\d must be \\\\d. Regex defaults to full-string matching, therefore ^ and $ are implicit and you do not need to add them. If the Regex pattern contains a capture group, the group will be ignored. That is, the group will not be captured for use later in the query. NOT RLIKE Determines if an attribute does not contain a specified Regex sub-string. Uses RE2 syntax. Example query with three conditions This query returns the browser response time for pages with checkout in the URL for Safari users in the United States and Canada over the past 24 hours. SELECT histogram(duration, 50, 20) FROM PageView WHERE countryCode IN ('CA', 'US') AND userAgentName='Safari' AND pageUrl LIKE '%checkout%' SINCE 1 day ago AS clause SELECT ... AS 'label' ... Use the AS clause to label an attribute, aggregator, step in a funnel, or the result of a math function with a string delimited by single quotes. The label is used in the resulting chart. Query using math function and AS This query returns the number of page views per session: SELECT count(*)/uniqueCount(session) AS 'Pageviews per Session' FROM PageView Query using funnel and AS This query returns a count of people who have visited both the main page and the careers page of a site over the past week: SELECT funnel(SESSION, WHERE name='Controller/about/main' AS 'Step 1', WHERE name = 'Controller/about/careers' AS 'Step 2') FROM PageView SINCE 1 week ago FACET clause SELECT ... FACET attribute ... Use FACET to separate and group your results by attribute values. For example, you could FACET your PageView data by deviceType to figure out what percentage of your traffic comes from mobile, tablet, and desktop devices. Use the LIMIT clause to specify how many facets appear (default is 10). For more complex grouping, use FACET CASES. FACET clauses support up to five attributes, separated by commas. The facets are sorted in descending order by the first field you provide in the SELECT clause. If you are faceting on attributes with more than 1,000 unique values, a subset of facet values is selected and sorted according to the query type. When selecting min(), max(), or count(), FACET uses those functions to determine how facets are picked and sorted. When selecting any other function, FACET uses the frequency of the attribute you are faceting on to determine how facets are picked and sorted. For more on faceting on multiple attributes, with some real-world examples, see this New Relic blog post. Faceted query using count() This query shows cities with the highest pageview counts. This query uses the total number of pageviews per city to determine how facets are picked and ordered. SELECT count(*) FROM PageView FACET city Faceted query using uniqueCount() This query shows the cities that access the highest number of unique URLs. This query uses the total number of times a particular city appears in the results to determine how facets are picked and ordered. SELECT uniqueCount(pageUrl) FROM PageView FACET city Grouping results across time Advanced segmentation and cohort analysis allow you to facet on bucket functions to more effectively break out your data. Cohort analysis is a way to group results together based on timestamps. You can separate them into buckets that cover a specified range of dates and times. FACET ... AS clause Use FACET ... AS to name facets using the AS keyword in queries. This clause is helpful for adding clearer or simplified names for facets in your results. It can also be used to rename facets in nested aggregation queries. FACET ... AS queries will change the facet names in results (when they appear as headers in tables, for example), but not the actual facet names themselves. FROM Transaction SELECT count(*) FACET response.headers.contentType AS 'content type' FACET CASES clause SELECT ... FACET CASES ( WHERE attribute operator value, WHERE attribute operator value, ... ) ... Use FACET CASES to break out your data by more complex conditions than possible with FACET. Separate multiple conditions with a comma ,. For example, you could query your PageView data and FACET CASES into categories like less than 1 second, from 1 to 10 seconds, and greater than 10 seconds. You can combine multiple attributes within your cases, and label the cases with the AS selector. Data points will be added to at most one facet case, the first facet case that they match. You may also use a time function with your attribute. Basic usage with WHERE SELECT count(*) FROM PageView FACET CASES (WHERE duration < 1, WHERE duration > 1 and duration < 10, WHERE duration > 10) Group based on multiple attributes This example groups results into one bucket where the transaction name contains login, and another where the URL contains login and a custom attribute indicates that the user was a paid user: SELECT count(*) FROM Transaction FACET CASES (WHERE name LIKE '%login%', WHERE name LIKE '%feature%' AND customer_type='Paid') Label groups with AS This example uses the AS selector to give your results a human-readable name: SELECT count(*) FROM Transaction FACET CASES (WHERE name LIKE '%login%' AS 'Total Logins', WHERE name LIKE '%feature%' AND customer_type='Paid' AS 'Feature Visits from Paid Users') FACET ... ORDER BY clause In NRQL, the default is for the first aggregation in the SELECT clause to guide the selection of facets in a query. FACET ... ORDER BY allows you to override this default behavior by adding an aggregate function with the ORDER BY modifier to specify how facets are selected. Specifically, the clause will override the priority by which facets are chosen to be in the final result before being limited by the LIMIT clause. This clause can be used in querying but not for alerts or streaming. This example shows how to use FACET ... ORDER BY to find the average durations of app transactions, showing the top 10 (default limit) highest durations by apps which have the highest response size. In this case, if FACET ... ORDER BY is not used, the query results will instead show the top 10 by highest durations, with response size being irrelevant to the app selection. FROM Transaction SELECT average(duration) TIMESERIES FACET appName ORDER BY max(responseSize) Because the operations are performed before the LIMIT clause is applied, FACET ... ORDER BY does not impact the sort of the final query results, which will be particularly noticeable in the results for non-timeseries queries. The ORDER BY modifier in this case works differently than the ORDER BY clause. When parsing queries that follow the format FACET attribute1 ORDER BY attribute2, New Relic will read these as FACET ... ORDER BY queries, but only if ORDER BY appears immediately after FACET. Otherwise ORDER BY will be interpreted by New Relic as a clause. LIMIT clause SELECT ... LIMIT count ... Use the LIMIT clause to control the maximum number of facet values returned by FACET queries or the maximum number of items returned by SELECT * queries. This clause takes a single integer value as an argument. If the LIMIT clause is not specified, or no value is provided, the limit defaults to 10 for FACET queries and 100 in the case of SELECT * queries. The maximum allowed value for the LIMIT clause is 2,000. Query using LIMIT This query shows the top 20 countries by session count and provides 95th percentile of response time for each country for Windows users only. SELECT uniqueCount(session), percentile(duration, 95) FROM PageView WHERE userAgentOS = 'Windows' FACET countryCode LIMIT 20 SINCE YESTERDAY OFFSET clause SELECT ... LIMIT count OFFSET count ... Use the OFFSET clause with LIMIT to control the portion of rows returned by SELECT * or SELECT column queries. Like the LIMIT clause, OFFSET takes a single integer value as an argument. OFFSET sets the number of rows to be skipped before the selected rows of your query are returned. This is constrained by LIMIT. OFFSET rows are skipped starting from the most recent record. For example, the query SELECT interestingValue FROM Minute_Report LIMIT 5 OFFSET 1 returns the last 5 values from Minute_Report except for the most recent one. ORDER BY clause The ORDER BY clause allows you to specify how you want to sort your query results in queries that select event attributes by row. This query orders transactions by duration. FROM Transaction SELECT appName, duration ORDER BY duration The default sort order is ascending, but this can be changed by adding the ASC or DESC modifiers. SINCE clause SELECT ... SINCE [numerical units AGO | phrase] ... The default value is 1 hour ago. Use the SINCE clause to define the beginning of a time range for the returned data. When using NRQL, you can set a UTC timestamp or relative time range. You can specify a timezone for the query but not for the results. NRQL results are based on your system time. See Set time range on dashboards and charts for detailed information and examples. UNTIL clause SELECT ... UNTIL integer units AGO ... The default value is NOW. Only use UNTIL to specify an end point other than the default. Use the UNTIL clause to define the end of a time range across which to return data. Once a time range has been specified, the data will be preserved and can be reviewed after the time range has ended. You can specify a UTC timestamp or relative time range. You can specify a time zone for the query but not for the results. The returned results are based on your system time. See Set time range on dashboards and charts for detailed information and examples. WITH TIMEZONE clause SELECT ... WITH TIMEZONE (selected zone) ... By default, query results are displayed in the timezone of the browser you're using. Use the WITH TIMEZONE clause to select a time zone for a date or time in the query that hasn't already had a time zone specified for it. For example, the query clause SINCE Monday UNTIL Tuesday WITH TIMEZONE 'America/New_York' will return data recorded from Monday at midnight, Eastern Standard Time, until midnight Tuesday, Eastern Standard Time. Available Time Zone Selections Africa/Abidjan Africa/Addis_Ababa Africa/Algiers Africa/Blantyre Africa/Cairo Africa/Windhoek America/Adak America/Anchorage America/Araguaina America/Argentina/Buenos_Aires America/Belize America/Bogota America/Campo_Grande America/Cancun America/Caracas America/Chicago America/Chihuahua America/Dawson_Creek America/Denver America/Ensenada America/Glace_Bay America/Godthab America/Goose_Bay America/Havana America/La_Paz America/Los_Angeles America/Miquelon America/Montevideo America/New_York America/Noronha America/Santiago America/Sao_Paulo America/St_Johns Asia/Anadyr Asia/Bangkok Asia/Beirut Asia/Damascus Asia/Dhaka Asia/Dubai Asia/Gaza Asia/Hong_Kong Asia/Irkutsk Asia/Jerusalem Asia/Kabul Asia/Katmandu Asia/Kolkata Asia/Krasnoyarsk Asia/Magadan Asia/Novosibirsk Asia/Rangoon Asia/Seoul Asia/Tashkent Asia/Tehran Asia/Tokyo Asia/Vladivostok Asia/Yakutsk Asia/Yekaterinburg Asia/Yerevan Atlantic/Azores Atlantic/Cape_Verde Atlantic/Stanley Australia/Adelaide Australia/Brisbane Australia/Darwin Australia/Eucla Australia/Hobart Australia/Lord_Howe Australia/Perth Chile/EasterIsland Etc/GMT+10 Etc/GMT+8 Etc/GMT-11 Etc/GMT-12 Europe/Amsterdam Europe/Belfast Europe/Belgrade Europe/Brussels Europe/Dublin Europe/Lisbon Europe/London Europe/Minsk Europe/Moscow Pacific/Auckland Pacific/Chatham Pacific/Gambier Pacific/Kiritimati Pacific/Marquesas Pacific/Midway Pacific/Norfolk Pacific/Tongatapu UTC See Set time range on dashboards and charts for detailed information and examples. WITH METRIC_FORMAT clause For information on querying metric data, see Query metrics. COMPARE WITH clause SELECT ... (SINCE or UNTIL) (integer units) AGO COMPARE WITH (integer units) AGO ... Use the COMPARE WITH clause to compare the values for two different time ranges. COMPARE WITH requires a SINCE or UNTIL statement. The time specified by COMPARE WITH is relative to the time specified by SINCE or UNTIL. For example, SINCE 1 day ago COMPARE WITH 1 day ago compares yesterday with the day before. The time range for theCOMPARE WITH value is always the same as that specified by SINCE or UNTIL. For example, SINCE 2 hours ago COMPARE WITH 4 hours ago might compare 3:00pm through 5:00pm against 1:00 through 3:00pm. COMPARE WITH can be formatted as either a line chart or a billboard: With TIMESERIES, COMPARE WITH creates a line chart with the comparison mapped over time. Without TIMESERIES, COMPARE WITH generates a billboard with the current value and the percent change from the COMPARE WITH value. Example: This query returns data as a line chart showing the 95th percentile for the past hour compared to the same range one week ago. First as a single value, then as a line chart. SELECT percentile(duration) FROM PageView SINCE 1 week ago COMPARE WITH 1 week AGO SELECT percentile(duration) FROM PageView SINCE 1 week ago COMPARE WITH 1 week AGO TIMESERIES AUTO TIMESERIES clause SELECT ... TIMESERIES integer units ... Use the TIMESERIES clause to return data as a time series broken out by a specified period of time. Since TIMESERIES is used to trigger certain charts, there is no default value. To indicate the time range, use integer units. For example: TIMESERIES 1 minute TIMESERIES 30 minutes TIMESERIES 1 hour TIMESERIES 30 seconds Use a set interval The value provided indicates the units used to break out the graph. For example, to present a one-day graph showing 30 minute increments: SELECT ... SINCE 1 day AGO TIMESERIES 30 minutes Use automatically set interval TIMESERIES can also be set to AUTO, which will divide your graph into a reasonable number of divisions. For example, a daily chart will be divided into 30 minute intervals and a weekly chart will be divided into 6 hour intervals. This query returns data as a line chart showing the 50th and 90th percentile of client-side transaction time for one week with a data point every 6 hours. SELECT average(duration), percentile(duration, 50, 90) FROM PageView SINCE 1 week AGO TIMESERIES AUTO Use max interval You can set TIMESERIES to MAX, which will automatically adjust your time window to the maximum number of intervals allowed for a given time period. This allows you to update your time windows without having to manually update your TIMESERIES buckets and ensures your time window is being split into the peak number of intervals allowed. The maximum number of TIMESERIES buckets that will be returned is 366. For example, the following query creates 4-minute intervals, which is the ceiling for a daily chart. SELECT average(duration) FROM Transaction since 1 day ago TIMESERIES MAX For functions such as average( ) or percentile( ), a large interval can have a significant smoothing effect on outliers. EXTRAPOLATE clause You can use this clause with these data types: Transaction TransactionError Custom events reported via APM agent APIs The purpose of EXTRAPOLATE is to mathematically compensate for the effects of APM agent sampling of event data so that query results more closely represent the total activity in your system. This clause will be useful when a New Relic APM agent reports so many events that it often passes its harvest cycle reporting limits. When that occurs, the agent begins to sample events. When EXTRAPOLATE is used in a NRQL query that supports its use, the ratio between the reported events and the total events is used to extrapolate a close approximation of the total unsampled data. When it is used in a NRQL query that doesn’t support its use or that hasn’t used sampled data, it has no effect. Note that EXTRAPOLATE is most useful for homogenous data (like throughput or error rate). It's not effective when attempting to extrapolate a count of distinct things (like uniqueCount() or uniques()). This clause works only with NRQL queries that use one of the following aggregator functions: apdex average count histogram sum percentage (if function it takes as an argument supports EXTRAPOLATE) rate (if function it takes as an argument supports EXTRAPOLATE) stddev Example of extrapolating throughput A query that will show the extrapolated throughput of a service named interestingApplication. SELECT count(*) FROM Transaction WHERE appName='interestingApplication' SINCE 60 minutes ago EXTRAPOLATE Example of extrapolating throughput as a time series A query that will show the extrapolated throughput of a service named interestingApplication by transaction name, displayed as a time series. SELECT count(*) FROM Transaction WHERE appName='interestingApplication' SINCE 60 minutes ago FACET name TIMESERIES 1 minute EXTRAPOLATE Query metric data There are several ways to query metric data using NRQL: Query metric timeslice data, which is reported by New Relic APM, Mobile, Browser Query the Metric data type, which is reported by some of our integrations and Telemetry SDKs For more on understanding metrics in New Relic, see Metric data types. Aggregator functions Use aggregator functions to filter and aggregate data in a NRQL query. Some helpful information about using aggregator functions: See the New Relic University tutorials for Filter queries, Apdex queries, and Percentile queries. Or, go to the full online course Writing NRQL queries. Data type \"coercion\" is not supported. Read about available type conversion functions. Cohort analysis functions appear on the New Relic Insights Cohort analysis page. The cohort functions aggregate transactions into time segments. Here are the available aggregator functions. The definitions below contain example NRQL queries. Examples: SELECT histogram(duration, 10, 20) FROM PageView SINCE 1 week ago apdex(attribute, t: ) Use the apdex function to return an Apdex score for a single transaction or for all your transactions. The attribute can be any attribute based on response time, such as duration or backendDuration. The t: argument defines an Apdex T threshold in seconds. The Apdex score returned by the apdex( ) function is based only on execution time. It does not account for APM errors. If a transaction includes an error but completes in Apdex T or less, that transaction will be rated satisfying by the apdex ( ) function. Get Apdex for specific customers If you have defined custom attributes, you can filter based on those attributes. For example, you could monitor the Apdex for a particularly important customer: SELECT apdex(duration, t: 0.4) FROM Transaction WHERE customerName='ReallyImportantCustomer' SINCE 1 day ago Get Apdex for specific transaction Use the name attribute to return a score for a specific transaction, or return an overall Apdex by omitting name. This query returns an Apdex score for the Controller/notes/index transaction over the last hour: SELECT apdex(duration, t: 0.5) from Transaction WHERE name='Controller/notes/index' SINCE 1 hour ago The apdex function returns an Apdex score that measures user satisfaction with your site. Arguments are a response time attribute and an Apdex T threshold in seconds. Get overall Apdex for your app This example query returns an overall Apdex for the application over the last three weeks: SELECT apdex(duration, t: 0.08) FROM Transaction SINCE 3 week ago average(attribute) Use the average( ) function to return the average value for an attribute. It takes a single attribute name as an argument. If a value of the attribute is not numeric, it will be ignored when aggregating. If data matching the query's conditions is not found, or there are no numeric values returned by the query, it will return a value of null. buckets(attribute, ceiling [,number of buckets]) Use the buckets() function to aggregate data split up by a FACET clause into buckets based on ranges. You can bucket by any attribute that is stored as a numerical value in the New Relic database. It takes three arguments: Attribute name Maximum value of the sample range. Any outliers will appear in the final bucket. Total number of buckets For more information and examples, see Split your data into buckets. bucketPercentile(attribute) The bucketPercentile( ) function is the NRQL equivalent of the histogram_quantile function in Prometheus. It is intended to be used with dimensional metric data. Instead of the quantile, New Relic returns the percentile, which is the quantile * 100. Use the bucketPercentile( ) function to calculate the quantile from the histogram data in a Prometheus format. It takes the bucket name as an argument and reports percentiles along the bucket's boundaries: SELECT bucketPercentile(duration_bucket) FROM Metric SINCE 1 day ago Optionally, you can add percentile specifications as an argument: SELECT bucketPercentile(duration_bucket, 50, 75, 90) FROM Metric SINCE 1 day ago Because multiple metrics are used to make up Prometheus histogram data, you must query for specific Prometheus metrics in terms of the associated . For example, to compute percentiles from a Prometheus histogram, with the prometheus_http_request_duration_seconds using NRQL, use bucketPercentile(prometheus_http_request_duration_seconds_bucket, 50). Note how _bucket is added to the end of the as a suffix. See the Prometheus.io documentation for more information. cardinality(attribute) Use the cardinality( ) function to obtain the number of combinations of all the dimensions (attributes) on a metric. It takes three arguments, all optional: Metric name: if present, cardinality( ) only computes the metric specified. Include: if present, the include list restricts the cardinality computation to those attributes. Exclude: if present, the exclude list causes those attributes to be ignored in the cardinality computation. SELECT cardinality(metric_name, include:{attribute_list}, exclude:{attribute_list}) count(*) Use the count( ) function to return a count of available records. It takes a single argument; either *, an attribute, or a constant value. Currently, it follows typical SQL behavior and counts all records that have values for its argument. Since count(*) does not name a specific attribute, the results will be formatted in the default \"humanize\" format. derivative(attribute [,time interval]) derivative() finds the rate of change for a given dataset. The rate of change is calculated using a least-squares regression to approximate the derivative. The time interval is the period for which the rate of change is calculated. For example, derivative(attributeName, 1 minute) will return the rate of change per minute. dimensions(include: {attributes}, exclude: {attributes}) Use the dimensions( ) function to return all the dimensional values on a data type. You can explicitly include or exclude specific attributes using the optional arguments: Include: if present, the include list limits dimensions( ) to those attributes. Exclude: if present, the dimensions( ) calculation ignores those attributes. FROM Metric SELECT count(node_filesystem_size) TIMESERIES FACET dimensions() When used with a FACET clause, dimensions( ) produces a unique timeseries for all facets available on the event type, similar to how Prometheus behaves with non-aggregated queries. earliest(attribute) Use the earliest( ) function to return the earliest value for an attribute over the specified time range. It takes a single argument. Arguments after the first will be ignored. If used in conjunction with a FACET it will return the most recent value for an attribute for each of the resulting facets. Get earliest country per user agent from PageView This query returns the earliest country code per each user agent from the PageView event. SELECT earliest(countryCode) FROM PageView FACET userAgentName eventType() ...WHERE eventType() = 'EventNameHere'... ...FACET eventType()... Use the eventType() function in a FACET clause to break out results by the selected data type or in a WHERE clause to filter results to a specific data type. This is particularly useful for targeting specific data types with the filter() and percentage() functions. In this context, \"event type\" refers to the types of data you can access with a NRQL query. Use eventType() in filter() function This query returns the percentage of total TransactionError results out of the total Transaction results. You can use the eventType() function to target specific types of data with the filter() function. SELECT 100 * filter(count(*), where eventType() = 'TransactionError') / filter(count(*), where eventType() = 'Transaction') FROM Transaction, TransactionError WHERE appName = 'App.Prod' TIMESERIES 2 Minutes SINCE 6 hours ago Use eventType() with FACET This query displays a count of how many records each data type (Transaction and TransactionError) returns. SELECT count(*) FROM Transaction, TransactionError FACET eventType() TIMESERIES filter(function(attribute), WHERE condition) Use the filter( ) function to limit the results for one of the aggregator functions in your SELECT statement. You can use filter() in conjunction with FACET or TIMESERIES. Analyze purchases that used offer codes You could use filter() to compare the items bought in a set of transactions for those using an offer code versus those who aren't: Use the filter( ) function to limit the results for one of the aggregator functions in your SELECT statement. funnel(attribute, steps) Use the funnel() function to generate a funnel chart. It takes an attribute as its first argument. You then specify steps as WHERE clauses (with optional AS clauses for labels) separated by commas. For details and examples, see the funnels documentation. getField(attribute, field) Use the getField() function to extract a field from complex metrics. It takes the following arguments: Metric type Supported fields summary count, total, max, min gauge count, total, max, min, latest distribution count, total, max, min counter count Examples: SELECT max(getField(mySummary, count)) from Metric SELECT sum(mySummary) from Metric where getField(mySummary, count) > 10 histogram(attribute, ceiling [,number of buckets]) Use the histogram( ) function to generate histograms. It takes three arguments: Attribute name Maximum value of the sample range Total number of buckets Histogram of response times from PageView events This query results in a histogram of response times ranging up to 10 seconds over 20 buckets. SELECT histogram(duration, 10, 20) FROM PageView SINCE 1 week ago Prometheus histogram buckets histogram( ) accepts Prometheus histogram buckets: SELECT histogram(duration_bucket, 10, 20) FROM Metric SINCE 1 week ago New Relic distribution metric histogram( ) accepts Distribution metric as an input: SELECT histogram(myDistributionMetric, 10, 20) FROM Metric SINCE 1 week ago keyset() Using keyset() will allow you to see all of the attributes for a given data type over a given time range. It takes no arguments. It returns a JSON structure containing groups of string-typed keys, numeric-typed keys, boolean-typed keys, and all keys. See all attributes for a data type This query returns the attributes found for PageView events from the last day: SELECT keyset() FROM PageView SINCE 1 day ago latest(attribute) Use the latest( ) function to return the most recent value for an attribute over a specified time range. It takes a single argument. Arguments after the first will be ignored. If used in conjunction with a FACET it will return the most recent value for an attribute for each of the resulting facets. Get most recent country per user agent from PageView This query returns the most recent country code per each user agent from the PageView event. SELECT latest(countryCode) FROM PageView FACET userAgentName max(attribute) Use the max( ) function to return the maximum recorded value of a numeric attribute over the time range specified. It takes a single attribute name as an argument. If a value of the attribute is not numeric, it will be ignored when aggregating. If data matching the query's conditions is not found, or there are no numeric values returned by the query, it will return a value of null. median(attribute) Use the median( ) function to return an attribute's median, or 50th percentile. For more information about percentile queries, see percentile(). The median( ) query is only available when using the query builder. Median query This query will generate a line chart for the median value. SELECT median(duration) FROM PageView TIMESERIES AUTO min(attribute) Use the min( ) function to return the minimum recorded value of a numeric attribute over the time range specified. It takes a single attribute name as an argument. If a value of the attribute is not numeric, it will be ignored when aggregating. If data matching the query's conditions is not found, or there are no numeric values returned by the query, it will return a value of null. percentage(function(attribute), WHERE condition) Use the percentage( ) function to return the percentage of a target data set that matches some condition. The first argument requires an aggregator function against the desired attribute. Use exactly two arguments (arguments after the first two will be ignored). If the attribute is not numeric, this function returns a value of 100%. percentile(attribute [, percentile [, ...]]) Use the percentile( ) function to return an attribute's approximate value at a given percentile. It requires an attribute and can take any number of arguments representing percentile points. The percentile() function enables percentiles to displays with up to three digits after the decimal point, providing greater precision. Percentile thresholds may be specified as decimal values, but be aware that for most data sets, percentiles closer than 0.1 from each other will not be resolved. Percentile display examples Use TIMESERIES to generate a line chart with percentiles mapped over time. Omit TIMESERIES to generate a billboard and attribute sheet showing aggregate values for the percentiles. If no percentiles are listed, the default is the 95th percentile. To return only the 50th percentile value, the median, you can also use median(). Basic percentile query This query will generate a line chart with lines for the 5th, 50th, and 95th percentile. SELECT percentile(duration, 5, 50, 95) FROM PageView TIMESERIES AUTO predictLinear(attribute, [,time interval]) predictLinear() is an extension of the derivative() function. It uses a similar method of least-squares linear regression to predict the future values for a dataset. The time interval is how far the query will look into the future. For example, predictLinear(attributeName, 1 hour) is a linear prediction 1 hour into the future of the query time window. Generally, predictLinear() is helpful for continuously growing values like disk space, or predictions on large trends. Since predictLinear() is a linear regression, familiarity with the dataset being queried helps to ensure accurate long-term predictions. Any dataset which grows exponentially, logarithmically, or by other nonlinear means will likely only be successful in very short-term predictions. New Relic recommends against using predictLinear in TIMESERIES queries. This is because each bucket will be making an individual prediction based on its relative timeframe within the query, meaning that such queries will not show predictions from the end of the timeseries forward. rate(function(attribute) [,time interval]) Use the rate( ) function to visualize the frequency or rate of a given query per time interval. For example, you might want to know the number of pageviews per minute over an hour-long period or the count of unique sessions on your site per hour over a day-long period. Use TIMESERIES to generate a line chart with rates mapped over time. Omit TIMESERIES to generate a billboard showing a single rate value averaged over time. Basic rate query This query will generate a line chart showing the rate of throughput for APM transactions per 10 minutes over the past 6 hours. SELECT rate(count(*), 10 minute) FROM Transaction SINCE 6 hours ago TIMESERIES round(attribute) Use the round( ) function to return the rounded value of an attribute. Optionally round( ) can take a second argument, to_nearest, to round the first argument to the closest multiple of the second one. to_nearest can be fractional. SELECT round(n [, to_nearest]) stddev(attribute) Use the stddev( ) function to return one standard deviation for a numeric attribute over the time range specified. It takes a single argument. If the attribute is not numeric, it will return a value of zero. stdvar(attribute) Use the stdvar( ) function to return the standard variance for a numeric attribute over the time range specified. It takes a single argument. If the attribute is not numeric, it will return a value of zero. sum(attribute) Use the sum( ) function to return the sum recorded values of a numeric attribute over the time range specified. It takes a single argument. Arguments after the first will be ignored. If the attribute is not numeric, it will return a value of zero. uniqueCount(attribute) Use the uniqueCount( ) function to return the number of unique values recorded for an attribute over the time range specified. To optimize query performance, this function returns approximate results for queries that inspect more than 256 unique values. uniques(attribute [,limit]​) Use the uniques( ) function to return a list of unique values recorded for an attribute over the time range specified. When used along with the facet clause, a list of unique attribute values will be returned per each facet value. The limit parameter is optional. When it is not provided, the default limit of 1,000 unique attribute values per facet is applied. You may specify a different limit value, up to a maximum of 10,000. The uniques( ) function will return the first set of unique attribute values discovered, until the limit is reached. Therefore, if you have 5,000 unique attribute values in your data set, and the limit is set to 1,000, the operator will return the first 1,000 unique values that it discovers, regardless of their frequency. The maximum number of values that can be returned in a query result is the product of the uniques( ) limit times the facet limit. In the following query, the theoretical maximum number of values that can be returned is 5 million (5,000 x 1,000). From Transaction SELECT uniques(host,5000) FACET appName LIMIT 1000 However, depending on the data set being queried, and the complexity of the query, memory protection limits may prevent a very large query from being executed. Type conversion NRQL does not support \"coercion.\" This means that a float stored as a string is treated as a string and cannot be operated on by functions expecting float values. You can convert a string with a numeric value or a boolean with a string value to their numeric and boolean types with these functions: Use the numeric() function to convert a number with a string format to a numeric function. The function can be built into a query that uses math functions on query results or NRQL aggregator functions, such as average(). Use the boolean() function to convert a string value of \"true\" or \"false\" to the corresponding boolean value. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 102.651375, + "_score": 79.35937, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Bring your cluster logs to New Relic", - "info": "New Relic's Kubernetes integration: features, requirements, and getting started. ", - "body": " data. Bring your cluster logs to New Relic Our Kubernetes plugin for log monitoring can collect all your cluster's logs and send them to our platform, so that you can set up new alerts and charts. To set it up, check the Log data box in step 3 of our install wizard, or follow the instructions. Check" + "title": "NRQL syntax, clauses, and functions", + "sections": "NRQL syntax, clauses, and functions", + "info": "New Relic Query Language (NRQL) dictionary of clauses and aggregator functions. ", + "category_0": "Query your data", + "category_1": "NRQL: New Relic Query Language", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/nrql-syntax-clauses-functions", + "body": " NRQL is used for, what data you can query with it, and basic NRQL syntax Examine NRQL queries used to build New Relic charts Simulate SQL JOIN functions Use funnels to evaluate a series of related data Format NRQL for querying with the Event API Query components Every NRQL query will begin", + "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started" }, - "id": "5cf9564164441f8f472a9169" + "id": "5f2abcef28ccbcb0ee0c3aed" }, { - "image": "https://developer.newrelic.com/static/kubecon-europe-2020-b989ec0e7b4ed71a89666c35fe934433.jpg", - "url": "https://developer.newrelic.com/kubecon-europe-2020/", + "category_2": "Explore data", + "nodeid": 1131, "sections": [ - "KubeCon and CloudNativeCon Europe 2020", - "New Relic welcomes you at Virtual Kubecon and CloudNativeCon Europe 2020!", - "Attend one of our lightning talks", - "Note", - "We handle Prometheus, you keep Grafana", - "How to use and customize Helm charts", - "Kubernetes observability with context", - "What is OpenTelemetry and how to get started?", - "OpenTelemetry Architecture", - "Kubernetes in the wild: best practices", - "Want some action now? Check out the following videos!", - "How to use the Kubernetes cluster explorer", - "What is OpenTelemetry?", - "Connecting Prometheus and Grafana to New Relic" + "Use Insights UI", + "Getting started", + "Explore data", + "Guides", + "Manage account data", + "Manage dashboards", + "Time settings", + "Export data", + "Troubleshooting", + "Query page: Create and edit NRQL queries", + "Use NRQL query history", + "For more help" ], - "published_at": "2020-09-24T02:26:05Z", - "title": "New Relic Developers", - "updated_at": "2020-08-15T01:43:38Z", - "type": "developer", - "external_id": "53cb6afa4f4062ba359559e9fb3bb2406ece2ad4", + "title": "Query page: Create and edit NRQL queries", + "category_0": "Insights", + "type": "docs", + "category_1": "Use Insights UI", + "external_id": "e00d2b865680d15c361b4058e22270fe5103aa8e", + "image": "", + "url": "https://docs.newrelic.com/docs/insights/use-insights-ui/manage-account-data/query-page-create-edit-nrql-queries", + "published_at": "2020-09-24T08:35:43Z", + "updated_at": "2020-07-26T08:08:39Z", + "breadcrumb": "Contents / Insights / Use Insights UI / Explore data", "document_type": "page", "popularity": 1, - "body": "KubeCon and CloudNativeCon Europe 2020 New Relic welcomes you at Virtual Kubecon and CloudNativeCon Europe 2020! Learn more about the New Relic One platform, the only observability platform that provides open, connected and programmable observability for cloud-native environments. Join us to dive into the New Relic One platform and our Kubernetes cluster explorer. Register here Attend one of our lightning talks Note Go to the virtual expo tab, and find New Relic in Silver Hall B to attend a lightning talk. We handle Prometheus, you keep Grafana Mon Aug 17 @ 14:35 CEST Samuel Vandamme How to use and customize Helm charts Mon Aug 17 @ 16:25 CEST Douglas Camata Kubernetes observability with context Tue Aug 18 @ 15:05 CEST Stijn Polfliet What is OpenTelemetry and how to get started? Tue Aug 18 @ 17:15 CEST Lavanya Chockaligam How to use and customize Helm charts Wed Aug 19 @ 15:05 CEST Douglas Camata OpenTelemetry Architecture Wed Aug 19 @ 16:25 CEST John Watson Kubernetes in the wild: best practices Thu Aug 20 @ 15:05 CEST Martin Fuentes Kubernetes observability with context Thu Aug 20 @ 16:50 CEST Stijn Polfliet Want some action now? Check out the following videos! How to use the Kubernetes cluster explorer What is OpenTelemetry? Connecting Prometheus and Grafana to New Relic", - "info": "", + "info": "Use the New Relic Insights Query page to create and edit NRQL queries, favorite them for later use, and add query results to dashboards. ", + "body": "New Relic Insights' Query page is one place you can run NRQL queries of your data. To get started: Go to insights.newrelic.com > Query, then use any of the available NRQL syntax and functions. Use the Query page to: Create and run queries of your data. View your query history. View favorite queries. Use the NRQL query to create, view, organize, and share Insights dashboards. For a library of educational videos about how to use New Relic Insights, visit learn.newrelic.com. Use NRQL query history To view up to twenty of your most recent queries, select the History tab directly below the query command line interface. Use the query history to adjust and improve recent queries. If you want to... Do this... Run recent queries Select a recent query from the history list. The query will appear on the command line, where it can be edited. Delete queries Mouse over a query in the history list so the delete [trash] icon appears. The query history only retains the twenty most recent queries, so it can be useful to delete unwanted queries to make room for queries you like. Favorite queries Mouse over a query in the history list and the favorite star icon appears. Then, to view and use your favorite queries, select the Favorites tab. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 102.32858, + "_score": 72.57219, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic Developers", - "sections": "How to use and customize Helm charts", - "body": " to use and customize Helm charts Mon Aug 17 @ 16:25 CEST Douglas Camata Kubernetes observability with context Tue Aug 18 @ 15:05 CEST Stijn Polfliet What is OpenTelemetry and how to get started? Tue Aug 18 @ 17:15 CEST Lavanya Chockaligam How to use and customize Helm charts Wed Aug 19 @ 15:05 CEST" + "title": "Query page: Create and edit NRQL queries", + "sections": "Explore data", + "info": "Use the New Relic Insights Query page to create and edit NRQL queries, favorite them for later use, and add query results to dashboards. ", + "category_2": "Explore data", + "body": "New Relic Insights' Query page is one place you can run NRQL queries of your data. To get started: Go to insights.newrelic.com > Query, then use any of the available NRQL syntax and functions. Use the Query page to: Create and run queries of your data. View your query history. View favorite queries", + "breadcrumb": "Contents / Insights / Use Insights UI / Explore data" }, - "id": "5f373dcae7b9d20949909274" + "id": "59425a3c8e9c0f6937f1cda9" } ], "/build-apps/map-pageviews-by-region": [ @@ -6257,18 +6504,18 @@ "New Relic developer champions", "New Relic Podcasts" ], - "published_at": "2020-09-24T02:24:45Z", + "published_at": "2020-09-25T01:41:27Z", "title": "New Relic Developers", - "updated_at": "2020-09-24T01:39:32Z", + "updated_at": "2020-09-25T01:37:24Z", "type": "developer", "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab", "document_type": "page", "popularity": 1, - "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 19 Days : 14 Hours : 58 Minutes : 8 Seconds Register 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 20 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", + "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 18 Days : 14 Hours : 58 Minutes : 41 Seconds Register 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 20 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", "info": "", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 167.15125, + "_score": 164.6712, "_version": null, "_explanation": null, "sort": null, @@ -6298,7 +6545,7 @@ "external_id": "c45638a9cd548d1ffffc9f1c7708f115a92ae04a", "image": "", "url": "https://developer.newrelic.com/build-apps/set-up-dev-env/", - "published_at": "2020-09-24T02:30:05Z", + "published_at": "2020-09-25T01:57:48Z", "updated_at": "2020-08-26T01:47:20Z", "document_type": "page", "popularity": 1, @@ -6306,7 +6553,7 @@ "body": "Set up your development environment 20 min If you've decided to build a custom app or modify one of our open source apps, you need a few essential tools: The New Relic One command line interface (CLI) An API key, which you get when you download the CLI Depending on what you want to do with your app, you might have some additional setup and configuration. This guide covers: Downloading the New Relic One CLI to build or modify apps Contribute content to this website Before you begin You must have: A github account account - While not strictly necessary for building apps, a GitHub account enables you to download and customize our open source apps, and contribute an open source project. A New Relic developer account - if you don't already have one, you can get a free trial account for developing New Relic applications. npm - If you've installed Node.js, then you already have npm, which is used to share, reuse, and update JavaScript code, and is necessary for working with React components that are the framework for New Relic apps and this website. A note on support Building a New Relic One application is the same as building any JavaScript/React application. We offer support to help with our building tools (our CLI and SDK library). However, we don't offer support for basic JavaScript or React coding questions or issues. For common questions and answers about building, see the Explorers Hub page on building on New Relic One. Tip Use the New Relic One VSCode extension to build your apps. Prepare to build or modify apps Step 1 of 1 Download the CLI and API key. On the Build New Relic One applications page, complete the Quick start steps. These six Quick start steps get you an API key for use with developing apps, and the New Relic One CLI, for building and deploying apps. At the end of the Quick start, you have a project consisting of the following: A Nerdpack - The package containing all the files required by your application. It contains two types of files that you customize to build your app: Nerdlets, and the launcher. One or more Nerdlet files - A specific UI view or window. A Nerdlet is a React JavaScript package that includes an index.js file, a stylesheet, and a JSON-format config file. It can contain any JS functionality (charts, interactive fields, tooltips, etc.). A launcher file: This is the basis for the launcher, which is used to open your application from New Relic One after you publish your app. Start building Step 1 of 1 If you're ready to code, cd to your Nerdpack and get started. If you want to learn more about building applications, try these step-by-step guides: Build a \"Hello, World!\" application shows how to create a little application, publish it to New Relic One, and share it with others by subscribing accounts to it. Map pageviews by region takes you through the steps to create one of our popular open source apps. You learn to add a custom query to an app and view it in a table, then add that data to a map. Contribute to developer.newrelic.com This site is open source, and we want your input. Create a pull request if you see a mistake you know how to fix. Drop us a GitHub issue if you see some content gaps you want us to work on. Or write up a whole new guide if you have one you'd like to share. Read on to learn how. Step 1 of 3 Fork the developer-website GithHub repo. Forking the repo enables you to work on your own copy of the developer.newrelic.com files, and build the site locally. It also enables us to more easily manage incomimg pull requests. On the developer-website page in GitHub, select the Fork button on the top right of the page, choose the account you want to fork to, and wait a few seconds while the fork is created. Sync regularly to keep your fork up to date with changes and additions to the main branch upstream. Step 2 of 3 Make a feature or documentation request. On any page, select the GitHub button at the top of the page, and then select the kind of change you want, and fill out the GitHub form. Step 3 of 3 Contribute a new guide. Check out our contributors guidelines, which will walk you through the process.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 122.855804, + "_score": 118.49132, "_version": null, "_explanation": null, "sort": null, @@ -6337,7 +6584,7 @@ "external_id": "709e06c25376d98b2191ca369b4d139e5084bd62", "image": "", "url": "https://developer.newrelic.com/explore-docs/nerdstorage/", - "published_at": "2020-09-24T02:28:37Z", + "published_at": "2020-09-25T01:49:59Z", "updated_at": "2020-09-08T01:50:19Z", "document_type": "page", "popularity": 1, @@ -6345,7 +6592,7 @@ "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,500 documents, plus storage type. Each document can have a maximum length of 1024 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 108.01843, + "_score": 102.578094, "_version": null, "_explanation": null, "sort": null, @@ -6388,296 +6635,73 @@ "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-lambda-monitoring-architecture.png", "url": "https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/enable-serverless-monitoring-aws-lambda", "published_at": "2020-09-24T09:32:20Z", - "updated_at": "2020-09-24T09:32:20Z", - "breadcrumb": "Contents / Serverless function monitoring / AWS Lambda monitoring / Enable Lambda monitoring", - "document_type": "page", - "popularity": 1, - "info": "Read about how to install and enable New Relic monitoring for Amazon AWS Lambda. ", - "body": "Serverless monitoring for AWS Lambda offers in-depth performance monitoring for your Lambda functions. Read on to learn how to enable this feature and get started using it. Using this feature may result in AWS charges. For more information, see the Lambda monitoring requirements.​​​ How Lambda monitoring works Before enabling Lambda monitoring, understanding how data flows from your Lambda functions to New Relic may be helpful: Diagram showing how data flows from a Lambda function to New Relic. When our Lambda monitoring is enabled, this is how data moves from your Lambda function to New Relic: The Lambda function is instrumented with our code. When the Lambda is invoked, log data is sent to CloudWatch. CloudWatch collects Lambda log data and sends it to our log-ingestion Lambda. The log-ingestion Lambda sends that data to New Relic. Enable procedure overview If you already have a New Relic account and use Node.js or Python, we recommend you use our automated installer. If you do not use the automated installer, complete these steps to set up monitoring: Install our CLI tool (recommended) Connect AWS and New Relic (required) Enable instrumentation of your Lambda (required) Stream CloudWatch logs to New Relic (required) Step 1. Install the newrelic-lambda-cli tool We provide a command line interface (CLI) tool that's used in steps 2 through 4. We recommend the CLI because it simplifies some of the work, but you can also perform those steps manually. If you want to understand what it does before you install it, see the manual procedures that the CLI tool performs in Step 2, Step 3 (option 2), and Step 4. You can also see the CLI documentation on GitHub. If you prefer a manual install, skip to Step 2. Connect AWS to New Relic. CLI requirements To use the CLI too, you need: Python 3.3 or higher The AWS CLI You must be a user or admin with an infrastructure manager Add-on role. Your AWS account needs permissions for creating IAM resources (Role and Policy) and Lambda functions. These resources are created using CloudFormation stacks, so you'll need permissions to create those. For more on permissions, including setting custom policies, expand this collapser: AWS permissions details Resource: * Actions: \"cloudformation:CreateChangeSet\", \"cloudformation:CreateStack\", \"cloudformation:DescribeStacks\", \"cloudformation:ExecuteChangeSets\", \"iam:AttachRolePolicy\", \"iam:CreateRole\", \"iam:GetRole\", \"iam:PassRole\", \"lambda:AddPermission\", \"lambda:CreateFunction\", \"lambda:GetFunction\", \"logs:DeleteSubscriptionFilter\", \"logs:DescribeSubscriptionFilters\", \"logs:PutSubscriptionFilter\" \"s3:GetObject\" \"serverlessrepo:CreateCloudFormationChangeSet\" Resource: \"arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion\" Actions: \"serverlessrepo:CreateCloudFormationTemplate\" \"serverlessrepo:GetCloudFormationTemplate\" Be sure that the AWS account you use to execute the CLI has all of these permissions. If your AWS account permissions are restrictive and you're unable to use the CLI, you can optionally use a manually managed custom IAM policy. This policy would require, at minimum, the following permissions: Resource: \"*\" Action: \"cloudwatch:GetMetricStatistics\" \"cloudwatch:ListMetrics\" \"cloudwatch:GetMetricData\" \"lambda:GetAccountSettings\" \"lambda:ListFunctions\" \"lambda:ListAliases\" \"lambda:ListTags\" \"lambda:ListEventSourceMappings\" These permissions are the minimum required. We recommend granting a managed ReadOnlyAccess policy as described in Connect AWS to infrastructure monitoring. CLI installation To install the CLI tool: Ensure you have the required permissions for both your New Relic and AWS account. From the command line, run: pip install newrelic-lambda-cli You may need to use pip3 in the command above if you have Python 2.7 installed. The CLI requires Python >=3.3. Step 2. Connect AWS to New Relic You must complete this step, and steps 3 and 4, to enable our Lambda monitoring. This step connects AWS to New Relic and creates a newrelic-log-ingestion Lambda function that sends your instrumented data to New Relic. You can either use the CLI tool or do the steps manually. Use CLI tool When you use the CLI, you have one optional step and one required step: Optional: If you're using multiple AWS profiles or multiple regions, you may want to configure the AWS environment variables: AWS environment variable instructions Setting the region To configure your region, use this environment variable to override the default region: export AWS_DEFAULT_REGION=MY_REGION # us-west-2, for example The CLI tool also allows passing this per-command using --aws-region. Setting profiles If you have multiple AWS profiles and don't want to use the default, use AWS_PROFILE environment variable to set another profile name. Ensure the profile is properly configured (including the default region). Example: export AWS_PROFILE=MY_PROFILE Run the following command using the CLI tool: newrelic-lambda integrations install --nr-account-id YOUR_ACCOUNT_ID \\ --linked-account-name YOUR_LINKED_ACCOUNT_NAME \\ --nr-api-key YOUR_NR_API_KEY This command: Connects your AWS account to New Relic. Installs a newrelic-log-ingestion Lambda that will send your instrumented data to New Relic. More details: This defaults to U.S. region. If your account is in the EU region, add this argument: --nr-region \"eu\". If you're instrumenting functions in multiple AWS regions, this command must be run for each region using the --aws-region argument. YOUR_LINKED_ACCOUNT_NAME is either a new AWS account you want to link to New Relic, or it's the name of the AWS account that you linked to when setting up the AWS Lambda monitoring integration. YOUR_NR_API_KEY refers to your personal API key (not your REST API key). For more on the API key and other arguments, see our Lambda monitoring GitHub repo. Manual procedures Here are the manual procedures performed by the CLI tool: Connect AWS to New Relic The newrelic-lambda integration command connects the AWS account containing your Lambdas to New Relic. If you've already installed one of our AWS integrations, your accounts should be linked to New Relic and you can skip this section. To manually establish this connection, follow the instructions for connecting AWS to Infrastructure monitoring. Configure our log-ingestion Lambda The newrelic-lambda integration command sets up a newrelic-log-ingestion Lambda. This Lambda takes the logs generated by your Lambda functions and pushes those logs to New Relic. If you're configuring this manually, you must configure our Lambda for the regions you want. The CLI, by default, establishes our Lambda in all regions. To manually configure our Lambda, go to the AWS Serverless Application Repository, which is where the newrelic-log-ingestion Lambda is stored. This repo is a collection of serverless applications published by developers, companies, and partners in the serverless community. It allows developers to share their Lambda functions code with customers, who can then find and deploy the corresponding application Lambda function. Each application is packaged with an AWS Serverless Application Model (SAM) template that defines the AWS resources used. To manually configure our Lambda with the AWS Serverless Application Repository: From the AWS console, go to the Lambda section, select Create function, and select Serverless Application Repository. Search for newrelic and find the newrelic-log-ingestion Lambda. Follow the instructions in the Lambda's documentation to deploy it. A SAM template will build the Lambda. In the environment variable section in AWS console, set the LICENSE_KEY environment variable to your New Relic license key. Note: If you have multiple accounts or a master and sub-account hierarchy, make sure the license key you're using matches the same account connected to AWS. Optional: If you want to stream all your logs to New Relic, set the LOGGING_ENABLED environment variable to true. For more on this, see Stream all logs. Step 3. Enable Lambda instrumentation This step enables instrumentation of your Lambda function, which allows detailed monitoring and alerting functionality. Our instrumentation is designed to have minimal impact on your Lambda performance. If you're using Node.js or Python, we recommend the first two options. Option #1: Use Serverless Framework plugin (Node.js and Python) Requirements Available only for Node.js and Python. For other languages, see Manual instrumentation. Serverless Framework version 1.34.0 or higher. Features If you meet the requirements (above), you can use our Serverless Framework plugin, which allows you to add our AWS Lambda Layer to your functions without requiring a code change. Supports Node.js and Python runtimes No code change required to enable Lambda instrumentation Enables our APM agent functionality using a single layer Configures CloudWatch subscription filters automatically Gets the layer into your code base which is useful for redeploys Install To install our Serverless Framework plugin: Choose an install option: NPM: npm install --save-dev serverless-newrelic-lambda-layers yarn: yarn add --dev serverless-newrelic-lambda-layers Add the plugin to your serverless.yml: plugins: - serverless-newrelic-lambda-layers Get your account ID and put it in the serverless.yml: custom: newRelic: accountId: YOUR_ACCOUNT_ID Deploy it: sls deploy You can skip Step 4. Setting up CloudWatch Logs. This is automatically completed on deploy by our Serverless Framework plugin. For the next step, go to What's next? Option #2: Add Lambda Layer with our CLI (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework and don't intend to redeploy your function frequently, you can use the CLI to add our Lambda Layer: If you haven't already done so, install the CLI: pip install newrelic-lambda-cli List available functions: newrelic-lambda functions list Pass the option -f not-installed to see which functions have not yet been instrumented. Add the layer to your function: newrelic-lambda layers install --function FUNCTION_NAME --nr-account-id NEW_RELIC_ACCOUNT_ID Next, you will configure CloudWatch to send logs to New Relic. Option #3: Manually add our Lambda Layer (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework, you can manually add our Lambda Layer: Find the layer that matches your runtime and region. Copy the Amazon Resource Name (ARN) of the most recent version and add it in the AWS Lambda console for your function. Update your functions handler to point to the newly attached layer in the console for your function: Python: newrelic_lambda_wrapper.handler Node: newrelic-lambda-wrapper.handler Add these environment variables to your Lambda console: NEW_RELIC_ACCOUNT_ID: Your account ID NEW_RELIC_LAMBDA_HANDLER: Path to your initial handler. If you have Node 8 and get a Lambda can't find file error message, expand this collapser: Node 8 \"can't find file\" error troubleshooting If you have Node 8 and receive a Lambda can't find the file newrelic-lambda-wrapper.js message, it's likely that the Node runtime isn't resolving NPM_PATH for the newrelic-lambda module in /opt/nodejs/node_modules. These steps should fix this problem: Create a newrelic-wrapper-helper.js script in your project's root. The script's contents should be module.exports = require('newrelic-lambda-wrapper');. (That is all that needs to be in that script.) Update the handler for your layer declaration to newrelic-lambda-wrapper.handler. Next, you will configure CloudWatch to send logs to New Relic. Option #4: Manually instrument Lambda code for Go, Java, .NET Core, Node.js, and Python If none of the previous options work for you, you can manually instrument your Lambda code. Choose your language: Go To instrument your Go-language Lambda: Download our Go agent package and place it in the same directory as your function. Install the agent: go get -u github.com/newrelic/go-agent. In your Lambda code, import our components, create an application, and update how you start your Lambda. See our GitHub repo for an example of an instrumented Lambda. Optional: Add custom events that will be associated with your Lambda invocation by using the RecordCustomEvent API. For example: func handler(ctx context.Context) { if txn := newrelic.FromContext(ctx); nil != txn { txn.Application().RecordCustomEvent(\"MyEvent\", map[string]interface{}{ \"zip\": \"zap\", }) } fmt.Println(\"hello world!\") } Build and zip your Lambda function and upload it to AWS. Zip and upload recommendations Here are suggestions for zipping and uploading the Lambda: Build the binary for execution on Linux. This produces a binary file called main. You can use: $ GOOS=linux go build -o main Zip the binary into a deployment package using: $ zip deployment.zip main Upload the zip file to AWS using either the AWS Lambda console or the AWS CLI. Name the handler main (to match the name given during the binary build). The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this is the account ID for the root/parent account. Optional: To configure logging, see Go agent logging. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Java Monitoring for AWS Lambda in Java doesn't use our APM Java agent. Instead, it uses these two OpenTracing dependencies: AWS Lambda OpenTracing Java SDK: OpenTracing instrumentation for AWS Lambda RequestHandler and RequestStreamHandler. Our AWS Lambda OpenTracing Tracer: An OpenTracing Tracer implementation designed to monitor AWS Lambda. It generates spans, error events, transaction events, error traces, and provides distributed tracing support. Supported OpenTracing Versions OpenTracing 0.31.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:1.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:1.0.0 OpenTracing 0.32.0, 0.33.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:2.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:2.1.0 To instrument your Java Lambda: In your project’s build.gradle file, include our OpenTracing AWS Lambda Tracer and the AWS Lambda OpenTracing SDK dependencies: dependencies { compile(\"com.newrelic.opentracing:java-aws-lambda:2.1.0\") compile(\"com.newrelic.opentracing:newrelic-java-lambda:2.1.1\") compile(\"io.opentracing:opentracing-util:0.33.0\") } Implement the AWS Lambda RequestHandler interface as shown in the Java Lambda example and override the doHandleRequest method. In the doHandleRequest method, call the LambdaTracing.instrument(...) API to create a root span to trace the lambda function's execution. This is also where you will define your business logic for the lambda function. Register a LambdaTracer.INSTANCE as the OpenTracing Global tracer, as shown in the Java Lambda example. Create a ZIP deployment package and upload it to AWS Lambda. Or deploy it via other means. In the AWS Lambda console, set the handler. For the example Java Lambda, the handler would be com.handler.example.MyLambdaHandler::handleRequest. Because handleRequest is assumed, you could also use com.handler.example.MyLambdaHandler. The following AWS console environment variables are required if you want your Lambda function to be included in distributed tracing. This is recommended. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_PRIMARY_APPLICATION_ID. This is also your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this must be the account ID for the root/parent account. Optional: In the Lambda console, enable debug logging by adding this environment variable: NEW_RELIC_DEBUG is true. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Please see the AWS Lambda distributed tracing example for a complete project that illustrates common use cases such as: Distributed tracing between Lambda functions Manual span creation (aka custom instrumentation) Tracing external calls Adding custom attributes (aka Tags) to spans .NET Core Our monitoring of .NET Core-based AWS Lambda functions doesn't use our standard .NET Core APM agent. Instead, it uses a NuGet package. To instrument your .NET Core Lambda: In your Lambda Functions project, install the NewRelic.OpenTracing.AmazonLambda.Tracer NuGet package. Import the NuGet package and OpenTracing utils: using OpenTracing.Util; using NewRelic.OpenTracing.AmazonLambda; Instrument your function, as shown in this example: public class Function { static Function() { // Register The NewRelic Lambda Tracer Instance GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public object FunctionWrapper(ILambdaContext context) { // Instantiate NewRelic TracingWrapper and pass your FunctionHandler as // an argument return new TracingRequestHandler().LambdaWrapper(FunctionHandler, context); } /// /// A simple function that takes a string and does a ToUpper /// /// /// /// public object FunctionHandler(ILambdaContext context) { ... } } The arguments passed to FunctionWrapper must match the signature of FunctionHandler. If your handler function returns a Task, the Lambda wrapper will block on the return task until it completes, so that it can measure the duration and capture exceptions, if any are present. In addition, you may also inherit from the APIGatewayProxyFunction. For an example, see below: Async handler function public override Task FunctionHandlerAsync(ILambdaContext lambdaContext) { // This call will block by calling task.Result Task task = new TracingRequestHandler().LambdaWrapper( ActualFunctionHandlerAsync, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(ILambdaContext lambdaContext) { // Function can make other async operations here ... } Inheriting from APIGatewayProxyFunction public class LambdaFunction : APIGatewayProxyFunction { static LambdaFunction() { // Register The NewRelic Lambda Tracer Instance OpenTracing.Util.GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public override Task FunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { Task task = new TracingRequestHandler().LambdaWrapper(ActualFunctionHandlerAsync, request, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { return base.FunctionHandlerAsync(request, lambdaContext); } } Optional for SQS and SNS: Starting in version 1.0 of our .NET Lambda Tracer, distributed tracing support has been added for SQS and SNS. To enable distributed tracing for SQS or SNS you will need to complete the items in this step as well as setup the environment variables in the step that follows this one. Enabling distributed tracing support for SQS and SNS will disable automatic instrumentation for both of SQS and SNS and require the use of these wrappers to instrument them. Set the NEW_RELIC_USE_DT_WRAPPER environment variable to true. To instrument SQS and SNS calls you will need to use the provided wrappers. Using the SQS Wrapper The SQS wrapper supports wrapping the following methods: Amazon.SQS.AmazonSQSClient.SendMessageAsync(...) Amazon.SQS.AmazonSQSClient.SendMessageBatchAsync(...) Examples // SQS Client AmazonSQSClient client = new AmazonSQSClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // SendMessageRequest SendMessageRequest sendRequest = new SendMessageRequest(\"QUEUE_URI_STRING\", \"An SQS Message\"); Task responseOne = SQSWrapper.WrapRequest(client.SendMessageAsync, sendRequest); // String-based Task responseTwo = SQSWrapper.WrapRequest(client.SendMessageAsync, \"QUEUE_URI_STRING\", \"Another SQS Message\"); // SendMessageBatchRequest List batchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id1\", \"First SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id2\", \"Second SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id3\", \"Third SQS Message\")); SendMessageBatchRequest sendBatchRequest = new SendMessageBatchRequest(QUEUE_URI, batchEntries); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, sendBatchRequest); // SendMessageBatchRequestEntry List List moreBatchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id4\", \"Fourth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id5\", \"Fifth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id6\", \"Sixth SQS Message\")); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, moreBatchEntries); Using the SNS Wrapper The SNS wrapper supports wrapping the following methods: Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient.PublishAsync(...) Examples // SNS Client AmazonSimpleNotificationServiceClient client = new Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // PublishRequest - Phone Number PublishRequest phonePublishRequest = new PublishRequest(); phonePublishRequest.PhoneNumber = +1XXX5555100; phonePublishRequest.Message = \"An SNS Message for phones\"; Task phoneResponse = SNSWrapper.WrapRequest(client.PublishAsync, phonePublishRequest); // PublishRequest - ARN PublishRequest publishRequest = new PublishRequest(\"TOPIC_ARN\", \"An SNS Message\"); Task publishResponse = SNSWrapper.WrapRequest(client.PublishAsync, publishRequest); // String-based without subject Task ResponseOne = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Another SNS Message\"); // String-based with subject Task ResponseTwo = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Yet Another SNS Message\", \"A Subject\"); The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS Lambda console: NEW_RELIC_ACCOUNT_ID: The account ID the Lambda is reporting to. NEW_RELIC_TRUSTED_ACCOUNT_KEY: This is also the account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Ensure that the wrapper function (FunctionWrapper in above example) is set up as the function handler. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Node.js To instrument your Node.js Lambda: Download our Node.js agent package and place it in the same directory as your function, ensuring the agent is installed as a dependency in the node_modules directory. Use the Node Package Manager: npm install newrelic --save Install our AWS SDK module alongside the Node.js agent: npm install @newrelic/aws-sdk --save In your Lambda code, require the agent module and the AWS SDK at the top of the file, and wrap the handler function. For example: const newrelic = require('newrelic'); require('@newrelic/aws-sdk'); module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { // This is your handler function code console.log('Lambda executed'); callback(); }); Optional: You can also add custom events to your Lambda using the recordCustomEvent API. For example: module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { newrelic.recordCustomEvent(‘MyEventType’, {foo: ‘bar’}); console.log('Lambda executed'); callback(); }); Zip your Lambda function and the Node.js agent folder together. Requirements and recommendations: The New Relic files outside the New Relic agent folder don't need to be included. If your Lambda function file name is, for example, lambda_function.node, we recommend naming your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set these environment variables: NEW_RELIC_NO_CONFIG_FILE. Set to true if not using a configuration file. NEW_RELIC_APP_NAME: Your application name. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To run the agent in serverless mode outside of AWS in a local environment, set the environment variable NEW_RELIC_SERVERLESS_MODE_ENABLED to true. (When executing this in an AWS Lambda environment, the agent will automatically run in serverless mode. Do not use this variable if you're running in AWS.) Optional: To enable logging in serverless mode, set these environment variables: Set NEW_RELIC_LOG_ENABLED to true. Set NEW_RELIC_LOG to stdout for output to CloudWatch, or set to any writeable file location. The log level is set to info by default. See other log levels. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Python To instrument your Python Lambda: Download our Python agent package and place it in the same directory as your function. To do this, use pip: pip install -t . newrelic If you use Homebrew, you may get this error: DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both. For details, see the Homebrew GitHub post. In your Lambda code, import the Python agent module and decorate the handler function using the New Relic decorator. The New Relic package must be imported first in your code. Here's an example: import newrelic.agent newrelic.agent.initialize() @newrelic.agent.lambda_handler() def handler(event, context): ... Optional: You can also add custom events to your Lambda using the record_custom_event API. Here's an example: @newrelic.agent.lambda_handler() def handler(event, context): newrelic.agent.record_custom_event('CustomEvent', {'foo': 'bar'}) … Zip your lambda_function.py and newrelic/ folder together using these guidelines: The New Relic files outside the newrelic/ folder don't need to be included. If your Lambda function file name is, for example, lambda_function.py, name your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set this environment variable: NEW_RELIC_SERVERLESS_MODE_ENABLED. Set to true The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_DISTRIBUTED_TRACING_ENABLED. Set to true. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To configure logging, use the NEW_RELIC_LOG and NEW_RELIC_LOG_LEVEL environment variables in the AWS Console. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. The New Relic decorator gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, configure CloudWatch to send those logs to New Relic. Step 4. Configure CloudWatch logs to stream to New Relic Lambda In this step, you'll link your Lambda function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda that was configured in Step 2. For Node.js and Python: This step isn't necessary if you used the Serverless Framework plugin option in Step 3. This step can be done using the CLI tool or using manual procedures. Use CLI tool Run this command for every Lambda function you want to monitor: newrelic-lambda subscriptions install --function FUNCTION_NAME_#1 Or to set subscription filters for all supported functions run this command:: newrelic-lambda subscriptions install --function all Notes on this command: You should only need one newrelic-log-ingestion Lambda per AWS account and region. You can subscribe as many functions to it as you like. To see more detail about the arguments, including a region-specifying argument, see our GitHub documentation. You may receive a CloudWatch validation error. This doesn't affect data reporting. If you see data reporting in New Relic, disregard that error message. If you have our Logs and want to send all your log data to us (not just Lambda logs), see Stream all logs. Manual procedures Here are the manual procedures performed by the CLI tool: Manual process: Stream CloudWatch logs to New Relic Lambda In Step 2, you set up a newrelic-log-ingestion Lambda function. After you've instrumented your Lambda function (Step 3), the newrelic-lambda subscriptions command links that function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda. To do this manually: Open CloudWatch and select Logs in the left-hand menu, and then select the log group for the function you are monitoring. Select Actions and choose Stream to AWS Lambda. Under Lambda function, select the newrelic-log-ingestion function. Set the Log format to JSON. Set the Subscription filter pattern to ?REPORT ?NR_LAMBDA_MONITORING ?\"Task timed out\". Alternatively, if you are using the LOGGING_ENABLED environment variable stream all your logs to our Logs, leave this field blank. See notes and caveats about this procedure. Make sure the newrelic-log-ingestion Lambda function you select in the method above is in the same AWS region as your Lambda function. What's next? After you complete these steps, here's what you can do next: See data reporting in the Lambda monitoring UI. If you're having trouble finding your data, see Lambda enable troubleshooting. Use configuration settings to fine-tune your data. Our newrelic-log-ingestion function is not updated automatically. For best results and access to latest features, we recommend you occasionally update our Lambda monitoring. Optional: Stream all logs to New Relic If you have log management enabled and want to report all your logs to New Relic, follow these instructions: Go to our newrelic-log-ingestion Lambda and set the LOGGING_ENABLED environment variable to true. It isn't possible to edit existing filter patterns, so they must be removed and re-added: Set the Subscription filter pattern to \"\". Go to the Log group for each monitored Lambda, and remove the newrelic-log-ingestion subscription. Add the subscription filter back, leaving the Subscription filter pattern field blank. 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.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 106.486176, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "body": " custom events that will be associated with your Lambda invocation by using the RecordCustomEvent API. For example: func handler(ctx context.Context) { if txn := newrelic.FromContext(ctx); nil != txn { txn.Application().RecordCustomEvent("MyEvent", map[string]interface{}{ "zip": "zap", }) } fmt.Println" - }, - "id": "5f6c67a464441f3a75eb72d3" - }, - { - "sections": [ - "Serve, publish, and deploy your New Relic One app", - "Before you begin", - "Serve your app locally", - "Add images and metadata to your apps", - "screenshots folder", - "documentation.md", - "additionalInfo.md", - "config.json", - "Publish your app", - "Tip", - "Deploy your app", - "Subscribe or unsubsribe apps", - "Handle duplicate applications" - ], - "title": "Serve, publish, and deploy your New Relic One app", - "type": "developer", - "tags": [ - "publish apps", - "deploy apps", - "subscribe apps", - "add metadata apps" - ], - "external_id": "63283ee8efdfa419b6a69cb8bd135d4bc2188d2c", - "image": "https://developer.newrelic.com/static/175cc6506f7161ebf121129fa87e0789/0086b/apps_catalog.png", - "url": "https://developer.newrelic.com/build-apps/publish-deploy/", - "published_at": "2020-09-24T02:32:50Z", - "updated_at": "2020-09-02T02:05:55Z", - "document_type": "page", - "popularity": 1, - "info": "Start sharing and using the custom New Relic One apps you build", - "body": "Serve, publish, and deploy your New Relic One app 30 min When you build a New Relic One app, chances are you'll want to share it with others in your organization. You might even want to share it broadly through our open source channel. But first, you probably want to try it out locally to make sure it's working properly. From the New Relic One Apps page, you can review available apps and subscribe to the ones you want for accounts you manage. The Your 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 visualizations 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. Your 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. Here, you learn to: Serve your app locally Add images and metadata to your app Publish it Subscribe and unsubscribe accounts you manage to the app Handle duplicate applications Before you begin This guide requires the following: A New Relic One app or Nerdpack New Relic One CLI A Nerdpack manager role for publishing, deploying, and subscribing apps. Serve your app locally You can locally serve the app you create to New Relic One to test it out. Step 1 of 1 In the parent root folder of your Nerdpack, run nr1 nerdpack:serve. Go to one.newrelic.com/?nerdpacks=local. The ?nerdpacks=local URL suffix will load any locally served Nerdpacks that are available. When you make a change to a locally served Nerdpack, New Relic One will automatically reload it. Add images and metadata to your apps Application creators can include a description of what their 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, custom, or public. 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. Step 1 of 3 Update the New Relic One CLI to ensure you're working with the latest version. nr1 update Copy Step 2 of 3 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 sections for the process to succeed. 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 \\n model that supports location-specific KPI's, custom metadata, drill-down navigation into Entities \\n 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\" } Copy Step 3 of 3 Save the metadata and screenshots to the catalog. This validates the information you added to the catalog directory against the criteria described in the previous step, and saves it to the catalog. nr1 catalog:submit Copy Publish your app Publishing places your Nerdpack in New Relic One. To publish or deploy, you must be a Nerdpack manager. New Relic One requires that only one version (following semantic versioning) of a Nerdpack can be published at a time. Tip If you know what channel you want to deploy to (as described in the Deploy your app section that follows), you can run nr1 nerdpack:publish --channel=STABLE or nr1 nerdpack:publish --channel=BETA. Step 1 of 2 Update the version attribute in the app's package.json file. This follows semantic versioning, and must be updated before you can successfully publish. Step 2 of 2 To publish your Nerdpack, run nr1 nerdpack:publish. Deploy your app Deploying is applying a Nerdpack version to a specific channel (for example, BETA, or STABLE). A channel can only have one Nerdpack version deployed to it at one time. If a channel has an existing Nerdpack associated with it, deploying a new Nerdpack version to that channel will undeploy the previous one. Channels are meant to be an easier way to control application version access than having to be concerned with specific version numbers. Step 1 of 1 To deploy an application, run nr1 nerdpack:deploy. Subscribe or unsubsribe apps Whether you want to subscribe accounts to an app you've created or to apps already available in the catalog, the process is the same. Note that if you subscribe to an app in the catalog, you'll automatically get any updates that are added to the app. To learn about the appropriate permissions for subscribing, see Permissions for managing applications. Step 1 of 2 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 members of the accounts you have subscribed to the app can launch it from New Relic One. Step 2 of 2 Unsubsribe from 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 Your 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. Step 1 of 1 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.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 101.04145, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "Serve, publish, and deploy your New Relic One app", - "sections": "Serve, publish, and deploy your New Relic One app", - "info": "Start sharing and using the custom New Relic One apps you build", - "tags": "publish apps", - "body": " that you haven't subscribed to, some developed by New Relic engineers to provide visualizations 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. Your apps in the catalog are created" - }, - "id": "5efa999de7b9d283e67bab8f" - } - ], - "/explore-docs/nr1-plugins": [ - { - "sections": [ - "New Relic One CLI reference", - "Installing the New Relic One CLI", - "Tip", - "New Relic One CLI Commands", - "Get started", - "Configure your CLI preferences", - "Set up your Nerdpacks", - "Manage your Nerdpack subscriptions", - "Install and manage plugins", - "Manage catalog information" - ], - "title": "New Relic One CLI reference", - "type": "developer", - "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-09-24T02:26:06Z", - "updated_at": "2020-09-17T01:51:10Z", - "document_type": "page", - "popularity": 1, - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. 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. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. 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.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 305.64545, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "New Relic One CLI reference", - "sections": "New Relic One CLI Commands", - "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", - "tags": "New Relic One app", - "body": " extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions" - }, - "id": "5efa989e28ccbc535a307dd0" - }, - { - "nodeid": 27692, - "sections": [ - "AWS Lambda monitoring", - "Get started", - "Enable Lambda monitoring", - "UI and data", - "Troubleshooting", - "Enable serverless monitoring for AWS Lambda", - "How Lambda monitoring works", - "Enable procedure overview", - "Step 1. Install the newrelic-lambda-cli tool", - "CLI requirements", - "CLI installation", - "Step 2. Connect AWS to New Relic", - "Use CLI tool", - "Manual procedures", - "Step 3. Enable Lambda instrumentation", - "Step 4. Configure CloudWatch logs to stream to New Relic Lambda", - "What's next?", - "Optional: Stream all logs to New Relic", - "For more help" - ], - "title": "Enable serverless monitoring for AWS Lambda", - "category_0": "Serverless function monitoring", - "type": "docs", - "category_1": "AWS Lambda monitoring", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/enable-serverless-monitoring-aws-lambda", - "external_id": "7992b896d4c35ca29aba34698aedd621dfe0b572", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-lambda-monitoring-architecture.png", - "url": "https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/enable-serverless-monitoring-aws-lambda", - "published_at": "2020-09-24T09:32:20Z", - "updated_at": "2020-09-24T09:32:20Z", - "breadcrumb": "Contents / Serverless function monitoring / AWS Lambda monitoring / Enable Lambda monitoring", - "document_type": "page", - "popularity": 1, - "info": "Read about how to install and enable New Relic monitoring for Amazon AWS Lambda. ", - "body": "Serverless monitoring for AWS Lambda offers in-depth performance monitoring for your Lambda functions. Read on to learn how to enable this feature and get started using it. Using this feature may result in AWS charges. For more information, see the Lambda monitoring requirements.​​​ How Lambda monitoring works Before enabling Lambda monitoring, understanding how data flows from your Lambda functions to New Relic may be helpful: Diagram showing how data flows from a Lambda function to New Relic. When our Lambda monitoring is enabled, this is how data moves from your Lambda function to New Relic: The Lambda function is instrumented with our code. When the Lambda is invoked, log data is sent to CloudWatch. CloudWatch collects Lambda log data and sends it to our log-ingestion Lambda. The log-ingestion Lambda sends that data to New Relic. Enable procedure overview If you already have a New Relic account and use Node.js or Python, we recommend you use our automated installer. If you do not use the automated installer, complete these steps to set up monitoring: Install our CLI tool (recommended) Connect AWS and New Relic (required) Enable instrumentation of your Lambda (required) Stream CloudWatch logs to New Relic (required) Step 1. Install the newrelic-lambda-cli tool We provide a command line interface (CLI) tool that's used in steps 2 through 4. We recommend the CLI because it simplifies some of the work, but you can also perform those steps manually. If you want to understand what it does before you install it, see the manual procedures that the CLI tool performs in Step 2, Step 3 (option 2), and Step 4. You can also see the CLI documentation on GitHub. If you prefer a manual install, skip to Step 2. Connect AWS to New Relic. CLI requirements To use the CLI too, you need: Python 3.3 or higher The AWS CLI You must be a user or admin with an infrastructure manager Add-on role. Your AWS account needs permissions for creating IAM resources (Role and Policy) and Lambda functions. These resources are created using CloudFormation stacks, so you'll need permissions to create those. For more on permissions, including setting custom policies, expand this collapser: AWS permissions details Resource: * Actions: \"cloudformation:CreateChangeSet\", \"cloudformation:CreateStack\", \"cloudformation:DescribeStacks\", \"cloudformation:ExecuteChangeSets\", \"iam:AttachRolePolicy\", \"iam:CreateRole\", \"iam:GetRole\", \"iam:PassRole\", \"lambda:AddPermission\", \"lambda:CreateFunction\", \"lambda:GetFunction\", \"logs:DeleteSubscriptionFilter\", \"logs:DescribeSubscriptionFilters\", \"logs:PutSubscriptionFilter\" \"s3:GetObject\" \"serverlessrepo:CreateCloudFormationChangeSet\" Resource: \"arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion\" Actions: \"serverlessrepo:CreateCloudFormationTemplate\" \"serverlessrepo:GetCloudFormationTemplate\" Be sure that the AWS account you use to execute the CLI has all of these permissions. If your AWS account permissions are restrictive and you're unable to use the CLI, you can optionally use a manually managed custom IAM policy. This policy would require, at minimum, the following permissions: Resource: \"*\" Action: \"cloudwatch:GetMetricStatistics\" \"cloudwatch:ListMetrics\" \"cloudwatch:GetMetricData\" \"lambda:GetAccountSettings\" \"lambda:ListFunctions\" \"lambda:ListAliases\" \"lambda:ListTags\" \"lambda:ListEventSourceMappings\" These permissions are the minimum required. We recommend granting a managed ReadOnlyAccess policy as described in Connect AWS to infrastructure monitoring. CLI installation To install the CLI tool: Ensure you have the required permissions for both your New Relic and AWS account. From the command line, run: pip install newrelic-lambda-cli You may need to use pip3 in the command above if you have Python 2.7 installed. The CLI requires Python >=3.3. Step 2. Connect AWS to New Relic You must complete this step, and steps 3 and 4, to enable our Lambda monitoring. This step connects AWS to New Relic and creates a newrelic-log-ingestion Lambda function that sends your instrumented data to New Relic. You can either use the CLI tool or do the steps manually. Use CLI tool When you use the CLI, you have one optional step and one required step: Optional: If you're using multiple AWS profiles or multiple regions, you may want to configure the AWS environment variables: AWS environment variable instructions Setting the region To configure your region, use this environment variable to override the default region: export AWS_DEFAULT_REGION=MY_REGION # us-west-2, for example The CLI tool also allows passing this per-command using --aws-region. Setting profiles If you have multiple AWS profiles and don't want to use the default, use AWS_PROFILE environment variable to set another profile name. Ensure the profile is properly configured (including the default region). Example: export AWS_PROFILE=MY_PROFILE Run the following command using the CLI tool: newrelic-lambda integrations install --nr-account-id YOUR_ACCOUNT_ID \\ --linked-account-name YOUR_LINKED_ACCOUNT_NAME \\ --nr-api-key YOUR_NR_API_KEY This command: Connects your AWS account to New Relic. Installs a newrelic-log-ingestion Lambda that will send your instrumented data to New Relic. More details: This defaults to U.S. region. If your account is in the EU region, add this argument: --nr-region \"eu\". If you're instrumenting functions in multiple AWS regions, this command must be run for each region using the --aws-region argument. YOUR_LINKED_ACCOUNT_NAME is either a new AWS account you want to link to New Relic, or it's the name of the AWS account that you linked to when setting up the AWS Lambda monitoring integration. YOUR_NR_API_KEY refers to your personal API key (not your REST API key). For more on the API key and other arguments, see our Lambda monitoring GitHub repo. Manual procedures Here are the manual procedures performed by the CLI tool: Connect AWS to New Relic The newrelic-lambda integration command connects the AWS account containing your Lambdas to New Relic. If you've already installed one of our AWS integrations, your accounts should be linked to New Relic and you can skip this section. To manually establish this connection, follow the instructions for connecting AWS to Infrastructure monitoring. Configure our log-ingestion Lambda The newrelic-lambda integration command sets up a newrelic-log-ingestion Lambda. This Lambda takes the logs generated by your Lambda functions and pushes those logs to New Relic. If you're configuring this manually, you must configure our Lambda for the regions you want. The CLI, by default, establishes our Lambda in all regions. To manually configure our Lambda, go to the AWS Serverless Application Repository, which is where the newrelic-log-ingestion Lambda is stored. This repo is a collection of serverless applications published by developers, companies, and partners in the serverless community. It allows developers to share their Lambda functions code with customers, who can then find and deploy the corresponding application Lambda function. Each application is packaged with an AWS Serverless Application Model (SAM) template that defines the AWS resources used. To manually configure our Lambda with the AWS Serverless Application Repository: From the AWS console, go to the Lambda section, select Create function, and select Serverless Application Repository. Search for newrelic and find the newrelic-log-ingestion Lambda. Follow the instructions in the Lambda's documentation to deploy it. A SAM template will build the Lambda. In the environment variable section in AWS console, set the LICENSE_KEY environment variable to your New Relic license key. Note: If you have multiple accounts or a master and sub-account hierarchy, make sure the license key you're using matches the same account connected to AWS. Optional: If you want to stream all your logs to New Relic, set the LOGGING_ENABLED environment variable to true. For more on this, see Stream all logs. Step 3. Enable Lambda instrumentation This step enables instrumentation of your Lambda function, which allows detailed monitoring and alerting functionality. Our instrumentation is designed to have minimal impact on your Lambda performance. If you're using Node.js or Python, we recommend the first two options. Option #1: Use Serverless Framework plugin (Node.js and Python) Requirements Available only for Node.js and Python. For other languages, see Manual instrumentation. Serverless Framework version 1.34.0 or higher. Features If you meet the requirements (above), you can use our Serverless Framework plugin, which allows you to add our AWS Lambda Layer to your functions without requiring a code change. Supports Node.js and Python runtimes No code change required to enable Lambda instrumentation Enables our APM agent functionality using a single layer Configures CloudWatch subscription filters automatically Gets the layer into your code base which is useful for redeploys Install To install our Serverless Framework plugin: Choose an install option: NPM: npm install --save-dev serverless-newrelic-lambda-layers yarn: yarn add --dev serverless-newrelic-lambda-layers Add the plugin to your serverless.yml: plugins: - serverless-newrelic-lambda-layers Get your account ID and put it in the serverless.yml: custom: newRelic: accountId: YOUR_ACCOUNT_ID Deploy it: sls deploy You can skip Step 4. Setting up CloudWatch Logs. This is automatically completed on deploy by our Serverless Framework plugin. For the next step, go to What's next? Option #2: Add Lambda Layer with our CLI (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework and don't intend to redeploy your function frequently, you can use the CLI to add our Lambda Layer: If you haven't already done so, install the CLI: pip install newrelic-lambda-cli List available functions: newrelic-lambda functions list Pass the option -f not-installed to see which functions have not yet been instrumented. Add the layer to your function: newrelic-lambda layers install --function FUNCTION_NAME --nr-account-id NEW_RELIC_ACCOUNT_ID Next, you will configure CloudWatch to send logs to New Relic. Option #3: Manually add our Lambda Layer (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework, you can manually add our Lambda Layer: Find the layer that matches your runtime and region. Copy the Amazon Resource Name (ARN) of the most recent version and add it in the AWS Lambda console for your function. Update your functions handler to point to the newly attached layer in the console for your function: Python: newrelic_lambda_wrapper.handler Node: newrelic-lambda-wrapper.handler Add these environment variables to your Lambda console: NEW_RELIC_ACCOUNT_ID: Your account ID NEW_RELIC_LAMBDA_HANDLER: Path to your initial handler. If you have Node 8 and get a Lambda can't find file error message, expand this collapser: Node 8 \"can't find file\" error troubleshooting If you have Node 8 and receive a Lambda can't find the file newrelic-lambda-wrapper.js message, it's likely that the Node runtime isn't resolving NPM_PATH for the newrelic-lambda module in /opt/nodejs/node_modules. These steps should fix this problem: Create a newrelic-wrapper-helper.js script in your project's root. The script's contents should be module.exports = require('newrelic-lambda-wrapper');. (That is all that needs to be in that script.) Update the handler for your layer declaration to newrelic-lambda-wrapper.handler. Next, you will configure CloudWatch to send logs to New Relic. Option #4: Manually instrument Lambda code for Go, Java, .NET Core, Node.js, and Python If none of the previous options work for you, you can manually instrument your Lambda code. Choose your language: Go To instrument your Go-language Lambda: Download our Go agent package and place it in the same directory as your function. Install the agent: go get -u github.com/newrelic/go-agent. In your Lambda code, import our components, create an application, and update how you start your Lambda. See our GitHub repo for an example of an instrumented Lambda. Optional: Add custom events that will be associated with your Lambda invocation by using the RecordCustomEvent API. For example: func handler(ctx context.Context) { if txn := newrelic.FromContext(ctx); nil != txn { txn.Application().RecordCustomEvent(\"MyEvent\", map[string]interface{}{ \"zip\": \"zap\", }) } fmt.Println(\"hello world!\") } Build and zip your Lambda function and upload it to AWS. Zip and upload recommendations Here are suggestions for zipping and uploading the Lambda: Build the binary for execution on Linux. This produces a binary file called main. You can use: $ GOOS=linux go build -o main Zip the binary into a deployment package using: $ zip deployment.zip main Upload the zip file to AWS using either the AWS Lambda console or the AWS CLI. Name the handler main (to match the name given during the binary build). The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this is the account ID for the root/parent account. Optional: To configure logging, see Go agent logging. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Java Monitoring for AWS Lambda in Java doesn't use our APM Java agent. Instead, it uses these two OpenTracing dependencies: AWS Lambda OpenTracing Java SDK: OpenTracing instrumentation for AWS Lambda RequestHandler and RequestStreamHandler. Our AWS Lambda OpenTracing Tracer: An OpenTracing Tracer implementation designed to monitor AWS Lambda. It generates spans, error events, transaction events, error traces, and provides distributed tracing support. Supported OpenTracing Versions OpenTracing 0.31.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:1.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:1.0.0 OpenTracing 0.32.0, 0.33.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:2.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:2.1.0 To instrument your Java Lambda: In your project’s build.gradle file, include our OpenTracing AWS Lambda Tracer and the AWS Lambda OpenTracing SDK dependencies: dependencies { compile(\"com.newrelic.opentracing:java-aws-lambda:2.1.0\") compile(\"com.newrelic.opentracing:newrelic-java-lambda:2.1.1\") compile(\"io.opentracing:opentracing-util:0.33.0\") } Implement the AWS Lambda RequestHandler interface as shown in the Java Lambda example and override the doHandleRequest method. In the doHandleRequest method, call the LambdaTracing.instrument(...) API to create a root span to trace the lambda function's execution. This is also where you will define your business logic for the lambda function. Register a LambdaTracer.INSTANCE as the OpenTracing Global tracer, as shown in the Java Lambda example. Create a ZIP deployment package and upload it to AWS Lambda. Or deploy it via other means. In the AWS Lambda console, set the handler. For the example Java Lambda, the handler would be com.handler.example.MyLambdaHandler::handleRequest. Because handleRequest is assumed, you could also use com.handler.example.MyLambdaHandler. The following AWS console environment variables are required if you want your Lambda function to be included in distributed tracing. This is recommended. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_PRIMARY_APPLICATION_ID. This is also your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this must be the account ID for the root/parent account. Optional: In the Lambda console, enable debug logging by adding this environment variable: NEW_RELIC_DEBUG is true. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Please see the AWS Lambda distributed tracing example for a complete project that illustrates common use cases such as: Distributed tracing between Lambda functions Manual span creation (aka custom instrumentation) Tracing external calls Adding custom attributes (aka Tags) to spans .NET Core Our monitoring of .NET Core-based AWS Lambda functions doesn't use our standard .NET Core APM agent. Instead, it uses a NuGet package. To instrument your .NET Core Lambda: In your Lambda Functions project, install the NewRelic.OpenTracing.AmazonLambda.Tracer NuGet package. Import the NuGet package and OpenTracing utils: using OpenTracing.Util; using NewRelic.OpenTracing.AmazonLambda; Instrument your function, as shown in this example: public class Function { static Function() { // Register The NewRelic Lambda Tracer Instance GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public object FunctionWrapper(ILambdaContext context) { // Instantiate NewRelic TracingWrapper and pass your FunctionHandler as // an argument return new TracingRequestHandler().LambdaWrapper(FunctionHandler, context); } /// /// A simple function that takes a string and does a ToUpper /// /// /// /// public object FunctionHandler(ILambdaContext context) { ... } } The arguments passed to FunctionWrapper must match the signature of FunctionHandler. If your handler function returns a Task, the Lambda wrapper will block on the return task until it completes, so that it can measure the duration and capture exceptions, if any are present. In addition, you may also inherit from the APIGatewayProxyFunction. For an example, see below: Async handler function public override Task FunctionHandlerAsync(ILambdaContext lambdaContext) { // This call will block by calling task.Result Task task = new TracingRequestHandler().LambdaWrapper( ActualFunctionHandlerAsync, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(ILambdaContext lambdaContext) { // Function can make other async operations here ... } Inheriting from APIGatewayProxyFunction public class LambdaFunction : APIGatewayProxyFunction { static LambdaFunction() { // Register The NewRelic Lambda Tracer Instance OpenTracing.Util.GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public override Task FunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { Task task = new TracingRequestHandler().LambdaWrapper(ActualFunctionHandlerAsync, request, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { return base.FunctionHandlerAsync(request, lambdaContext); } } Optional for SQS and SNS: Starting in version 1.0 of our .NET Lambda Tracer, distributed tracing support has been added for SQS and SNS. To enable distributed tracing for SQS or SNS you will need to complete the items in this step as well as setup the environment variables in the step that follows this one. Enabling distributed tracing support for SQS and SNS will disable automatic instrumentation for both of SQS and SNS and require the use of these wrappers to instrument them. Set the NEW_RELIC_USE_DT_WRAPPER environment variable to true. To instrument SQS and SNS calls you will need to use the provided wrappers. Using the SQS Wrapper The SQS wrapper supports wrapping the following methods: Amazon.SQS.AmazonSQSClient.SendMessageAsync(...) Amazon.SQS.AmazonSQSClient.SendMessageBatchAsync(...) Examples // SQS Client AmazonSQSClient client = new AmazonSQSClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // SendMessageRequest SendMessageRequest sendRequest = new SendMessageRequest(\"QUEUE_URI_STRING\", \"An SQS Message\"); Task responseOne = SQSWrapper.WrapRequest(client.SendMessageAsync, sendRequest); // String-based Task responseTwo = SQSWrapper.WrapRequest(client.SendMessageAsync, \"QUEUE_URI_STRING\", \"Another SQS Message\"); // SendMessageBatchRequest List batchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id1\", \"First SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id2\", \"Second SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id3\", \"Third SQS Message\")); SendMessageBatchRequest sendBatchRequest = new SendMessageBatchRequest(QUEUE_URI, batchEntries); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, sendBatchRequest); // SendMessageBatchRequestEntry List List moreBatchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id4\", \"Fourth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id5\", \"Fifth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id6\", \"Sixth SQS Message\")); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, moreBatchEntries); Using the SNS Wrapper The SNS wrapper supports wrapping the following methods: Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient.PublishAsync(...) Examples // SNS Client AmazonSimpleNotificationServiceClient client = new Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // PublishRequest - Phone Number PublishRequest phonePublishRequest = new PublishRequest(); phonePublishRequest.PhoneNumber = +1XXX5555100; phonePublishRequest.Message = \"An SNS Message for phones\"; Task phoneResponse = SNSWrapper.WrapRequest(client.PublishAsync, phonePublishRequest); // PublishRequest - ARN PublishRequest publishRequest = new PublishRequest(\"TOPIC_ARN\", \"An SNS Message\"); Task publishResponse = SNSWrapper.WrapRequest(client.PublishAsync, publishRequest); // String-based without subject Task ResponseOne = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Another SNS Message\"); // String-based with subject Task ResponseTwo = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Yet Another SNS Message\", \"A Subject\"); The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS Lambda console: NEW_RELIC_ACCOUNT_ID: The account ID the Lambda is reporting to. NEW_RELIC_TRUSTED_ACCOUNT_KEY: This is also the account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Ensure that the wrapper function (FunctionWrapper in above example) is set up as the function handler. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Node.js To instrument your Node.js Lambda: Download our Node.js agent package and place it in the same directory as your function, ensuring the agent is installed as a dependency in the node_modules directory. Use the Node Package Manager: npm install newrelic --save Install our AWS SDK module alongside the Node.js agent: npm install @newrelic/aws-sdk --save In your Lambda code, require the agent module and the AWS SDK at the top of the file, and wrap the handler function. For example: const newrelic = require('newrelic'); require('@newrelic/aws-sdk'); module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { // This is your handler function code console.log('Lambda executed'); callback(); }); Optional: You can also add custom events to your Lambda using the recordCustomEvent API. For example: module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { newrelic.recordCustomEvent(‘MyEventType’, {foo: ‘bar’}); console.log('Lambda executed'); callback(); }); Zip your Lambda function and the Node.js agent folder together. Requirements and recommendations: The New Relic files outside the New Relic agent folder don't need to be included. If your Lambda function file name is, for example, lambda_function.node, we recommend naming your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set these environment variables: NEW_RELIC_NO_CONFIG_FILE. Set to true if not using a configuration file. NEW_RELIC_APP_NAME: Your application name. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To run the agent in serverless mode outside of AWS in a local environment, set the environment variable NEW_RELIC_SERVERLESS_MODE_ENABLED to true. (When executing this in an AWS Lambda environment, the agent will automatically run in serverless mode. Do not use this variable if you're running in AWS.) Optional: To enable logging in serverless mode, set these environment variables: Set NEW_RELIC_LOG_ENABLED to true. Set NEW_RELIC_LOG to stdout for output to CloudWatch, or set to any writeable file location. The log level is set to info by default. See other log levels. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Python To instrument your Python Lambda: Download our Python agent package and place it in the same directory as your function. To do this, use pip: pip install -t . newrelic If you use Homebrew, you may get this error: DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both. For details, see the Homebrew GitHub post. In your Lambda code, import the Python agent module and decorate the handler function using the New Relic decorator. The New Relic package must be imported first in your code. Here's an example: import newrelic.agent newrelic.agent.initialize() @newrelic.agent.lambda_handler() def handler(event, context): ... Optional: You can also add custom events to your Lambda using the record_custom_event API. Here's an example: @newrelic.agent.lambda_handler() def handler(event, context): newrelic.agent.record_custom_event('CustomEvent', {'foo': 'bar'}) … Zip your lambda_function.py and newrelic/ folder together using these guidelines: The New Relic files outside the newrelic/ folder don't need to be included. If your Lambda function file name is, for example, lambda_function.py, name your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set this environment variable: NEW_RELIC_SERVERLESS_MODE_ENABLED. Set to true The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_DISTRIBUTED_TRACING_ENABLED. Set to true. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To configure logging, use the NEW_RELIC_LOG and NEW_RELIC_LOG_LEVEL environment variables in the AWS Console. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. The New Relic decorator gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, configure CloudWatch to send those logs to New Relic. Step 4. Configure CloudWatch logs to stream to New Relic Lambda In this step, you'll link your Lambda function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda that was configured in Step 2. For Node.js and Python: This step isn't necessary if you used the Serverless Framework plugin option in Step 3. This step can be done using the CLI tool or using manual procedures. Use CLI tool Run this command for every Lambda function you want to monitor: newrelic-lambda subscriptions install --function FUNCTION_NAME_#1 Or to set subscription filters for all supported functions run this command:: newrelic-lambda subscriptions install --function all Notes on this command: You should only need one newrelic-log-ingestion Lambda per AWS account and region. You can subscribe as many functions to it as you like. To see more detail about the arguments, including a region-specifying argument, see our GitHub documentation. You may receive a CloudWatch validation error. This doesn't affect data reporting. If you see data reporting in New Relic, disregard that error message. If you have our Logs and want to send all your log data to us (not just Lambda logs), see Stream all logs. Manual procedures Here are the manual procedures performed by the CLI tool: Manual process: Stream CloudWatch logs to New Relic Lambda In Step 2, you set up a newrelic-log-ingestion Lambda function. After you've instrumented your Lambda function (Step 3), the newrelic-lambda subscriptions command links that function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda. To do this manually: Open CloudWatch and select Logs in the left-hand menu, and then select the log group for the function you are monitoring. Select Actions and choose Stream to AWS Lambda. Under Lambda function, select the newrelic-log-ingestion function. Set the Log format to JSON. Set the Subscription filter pattern to ?REPORT ?NR_LAMBDA_MONITORING ?\"Task timed out\". Alternatively, if you are using the LOGGING_ENABLED environment variable stream all your logs to our Logs, leave this field blank. See notes and caveats about this procedure. Make sure the newrelic-log-ingestion Lambda function you select in the method above is in the same AWS region as your Lambda function. What's next? After you complete these steps, here's what you can do next: See data reporting in the Lambda monitoring UI. If you're having trouble finding your data, see Lambda enable troubleshooting. Use configuration settings to fine-tune your data. Our newrelic-log-ingestion function is not updated automatically. For best results and access to latest features, we recommend you occasionally update our Lambda monitoring. Optional: Stream all logs to New Relic If you have log management enabled and want to report all your logs to New Relic, follow these instructions: Go to our newrelic-log-ingestion Lambda and set the LOGGING_ENABLED environment variable to true. It isn't possible to edit existing filter patterns, so they must be removed and re-added: Set the Subscription filter pattern to \"\". Go to the Log group for each monitored Lambda, and remove the newrelic-log-ingestion subscription. Add the subscription filter back, leaving the Subscription filter pattern field blank. 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.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 156.05438, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "sections": "Step 1. Install the newrelic-lambda-cli tool", - "info": "Read about how to install and enable New Relic monitoring for Amazon AWS Lambda. ", - "body": " CloudWatch logs to New Relic (required) Step 1. Install the newrelic-lambda-cli tool We provide a command line interface (CLI) tool that's used in steps 2 through 4. We recommend the CLI because it simplifies some of the work, but you can also perform those steps manually. If you want to understand" - }, - "id": "5f6c67a464441f3a75eb72d3" - }, - { - "nodeid": 37686, - "sections": [ - "AWS Lambda monitoring", - "Get started", - "Enable Lambda monitoring", - "UI and data", - "Troubleshooting", - "Update serverless monitoring for AWS Lambda", - "Update our Lambda integration via CLI", - "Update Layers via CLI", - "Update a manual Serverless Application Repository install", - "Enabling log management", - "For more help" - ], - "title": "Update serverless monitoring for AWS Lambda", - "category_0": "Serverless function monitoring", - "type": "docs", - "category_1": "AWS Lambda monitoring", - "external_id": "9241e43c2db3e0298407449d530fa8fe601c1833", - "image": "", - "url": "https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/update-serverless-monitoring-aws-lambda", - "published_at": "2020-09-24T13:55:00Z", - "updated_at": "2020-09-24T13:54:59Z", - "breadcrumb": "Contents / Serverless function monitoring / AWS Lambda monitoring / Enable Lambda monitoring", - "document_type": "page", - "popularity": 1, - "info": "How to update our Serverless monitoring for AWS Lambda. ", - "body": "After enabling our monitoring for AWS Lambda, you should occasionally update our Lambda function that's used to report AWS log data: newrelic-log-ingestion. There are two ways to do this: Update via CLI: Use this if you enabled our Lambda monitoring using our CLI tool. Update via AWS Serverless Application Repository: Use this if you enabled using the manual procedure. These update procedures apply to our serverless monitoring for AWS Lambda, and not to our infrastructure monitoring for AWS Lambda integration. Update our Lambda integration via CLI This section describes how to update if your Lambda monitoring was enabled using our recommended CLI tool. Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following command, replacing YOUR_REGION with your region identifier (for example, us-west-2). newrelic-lambda integrations update \\ --aws-region YOUR_REGION If you do not have our logs enabled, you'll also need to update your AWS CloudWatch log subscription filters with the following command: newrelic-lambda subscriptions install \\ --function installed \\ --aws-region YOUR_REGION Update Layers via CLI This section describes how to update your function's Layer if you installed it with our CLI tool. Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli Pass the --upgrade flag to the install command: newrelic-lambda layers install \\ --function installed \\ --nr-account-id NR_ACCOUNT_ID \\ --upgrade Update a manual Serverless Application Repository install If you manually installed the ingest function from the AWS Serverless Application Repository (and didn't use the CLI), update using this procedure: Run the following, replacing YOUR_REGION with your region (for example, us-west-2)​. aws serverlessrepo create-cloud-formation-change-set \\ --application-id arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion \\ --stack-name NewRelic-log-ingestion \\ --capabilities CAPABILITY_RESOURCE_POLICY \\ --region YOUR_REGION This command outputs several fields, one of which is the ChangeSetId: an ARN for the change set that you just created. Copy that ARN. Use the ARN in this command, which executes the change set: aws cloudformation execute-change-set --change-set-name YOUR_CHANGE_SET_ARN Enabling log management If you currently don't have New Relic's log management enabled, but would like to: Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following command, replacing YOUR_REGION with your region (for example, us-west-2). newrelic-lambda integrations update \\ --enable-logs \\ --aws-region YOUR_REGION Then update your AWS CloudWatch log subscription filters for each region with the following command: newrelic-lambda subscriptions install \\ --function installed \\ --filter-pattern \"\" \\ --aws-region YOUR_REGION 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.", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 146.85583, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "sections": "Update our Lambda integration via CLI", - "body": " YOUR_CHANGE_SET_ARN Enabling log management If you currently don't have New Relic's log management enabled, but would like to: Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following" - }, - "id": "5f6ca534196a67b08750423e" - }, - { - "sections": [ - "New Relic CLI Reference", - "New Relic CLI commands", - "Options", - "Commands" - ], - "title": "New Relic CLI Reference", - "type": "developer", - "tags": "new relic cli", - "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", - "image": "", - "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-09-24T02:31:14Z", - "updated_at": "2020-08-14T01:47:12Z", - "document_type": "page", - "popularity": 1, - "info": "The command line tools for performing tasks against New Relic APIs", - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", - "_index": "520d1d5d14cc8a32e600034b", - "_type": "520d1d5d14cc8a32e600034c", - "_score": 142.10017, - "_version": null, - "_explanation": null, - "sort": null, - "highlight": { - "title": "New Relic CLI Reference", - "sections": "New Relic CLI commands", - "info": "The command line tools for performing tasks against New Relic APIs", - "tags": "new relic cli", - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" - }, - "id": "5efa989ee7b9d2024b7bab97" - }, - { - "image": "", - "url": "https://developer.newrelic.com/explore-docs/nr1-nerdpack/", - "sections": [ - "New Relic One CLI Nerdpack commands", - "Command details", - "nr1 nerdpack:build", - "Builds a Nerdpack", - "Usage", - "Options", - "nr1 nerdpack:clone", - "Clone an existing Nerdpack", - "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", - "nr1 nerdpack:clean", - "Removes all built artifacts", - "nr1 nerdpack:validate", - "Validates artifacts inside your Nerdpack", - "nr1 nerdpack:Info", - "Shows the state of your Nerdpack in the New Relic's registry" + "updated_at": "2020-09-24T09:32:20Z", + "breadcrumb": "Contents / Serverless function monitoring / AWS Lambda monitoring / Enable Lambda monitoring", + "document_type": "page", + "popularity": 1, + "info": "Read about how to install and enable New Relic monitoring for Amazon AWS Lambda. ", + "body": "Serverless monitoring for AWS Lambda offers in-depth performance monitoring for your Lambda functions. Read on to learn how to enable this feature and get started using it. Using this feature may result in AWS charges. For more information, see the Lambda monitoring requirements.​​​ How Lambda monitoring works Before enabling Lambda monitoring, understanding how data flows from your Lambda functions to New Relic may be helpful: Diagram showing how data flows from a Lambda function to New Relic. When our Lambda monitoring is enabled, this is how data moves from your Lambda function to New Relic: The Lambda function is instrumented with our code. When the Lambda is invoked, log data is sent to CloudWatch. CloudWatch collects Lambda log data and sends it to our log-ingestion Lambda. The log-ingestion Lambda sends that data to New Relic. Enable procedure overview If you already have a New Relic account and use Node.js or Python, we recommend you use our automated installer. If you do not use the automated installer, complete these steps to set up monitoring: Install our CLI tool (recommended) Connect AWS and New Relic (required) Enable instrumentation of your Lambda (required) Stream CloudWatch logs to New Relic (required) Step 1. Install the newrelic-lambda-cli tool We provide a command line interface (CLI) tool that's used in steps 2 through 4. We recommend the CLI because it simplifies some of the work, but you can also perform those steps manually. If you want to understand what it does before you install it, see the manual procedures that the CLI tool performs in Step 2, Step 3 (option 2), and Step 4. You can also see the CLI documentation on GitHub. If you prefer a manual install, skip to Step 2. Connect AWS to New Relic. CLI requirements To use the CLI too, you need: Python 3.3 or higher The AWS CLI You must be a user or admin with an infrastructure manager Add-on role. Your AWS account needs permissions for creating IAM resources (Role and Policy) and Lambda functions. These resources are created using CloudFormation stacks, so you'll need permissions to create those. For more on permissions, including setting custom policies, expand this collapser: AWS permissions details Resource: * Actions: \"cloudformation:CreateChangeSet\", \"cloudformation:CreateStack\", \"cloudformation:DescribeStacks\", \"cloudformation:ExecuteChangeSets\", \"iam:AttachRolePolicy\", \"iam:CreateRole\", \"iam:GetRole\", \"iam:PassRole\", \"lambda:AddPermission\", \"lambda:CreateFunction\", \"lambda:GetFunction\", \"logs:DeleteSubscriptionFilter\", \"logs:DescribeSubscriptionFilters\", \"logs:PutSubscriptionFilter\" \"s3:GetObject\" \"serverlessrepo:CreateCloudFormationChangeSet\" Resource: \"arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion\" Actions: \"serverlessrepo:CreateCloudFormationTemplate\" \"serverlessrepo:GetCloudFormationTemplate\" Be sure that the AWS account you use to execute the CLI has all of these permissions. If your AWS account permissions are restrictive and you're unable to use the CLI, you can optionally use a manually managed custom IAM policy. This policy would require, at minimum, the following permissions: Resource: \"*\" Action: \"cloudwatch:GetMetricStatistics\" \"cloudwatch:ListMetrics\" \"cloudwatch:GetMetricData\" \"lambda:GetAccountSettings\" \"lambda:ListFunctions\" \"lambda:ListAliases\" \"lambda:ListTags\" \"lambda:ListEventSourceMappings\" These permissions are the minimum required. We recommend granting a managed ReadOnlyAccess policy as described in Connect AWS to infrastructure monitoring. CLI installation To install the CLI tool: Ensure you have the required permissions for both your New Relic and AWS account. From the command line, run: pip install newrelic-lambda-cli You may need to use pip3 in the command above if you have Python 2.7 installed. The CLI requires Python >=3.3. Step 2. Connect AWS to New Relic You must complete this step, and steps 3 and 4, to enable our Lambda monitoring. This step connects AWS to New Relic and creates a newrelic-log-ingestion Lambda function that sends your instrumented data to New Relic. You can either use the CLI tool or do the steps manually. Use CLI tool When you use the CLI, you have one optional step and one required step: Optional: If you're using multiple AWS profiles or multiple regions, you may want to configure the AWS environment variables: AWS environment variable instructions Setting the region To configure your region, use this environment variable to override the default region: export AWS_DEFAULT_REGION=MY_REGION # us-west-2, for example The CLI tool also allows passing this per-command using --aws-region. Setting profiles If you have multiple AWS profiles and don't want to use the default, use AWS_PROFILE environment variable to set another profile name. Ensure the profile is properly configured (including the default region). Example: export AWS_PROFILE=MY_PROFILE Run the following command using the CLI tool: newrelic-lambda integrations install --nr-account-id YOUR_ACCOUNT_ID \\ --linked-account-name YOUR_LINKED_ACCOUNT_NAME \\ --nr-api-key YOUR_NR_API_KEY This command: Connects your AWS account to New Relic. Installs a newrelic-log-ingestion Lambda that will send your instrumented data to New Relic. More details: This defaults to U.S. region. If your account is in the EU region, add this argument: --nr-region \"eu\". If you're instrumenting functions in multiple AWS regions, this command must be run for each region using the --aws-region argument. YOUR_LINKED_ACCOUNT_NAME is either a new AWS account you want to link to New Relic, or it's the name of the AWS account that you linked to when setting up the AWS Lambda monitoring integration. YOUR_NR_API_KEY refers to your personal API key (not your REST API key). For more on the API key and other arguments, see our Lambda monitoring GitHub repo. Manual procedures Here are the manual procedures performed by the CLI tool: Connect AWS to New Relic The newrelic-lambda integration command connects the AWS account containing your Lambdas to New Relic. If you've already installed one of our AWS integrations, your accounts should be linked to New Relic and you can skip this section. To manually establish this connection, follow the instructions for connecting AWS to Infrastructure monitoring. Configure our log-ingestion Lambda The newrelic-lambda integration command sets up a newrelic-log-ingestion Lambda. This Lambda takes the logs generated by your Lambda functions and pushes those logs to New Relic. If you're configuring this manually, you must configure our Lambda for the regions you want. The CLI, by default, establishes our Lambda in all regions. To manually configure our Lambda, go to the AWS Serverless Application Repository, which is where the newrelic-log-ingestion Lambda is stored. This repo is a collection of serverless applications published by developers, companies, and partners in the serverless community. It allows developers to share their Lambda functions code with customers, who can then find and deploy the corresponding application Lambda function. Each application is packaged with an AWS Serverless Application Model (SAM) template that defines the AWS resources used. To manually configure our Lambda with the AWS Serverless Application Repository: From the AWS console, go to the Lambda section, select Create function, and select Serverless Application Repository. Search for newrelic and find the newrelic-log-ingestion Lambda. Follow the instructions in the Lambda's documentation to deploy it. A SAM template will build the Lambda. In the environment variable section in AWS console, set the LICENSE_KEY environment variable to your New Relic license key. Note: If you have multiple accounts or a master and sub-account hierarchy, make sure the license key you're using matches the same account connected to AWS. Optional: If you want to stream all your logs to New Relic, set the LOGGING_ENABLED environment variable to true. For more on this, see Stream all logs. Step 3. Enable Lambda instrumentation This step enables instrumentation of your Lambda function, which allows detailed monitoring and alerting functionality. Our instrumentation is designed to have minimal impact on your Lambda performance. If you're using Node.js or Python, we recommend the first two options. Option #1: Use Serverless Framework plugin (Node.js and Python) Requirements Available only for Node.js and Python. For other languages, see Manual instrumentation. Serverless Framework version 1.34.0 or higher. Features If you meet the requirements (above), you can use our Serverless Framework plugin, which allows you to add our AWS Lambda Layer to your functions without requiring a code change. Supports Node.js and Python runtimes No code change required to enable Lambda instrumentation Enables our APM agent functionality using a single layer Configures CloudWatch subscription filters automatically Gets the layer into your code base which is useful for redeploys Install To install our Serverless Framework plugin: Choose an install option: NPM: npm install --save-dev serverless-newrelic-lambda-layers yarn: yarn add --dev serverless-newrelic-lambda-layers Add the plugin to your serverless.yml: plugins: - serverless-newrelic-lambda-layers Get your account ID and put it in the serverless.yml: custom: newRelic: accountId: YOUR_ACCOUNT_ID Deploy it: sls deploy You can skip Step 4. Setting up CloudWatch Logs. This is automatically completed on deploy by our Serverless Framework plugin. For the next step, go to What's next? Option #2: Add Lambda Layer with our CLI (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework and don't intend to redeploy your function frequently, you can use the CLI to add our Lambda Layer: If you haven't already done so, install the CLI: pip install newrelic-lambda-cli List available functions: newrelic-lambda functions list Pass the option -f not-installed to see which functions have not yet been instrumented. Add the layer to your function: newrelic-lambda layers install --function FUNCTION_NAME --nr-account-id NEW_RELIC_ACCOUNT_ID Next, you will configure CloudWatch to send logs to New Relic. Option #3: Manually add our Lambda Layer (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework, you can manually add our Lambda Layer: Find the layer that matches your runtime and region. Copy the Amazon Resource Name (ARN) of the most recent version and add it in the AWS Lambda console for your function. Update your functions handler to point to the newly attached layer in the console for your function: Python: newrelic_lambda_wrapper.handler Node: newrelic-lambda-wrapper.handler Add these environment variables to your Lambda console: NEW_RELIC_ACCOUNT_ID: Your account ID NEW_RELIC_LAMBDA_HANDLER: Path to your initial handler. If you have Node 8 and get a Lambda can't find file error message, expand this collapser: Node 8 \"can't find file\" error troubleshooting If you have Node 8 and receive a Lambda can't find the file newrelic-lambda-wrapper.js message, it's likely that the Node runtime isn't resolving NPM_PATH for the newrelic-lambda module in /opt/nodejs/node_modules. These steps should fix this problem: Create a newrelic-wrapper-helper.js script in your project's root. The script's contents should be module.exports = require('newrelic-lambda-wrapper');. (That is all that needs to be in that script.) Update the handler for your layer declaration to newrelic-lambda-wrapper.handler. Next, you will configure CloudWatch to send logs to New Relic. Option #4: Manually instrument Lambda code for Go, Java, .NET Core, Node.js, and Python If none of the previous options work for you, you can manually instrument your Lambda code. Choose your language: Go To instrument your Go-language Lambda: Download our Go agent package and place it in the same directory as your function. Install the agent: go get -u github.com/newrelic/go-agent. In your Lambda code, import our components, create an application, and update how you start your Lambda. See our GitHub repo for an example of an instrumented Lambda. Optional: Add custom events that will be associated with your Lambda invocation by using the RecordCustomEvent API. For example: func handler(ctx context.Context) { if txn := newrelic.FromContext(ctx); nil != txn { txn.Application().RecordCustomEvent(\"MyEvent\", map[string]interface{}{ \"zip\": \"zap\", }) } fmt.Println(\"hello world!\") } Build and zip your Lambda function and upload it to AWS. Zip and upload recommendations Here are suggestions for zipping and uploading the Lambda: Build the binary for execution on Linux. This produces a binary file called main. You can use: $ GOOS=linux go build -o main Zip the binary into a deployment package using: $ zip deployment.zip main Upload the zip file to AWS using either the AWS Lambda console or the AWS CLI. Name the handler main (to match the name given during the binary build). The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this is the account ID for the root/parent account. Optional: To configure logging, see Go agent logging. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Java Monitoring for AWS Lambda in Java doesn't use our APM Java agent. Instead, it uses these two OpenTracing dependencies: AWS Lambda OpenTracing Java SDK: OpenTracing instrumentation for AWS Lambda RequestHandler and RequestStreamHandler. Our AWS Lambda OpenTracing Tracer: An OpenTracing Tracer implementation designed to monitor AWS Lambda. It generates spans, error events, transaction events, error traces, and provides distributed tracing support. Supported OpenTracing Versions OpenTracing 0.31.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:1.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:1.0.0 OpenTracing 0.32.0, 0.33.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:2.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:2.1.0 To instrument your Java Lambda: In your project’s build.gradle file, include our OpenTracing AWS Lambda Tracer and the AWS Lambda OpenTracing SDK dependencies: dependencies { compile(\"com.newrelic.opentracing:java-aws-lambda:2.1.0\") compile(\"com.newrelic.opentracing:newrelic-java-lambda:2.1.1\") compile(\"io.opentracing:opentracing-util:0.33.0\") } Implement the AWS Lambda RequestHandler interface as shown in the Java Lambda example and override the doHandleRequest method. In the doHandleRequest method, call the LambdaTracing.instrument(...) API to create a root span to trace the lambda function's execution. This is also where you will define your business logic for the lambda function. Register a LambdaTracer.INSTANCE as the OpenTracing Global tracer, as shown in the Java Lambda example. Create a ZIP deployment package and upload it to AWS Lambda. Or deploy it via other means. In the AWS Lambda console, set the handler. For the example Java Lambda, the handler would be com.handler.example.MyLambdaHandler::handleRequest. Because handleRequest is assumed, you could also use com.handler.example.MyLambdaHandler. The following AWS console environment variables are required if you want your Lambda function to be included in distributed tracing. This is recommended. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_PRIMARY_APPLICATION_ID. This is also your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this must be the account ID for the root/parent account. Optional: In the Lambda console, enable debug logging by adding this environment variable: NEW_RELIC_DEBUG is true. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Please see the AWS Lambda distributed tracing example for a complete project that illustrates common use cases such as: Distributed tracing between Lambda functions Manual span creation (aka custom instrumentation) Tracing external calls Adding custom attributes (aka Tags) to spans .NET Core Our monitoring of .NET Core-based AWS Lambda functions doesn't use our standard .NET Core APM agent. Instead, it uses a NuGet package. To instrument your .NET Core Lambda: In your Lambda Functions project, install the NewRelic.OpenTracing.AmazonLambda.Tracer NuGet package. Import the NuGet package and OpenTracing utils: using OpenTracing.Util; using NewRelic.OpenTracing.AmazonLambda; Instrument your function, as shown in this example: public class Function { static Function() { // Register The NewRelic Lambda Tracer Instance GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public object FunctionWrapper(ILambdaContext context) { // Instantiate NewRelic TracingWrapper and pass your FunctionHandler as // an argument return new TracingRequestHandler().LambdaWrapper(FunctionHandler, context); } /// /// A simple function that takes a string and does a ToUpper /// /// /// /// public object FunctionHandler(ILambdaContext context) { ... } } The arguments passed to FunctionWrapper must match the signature of FunctionHandler. If your handler function returns a Task, the Lambda wrapper will block on the return task until it completes, so that it can measure the duration and capture exceptions, if any are present. In addition, you may also inherit from the APIGatewayProxyFunction. For an example, see below: Async handler function public override Task FunctionHandlerAsync(ILambdaContext lambdaContext) { // This call will block by calling task.Result Task task = new TracingRequestHandler().LambdaWrapper( ActualFunctionHandlerAsync, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(ILambdaContext lambdaContext) { // Function can make other async operations here ... } Inheriting from APIGatewayProxyFunction public class LambdaFunction : APIGatewayProxyFunction { static LambdaFunction() { // Register The NewRelic Lambda Tracer Instance OpenTracing.Util.GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public override Task FunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { Task task = new TracingRequestHandler().LambdaWrapper(ActualFunctionHandlerAsync, request, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { return base.FunctionHandlerAsync(request, lambdaContext); } } Optional for SQS and SNS: Starting in version 1.0 of our .NET Lambda Tracer, distributed tracing support has been added for SQS and SNS. To enable distributed tracing for SQS or SNS you will need to complete the items in this step as well as setup the environment variables in the step that follows this one. Enabling distributed tracing support for SQS and SNS will disable automatic instrumentation for both of SQS and SNS and require the use of these wrappers to instrument them. Set the NEW_RELIC_USE_DT_WRAPPER environment variable to true. To instrument SQS and SNS calls you will need to use the provided wrappers. Using the SQS Wrapper The SQS wrapper supports wrapping the following methods: Amazon.SQS.AmazonSQSClient.SendMessageAsync(...) Amazon.SQS.AmazonSQSClient.SendMessageBatchAsync(...) Examples // SQS Client AmazonSQSClient client = new AmazonSQSClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // SendMessageRequest SendMessageRequest sendRequest = new SendMessageRequest(\"QUEUE_URI_STRING\", \"An SQS Message\"); Task responseOne = SQSWrapper.WrapRequest(client.SendMessageAsync, sendRequest); // String-based Task responseTwo = SQSWrapper.WrapRequest(client.SendMessageAsync, \"QUEUE_URI_STRING\", \"Another SQS Message\"); // SendMessageBatchRequest List batchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id1\", \"First SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id2\", \"Second SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id3\", \"Third SQS Message\")); SendMessageBatchRequest sendBatchRequest = new SendMessageBatchRequest(QUEUE_URI, batchEntries); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, sendBatchRequest); // SendMessageBatchRequestEntry List List moreBatchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id4\", \"Fourth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id5\", \"Fifth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id6\", \"Sixth SQS Message\")); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, moreBatchEntries); Using the SNS Wrapper The SNS wrapper supports wrapping the following methods: Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient.PublishAsync(...) Examples // SNS Client AmazonSimpleNotificationServiceClient client = new Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // PublishRequest - Phone Number PublishRequest phonePublishRequest = new PublishRequest(); phonePublishRequest.PhoneNumber = +1XXX5555100; phonePublishRequest.Message = \"An SNS Message for phones\"; Task phoneResponse = SNSWrapper.WrapRequest(client.PublishAsync, phonePublishRequest); // PublishRequest - ARN PublishRequest publishRequest = new PublishRequest(\"TOPIC_ARN\", \"An SNS Message\"); Task publishResponse = SNSWrapper.WrapRequest(client.PublishAsync, publishRequest); // String-based without subject Task ResponseOne = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Another SNS Message\"); // String-based with subject Task ResponseTwo = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Yet Another SNS Message\", \"A Subject\"); The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS Lambda console: NEW_RELIC_ACCOUNT_ID: The account ID the Lambda is reporting to. NEW_RELIC_TRUSTED_ACCOUNT_KEY: This is also the account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Ensure that the wrapper function (FunctionWrapper in above example) is set up as the function handler. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Node.js To instrument your Node.js Lambda: Download our Node.js agent package and place it in the same directory as your function, ensuring the agent is installed as a dependency in the node_modules directory. Use the Node Package Manager: npm install newrelic --save Install our AWS SDK module alongside the Node.js agent: npm install @newrelic/aws-sdk --save In your Lambda code, require the agent module and the AWS SDK at the top of the file, and wrap the handler function. For example: const newrelic = require('newrelic'); require('@newrelic/aws-sdk'); module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { // This is your handler function code console.log('Lambda executed'); callback(); }); Optional: You can also add custom events to your Lambda using the recordCustomEvent API. For example: module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { newrelic.recordCustomEvent(‘MyEventType’, {foo: ‘bar’}); console.log('Lambda executed'); callback(); }); Zip your Lambda function and the Node.js agent folder together. Requirements and recommendations: The New Relic files outside the New Relic agent folder don't need to be included. If your Lambda function file name is, for example, lambda_function.node, we recommend naming your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set these environment variables: NEW_RELIC_NO_CONFIG_FILE. Set to true if not using a configuration file. NEW_RELIC_APP_NAME: Your application name. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To run the agent in serverless mode outside of AWS in a local environment, set the environment variable NEW_RELIC_SERVERLESS_MODE_ENABLED to true. (When executing this in an AWS Lambda environment, the agent will automatically run in serverless mode. Do not use this variable if you're running in AWS.) Optional: To enable logging in serverless mode, set these environment variables: Set NEW_RELIC_LOG_ENABLED to true. Set NEW_RELIC_LOG to stdout for output to CloudWatch, or set to any writeable file location. The log level is set to info by default. See other log levels. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Python To instrument your Python Lambda: Download our Python agent package and place it in the same directory as your function. To do this, use pip: pip install -t . newrelic If you use Homebrew, you may get this error: DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both. For details, see the Homebrew GitHub post. In your Lambda code, import the Python agent module and decorate the handler function using the New Relic decorator. The New Relic package must be imported first in your code. Here's an example: import newrelic.agent newrelic.agent.initialize() @newrelic.agent.lambda_handler() def handler(event, context): ... Optional: You can also add custom events to your Lambda using the record_custom_event API. Here's an example: @newrelic.agent.lambda_handler() def handler(event, context): newrelic.agent.record_custom_event('CustomEvent', {'foo': 'bar'}) … Zip your lambda_function.py and newrelic/ folder together using these guidelines: The New Relic files outside the newrelic/ folder don't need to be included. If your Lambda function file name is, for example, lambda_function.py, name your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set this environment variable: NEW_RELIC_SERVERLESS_MODE_ENABLED. Set to true The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_DISTRIBUTED_TRACING_ENABLED. Set to true. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To configure logging, use the NEW_RELIC_LOG and NEW_RELIC_LOG_LEVEL environment variables in the AWS Console. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. The New Relic decorator gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, configure CloudWatch to send those logs to New Relic. Step 4. Configure CloudWatch logs to stream to New Relic Lambda In this step, you'll link your Lambda function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda that was configured in Step 2. For Node.js and Python: This step isn't necessary if you used the Serverless Framework plugin option in Step 3. This step can be done using the CLI tool or using manual procedures. Use CLI tool Run this command for every Lambda function you want to monitor: newrelic-lambda subscriptions install --function FUNCTION_NAME_#1 Or to set subscription filters for all supported functions run this command:: newrelic-lambda subscriptions install --function all Notes on this command: You should only need one newrelic-log-ingestion Lambda per AWS account and region. You can subscribe as many functions to it as you like. To see more detail about the arguments, including a region-specifying argument, see our GitHub documentation. You may receive a CloudWatch validation error. This doesn't affect data reporting. If you see data reporting in New Relic, disregard that error message. If you have our Logs and want to send all your log data to us (not just Lambda logs), see Stream all logs. Manual procedures Here are the manual procedures performed by the CLI tool: Manual process: Stream CloudWatch logs to New Relic Lambda In Step 2, you set up a newrelic-log-ingestion Lambda function. After you've instrumented your Lambda function (Step 3), the newrelic-lambda subscriptions command links that function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda. To do this manually: Open CloudWatch and select Logs in the left-hand menu, and then select the log group for the function you are monitoring. Select Actions and choose Stream to AWS Lambda. Under Lambda function, select the newrelic-log-ingestion function. Set the Log format to JSON. Set the Subscription filter pattern to ?REPORT ?NR_LAMBDA_MONITORING ?\"Task timed out\". Alternatively, if you are using the LOGGING_ENABLED environment variable stream all your logs to our Logs, leave this field blank. See notes and caveats about this procedure. Make sure the newrelic-log-ingestion Lambda function you select in the method above is in the same AWS region as your Lambda function. What's next? After you complete these steps, here's what you can do next: See data reporting in the Lambda monitoring UI. If you're having trouble finding your data, see Lambda enable troubleshooting. Use configuration settings to fine-tune your data. Our newrelic-log-ingestion function is not updated automatically. For best results and access to latest features, we recommend you occasionally update our Lambda monitoring. Optional: Stream all logs to New Relic If you have log management enabled and want to report all your logs to New Relic, follow these instructions: Go to our newrelic-log-ingestion Lambda and set the LOGGING_ENABLED environment variable to true. It isn't possible to edit existing filter patterns, so they must be removed and re-added: Set the Subscription filter pattern to \"\". Go to the Log group for each monitored Lambda, and remove the newrelic-log-ingestion subscription. Add the subscription filter back, leaving the Subscription filter pattern field blank. 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.", + "_index": "520d1d5d14cc8a32e600034b", + "_type": "520d1d5d14cc8a32e600034c", + "_score": 97.66231, + "_version": null, + "_explanation": null, + "sort": null, + "highlight": { + "body": " custom events that will be associated with your Lambda invocation by using the RecordCustomEvent API. For example: func handler(ctx context.Context) { if txn := newrelic.FromContext(ctx); nil != txn { txn.Application().RecordCustomEvent("MyEvent", map[string]interface{}{ "zip": "zap", }) } fmt.Println" + }, + "id": "5f6c67a464441f3a75eb72d3" + }, + { + "sections": [ + "Serve, publish, and deploy your New Relic One app", + "Before you begin", + "Serve your app locally", + "Add images and metadata to your apps", + "screenshots folder", + "documentation.md", + "additionalInfo.md", + "config.json", + "Publish your app", + "Tip", + "Deploy your app", + "Subscribe or unsubsribe apps", + "Handle duplicate applications" ], - "published_at": "2020-09-24T02:27:37Z", - "title": "New Relic One CLI Nerdpack commands", - "updated_at": "2020-09-17T01:49:55Z", + "title": "Serve, publish, and deploy your New Relic One app", "type": "developer", - "external_id": "7c1050a6a8624664b90c15111f7c72e96b2fbe17", + "tags": [ + "publish apps", + "deploy apps", + "subscribe apps", + "add metadata apps" + ], + "external_id": "63283ee8efdfa419b6a69cb8bd135d4bc2188d2c", + "image": "https://developer.newrelic.com/static/175cc6506f7161ebf121129fa87e0789/0086b/apps_catalog.png", + "url": "https://developer.newrelic.com/build-apps/publish-deploy/", + "published_at": "2020-09-25T01:51:37Z", + "updated_at": "2020-09-02T02:05:55Z", "document_type": "page", "popularity": 1, - "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.", - "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:build Assembles your Nerdpack into bundles 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. nr1 nerdpack:clean Cleans your development folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. Command details nr1 nerdpack:build Builds a Nerdpack Runs a webpack process to assemble your Nerdpack into javascript and CSS bundles. As many other CLI commands, it should be run at the package.json level of your Nerdpack. Usage $ nr1 nerdpack:build OPTION Options --extra-metadata-path=extra-metadata-path Specify a json file path with extra metadata. [default: extra-metadata.json] --prerelease=prerelease If specififed, the value will be appended to the current version of generated files. ie: --prerelease=abc. Then the version will be \"1.2.3-abc\". --profile=profile The authencation profile you want to use. --verbose Adds extra information to the output. 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. nr1 nerdpack:clean Removes all built artifacts Cleans and removes the content and the developtment folders (dist/, tmp/). Usage $ nr1 nerdpack:clean OPTION Options --profile=profile The authentication profile you want to use --verbose Adds extra information to the output. nr1 nerdpack:validate Validates artifacts inside your Nerdpack Validates artifacts inside your Nerdpack. Usage $ nr1 nerdpack:validate OPTION Options -l, --force-local The authentication profile you want to use. -r, --force-remote Force download of new schema files. --profile=profile The authentication profile you want to uset. --verbose Adds extra information to the output. nr1 nerdpack:Info Shows the state of your Nerdpack in the New Relic's registry Shows the state of your Nerdpack in the New Relic's registry. The default amount of versions shown is 10 but all versions can be shown if the --all (or -a) flag is used Usage $ nr1 nerdpack:info OPTION Options -a, --all Show all versions. -i, --nerdpack-id=nerdpack-id Get info from the specified Nerdpack instead of local one. --profile=profile The authentication profile you want to use. --verbose Adds extra information to the output.", + "info": "Start sharing and using the custom New Relic One apps you build", + "body": "Serve, publish, and deploy your New Relic One app 30 min When you build a New Relic One app, chances are you'll want to share it with others in your organization. You might even want to share it broadly through our open source channel. But first, you probably want to try it out locally to make sure it's working properly. From the New Relic One Apps page, you can review available apps and subscribe to the ones you want for accounts you manage. The Your 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 visualizations 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. Your 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. Here, you learn to: Serve your app locally Add images and metadata to your app Publish it Subscribe and unsubscribe accounts you manage to the app Handle duplicate applications Before you begin This guide requires the following: A New Relic One app or Nerdpack New Relic One CLI A Nerdpack manager role for publishing, deploying, and subscribing apps. Serve your app locally You can locally serve the app you create to New Relic One to test it out. Step 1 of 1 In the parent root folder of your Nerdpack, run nr1 nerdpack:serve. Go to one.newrelic.com/?nerdpacks=local. The ?nerdpacks=local URL suffix will load any locally served Nerdpacks that are available. When you make a change to a locally served Nerdpack, New Relic One will automatically reload it. Add images and metadata to your apps Application creators can include a description of what their 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, custom, or public. 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. Step 1 of 3 Update the New Relic One CLI to ensure you're working with the latest version. nr1 update Copy Step 2 of 3 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 sections for the process to succeed. 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 \\n model that supports location-specific KPI's, custom metadata, drill-down navigation into Entities \\n 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\" } Copy Step 3 of 3 Save the metadata and screenshots to the catalog. This validates the information you added to the catalog directory against the criteria described in the previous step, and saves it to the catalog. nr1 catalog:submit Copy Publish your app Publishing places your Nerdpack in New Relic One. To publish or deploy, you must be a Nerdpack manager. New Relic One requires that only one version (following semantic versioning) of a Nerdpack can be published at a time. Tip If you know what channel you want to deploy to (as described in the Deploy your app section that follows), you can run nr1 nerdpack:publish --channel=STABLE or nr1 nerdpack:publish --channel=BETA. Step 1 of 2 Update the version attribute in the app's package.json file. This follows semantic versioning, and must be updated before you can successfully publish. Step 2 of 2 To publish your Nerdpack, run nr1 nerdpack:publish. Deploy your app Deploying is applying a Nerdpack version to a specific channel (for example, BETA, or STABLE). A channel can only have one Nerdpack version deployed to it at one time. If a channel has an existing Nerdpack associated with it, deploying a new Nerdpack version to that channel will undeploy the previous one. Channels are meant to be an easier way to control application version access than having to be concerned with specific version numbers. Step 1 of 1 To deploy an application, run nr1 nerdpack:deploy. Subscribe or unsubsribe apps Whether you want to subscribe accounts to an app you've created or to apps already available in the catalog, the process is the same. Note that if you subscribe to an app in the catalog, you'll automatically get any updates that are added to the app. To learn about the appropriate permissions for subscribing, see Permissions for managing applications. Step 1 of 2 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 members of the accounts you have subscribed to the app can launch it from New Relic One. Step 2 of 2 Unsubsribe from 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 Your 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. Step 1 of 1 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 136.92252, + "_score": 96.35614, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI Nerdpack commands", - "sections": "New Relic One CLI Nerdpack commands", - "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.", - "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:build Assembles your Nerdpack into bundles nr1 nerdpack:clone Clones a Nerdpack from" + "title": "Serve, publish, and deploy your New Relic One app", + "sections": "Serve, publish, and deploy your New Relic One app", + "info": "Start sharing and using the custom New Relic One apps you build", + "tags": "publish apps", + "body": " that you haven't subscribed to, some developed by New Relic engineers to provide visualizations 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. Your apps in the catalog are created" }, - "id": "5f28bd6a64441f9817b11a38" + "id": "5efa999de7b9d283e67bab8f" } ], - "/explore-docs/nr1-subscription": [ + "/explore-docs/nr1-plugins": [ { "sections": [ "New Relic One CLI reference", @@ -6700,7 +6724,7 @@ "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-09-24T02:26:06Z", + "published_at": "2020-09-25T01:49:59Z", "updated_at": "2020-09-17T01:51:10Z", "document_type": "page", "popularity": 1, @@ -6708,7 +6732,7 @@ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. 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. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 319.01785, + "_score": 290.11594, "_version": null, "_explanation": null, "sort": null, @@ -6722,45 +6746,38 @@ "id": "5efa989e28ccbc535a307dd0" }, { - "nodeid": 37686, "sections": [ - "AWS Lambda monitoring", - "Get started", - "Enable Lambda monitoring", - "UI and data", - "Troubleshooting", - "Update serverless monitoring for AWS Lambda", - "Update our Lambda integration via CLI", - "Update Layers via CLI", - "Update a manual Serverless Application Repository install", - "Enabling log management", - "For more help" + "New Relic CLI Reference", + "New Relic CLI commands", + "Options", + "Commands" ], - "title": "Update serverless monitoring for AWS Lambda", - "category_0": "Serverless function monitoring", - "type": "docs", - "category_1": "AWS Lambda monitoring", - "external_id": "9241e43c2db3e0298407449d530fa8fe601c1833", + "title": "New Relic CLI Reference", + "type": "developer", + "tags": "new relic cli", + "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", "image": "", - "url": "https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/update-serverless-monitoring-aws-lambda", - "published_at": "2020-09-24T13:55:00Z", - "updated_at": "2020-09-24T13:54:59Z", - "breadcrumb": "Contents / Serverless function monitoring / AWS Lambda monitoring / Enable Lambda monitoring", + "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", + "published_at": "2020-09-25T01:50:00Z", + "updated_at": "2020-08-14T01:47:12Z", "document_type": "page", "popularity": 1, - "info": "How to update our Serverless monitoring for AWS Lambda. ", - "body": "After enabling our monitoring for AWS Lambda, you should occasionally update our Lambda function that's used to report AWS log data: newrelic-log-ingestion. There are two ways to do this: Update via CLI: Use this if you enabled our Lambda monitoring using our CLI tool. Update via AWS Serverless Application Repository: Use this if you enabled using the manual procedure. These update procedures apply to our serverless monitoring for AWS Lambda, and not to our infrastructure monitoring for AWS Lambda integration. Update our Lambda integration via CLI This section describes how to update if your Lambda monitoring was enabled using our recommended CLI tool. Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following command, replacing YOUR_REGION with your region identifier (for example, us-west-2). newrelic-lambda integrations update \\ --aws-region YOUR_REGION If you do not have our logs enabled, you'll also need to update your AWS CloudWatch log subscription filters with the following command: newrelic-lambda subscriptions install \\ --function installed \\ --aws-region YOUR_REGION Update Layers via CLI This section describes how to update your function's Layer if you installed it with our CLI tool. Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli Pass the --upgrade flag to the install command: newrelic-lambda layers install \\ --function installed \\ --nr-account-id NR_ACCOUNT_ID \\ --upgrade Update a manual Serverless Application Repository install If you manually installed the ingest function from the AWS Serverless Application Repository (and didn't use the CLI), update using this procedure: Run the following, replacing YOUR_REGION with your region (for example, us-west-2)​. aws serverlessrepo create-cloud-formation-change-set \\ --application-id arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion \\ --stack-name NewRelic-log-ingestion \\ --capabilities CAPABILITY_RESOURCE_POLICY \\ --region YOUR_REGION This command outputs several fields, one of which is the ChangeSetId: an ARN for the change set that you just created. Copy that ARN. Use the ARN in this command, which executes the change set: aws cloudformation execute-change-set --change-set-name YOUR_CHANGE_SET_ARN Enabling log management If you currently don't have New Relic's log management enabled, but would like to: Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following command, replacing YOUR_REGION with your region (for example, us-west-2). newrelic-lambda integrations update \\ --enable-logs \\ --aws-region YOUR_REGION Then update your AWS CloudWatch log subscription filters for each region with the following command: newrelic-lambda subscriptions install \\ --function installed \\ --filter-pattern \"\" \\ --aws-region YOUR_REGION 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.", + "info": "The command line tools for performing tasks against New Relic APIs", + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 224.26837, + "_score": 139.21071, "_version": null, "_explanation": null, "sort": null, "highlight": { - "sections": "Update our Lambda integration via CLI", - "body": " YOUR_CHANGE_SET_ARN Enabling log management If you currently don't have New Relic's log management enabled, but would like to: Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following" + "title": "New Relic CLI Reference", + "sections": "New Relic CLI commands", + "info": "The command line tools for performing tasks against New Relic APIs", + "tags": "new relic cli", + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" }, - "id": "5f6ca534196a67b08750423e" + "id": "5efa989ee7b9d2024b7bab97" }, { "nodeid": 27692, @@ -6802,7 +6819,7 @@ "body": "Serverless monitoring for AWS Lambda offers in-depth performance monitoring for your Lambda functions. Read on to learn how to enable this feature and get started using it. Using this feature may result in AWS charges. For more information, see the Lambda monitoring requirements.​​​ How Lambda monitoring works Before enabling Lambda monitoring, understanding how data flows from your Lambda functions to New Relic may be helpful: Diagram showing how data flows from a Lambda function to New Relic. When our Lambda monitoring is enabled, this is how data moves from your Lambda function to New Relic: The Lambda function is instrumented with our code. When the Lambda is invoked, log data is sent to CloudWatch. CloudWatch collects Lambda log data and sends it to our log-ingestion Lambda. The log-ingestion Lambda sends that data to New Relic. Enable procedure overview If you already have a New Relic account and use Node.js or Python, we recommend you use our automated installer. If you do not use the automated installer, complete these steps to set up monitoring: Install our CLI tool (recommended) Connect AWS and New Relic (required) Enable instrumentation of your Lambda (required) Stream CloudWatch logs to New Relic (required) Step 1. Install the newrelic-lambda-cli tool We provide a command line interface (CLI) tool that's used in steps 2 through 4. We recommend the CLI because it simplifies some of the work, but you can also perform those steps manually. If you want to understand what it does before you install it, see the manual procedures that the CLI tool performs in Step 2, Step 3 (option 2), and Step 4. You can also see the CLI documentation on GitHub. If you prefer a manual install, skip to Step 2. Connect AWS to New Relic. CLI requirements To use the CLI too, you need: Python 3.3 or higher The AWS CLI You must be a user or admin with an infrastructure manager Add-on role. Your AWS account needs permissions for creating IAM resources (Role and Policy) and Lambda functions. These resources are created using CloudFormation stacks, so you'll need permissions to create those. For more on permissions, including setting custom policies, expand this collapser: AWS permissions details Resource: * Actions: \"cloudformation:CreateChangeSet\", \"cloudformation:CreateStack\", \"cloudformation:DescribeStacks\", \"cloudformation:ExecuteChangeSets\", \"iam:AttachRolePolicy\", \"iam:CreateRole\", \"iam:GetRole\", \"iam:PassRole\", \"lambda:AddPermission\", \"lambda:CreateFunction\", \"lambda:GetFunction\", \"logs:DeleteSubscriptionFilter\", \"logs:DescribeSubscriptionFilters\", \"logs:PutSubscriptionFilter\" \"s3:GetObject\" \"serverlessrepo:CreateCloudFormationChangeSet\" Resource: \"arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion\" Actions: \"serverlessrepo:CreateCloudFormationTemplate\" \"serverlessrepo:GetCloudFormationTemplate\" Be sure that the AWS account you use to execute the CLI has all of these permissions. If your AWS account permissions are restrictive and you're unable to use the CLI, you can optionally use a manually managed custom IAM policy. This policy would require, at minimum, the following permissions: Resource: \"*\" Action: \"cloudwatch:GetMetricStatistics\" \"cloudwatch:ListMetrics\" \"cloudwatch:GetMetricData\" \"lambda:GetAccountSettings\" \"lambda:ListFunctions\" \"lambda:ListAliases\" \"lambda:ListTags\" \"lambda:ListEventSourceMappings\" These permissions are the minimum required. We recommend granting a managed ReadOnlyAccess policy as described in Connect AWS to infrastructure monitoring. CLI installation To install the CLI tool: Ensure you have the required permissions for both your New Relic and AWS account. From the command line, run: pip install newrelic-lambda-cli You may need to use pip3 in the command above if you have Python 2.7 installed. The CLI requires Python >=3.3. Step 2. Connect AWS to New Relic You must complete this step, and steps 3 and 4, to enable our Lambda monitoring. This step connects AWS to New Relic and creates a newrelic-log-ingestion Lambda function that sends your instrumented data to New Relic. You can either use the CLI tool or do the steps manually. Use CLI tool When you use the CLI, you have one optional step and one required step: Optional: If you're using multiple AWS profiles or multiple regions, you may want to configure the AWS environment variables: AWS environment variable instructions Setting the region To configure your region, use this environment variable to override the default region: export AWS_DEFAULT_REGION=MY_REGION # us-west-2, for example The CLI tool also allows passing this per-command using --aws-region. Setting profiles If you have multiple AWS profiles and don't want to use the default, use AWS_PROFILE environment variable to set another profile name. Ensure the profile is properly configured (including the default region). Example: export AWS_PROFILE=MY_PROFILE Run the following command using the CLI tool: newrelic-lambda integrations install --nr-account-id YOUR_ACCOUNT_ID \\ --linked-account-name YOUR_LINKED_ACCOUNT_NAME \\ --nr-api-key YOUR_NR_API_KEY This command: Connects your AWS account to New Relic. Installs a newrelic-log-ingestion Lambda that will send your instrumented data to New Relic. More details: This defaults to U.S. region. If your account is in the EU region, add this argument: --nr-region \"eu\". If you're instrumenting functions in multiple AWS regions, this command must be run for each region using the --aws-region argument. YOUR_LINKED_ACCOUNT_NAME is either a new AWS account you want to link to New Relic, or it's the name of the AWS account that you linked to when setting up the AWS Lambda monitoring integration. YOUR_NR_API_KEY refers to your personal API key (not your REST API key). For more on the API key and other arguments, see our Lambda monitoring GitHub repo. Manual procedures Here are the manual procedures performed by the CLI tool: Connect AWS to New Relic The newrelic-lambda integration command connects the AWS account containing your Lambdas to New Relic. If you've already installed one of our AWS integrations, your accounts should be linked to New Relic and you can skip this section. To manually establish this connection, follow the instructions for connecting AWS to Infrastructure monitoring. Configure our log-ingestion Lambda The newrelic-lambda integration command sets up a newrelic-log-ingestion Lambda. This Lambda takes the logs generated by your Lambda functions and pushes those logs to New Relic. If you're configuring this manually, you must configure our Lambda for the regions you want. The CLI, by default, establishes our Lambda in all regions. To manually configure our Lambda, go to the AWS Serverless Application Repository, which is where the newrelic-log-ingestion Lambda is stored. This repo is a collection of serverless applications published by developers, companies, and partners in the serverless community. It allows developers to share their Lambda functions code with customers, who can then find and deploy the corresponding application Lambda function. Each application is packaged with an AWS Serverless Application Model (SAM) template that defines the AWS resources used. To manually configure our Lambda with the AWS Serverless Application Repository: From the AWS console, go to the Lambda section, select Create function, and select Serverless Application Repository. Search for newrelic and find the newrelic-log-ingestion Lambda. Follow the instructions in the Lambda's documentation to deploy it. A SAM template will build the Lambda. In the environment variable section in AWS console, set the LICENSE_KEY environment variable to your New Relic license key. Note: If you have multiple accounts or a master and sub-account hierarchy, make sure the license key you're using matches the same account connected to AWS. Optional: If you want to stream all your logs to New Relic, set the LOGGING_ENABLED environment variable to true. For more on this, see Stream all logs. Step 3. Enable Lambda instrumentation This step enables instrumentation of your Lambda function, which allows detailed monitoring and alerting functionality. Our instrumentation is designed to have minimal impact on your Lambda performance. If you're using Node.js or Python, we recommend the first two options. Option #1: Use Serverless Framework plugin (Node.js and Python) Requirements Available only for Node.js and Python. For other languages, see Manual instrumentation. Serverless Framework version 1.34.0 or higher. Features If you meet the requirements (above), you can use our Serverless Framework plugin, which allows you to add our AWS Lambda Layer to your functions without requiring a code change. Supports Node.js and Python runtimes No code change required to enable Lambda instrumentation Enables our APM agent functionality using a single layer Configures CloudWatch subscription filters automatically Gets the layer into your code base which is useful for redeploys Install To install our Serverless Framework plugin: Choose an install option: NPM: npm install --save-dev serverless-newrelic-lambda-layers yarn: yarn add --dev serverless-newrelic-lambda-layers Add the plugin to your serverless.yml: plugins: - serverless-newrelic-lambda-layers Get your account ID and put it in the serverless.yml: custom: newRelic: accountId: YOUR_ACCOUNT_ID Deploy it: sls deploy You can skip Step 4. Setting up CloudWatch Logs. This is automatically completed on deploy by our Serverless Framework plugin. For the next step, go to What's next? Option #2: Add Lambda Layer with our CLI (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework and don't intend to redeploy your function frequently, you can use the CLI to add our Lambda Layer: If you haven't already done so, install the CLI: pip install newrelic-lambda-cli List available functions: newrelic-lambda functions list Pass the option -f not-installed to see which functions have not yet been instrumented. Add the layer to your function: newrelic-lambda layers install --function FUNCTION_NAME --nr-account-id NEW_RELIC_ACCOUNT_ID Next, you will configure CloudWatch to send logs to New Relic. Option #3: Manually add our Lambda Layer (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework, you can manually add our Lambda Layer: Find the layer that matches your runtime and region. Copy the Amazon Resource Name (ARN) of the most recent version and add it in the AWS Lambda console for your function. Update your functions handler to point to the newly attached layer in the console for your function: Python: newrelic_lambda_wrapper.handler Node: newrelic-lambda-wrapper.handler Add these environment variables to your Lambda console: NEW_RELIC_ACCOUNT_ID: Your account ID NEW_RELIC_LAMBDA_HANDLER: Path to your initial handler. If you have Node 8 and get a Lambda can't find file error message, expand this collapser: Node 8 \"can't find file\" error troubleshooting If you have Node 8 and receive a Lambda can't find the file newrelic-lambda-wrapper.js message, it's likely that the Node runtime isn't resolving NPM_PATH for the newrelic-lambda module in /opt/nodejs/node_modules. These steps should fix this problem: Create a newrelic-wrapper-helper.js script in your project's root. The script's contents should be module.exports = require('newrelic-lambda-wrapper');. (That is all that needs to be in that script.) Update the handler for your layer declaration to newrelic-lambda-wrapper.handler. Next, you will configure CloudWatch to send logs to New Relic. Option #4: Manually instrument Lambda code for Go, Java, .NET Core, Node.js, and Python If none of the previous options work for you, you can manually instrument your Lambda code. Choose your language: Go To instrument your Go-language Lambda: Download our Go agent package and place it in the same directory as your function. Install the agent: go get -u github.com/newrelic/go-agent. In your Lambda code, import our components, create an application, and update how you start your Lambda. See our GitHub repo for an example of an instrumented Lambda. Optional: Add custom events that will be associated with your Lambda invocation by using the RecordCustomEvent API. For example: func handler(ctx context.Context) { if txn := newrelic.FromContext(ctx); nil != txn { txn.Application().RecordCustomEvent(\"MyEvent\", map[string]interface{}{ \"zip\": \"zap\", }) } fmt.Println(\"hello world!\") } Build and zip your Lambda function and upload it to AWS. Zip and upload recommendations Here are suggestions for zipping and uploading the Lambda: Build the binary for execution on Linux. This produces a binary file called main. You can use: $ GOOS=linux go build -o main Zip the binary into a deployment package using: $ zip deployment.zip main Upload the zip file to AWS using either the AWS Lambda console or the AWS CLI. Name the handler main (to match the name given during the binary build). The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this is the account ID for the root/parent account. Optional: To configure logging, see Go agent logging. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Java Monitoring for AWS Lambda in Java doesn't use our APM Java agent. Instead, it uses these two OpenTracing dependencies: AWS Lambda OpenTracing Java SDK: OpenTracing instrumentation for AWS Lambda RequestHandler and RequestStreamHandler. Our AWS Lambda OpenTracing Tracer: An OpenTracing Tracer implementation designed to monitor AWS Lambda. It generates spans, error events, transaction events, error traces, and provides distributed tracing support. Supported OpenTracing Versions OpenTracing 0.31.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:1.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:1.0.0 OpenTracing 0.32.0, 0.33.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:2.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:2.1.0 To instrument your Java Lambda: In your project’s build.gradle file, include our OpenTracing AWS Lambda Tracer and the AWS Lambda OpenTracing SDK dependencies: dependencies { compile(\"com.newrelic.opentracing:java-aws-lambda:2.1.0\") compile(\"com.newrelic.opentracing:newrelic-java-lambda:2.1.1\") compile(\"io.opentracing:opentracing-util:0.33.0\") } Implement the AWS Lambda RequestHandler interface as shown in the Java Lambda example and override the doHandleRequest method. In the doHandleRequest method, call the LambdaTracing.instrument(...) API to create a root span to trace the lambda function's execution. This is also where you will define your business logic for the lambda function. Register a LambdaTracer.INSTANCE as the OpenTracing Global tracer, as shown in the Java Lambda example. Create a ZIP deployment package and upload it to AWS Lambda. Or deploy it via other means. In the AWS Lambda console, set the handler. For the example Java Lambda, the handler would be com.handler.example.MyLambdaHandler::handleRequest. Because handleRequest is assumed, you could also use com.handler.example.MyLambdaHandler. The following AWS console environment variables are required if you want your Lambda function to be included in distributed tracing. This is recommended. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_PRIMARY_APPLICATION_ID. This is also your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this must be the account ID for the root/parent account. Optional: In the Lambda console, enable debug logging by adding this environment variable: NEW_RELIC_DEBUG is true. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Please see the AWS Lambda distributed tracing example for a complete project that illustrates common use cases such as: Distributed tracing between Lambda functions Manual span creation (aka custom instrumentation) Tracing external calls Adding custom attributes (aka Tags) to spans .NET Core Our monitoring of .NET Core-based AWS Lambda functions doesn't use our standard .NET Core APM agent. Instead, it uses a NuGet package. To instrument your .NET Core Lambda: In your Lambda Functions project, install the NewRelic.OpenTracing.AmazonLambda.Tracer NuGet package. Import the NuGet package and OpenTracing utils: using OpenTracing.Util; using NewRelic.OpenTracing.AmazonLambda; Instrument your function, as shown in this example: public class Function { static Function() { // Register The NewRelic Lambda Tracer Instance GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public object FunctionWrapper(ILambdaContext context) { // Instantiate NewRelic TracingWrapper and pass your FunctionHandler as // an argument return new TracingRequestHandler().LambdaWrapper(FunctionHandler, context); } /// /// A simple function that takes a string and does a ToUpper /// /// /// /// public object FunctionHandler(ILambdaContext context) { ... } } The arguments passed to FunctionWrapper must match the signature of FunctionHandler. If your handler function returns a Task, the Lambda wrapper will block on the return task until it completes, so that it can measure the duration and capture exceptions, if any are present. In addition, you may also inherit from the APIGatewayProxyFunction. For an example, see below: Async handler function public override Task FunctionHandlerAsync(ILambdaContext lambdaContext) { // This call will block by calling task.Result Task task = new TracingRequestHandler().LambdaWrapper( ActualFunctionHandlerAsync, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(ILambdaContext lambdaContext) { // Function can make other async operations here ... } Inheriting from APIGatewayProxyFunction public class LambdaFunction : APIGatewayProxyFunction { static LambdaFunction() { // Register The NewRelic Lambda Tracer Instance OpenTracing.Util.GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public override Task FunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { Task task = new TracingRequestHandler().LambdaWrapper(ActualFunctionHandlerAsync, request, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { return base.FunctionHandlerAsync(request, lambdaContext); } } Optional for SQS and SNS: Starting in version 1.0 of our .NET Lambda Tracer, distributed tracing support has been added for SQS and SNS. To enable distributed tracing for SQS or SNS you will need to complete the items in this step as well as setup the environment variables in the step that follows this one. Enabling distributed tracing support for SQS and SNS will disable automatic instrumentation for both of SQS and SNS and require the use of these wrappers to instrument them. Set the NEW_RELIC_USE_DT_WRAPPER environment variable to true. To instrument SQS and SNS calls you will need to use the provided wrappers. Using the SQS Wrapper The SQS wrapper supports wrapping the following methods: Amazon.SQS.AmazonSQSClient.SendMessageAsync(...) Amazon.SQS.AmazonSQSClient.SendMessageBatchAsync(...) Examples // SQS Client AmazonSQSClient client = new AmazonSQSClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // SendMessageRequest SendMessageRequest sendRequest = new SendMessageRequest(\"QUEUE_URI_STRING\", \"An SQS Message\"); Task responseOne = SQSWrapper.WrapRequest(client.SendMessageAsync, sendRequest); // String-based Task responseTwo = SQSWrapper.WrapRequest(client.SendMessageAsync, \"QUEUE_URI_STRING\", \"Another SQS Message\"); // SendMessageBatchRequest List batchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id1\", \"First SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id2\", \"Second SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id3\", \"Third SQS Message\")); SendMessageBatchRequest sendBatchRequest = new SendMessageBatchRequest(QUEUE_URI, batchEntries); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, sendBatchRequest); // SendMessageBatchRequestEntry List List moreBatchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id4\", \"Fourth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id5\", \"Fifth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id6\", \"Sixth SQS Message\")); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, moreBatchEntries); Using the SNS Wrapper The SNS wrapper supports wrapping the following methods: Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient.PublishAsync(...) Examples // SNS Client AmazonSimpleNotificationServiceClient client = new Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // PublishRequest - Phone Number PublishRequest phonePublishRequest = new PublishRequest(); phonePublishRequest.PhoneNumber = +1XXX5555100; phonePublishRequest.Message = \"An SNS Message for phones\"; Task phoneResponse = SNSWrapper.WrapRequest(client.PublishAsync, phonePublishRequest); // PublishRequest - ARN PublishRequest publishRequest = new PublishRequest(\"TOPIC_ARN\", \"An SNS Message\"); Task publishResponse = SNSWrapper.WrapRequest(client.PublishAsync, publishRequest); // String-based without subject Task ResponseOne = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Another SNS Message\"); // String-based with subject Task ResponseTwo = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Yet Another SNS Message\", \"A Subject\"); The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS Lambda console: NEW_RELIC_ACCOUNT_ID: The account ID the Lambda is reporting to. NEW_RELIC_TRUSTED_ACCOUNT_KEY: This is also the account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Ensure that the wrapper function (FunctionWrapper in above example) is set up as the function handler. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Node.js To instrument your Node.js Lambda: Download our Node.js agent package and place it in the same directory as your function, ensuring the agent is installed as a dependency in the node_modules directory. Use the Node Package Manager: npm install newrelic --save Install our AWS SDK module alongside the Node.js agent: npm install @newrelic/aws-sdk --save In your Lambda code, require the agent module and the AWS SDK at the top of the file, and wrap the handler function. For example: const newrelic = require('newrelic'); require('@newrelic/aws-sdk'); module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { // This is your handler function code console.log('Lambda executed'); callback(); }); Optional: You can also add custom events to your Lambda using the recordCustomEvent API. For example: module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { newrelic.recordCustomEvent(‘MyEventType’, {foo: ‘bar’}); console.log('Lambda executed'); callback(); }); Zip your Lambda function and the Node.js agent folder together. Requirements and recommendations: The New Relic files outside the New Relic agent folder don't need to be included. If your Lambda function file name is, for example, lambda_function.node, we recommend naming your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set these environment variables: NEW_RELIC_NO_CONFIG_FILE. Set to true if not using a configuration file. NEW_RELIC_APP_NAME: Your application name. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To run the agent in serverless mode outside of AWS in a local environment, set the environment variable NEW_RELIC_SERVERLESS_MODE_ENABLED to true. (When executing this in an AWS Lambda environment, the agent will automatically run in serverless mode. Do not use this variable if you're running in AWS.) Optional: To enable logging in serverless mode, set these environment variables: Set NEW_RELIC_LOG_ENABLED to true. Set NEW_RELIC_LOG to stdout for output to CloudWatch, or set to any writeable file location. The log level is set to info by default. See other log levels. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Python To instrument your Python Lambda: Download our Python agent package and place it in the same directory as your function. To do this, use pip: pip install -t . newrelic If you use Homebrew, you may get this error: DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both. For details, see the Homebrew GitHub post. In your Lambda code, import the Python agent module and decorate the handler function using the New Relic decorator. The New Relic package must be imported first in your code. Here's an example: import newrelic.agent newrelic.agent.initialize() @newrelic.agent.lambda_handler() def handler(event, context): ... Optional: You can also add custom events to your Lambda using the record_custom_event API. Here's an example: @newrelic.agent.lambda_handler() def handler(event, context): newrelic.agent.record_custom_event('CustomEvent', {'foo': 'bar'}) … Zip your lambda_function.py and newrelic/ folder together using these guidelines: The New Relic files outside the newrelic/ folder don't need to be included. If your Lambda function file name is, for example, lambda_function.py, name your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set this environment variable: NEW_RELIC_SERVERLESS_MODE_ENABLED. Set to true The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_DISTRIBUTED_TRACING_ENABLED. Set to true. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To configure logging, use the NEW_RELIC_LOG and NEW_RELIC_LOG_LEVEL environment variables in the AWS Console. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. The New Relic decorator gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, configure CloudWatch to send those logs to New Relic. Step 4. Configure CloudWatch logs to stream to New Relic Lambda In this step, you'll link your Lambda function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda that was configured in Step 2. For Node.js and Python: This step isn't necessary if you used the Serverless Framework plugin option in Step 3. This step can be done using the CLI tool or using manual procedures. Use CLI tool Run this command for every Lambda function you want to monitor: newrelic-lambda subscriptions install --function FUNCTION_NAME_#1 Or to set subscription filters for all supported functions run this command:: newrelic-lambda subscriptions install --function all Notes on this command: You should only need one newrelic-log-ingestion Lambda per AWS account and region. You can subscribe as many functions to it as you like. To see more detail about the arguments, including a region-specifying argument, see our GitHub documentation. You may receive a CloudWatch validation error. This doesn't affect data reporting. If you see data reporting in New Relic, disregard that error message. If you have our Logs and want to send all your log data to us (not just Lambda logs), see Stream all logs. Manual procedures Here are the manual procedures performed by the CLI tool: Manual process: Stream CloudWatch logs to New Relic Lambda In Step 2, you set up a newrelic-log-ingestion Lambda function. After you've instrumented your Lambda function (Step 3), the newrelic-lambda subscriptions command links that function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda. To do this manually: Open CloudWatch and select Logs in the left-hand menu, and then select the log group for the function you are monitoring. Select Actions and choose Stream to AWS Lambda. Under Lambda function, select the newrelic-log-ingestion function. Set the Log format to JSON. Set the Subscription filter pattern to ?REPORT ?NR_LAMBDA_MONITORING ?\"Task timed out\". Alternatively, if you are using the LOGGING_ENABLED environment variable stream all your logs to our Logs, leave this field blank. See notes and caveats about this procedure. Make sure the newrelic-log-ingestion Lambda function you select in the method above is in the same AWS region as your Lambda function. What's next? After you complete these steps, here's what you can do next: See data reporting in the Lambda monitoring UI. If you're having trouble finding your data, see Lambda enable troubleshooting. Use configuration settings to fine-tune your data. Our newrelic-log-ingestion function is not updated automatically. For best results and access to latest features, we recommend you occasionally update our Lambda monitoring. Optional: Stream all logs to New Relic If you have log management enabled and want to report all your logs to New Relic, follow these instructions: Go to our newrelic-log-ingestion Lambda and set the LOGGING_ENABLED environment variable to true. It isn't possible to edit existing filter patterns, so they must be removed and re-added: Set the Subscription filter pattern to \"\". Go to the Log group for each monitored Lambda, and remove the newrelic-log-ingestion subscription. Add the subscription filter back, leaving the Subscription filter pattern field blank. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 181.45001, + "_score": 138.97357, "_version": null, "_explanation": null, "sort": null, @@ -6814,38 +6831,45 @@ "id": "5f6c67a464441f3a75eb72d3" }, { + "nodeid": 37686, "sections": [ - "New Relic CLI Reference", - "New Relic CLI commands", - "Options", - "Commands" + "AWS Lambda monitoring", + "Get started", + "Enable Lambda monitoring", + "UI and data", + "Troubleshooting", + "Update serverless monitoring for AWS Lambda", + "Update our Lambda integration via CLI", + "Update Layers via CLI", + "Update a manual Serverless Application Repository install", + "Enabling log management", + "For more help" ], - "title": "New Relic CLI Reference", - "type": "developer", - "tags": "new relic cli", - "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", + "title": "Update serverless monitoring for AWS Lambda", + "category_0": "Serverless function monitoring", + "type": "docs", + "category_1": "AWS Lambda monitoring", + "external_id": "9241e43c2db3e0298407449d530fa8fe601c1833", "image": "", - "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", - "published_at": "2020-09-24T02:31:14Z", - "updated_at": "2020-08-14T01:47:12Z", + "url": "https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/update-serverless-monitoring-aws-lambda", + "published_at": "2020-09-24T13:55:00Z", + "updated_at": "2020-09-24T13:54:59Z", + "breadcrumb": "Contents / Serverless function monitoring / AWS Lambda monitoring / Enable Lambda monitoring", "document_type": "page", "popularity": 1, - "info": "The command line tools for performing tasks against New Relic APIs", - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", + "info": "How to update our Serverless monitoring for AWS Lambda. ", + "body": "After enabling our monitoring for AWS Lambda, you should occasionally update our Lambda function that's used to report AWS log data: newrelic-log-ingestion. There are two ways to do this: Update via CLI: Use this if you enabled our Lambda monitoring using our CLI tool. Update via AWS Serverless Application Repository: Use this if you enabled using the manual procedure. These update procedures apply to our serverless monitoring for AWS Lambda, and not to our infrastructure monitoring for AWS Lambda integration. Update our Lambda integration via CLI This section describes how to update if your Lambda monitoring was enabled using our recommended CLI tool. Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following command, replacing YOUR_REGION with your region identifier (for example, us-west-2). newrelic-lambda integrations update \\ --aws-region YOUR_REGION If you do not have our logs enabled, you'll also need to update your AWS CloudWatch log subscription filters with the following command: newrelic-lambda subscriptions install \\ --function installed \\ --aws-region YOUR_REGION Update Layers via CLI This section describes how to update your function's Layer if you installed it with our CLI tool. Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli Pass the --upgrade flag to the install command: newrelic-lambda layers install \\ --function installed \\ --nr-account-id NR_ACCOUNT_ID \\ --upgrade Update a manual Serverless Application Repository install If you manually installed the ingest function from the AWS Serverless Application Repository (and didn't use the CLI), update using this procedure: Run the following, replacing YOUR_REGION with your region (for example, us-west-2)​. aws serverlessrepo create-cloud-formation-change-set \\ --application-id arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion \\ --stack-name NewRelic-log-ingestion \\ --capabilities CAPABILITY_RESOURCE_POLICY \\ --region YOUR_REGION This command outputs several fields, one of which is the ChangeSetId: an ARN for the change set that you just created. Copy that ARN. Use the ARN in this command, which executes the change set: aws cloudformation execute-change-set --change-set-name YOUR_CHANGE_SET_ARN Enabling log management If you currently don't have New Relic's log management enabled, but would like to: Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following command, replacing YOUR_REGION with your region (for example, us-west-2). newrelic-lambda integrations update \\ --enable-logs \\ --aws-region YOUR_REGION Then update your AWS CloudWatch log subscription filters for each region with the following command: newrelic-lambda subscriptions install \\ --function installed \\ --filter-pattern \"\" \\ --aws-region YOUR_REGION 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 141.60191, + "_score": 131.67224, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic CLI Reference", - "sections": "New Relic CLI commands", - "info": "The command line tools for performing tasks against New Relic APIs", - "tags": "new relic cli", - "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" + "sections": "Update our Lambda integration via CLI", + "body": " YOUR_CHANGE_SET_ARN Enabling log management If you currently don't have New Relic's log management enabled, but would like to: Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following" }, - "id": "5efa989ee7b9d2024b7bab97" + "id": "5f6ca534196a67b08750423e" }, { "image": "", @@ -6876,7 +6900,7 @@ "nr1 nerdpack:Info", "Shows the state of your Nerdpack in the New Relic's registry" ], - "published_at": "2020-09-24T02:27:37Z", + "published_at": "2020-09-25T01:51:37Z", "title": "New Relic One CLI Nerdpack commands", "updated_at": "2020-09-17T01:49:55Z", "type": "developer", @@ -6887,7 +6911,7 @@ "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:build Assembles your Nerdpack into bundles 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. nr1 nerdpack:clean Cleans your development folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. Command details nr1 nerdpack:build Builds a Nerdpack Runs a webpack process to assemble your Nerdpack into javascript and CSS bundles. As many other CLI commands, it should be run at the package.json level of your Nerdpack. Usage $ nr1 nerdpack:build OPTION Options --extra-metadata-path=extra-metadata-path Specify a json file path with extra metadata. [default: extra-metadata.json] --prerelease=prerelease If specififed, the value will be appended to the current version of generated files. ie: --prerelease=abc. Then the version will be \"1.2.3-abc\". --profile=profile The authencation profile you want to use. --verbose Adds extra information to the output. 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. nr1 nerdpack:clean Removes all built artifacts Cleans and removes the content and the developtment folders (dist/, tmp/). Usage $ nr1 nerdpack:clean OPTION Options --profile=profile The authentication profile you want to use --verbose Adds extra information to the output. nr1 nerdpack:validate Validates artifacts inside your Nerdpack Validates artifacts inside your Nerdpack. Usage $ nr1 nerdpack:validate OPTION Options -l, --force-local The authentication profile you want to use. -r, --force-remote Force download of new schema files. --profile=profile The authentication profile you want to uset. --verbose Adds extra information to the output. nr1 nerdpack:Info Shows the state of your Nerdpack in the New Relic's registry Shows the state of your Nerdpack in the New Relic's registry. The default amount of versions shown is 10 but all versions can be shown if the --all (or -a) flag is used Usage $ nr1 nerdpack:info OPTION Options -a, --all Show all versions. -i, --nerdpack-id=nerdpack-id Get info from the specified Nerdpack instead of local one. --profile=profile The authentication profile you want to use. --verbose Adds extra information to the output.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 136.68062, + "_score": 130.24953, "_version": null, "_explanation": null, "sort": null, @@ -6900,253 +6924,227 @@ "id": "5f28bd6a64441f9817b11a38" } ], - "/collect-data/query-data-nrql": [ + "/explore-docs/nr1-subscription": [ { - "category_2": "Get started", - "nodeid": 11431, "sections": [ - "NRQL: New Relic Query Language", + "New Relic One CLI reference", + "Installing the New Relic One CLI", + "Tip", + "New Relic One CLI Commands", "Get started", - "NRQL query tools", - "NRQL query tutorials", - "Introduction to NRQL, New Relic's query language", - "What is NRQL?", - "Where can you use NRQL?", - "What data can you query with NRQL?", - "Start using NRQL", - "NRQL query examples", - "NRQL syntax", - "For more help" + "Configure your CLI preferences", + "Set up your Nerdpacks", + "Manage your Nerdpack subscriptions", + "Install and manage plugins", + "Manage catalog information" ], - "title": "Introduction to NRQL, New Relic's query language", - "category_0": "Query your data", - "type": "docs", - "category_1": "NRQL: New Relic Query Language", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", - "external_id": "d44be2c7df7addda8679b4c842015223cfcbd1a3", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-view-chart-nrql-query_0.png", - "url": "https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", - "published_at": "2020-09-24T08:40:21Z", - "updated_at": "2020-09-24T08:40:20Z", - "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started", + "title": "New Relic One CLI reference", + "type": "developer", + "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-09-25T01:49:59Z", + "updated_at": "2020-09-17T01:51:10Z", "document_type": "page", "popularity": 1, - "info": "An introduction to New Relic Query Language (NRQL) and how to use it.", - "body": "One way to query your New Relic data is with the New Relic Query Language (NRQL). This resource explains what NRQL is, when and how you can use it, and basic syntax rules. For more detailed information on querying, including a listing of clauses and functions and example queries, see NRQL syntax, clauses, and functions. What is NRQL? NRQL is New Relic's SQL-like query language. You can use NRQL to retrieve detailed New Relic data and get insight into your applications, hosts, and business-important activity. Reasons to use NRQL include: To answer a question for the purpose of troubleshooting or business analysis To create a new chart To make API queries of New Relic data (for example, using our NerdGraph API) NRQL is used behind the scenes to generate some New Relic charts: Some New Relic charts are built using NRQL. One way to start using NRQL is to view a chart's query and then edit it to make your own custom chart. Where can you use NRQL? You can use NRQL in these places: New Relic One query builder: Advanced mode is a NRQL query interface Basic mode provides a simplified query experience that doesn't require knowledge of NRQL but that uses NRQL to generate results New Relic Insights NerdGraph: our GraphQL-format API, which includes options for making NRQL queries one.newrelic.com > Query your data: You can run a NRQL query in both New Relic One and New Relic Insights. This NRQL query shows a count of distributed tracing spans faceted by their entity names. NRQL is one of several ways to query New Relic data. For more on all query options, see Query your data. What data can you query with NRQL? NRQL allows you to query these New Relic data types: Event data from all New Relic products, including: APM events, like Transaction New Relic Browser events, like PageView New Relic Mobile events, like Mobile Infrastructure events, like ProcessSample Synthetics events, like SyntheticCheck Custom events, like those reported by the Event API Metric timeslice data (metrics reported by New Relic APM, Browser, and Mobile) The Metric data type (metrics reported by the Metric API and data sources that use that API) The Span data type (distributed tracing data) The Log data type (data from New Relic Logs) Some data, like relationships between monitored entities, is not available via NRQL but is available using our NerdGraph API. Start using NRQL One way to start using NRQL and to understand what data you have available is to go to a NRQL interface (for example, the New Relic One query builder), type FROM, and press space. The interface will suggest available types of data: To see the attributes available for a specific data type, type FROM DATA_TYPE SELECT and press space. The interface will suggest available attributes. For example: To see the complete JSON associated with a data type, including all of its attributes, use the keyset() attribute. For example: FROM Transaction SELECT keyset() NRQL is used behind the scenes to build some New Relic charts and dashboards. One way to learn NRQL is to find one of these NRQL-generated charts and start playing with the NRQL to create new, customized queries and charts: Charts built with NRQL will have View query as an option. You can then edit and customize that query to see how your changes affect the resulting visualization. To explore your data without having to use NRQL, use the basic mode of New Relic One query builder. NRQL query examples Here's an example NRQL query of Transaction data, which is reported by New Relic APM. FROM Transaction SELECT average(duration) FACET appName TIMESERIES auto This would generate a chart that looks like: Here are some more query examples: Basic NRQL query of Browser data Here's a NRQL query of PageView data, which is reported by New Relic Browser. SELECT uniqueCount(user) FROM PageView WHERE userAgentOS = 'Mac' FACET countryCode SINCE 1 day ago LIMIT 20 Attribute name with a space in it If a custom attribute name has a space in it, use backticks around the attribute name: SELECT count(*) FROM Transaction FACET `Logged-in user` Querying multiple data sources To return data from two data sources, separate their data types with a comma. For example, this query returns a count of all APM transactions and Browser events over the last three days:​ SELECT count(*) FROM Transaction, PageView SINCE 3 days ago Query returning multiple columns To return multiple columns from a dataset, separate the aggregator arguments with a comma: SELECT function(attribute), function(attribute) ... FROM ... This query returns the minimum, average, and maximum duration for New Relic Browser PageView events over the last week: SELECT min(duration), max(duration), average(duration) FROM PageView SINCE 1 week ago See more NRQL query examples. NRQL syntax The syntax of a NRQL query is similar to standard SQL queries. Here is a breakdown of the structure of a NRQL query: SELECT function(attribute) [AS 'label'][, ...] FROM data type [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] Basic rules include: NRQL condition Details Required values The SELECT statement and FROM clause are required. All other clauses are optional. You can start your query with either SELECT or FROM. Query string size The query string must be less than 4 KB. Case sensitivity The data type names and attribute names are case sensitive. NRQL clauses and functions are not case sensitive. Syntax for strings NRQL uses single quotes to designate strings. For example: ... where traceId = '030a573f0df02c57' Attribute names with spaces Use backticks `` to quote a custom attribute name that has a space in it. For example: ... FACET `Logged-in user` Data type coercion Insights does not support data type \"coercion.\" For more information, see Data type conversion. Use of math functions Basic and advanced math functions are supported in the SELECT statement. JOIN functions NRQL does not have the equivalent of the SQL JOIN function, but you can simulate a JOIN with custom attributes. Read more about NRQL syntax and functions. 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.", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. 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. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 200.41708, + "_score": 304.64825, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Introduction to NRQL, New Relic's query language", - "sections": "What data can you query with NRQL?", - "info": "An introduction to New Relic Query Language (NRQL) and how to use it.", - "category_0": "Query your data", - "category_1": "NRQL: New Relic Query Language", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language", - "body": "One way to query your New Relic data is with the New Relic Query Language (NRQL). This resource explains what NRQL is, when and how you can use it, and basic syntax rules. For more detailed information on querying, including a listing of clauses and functions and example queries, see NRQL syntax", - "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started" + "title": "New Relic One CLI reference", + "sections": "New Relic One CLI Commands", + "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.", + "tags": "New Relic One app", + "body": " extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions" }, - "id": "5f2abd47196a67747343fbe1" + "id": "5efa989e28ccbc535a307dd0" }, { - "category_2": "Custom events", - "nodeid": 13661, + "nodeid": 37686, "sections": [ - "Event data sources", - "Default events", - "Custom events", - "Data requirements and limits for custom event data", - "General requirements", - "Reserved words", - "Additional Browser PageAction requirements", - "Additional Event API requirements", - "Event type limits", + "AWS Lambda monitoring", + "Get started", + "Enable Lambda monitoring", + "UI and data", + "Troubleshooting", + "Update serverless monitoring for AWS Lambda", + "Update our Lambda integration via CLI", + "Update Layers via CLI", + "Update a manual Serverless Application Repository install", + "Enabling log management", "For more help" ], - "title": "Data requirements and limits for custom event data", - "category_0": "Insights", + "title": "Update serverless monitoring for AWS Lambda", + "category_0": "Serverless function monitoring", "type": "docs", - "category_1": "Event data sources", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", - "external_id": "f5beef0d09bb5918be3f8a1a3ece98c09947cd1e", + "category_1": "AWS Lambda monitoring", + "external_id": "9241e43c2db3e0298407449d530fa8fe601c1833", "image": "", - "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", - "published_at": "2020-09-24T07:25:32Z", - "updated_at": "2020-09-20T19:39:10Z", - "breadcrumb": "Contents / Insights / Event data sources / Custom events", + "url": "https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/update-serverless-monitoring-aws-lambda", + "published_at": "2020-09-24T13:55:00Z", + "updated_at": "2020-09-24T13:54:59Z", + "breadcrumb": "Contents / Serverless function monitoring / AWS Lambda monitoring / Enable Lambda monitoring", "document_type": "page", - "popularity": 1, - "info": "For New Relic, general limits and requirements for reporting custom events and attributes. ", - "body": "You can report custom events to New Relic in several ways, including the New Relic Event API, APM agent APIs, Browser agent APIs, and the Mobile SDK. This document contains general requirements and rules for inserting and using custom events and their associated attributes. Additional requirements may apply based on the method you use. General requirements How long custom data is retained depends on your Insights subscription and its associated data retention. When reporting custom events and attributes, follow these general requirements for supported data types, naming syntax, and size: Requirement Description Payload Total maximum size or length: 1 MB maximum per POST. We highly recommend using compression. The Event API has additional HTTP rate limits. Attribute data types Attribute values can be either a string or a numeric integer or float. If your attribute values contain date information, define it as an unformatted Unix timestamp (in seconds or milliseconds) by using the Insights data formatter. Attribute size Maximum name size: 255 bytes. Maximum attribute value size: Custom attributes sent by the agent: 255 bytes Attributes attached to custom events sent using the Event API: 4096 characters Charts may only display the first 255 characters of attribute values. For complete attribute values, use the JSON chart type or Query API. Maximum total attributes per event: 254. Exception: If you use an APM agent API, the max is 64. Maximum total attributes per event type: 48,000. Naming syntax Attribute names can be a combination of alphanumeric characters, colons (:), periods (.), and underscores (_). Event types (using the eventType attribute) can be a combination of alphanumeric characters, colons (:), and underscores (_). Do not use words reserved for use by NRQL. Null values The database does not store any data with a null value. Reserved words Avoid using the following reserved words as names for events and attributes. Otherwise, unexpected results may occur. This is not a complete list. In general, it's a good practice to avoid using MySQL-reserved words to avoid collision with future New Relic functionality. Keyword Description accountId This is a reserved attribute name. If it's included, it will be dropped during ingest. appId Value must be an integer. If it is not an integer, the attribute name and value will be dropped during ingest. eventType The event type as stored in New Relic. New Relic agents and scripts normally report this as eventType. Can be a combination of alphanumeric characters, colons (:), and underscores (_). Be sure to review the prohibited eventType values and eventType limits. Prohibited eventType values For your eventType value, avoid using: Metric, MetricRaw, and strings prefixed with Metric[0-9] (such as Metric2 or Metric1Minute). Public_ and strings prefixed with Public_. These event types are reserved for use by New Relic. Events passed in with these eventType values will be dropped. timestamp Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds. It must be +/-1 day (24 hours) of the current time on the server. Log forwarding terms The following keys are reserved by the Infrastructure agent's log forwarding feature: entity.guid, log, hostname, plugin.type, fb.input. If used, they are dropped during ingest and a warning is added to the logs. NRQL syntax terms If you need to use NRQL syntax terms as attribute names, including dotted attributes, they must be enclosed in backticks; for example, `LIMIT` or `consumer.offset`. Otherwise, avoid using these reserved words: ago, and, as, auto, begin, begintime, compare, day, days, end, endtime, explain, facet, from, hour, hours, in, is, like, limit, minute, minutes, month, months, not, null, offset, or, raw, second, seconds, select, since, timeseries, until, week, weeks, where, with Additional Browser PageAction requirements For additional requirements for using New Relic Browser's custom PageAction event, see Insert custom data via New Relic Browser agent. Additional Event API requirements For more requirements and details for the Event API, see Event API. Event type limits The current limit for total number of eventType values is 250 per sub-account in a given 24-hour time period. If a user exceeds this limit, New Relic may filter or drop data. Event types include: Default events from New Relic agents Custom events from New Relic agents Custom events from Insights custom event inserter 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.", + "popularity": 1, + "info": "How to update our Serverless monitoring for AWS Lambda. ", + "body": "After enabling our monitoring for AWS Lambda, you should occasionally update our Lambda function that's used to report AWS log data: newrelic-log-ingestion. There are two ways to do this: Update via CLI: Use this if you enabled our Lambda monitoring using our CLI tool. Update via AWS Serverless Application Repository: Use this if you enabled using the manual procedure. These update procedures apply to our serverless monitoring for AWS Lambda, and not to our infrastructure monitoring for AWS Lambda integration. Update our Lambda integration via CLI This section describes how to update if your Lambda monitoring was enabled using our recommended CLI tool. Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following command, replacing YOUR_REGION with your region identifier (for example, us-west-2). newrelic-lambda integrations update \\ --aws-region YOUR_REGION If you do not have our logs enabled, you'll also need to update your AWS CloudWatch log subscription filters with the following command: newrelic-lambda subscriptions install \\ --function installed \\ --aws-region YOUR_REGION Update Layers via CLI This section describes how to update your function's Layer if you installed it with our CLI tool. Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli Pass the --upgrade flag to the install command: newrelic-lambda layers install \\ --function installed \\ --nr-account-id NR_ACCOUNT_ID \\ --upgrade Update a manual Serverless Application Repository install If you manually installed the ingest function from the AWS Serverless Application Repository (and didn't use the CLI), update using this procedure: Run the following, replacing YOUR_REGION with your region (for example, us-west-2)​. aws serverlessrepo create-cloud-formation-change-set \\ --application-id arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion \\ --stack-name NewRelic-log-ingestion \\ --capabilities CAPABILITY_RESOURCE_POLICY \\ --region YOUR_REGION This command outputs several fields, one of which is the ChangeSetId: an ARN for the change set that you just created. Copy that ARN. Use the ARN in this command, which executes the change set: aws cloudformation execute-change-set --change-set-name YOUR_CHANGE_SET_ARN Enabling log management If you currently don't have New Relic's log management enabled, but would like to: Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following command, replacing YOUR_REGION with your region (for example, us-west-2). newrelic-lambda integrations update \\ --enable-logs \\ --aws-region YOUR_REGION Then update your AWS CloudWatch log subscription filters for each region with the following command: newrelic-lambda subscriptions install \\ --function installed \\ --filter-pattern \"\" \\ --aws-region YOUR_REGION 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 141.56723, + "_score": 201.32156, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Data requirements and limits for custom event data", - "sections": "Event data sources", - "category_1": "Event data sources", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits", - "body": " may apply based on the method you use. General requirements How long custom data is retained depends on your Insights subscription and its associated data retention. When reporting custom events and attributes, follow these general requirements for supported data types, naming syntax, and size", - "breadcrumb": "Contents / Insights / Event data sources / Custom events" + "sections": "Update our Lambda integration via CLI", + "body": " YOUR_CHANGE_SET_ARN Enabling log management If you currently don't have New Relic's log management enabled, but would like to: Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following" }, - "id": "59f4354f4bb81c2ea8b80d0a" + "id": "5f6ca534196a67b08750423e" }, { - "category_2": "Alert conditions", - "nodeid": 9231, + "nodeid": 27692, "sections": [ - "New Relic Alerts", + "AWS Lambda monitoring", "Get started", - "Alert policies", - "Alert conditions", - "Alert violations", - "Alert Incidents", - "Alert notifications", + "Enable Lambda monitoring", + "UI and data", "Troubleshooting", - "Rules, limits, and glossary", - "Alerts and Nerdgraph", - "REST API alerts", - "Create NRQL alert conditions", - "Create NRQL alert condition", - "Alert threshold types", - "NRQL alert syntax", - "Sum of query results (limited or intermittent data)", - "Offset the query time window", - "NRQL alert threshold examples", - "Create a description", + "Enable serverless monitoring for AWS Lambda", + "How Lambda monitoring works", + "Enable procedure overview", + "Step 1. Install the newrelic-lambda-cli tool", + "CLI requirements", + "CLI installation", + "Step 2. Connect AWS to New Relic", + "Use CLI tool", + "Manual procedures", + "Step 3. Enable Lambda instrumentation", + "Step 4. Configure CloudWatch logs to stream to New Relic Lambda", + "What's next?", + "Optional: Stream all logs to New Relic", "For more help" ], - "title": "Create NRQL alert conditions", - "category_0": "Alerts and Applied intelligence", + "title": "Enable serverless monitoring for AWS Lambda", + "category_0": "Serverless function monitoring", "type": "docs", - "category_1": "New Relic Alerts", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions", - "external_id": "956a7a0b84d2afac5e6236df3143085ebc4f7459", - "image": "", - "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions", - "published_at": "2020-09-24T23:57:53Z", - "updated_at": "2020-09-03T23:54:56Z", - "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert conditions", + "category_1": "AWS Lambda monitoring", + "translation_ja_url": "https://docs.newrelic.co.jp/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/enable-serverless-monitoring-aws-lambda", + "external_id": "7992b896d4c35ca29aba34698aedd621dfe0b572", + "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-lambda-monitoring-architecture.png", + "url": "https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/enable-serverless-monitoring-aws-lambda", + "published_at": "2020-09-24T09:32:20Z", + "updated_at": "2020-09-24T09:32:20Z", + "breadcrumb": "Contents / Serverless function monitoring / AWS Lambda monitoring / Enable Lambda monitoring", "document_type": "page", "popularity": 1, - "info": "How to define thresholds that trigger alert notifications based on your NRQL queries.", - "body": "You can create alert conditions using NRQL queries. Create NRQL alert condition To create a NRQL alert condition: When you start to create a condition, where it prompts you to Select a product, click NRQL. Tips for creating and using a NRQL condition: Topic Tips Condition types NRQL condition types include static, baseline, and outlier. Create a description For some condition types, you can create a Description. Query results Queries must return a number. The condition works by evaluating that returned number against the thresholds you set. Time period As with all alert conditions, NRQL conditions evaluate one single minute at a time. The implicit SINCE ... UNTIL clause specifying which minute to evaluate is controlled by your Evaluation offset setting. Since very recent data may be incomplete, you may want to query data from 3 minutes ago or longer, especially for: Applications that run on multiple hosts. SyntheticCheck data: Timeouts can take 3 minutes, so 5 minutes or more is recommended. Also, if a query will generate intermittent data, consider using the sum of query results option. Condition settings Use the Condition settings to: Configure whether and how open violations are force-closed. Adjust the evaluation offset. Create a concise and descriptive condition name. (NerdGraph API Only) Provide a text description for the condition that will be included in violations and notifications. Troubleshooting procedures Optional: To include your organization's procedures for handling the incident, add the runbook URL to the condition. Limits on conditions See the maximum values. Health status NRQL alert conditions do not affect an entity's health status display. Examples For more information, see: Expected NRQL syntax Examples of NRQL condition queries Alert threshold types When you create a NRQL alert, you can choose from different types of thresholds: NRQL alert threshold types Description Static This is the simplest type of NRQL threshold. It allows you to create a condition based on a NRQL query that returns a numeric value. Optional: Include a FACET clause. Baseline Uses a self-adjusting condition based on the past behavior of the monitored values. Uses the same NRQL query form as the static type, except you cannot use a FACET clause. Outlier Looks for group behavior and values that are outliers from those groups. Uses the same NRQL query form as the static type, but requires a FACET clause. NRQL alert syntax Here is the basic syntax for creating all NRQL alert conditions. Depending on the threshold type, also include a FACET clause as applicable. SELECT function(attribute) FROM Event WHERE attribute [comparison] [AND|OR ...] Clause Notes SELECT function(attribute) Required Supported functions that return numbers include: apdex average count latest max min percentage percentile sum uniqueCount If you use the percentile aggregator in a faceted alert condition with many facets, this may cause the following error to appear: An error occurred while fetching chart data. If you see this error, use average instead. FROM data type Required Only one data type can be targeted. Supported data types: Event Metric (RAW data points will be returned) WHERE attribute [comparison] [AND|OR ...] Optional Use the WHERE clause to specify a series of one or more conditions. All the operators are supported. FACET attribute Static: Optional Baseline: Not allowed Outlier: Required Including a FACET clause in your NRQL syntax depends on the threshold type: static, baseline, or outlier. Use the FACET clause to separate your results by attribute and alert on each attribute independently. Faceted queries can return a maximum of 5000 values for static conditions and a maximum of 500 values for outlier conditions. If the query returns more than this number of values, the alert condition cannot be created. If you create the condition and the query returns more than this number later, the alert will fail. Sum of query results (limited or intermittent data) Available only for static (basic) threshold types. If a query returns intermittent or limited data, it may be difficult to set a meaningful threshold. Missing or limited data will sometimes generate false positives or false negatives. To avoid this problem when using the static threshold type, you can set the selector to sum of query results. This lets you set the alert on an aggregated sum instead of a value from a single harvest cycle. Up to two hours of the one-minute data checks can be aggregated. The duration you select determines the width of the rolling sum, and the preview chart will update accordingly. Offset the query time window Every minute, we evaluate the NRQL query in one-minute time windows. The start time depends on the value you select in the NRQL condition's Advanced settings > Evaluation offset. Example: Using the default time window to evaluate violations With the Evaluation offset at the default setting of three minutes, the NRQL time window applied to your query will be: SINCE 3 minutes ago UNTIL 2 minutes ago If the event type is sourced from an APM language agent and aggregated from many app instances (for example, Transactions, TransactionErrors, etc.), we recommend evaluating data from three minutes ago or longer. An offset of less than 3 minutes will trigger violations sooner, but you might see more false positives and negatives due to data latency. For cloud data, such as AWS integrations, you may need an offset longer than 3 minutes. Check our AWS polling intervals documentation to determine your best setting. NRQL alert threshold examples Here are some common use cases for NRQL alert conditions. These queries will work for static and baseline threshold types. The outlier threshold type will require additional FACET clauses. Alert on specific segments of your data Create constrained alerts that target a specific segment of your data, such as a few key customers or a range of data. Use the WHERE clause to define those conditions. SELECT average(duration) FROM Transaction WHERE account_id in (91290, 102021, 20230) SELECT percentile(duration, 95) FROM Transaction WHERE name LIKE 'Controller/checkout/%' Alert on Nth percentile of your data Create alerts when an Nth percentile of your data hits a specified threshold; for example, maintaining SLA service levels. Since we evaluate the NRQL query in one-minute time windows, percentiles will be calculated for each minute separately. SELECT percentile(duration, 95) FROM Transaction SELECT percentile(databaseDuration, 75) FROM Transaction Alert on max, min, avg of your data Create alerts when your data hits a certain maximum, minimum, or average; for example, ensuring that a duration or response time does not pass a certain threshold. SELECT max(duration) FROM Transaction SELECT average(duration) FROM Transaction Alert on a percentage of your data Create alerts when a proportion of your data goes above or below a certain threshold. SELECT percentage(count(*), WHERE duration > 2) FROM Transaction SELECT percentage(count(*), WHERE httpResponseCode = '500') FROM Transaction Alert on Apdex with any T-value Create alerts on Apdex, applying your own T-value for certain transactions. For example, get an alert notification when your Apdex for a T-value of 500ms on transactions for production apps goes below 0.8. SELECT apdex(duration, t:0.5) FROM Transaction WHERE appName like '%prod%' Create a description You can define a description that passes useful information downstream for better violation responses or for use by downstream systems. For details, see Description. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "info": "Read about how to install and enable New Relic monitoring for Amazon AWS Lambda. ", + "body": "Serverless monitoring for AWS Lambda offers in-depth performance monitoring for your Lambda functions. Read on to learn how to enable this feature and get started using it. Using this feature may result in AWS charges. For more information, see the Lambda monitoring requirements.​​​ How Lambda monitoring works Before enabling Lambda monitoring, understanding how data flows from your Lambda functions to New Relic may be helpful: Diagram showing how data flows from a Lambda function to New Relic. When our Lambda monitoring is enabled, this is how data moves from your Lambda function to New Relic: The Lambda function is instrumented with our code. When the Lambda is invoked, log data is sent to CloudWatch. CloudWatch collects Lambda log data and sends it to our log-ingestion Lambda. The log-ingestion Lambda sends that data to New Relic. Enable procedure overview If you already have a New Relic account and use Node.js or Python, we recommend you use our automated installer. If you do not use the automated installer, complete these steps to set up monitoring: Install our CLI tool (recommended) Connect AWS and New Relic (required) Enable instrumentation of your Lambda (required) Stream CloudWatch logs to New Relic (required) Step 1. Install the newrelic-lambda-cli tool We provide a command line interface (CLI) tool that's used in steps 2 through 4. We recommend the CLI because it simplifies some of the work, but you can also perform those steps manually. If you want to understand what it does before you install it, see the manual procedures that the CLI tool performs in Step 2, Step 3 (option 2), and Step 4. You can also see the CLI documentation on GitHub. If you prefer a manual install, skip to Step 2. Connect AWS to New Relic. CLI requirements To use the CLI too, you need: Python 3.3 or higher The AWS CLI You must be a user or admin with an infrastructure manager Add-on role. Your AWS account needs permissions for creating IAM resources (Role and Policy) and Lambda functions. These resources are created using CloudFormation stacks, so you'll need permissions to create those. For more on permissions, including setting custom policies, expand this collapser: AWS permissions details Resource: * Actions: \"cloudformation:CreateChangeSet\", \"cloudformation:CreateStack\", \"cloudformation:DescribeStacks\", \"cloudformation:ExecuteChangeSets\", \"iam:AttachRolePolicy\", \"iam:CreateRole\", \"iam:GetRole\", \"iam:PassRole\", \"lambda:AddPermission\", \"lambda:CreateFunction\", \"lambda:GetFunction\", \"logs:DeleteSubscriptionFilter\", \"logs:DescribeSubscriptionFilters\", \"logs:PutSubscriptionFilter\" \"s3:GetObject\" \"serverlessrepo:CreateCloudFormationChangeSet\" Resource: \"arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion\" Actions: \"serverlessrepo:CreateCloudFormationTemplate\" \"serverlessrepo:GetCloudFormationTemplate\" Be sure that the AWS account you use to execute the CLI has all of these permissions. If your AWS account permissions are restrictive and you're unable to use the CLI, you can optionally use a manually managed custom IAM policy. This policy would require, at minimum, the following permissions: Resource: \"*\" Action: \"cloudwatch:GetMetricStatistics\" \"cloudwatch:ListMetrics\" \"cloudwatch:GetMetricData\" \"lambda:GetAccountSettings\" \"lambda:ListFunctions\" \"lambda:ListAliases\" \"lambda:ListTags\" \"lambda:ListEventSourceMappings\" These permissions are the minimum required. We recommend granting a managed ReadOnlyAccess policy as described in Connect AWS to infrastructure monitoring. CLI installation To install the CLI tool: Ensure you have the required permissions for both your New Relic and AWS account. From the command line, run: pip install newrelic-lambda-cli You may need to use pip3 in the command above if you have Python 2.7 installed. The CLI requires Python >=3.3. Step 2. Connect AWS to New Relic You must complete this step, and steps 3 and 4, to enable our Lambda monitoring. This step connects AWS to New Relic and creates a newrelic-log-ingestion Lambda function that sends your instrumented data to New Relic. You can either use the CLI tool or do the steps manually. Use CLI tool When you use the CLI, you have one optional step and one required step: Optional: If you're using multiple AWS profiles or multiple regions, you may want to configure the AWS environment variables: AWS environment variable instructions Setting the region To configure your region, use this environment variable to override the default region: export AWS_DEFAULT_REGION=MY_REGION # us-west-2, for example The CLI tool also allows passing this per-command using --aws-region. Setting profiles If you have multiple AWS profiles and don't want to use the default, use AWS_PROFILE environment variable to set another profile name. Ensure the profile is properly configured (including the default region). Example: export AWS_PROFILE=MY_PROFILE Run the following command using the CLI tool: newrelic-lambda integrations install --nr-account-id YOUR_ACCOUNT_ID \\ --linked-account-name YOUR_LINKED_ACCOUNT_NAME \\ --nr-api-key YOUR_NR_API_KEY This command: Connects your AWS account to New Relic. Installs a newrelic-log-ingestion Lambda that will send your instrumented data to New Relic. More details: This defaults to U.S. region. If your account is in the EU region, add this argument: --nr-region \"eu\". If you're instrumenting functions in multiple AWS regions, this command must be run for each region using the --aws-region argument. YOUR_LINKED_ACCOUNT_NAME is either a new AWS account you want to link to New Relic, or it's the name of the AWS account that you linked to when setting up the AWS Lambda monitoring integration. YOUR_NR_API_KEY refers to your personal API key (not your REST API key). For more on the API key and other arguments, see our Lambda monitoring GitHub repo. Manual procedures Here are the manual procedures performed by the CLI tool: Connect AWS to New Relic The newrelic-lambda integration command connects the AWS account containing your Lambdas to New Relic. If you've already installed one of our AWS integrations, your accounts should be linked to New Relic and you can skip this section. To manually establish this connection, follow the instructions for connecting AWS to Infrastructure monitoring. Configure our log-ingestion Lambda The newrelic-lambda integration command sets up a newrelic-log-ingestion Lambda. This Lambda takes the logs generated by your Lambda functions and pushes those logs to New Relic. If you're configuring this manually, you must configure our Lambda for the regions you want. The CLI, by default, establishes our Lambda in all regions. To manually configure our Lambda, go to the AWS Serverless Application Repository, which is where the newrelic-log-ingestion Lambda is stored. This repo is a collection of serverless applications published by developers, companies, and partners in the serverless community. It allows developers to share their Lambda functions code with customers, who can then find and deploy the corresponding application Lambda function. Each application is packaged with an AWS Serverless Application Model (SAM) template that defines the AWS resources used. To manually configure our Lambda with the AWS Serverless Application Repository: From the AWS console, go to the Lambda section, select Create function, and select Serverless Application Repository. Search for newrelic and find the newrelic-log-ingestion Lambda. Follow the instructions in the Lambda's documentation to deploy it. A SAM template will build the Lambda. In the environment variable section in AWS console, set the LICENSE_KEY environment variable to your New Relic license key. Note: If you have multiple accounts or a master and sub-account hierarchy, make sure the license key you're using matches the same account connected to AWS. Optional: If you want to stream all your logs to New Relic, set the LOGGING_ENABLED environment variable to true. For more on this, see Stream all logs. Step 3. Enable Lambda instrumentation This step enables instrumentation of your Lambda function, which allows detailed monitoring and alerting functionality. Our instrumentation is designed to have minimal impact on your Lambda performance. If you're using Node.js or Python, we recommend the first two options. Option #1: Use Serverless Framework plugin (Node.js and Python) Requirements Available only for Node.js and Python. For other languages, see Manual instrumentation. Serverless Framework version 1.34.0 or higher. Features If you meet the requirements (above), you can use our Serverless Framework plugin, which allows you to add our AWS Lambda Layer to your functions without requiring a code change. Supports Node.js and Python runtimes No code change required to enable Lambda instrumentation Enables our APM agent functionality using a single layer Configures CloudWatch subscription filters automatically Gets the layer into your code base which is useful for redeploys Install To install our Serverless Framework plugin: Choose an install option: NPM: npm install --save-dev serverless-newrelic-lambda-layers yarn: yarn add --dev serverless-newrelic-lambda-layers Add the plugin to your serverless.yml: plugins: - serverless-newrelic-lambda-layers Get your account ID and put it in the serverless.yml: custom: newRelic: accountId: YOUR_ACCOUNT_ID Deploy it: sls deploy You can skip Step 4. Setting up CloudWatch Logs. This is automatically completed on deploy by our Serverless Framework plugin. For the next step, go to What's next? Option #2: Add Lambda Layer with our CLI (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework and don't intend to redeploy your function frequently, you can use the CLI to add our Lambda Layer: If you haven't already done so, install the CLI: pip install newrelic-lambda-cli List available functions: newrelic-lambda functions list Pass the option -f not-installed to see which functions have not yet been instrumented. Add the layer to your function: newrelic-lambda layers install --function FUNCTION_NAME --nr-account-id NEW_RELIC_ACCOUNT_ID Next, you will configure CloudWatch to send logs to New Relic. Option #3: Manually add our Lambda Layer (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework, you can manually add our Lambda Layer: Find the layer that matches your runtime and region. Copy the Amazon Resource Name (ARN) of the most recent version and add it in the AWS Lambda console for your function. Update your functions handler to point to the newly attached layer in the console for your function: Python: newrelic_lambda_wrapper.handler Node: newrelic-lambda-wrapper.handler Add these environment variables to your Lambda console: NEW_RELIC_ACCOUNT_ID: Your account ID NEW_RELIC_LAMBDA_HANDLER: Path to your initial handler. If you have Node 8 and get a Lambda can't find file error message, expand this collapser: Node 8 \"can't find file\" error troubleshooting If you have Node 8 and receive a Lambda can't find the file newrelic-lambda-wrapper.js message, it's likely that the Node runtime isn't resolving NPM_PATH for the newrelic-lambda module in /opt/nodejs/node_modules. These steps should fix this problem: Create a newrelic-wrapper-helper.js script in your project's root. The script's contents should be module.exports = require('newrelic-lambda-wrapper');. (That is all that needs to be in that script.) Update the handler for your layer declaration to newrelic-lambda-wrapper.handler. Next, you will configure CloudWatch to send logs to New Relic. Option #4: Manually instrument Lambda code for Go, Java, .NET Core, Node.js, and Python If none of the previous options work for you, you can manually instrument your Lambda code. Choose your language: Go To instrument your Go-language Lambda: Download our Go agent package and place it in the same directory as your function. Install the agent: go get -u github.com/newrelic/go-agent. In your Lambda code, import our components, create an application, and update how you start your Lambda. See our GitHub repo for an example of an instrumented Lambda. Optional: Add custom events that will be associated with your Lambda invocation by using the RecordCustomEvent API. For example: func handler(ctx context.Context) { if txn := newrelic.FromContext(ctx); nil != txn { txn.Application().RecordCustomEvent(\"MyEvent\", map[string]interface{}{ \"zip\": \"zap\", }) } fmt.Println(\"hello world!\") } Build and zip your Lambda function and upload it to AWS. Zip and upload recommendations Here are suggestions for zipping and uploading the Lambda: Build the binary for execution on Linux. This produces a binary file called main. You can use: $ GOOS=linux go build -o main Zip the binary into a deployment package using: $ zip deployment.zip main Upload the zip file to AWS using either the AWS Lambda console or the AWS CLI. Name the handler main (to match the name given during the binary build). The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this is the account ID for the root/parent account. Optional: To configure logging, see Go agent logging. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Java Monitoring for AWS Lambda in Java doesn't use our APM Java agent. Instead, it uses these two OpenTracing dependencies: AWS Lambda OpenTracing Java SDK: OpenTracing instrumentation for AWS Lambda RequestHandler and RequestStreamHandler. Our AWS Lambda OpenTracing Tracer: An OpenTracing Tracer implementation designed to monitor AWS Lambda. It generates spans, error events, transaction events, error traces, and provides distributed tracing support. Supported OpenTracing Versions OpenTracing 0.31.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:1.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:1.0.0 OpenTracing 0.32.0, 0.33.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:2.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:2.1.0 To instrument your Java Lambda: In your project’s build.gradle file, include our OpenTracing AWS Lambda Tracer and the AWS Lambda OpenTracing SDK dependencies: dependencies { compile(\"com.newrelic.opentracing:java-aws-lambda:2.1.0\") compile(\"com.newrelic.opentracing:newrelic-java-lambda:2.1.1\") compile(\"io.opentracing:opentracing-util:0.33.0\") } Implement the AWS Lambda RequestHandler interface as shown in the Java Lambda example and override the doHandleRequest method. In the doHandleRequest method, call the LambdaTracing.instrument(...) API to create a root span to trace the lambda function's execution. This is also where you will define your business logic for the lambda function. Register a LambdaTracer.INSTANCE as the OpenTracing Global tracer, as shown in the Java Lambda example. Create a ZIP deployment package and upload it to AWS Lambda. Or deploy it via other means. In the AWS Lambda console, set the handler. For the example Java Lambda, the handler would be com.handler.example.MyLambdaHandler::handleRequest. Because handleRequest is assumed, you could also use com.handler.example.MyLambdaHandler. The following AWS console environment variables are required if you want your Lambda function to be included in distributed tracing. This is recommended. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_PRIMARY_APPLICATION_ID. This is also your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this must be the account ID for the root/parent account. Optional: In the Lambda console, enable debug logging by adding this environment variable: NEW_RELIC_DEBUG is true. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Please see the AWS Lambda distributed tracing example for a complete project that illustrates common use cases such as: Distributed tracing between Lambda functions Manual span creation (aka custom instrumentation) Tracing external calls Adding custom attributes (aka Tags) to spans .NET Core Our monitoring of .NET Core-based AWS Lambda functions doesn't use our standard .NET Core APM agent. Instead, it uses a NuGet package. To instrument your .NET Core Lambda: In your Lambda Functions project, install the NewRelic.OpenTracing.AmazonLambda.Tracer NuGet package. Import the NuGet package and OpenTracing utils: using OpenTracing.Util; using NewRelic.OpenTracing.AmazonLambda; Instrument your function, as shown in this example: public class Function { static Function() { // Register The NewRelic Lambda Tracer Instance GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public object FunctionWrapper(ILambdaContext context) { // Instantiate NewRelic TracingWrapper and pass your FunctionHandler as // an argument return new TracingRequestHandler().LambdaWrapper(FunctionHandler, context); } /// /// A simple function that takes a string and does a ToUpper /// /// /// /// public object FunctionHandler(ILambdaContext context) { ... } } The arguments passed to FunctionWrapper must match the signature of FunctionHandler. If your handler function returns a Task, the Lambda wrapper will block on the return task until it completes, so that it can measure the duration and capture exceptions, if any are present. In addition, you may also inherit from the APIGatewayProxyFunction. For an example, see below: Async handler function public override Task FunctionHandlerAsync(ILambdaContext lambdaContext) { // This call will block by calling task.Result Task task = new TracingRequestHandler().LambdaWrapper( ActualFunctionHandlerAsync, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(ILambdaContext lambdaContext) { // Function can make other async operations here ... } Inheriting from APIGatewayProxyFunction public class LambdaFunction : APIGatewayProxyFunction { static LambdaFunction() { // Register The NewRelic Lambda Tracer Instance OpenTracing.Util.GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public override Task FunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { Task task = new TracingRequestHandler().LambdaWrapper(ActualFunctionHandlerAsync, request, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { return base.FunctionHandlerAsync(request, lambdaContext); } } Optional for SQS and SNS: Starting in version 1.0 of our .NET Lambda Tracer, distributed tracing support has been added for SQS and SNS. To enable distributed tracing for SQS or SNS you will need to complete the items in this step as well as setup the environment variables in the step that follows this one. Enabling distributed tracing support for SQS and SNS will disable automatic instrumentation for both of SQS and SNS and require the use of these wrappers to instrument them. Set the NEW_RELIC_USE_DT_WRAPPER environment variable to true. To instrument SQS and SNS calls you will need to use the provided wrappers. Using the SQS Wrapper The SQS wrapper supports wrapping the following methods: Amazon.SQS.AmazonSQSClient.SendMessageAsync(...) Amazon.SQS.AmazonSQSClient.SendMessageBatchAsync(...) Examples // SQS Client AmazonSQSClient client = new AmazonSQSClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // SendMessageRequest SendMessageRequest sendRequest = new SendMessageRequest(\"QUEUE_URI_STRING\", \"An SQS Message\"); Task responseOne = SQSWrapper.WrapRequest(client.SendMessageAsync, sendRequest); // String-based Task responseTwo = SQSWrapper.WrapRequest(client.SendMessageAsync, \"QUEUE_URI_STRING\", \"Another SQS Message\"); // SendMessageBatchRequest List batchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id1\", \"First SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id2\", \"Second SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id3\", \"Third SQS Message\")); SendMessageBatchRequest sendBatchRequest = new SendMessageBatchRequest(QUEUE_URI, batchEntries); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, sendBatchRequest); // SendMessageBatchRequestEntry List List moreBatchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id4\", \"Fourth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id5\", \"Fifth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id6\", \"Sixth SQS Message\")); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, moreBatchEntries); Using the SNS Wrapper The SNS wrapper supports wrapping the following methods: Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient.PublishAsync(...) Examples // SNS Client AmazonSimpleNotificationServiceClient client = new Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // PublishRequest - Phone Number PublishRequest phonePublishRequest = new PublishRequest(); phonePublishRequest.PhoneNumber = +1XXX5555100; phonePublishRequest.Message = \"An SNS Message for phones\"; Task phoneResponse = SNSWrapper.WrapRequest(client.PublishAsync, phonePublishRequest); // PublishRequest - ARN PublishRequest publishRequest = new PublishRequest(\"TOPIC_ARN\", \"An SNS Message\"); Task publishResponse = SNSWrapper.WrapRequest(client.PublishAsync, publishRequest); // String-based without subject Task ResponseOne = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Another SNS Message\"); // String-based with subject Task ResponseTwo = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Yet Another SNS Message\", \"A Subject\"); The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS Lambda console: NEW_RELIC_ACCOUNT_ID: The account ID the Lambda is reporting to. NEW_RELIC_TRUSTED_ACCOUNT_KEY: This is also the account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Ensure that the wrapper function (FunctionWrapper in above example) is set up as the function handler. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Node.js To instrument your Node.js Lambda: Download our Node.js agent package and place it in the same directory as your function, ensuring the agent is installed as a dependency in the node_modules directory. Use the Node Package Manager: npm install newrelic --save Install our AWS SDK module alongside the Node.js agent: npm install @newrelic/aws-sdk --save In your Lambda code, require the agent module and the AWS SDK at the top of the file, and wrap the handler function. For example: const newrelic = require('newrelic'); require('@newrelic/aws-sdk'); module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { // This is your handler function code console.log('Lambda executed'); callback(); }); Optional: You can also add custom events to your Lambda using the recordCustomEvent API. For example: module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { newrelic.recordCustomEvent(‘MyEventType’, {foo: ‘bar’}); console.log('Lambda executed'); callback(); }); Zip your Lambda function and the Node.js agent folder together. Requirements and recommendations: The New Relic files outside the New Relic agent folder don't need to be included. If your Lambda function file name is, for example, lambda_function.node, we recommend naming your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set these environment variables: NEW_RELIC_NO_CONFIG_FILE. Set to true if not using a configuration file. NEW_RELIC_APP_NAME: Your application name. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To run the agent in serverless mode outside of AWS in a local environment, set the environment variable NEW_RELIC_SERVERLESS_MODE_ENABLED to true. (When executing this in an AWS Lambda environment, the agent will automatically run in serverless mode. Do not use this variable if you're running in AWS.) Optional: To enable logging in serverless mode, set these environment variables: Set NEW_RELIC_LOG_ENABLED to true. Set NEW_RELIC_LOG to stdout for output to CloudWatch, or set to any writeable file location. The log level is set to info by default. See other log levels. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Python To instrument your Python Lambda: Download our Python agent package and place it in the same directory as your function. To do this, use pip: pip install -t . newrelic If you use Homebrew, you may get this error: DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both. For details, see the Homebrew GitHub post. In your Lambda code, import the Python agent module and decorate the handler function using the New Relic decorator. The New Relic package must be imported first in your code. Here's an example: import newrelic.agent newrelic.agent.initialize() @newrelic.agent.lambda_handler() def handler(event, context): ... Optional: You can also add custom events to your Lambda using the record_custom_event API. Here's an example: @newrelic.agent.lambda_handler() def handler(event, context): newrelic.agent.record_custom_event('CustomEvent', {'foo': 'bar'}) … Zip your lambda_function.py and newrelic/ folder together using these guidelines: The New Relic files outside the newrelic/ folder don't need to be included. If your Lambda function file name is, for example, lambda_function.py, name your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set this environment variable: NEW_RELIC_SERVERLESS_MODE_ENABLED. Set to true The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_DISTRIBUTED_TRACING_ENABLED. Set to true. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To configure logging, use the NEW_RELIC_LOG and NEW_RELIC_LOG_LEVEL environment variables in the AWS Console. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. The New Relic decorator gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, configure CloudWatch to send those logs to New Relic. Step 4. Configure CloudWatch logs to stream to New Relic Lambda In this step, you'll link your Lambda function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda that was configured in Step 2. For Node.js and Python: This step isn't necessary if you used the Serverless Framework plugin option in Step 3. This step can be done using the CLI tool or using manual procedures. Use CLI tool Run this command for every Lambda function you want to monitor: newrelic-lambda subscriptions install --function FUNCTION_NAME_#1 Or to set subscription filters for all supported functions run this command:: newrelic-lambda subscriptions install --function all Notes on this command: You should only need one newrelic-log-ingestion Lambda per AWS account and region. You can subscribe as many functions to it as you like. To see more detail about the arguments, including a region-specifying argument, see our GitHub documentation. You may receive a CloudWatch validation error. This doesn't affect data reporting. If you see data reporting in New Relic, disregard that error message. If you have our Logs and want to send all your log data to us (not just Lambda logs), see Stream all logs. Manual procedures Here are the manual procedures performed by the CLI tool: Manual process: Stream CloudWatch logs to New Relic Lambda In Step 2, you set up a newrelic-log-ingestion Lambda function. After you've instrumented your Lambda function (Step 3), the newrelic-lambda subscriptions command links that function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda. To do this manually: Open CloudWatch and select Logs in the left-hand menu, and then select the log group for the function you are monitoring. Select Actions and choose Stream to AWS Lambda. Under Lambda function, select the newrelic-log-ingestion function. Set the Log format to JSON. Set the Subscription filter pattern to ?REPORT ?NR_LAMBDA_MONITORING ?\"Task timed out\". Alternatively, if you are using the LOGGING_ENABLED environment variable stream all your logs to our Logs, leave this field blank. See notes and caveats about this procedure. Make sure the newrelic-log-ingestion Lambda function you select in the method above is in the same AWS region as your Lambda function. What's next? After you complete these steps, here's what you can do next: See data reporting in the Lambda monitoring UI. If you're having trouble finding your data, see Lambda enable troubleshooting. Use configuration settings to fine-tune your data. Our newrelic-log-ingestion function is not updated automatically. For best results and access to latest features, we recommend you occasionally update our Lambda monitoring. Optional: Stream all logs to New Relic If you have log management enabled and want to report all your logs to New Relic, follow these instructions: Go to our newrelic-log-ingestion Lambda and set the LOGGING_ENABLED environment variable to true. It isn't possible to edit existing filter patterns, so they must be removed and re-added: Set the Subscription filter pattern to \"\". Go to the Log group for each monitored Lambda, and remove the newrelic-log-ingestion subscription. Add the subscription filter back, leaving the Subscription filter pattern field blank. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 97.38433, + "_score": 163.28513, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Create NRQL alert conditions", - "sections": "NRQL alert syntax", - "info": "How to define thresholds that trigger alert notifications based on your NRQL queries.", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions", - "body": " for handling the incident, add the runbook URL to the condition. Limits on conditions See the maximum values. Health status NRQL alert conditions do not affect an entity's health status display. Examples For more information, see: Expected NRQL syntax Examples of NRQL condition queries Alert threshold" + "sections": "Step 1. Install the newrelic-lambda-cli tool", + "info": "Read about how to install and enable New Relic monitoring for Amazon AWS Lambda. ", + "body": " CloudWatch logs to New Relic (required) Step 1. Install the newrelic-lambda-cli tool We provide a command line interface (CLI) tool that's used in steps 2 through 4. We recommend the CLI because it simplifies some of the work, but you can also perform those steps manually. If you want to understand" }, - "id": "5f2d992528ccbc489d88dfc1" + "id": "5f6c67a464441f3a75eb72d3" }, { - "category_2": "Get started", - "nodeid": 1136, "sections": [ - "NRQL: New Relic Query Language", - "Get started", - "NRQL query tools", - "NRQL query tutorials", - "NRQL syntax, clauses, and functions", - "Syntax", - "Query components", - "Query metric data", - "Aggregator functions", - "Type conversion", - "For more help" + "New Relic CLI Reference", + "New Relic CLI commands", + "Options", + "Commands" ], - "title": "NRQL syntax, clauses, and functions", - "category_0": "Query your data", - "type": "docs", - "category_1": "NRQL: New Relic Query Language", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/nrql-syntax-clauses-functions", - "external_id": "a748f594f32d72e0cbd0bca97e4cedc4e398dbab", - "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/percentile_0.png", - "url": "https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/nrql-syntax-clauses-functions", - "published_at": "2020-09-24T08:39:09Z", - "updated_at": "2020-09-20T16:38:51Z", - "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started", + "title": "New Relic CLI Reference", + "type": "developer", + "tags": "new relic cli", + "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888", + "image": "", + "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/", + "published_at": "2020-09-25T01:50:00Z", + "updated_at": "2020-08-14T01:47:12Z", "document_type": "page", "popularity": 1, - "info": "New Relic Query Language (NRQL) dictionary of clauses and aggregator functions. ", - "body": "NRQL is a query language you can use to query the New Relic database. This document explains NRQL syntax, clauses, components, and functions. Syntax This document is a reference for the functions and clauses used in a NRQL query. Other resources for understanding NRQL: Intro to NRQL: explains what NRQL is used for, what data you can query with it, and basic NRQL syntax Examine NRQL queries used to build New Relic charts Simulate SQL JOIN functions Use funnels to evaluate a series of related data Format NRQL for querying with the Event API Query components Every NRQL query will begin with a SELECT statement or a FROM clause. All other clauses are optional. The clause definitions below also contain example NRQL queries. Required: SELECT statement SELECT attribute ... SELECT function(attribute) ... The SELECT specifies what portion of a data type you want to query by specifying an attribute or a function. It's followed by one or more arguments separated by commas. In each argument you can: Get the values of all available attributes by using * as a wildcard. For example: SELECT * from Transaction. Get values associated with a specified attribute or multiple attributes specified in a comma separated list. Get aggregated values from specified attributes by selecting an aggregator function. Label the results returned in each argument with the AS clause. You can also use SELECT with basic math functions. Avg response time since last week This query returns the average response time since last week. SELECT average(duration) FROM PageView SINCE 1 week ago Required: FROM clause SELECT ... FROM data type ... Use the FROM clause to specify the data type you wish to query. You can start your query with FROM or with SELECT. You can merge values for the same attributes across multiple data types in a comma separated list. Query one data type This query returns the count of all APM transactions over the last three days: SELECT count(*) FROM Transaction SINCE 3 days ago Query multiple data types This query returns the count of all APM transactions and Browser events over the last three days: SELECT count(*) FROM Transaction, PageView SINCE 3 days ago SHOW EVENT TYPES clause SHOW EVENT TYPES... SHOW EVENT TYPES will return a list of all the data types present in your account for a specific time range. It is used as the first clause in a query instead of SELECT. In this context, \"event types\" refers to the data types you can access with a NRQL query. Data types in the last day This query will return all the data types present over the past day: SHOW EVENT TYPES SINCE 1 day ago WHERE clause Use the WHERE clause to filter results. NRQL returns the results that fulfill the condition(s) you specify in the clause. SELECT function(attribute) ... WHERE attribute [operator 'value' | IN ('value' [, 'value]) | IS [NOT] NULL ] [AND|OR ...] ... If you specify more than one condition, separate the conditions by the operators AND or OR. If you want to simulate a SQL join, use custom attributes in a WHERE or FACET clause. Operators that the WHERE clause accepts Description =, !=, <, <=, >, >= NRQL accepts standard comparison operators. Example: state = 'WA' AND Used to define an intersection of two conditions. OR Used to define a union of two conditions. IS NULL Determines if an attribute has a null value. IS NOT NULL Determines if an attribute does not have a null value. IN Determines if the string value of an attribute is in a specified set. Using this method yields better performance than stringing together multiple WHERE clauses. Example: animalType IN ('cat', 'dog', 'fish') NOT IN Determines if the string value of an attribute is not in a specified set. Using this method yields better performance than stringing together multiple WHERE clauses. Values must be in parentheses, separated by commas. For example: SELECT * FROM PageView WHERE countryCode NOT IN ('CA', 'WA') LIKE Determines if an attribute contains a specified sub-string. The string argument for the LIKE operator accepts the percent sign (%) as a wildcard anywhere in the string. If the substring does not begin or end the string you are matching against, the wildcard must begin or end the string. Examples: userAgentName LIKE 'IE%' IE IE Mobile userAgentName LIKE 'o%a%' Opera Opera Mini userAgentName LIKE 'o%a' Opera userAgentName LIKE '%o%a%' Opera Opera Mini Mozilla Gecko NOT LIKE Determines if an attribute does not contain a specified sub-string. RLIKE Determines if an attribute contains a specified Regex sub-string. Uses RE2 syntax. Examples: appName RLIKE 'z.*|q.*'' z-app q-app hostname RLIKE 'ip-10-351-[0-2]?[0-9]-.*' ip-10-351-19-237 ip-10-351-2-41 ip-10-351-24-238 ip-10-351-14-15 Note: Slashes must be escaped in the Regex pattern. For example, \\d must be \\\\d. Regex defaults to full-string matching, therefore ^ and $ are implicit and you do not need to add them. If the Regex pattern contains a capture group, the group will be ignored. That is, the group will not be captured for use later in the query. NOT RLIKE Determines if an attribute does not contain a specified Regex sub-string. Uses RE2 syntax. Example query with three conditions This query returns the browser response time for pages with checkout in the URL for Safari users in the United States and Canada over the past 24 hours. SELECT histogram(duration, 50, 20) FROM PageView WHERE countryCode IN ('CA', 'US') AND userAgentName='Safari' AND pageUrl LIKE '%checkout%' SINCE 1 day ago AS clause SELECT ... AS 'label' ... Use the AS clause to label an attribute, aggregator, step in a funnel, or the result of a math function with a string delimited by single quotes. The label is used in the resulting chart. Query using math function and AS This query returns the number of page views per session: SELECT count(*)/uniqueCount(session) AS 'Pageviews per Session' FROM PageView Query using funnel and AS This query returns a count of people who have visited both the main page and the careers page of a site over the past week: SELECT funnel(SESSION, WHERE name='Controller/about/main' AS 'Step 1', WHERE name = 'Controller/about/careers' AS 'Step 2') FROM PageView SINCE 1 week ago FACET clause SELECT ... FACET attribute ... Use FACET to separate and group your results by attribute values. For example, you could FACET your PageView data by deviceType to figure out what percentage of your traffic comes from mobile, tablet, and desktop devices. Use the LIMIT clause to specify how many facets appear (default is 10). For more complex grouping, use FACET CASES. FACET clauses support up to five attributes, separated by commas. The facets are sorted in descending order by the first field you provide in the SELECT clause. If you are faceting on attributes with more than 1,000 unique values, a subset of facet values is selected and sorted according to the query type. When selecting min(), max(), or count(), FACET uses those functions to determine how facets are picked and sorted. When selecting any other function, FACET uses the frequency of the attribute you are faceting on to determine how facets are picked and sorted. For more on faceting on multiple attributes, with some real-world examples, see this New Relic blog post. Faceted query using count() This query shows cities with the highest pageview counts. This query uses the total number of pageviews per city to determine how facets are picked and ordered. SELECT count(*) FROM PageView FACET city Faceted query using uniqueCount() This query shows the cities that access the highest number of unique URLs. This query uses the total number of times a particular city appears in the results to determine how facets are picked and ordered. SELECT uniqueCount(pageUrl) FROM PageView FACET city Grouping results across time Advanced segmentation and cohort analysis allow you to facet on bucket functions to more effectively break out your data. Cohort analysis is a way to group results together based on timestamps. You can separate them into buckets that cover a specified range of dates and times. FACET ... AS clause Use FACET ... AS to name facets using the AS keyword in queries. This clause is helpful for adding clearer or simplified names for facets in your results. It can also be used to rename facets in nested aggregation queries. FACET ... AS queries will change the facet names in results (when they appear as headers in tables, for example), but not the actual facet names themselves. FROM Transaction SELECT count(*) FACET response.headers.contentType AS 'content type' FACET CASES clause SELECT ... FACET CASES ( WHERE attribute operator value, WHERE attribute operator value, ... ) ... Use FACET CASES to break out your data by more complex conditions than possible with FACET. Separate multiple conditions with a comma ,. For example, you could query your PageView data and FACET CASES into categories like less than 1 second, from 1 to 10 seconds, and greater than 10 seconds. You can combine multiple attributes within your cases, and label the cases with the AS selector. Data points will be added to at most one facet case, the first facet case that they match. You may also use a time function with your attribute. Basic usage with WHERE SELECT count(*) FROM PageView FACET CASES (WHERE duration < 1, WHERE duration > 1 and duration < 10, WHERE duration > 10) Group based on multiple attributes This example groups results into one bucket where the transaction name contains login, and another where the URL contains login and a custom attribute indicates that the user was a paid user: SELECT count(*) FROM Transaction FACET CASES (WHERE name LIKE '%login%', WHERE name LIKE '%feature%' AND customer_type='Paid') Label groups with AS This example uses the AS selector to give your results a human-readable name: SELECT count(*) FROM Transaction FACET CASES (WHERE name LIKE '%login%' AS 'Total Logins', WHERE name LIKE '%feature%' AND customer_type='Paid' AS 'Feature Visits from Paid Users') FACET ... ORDER BY clause In NRQL, the default is for the first aggregation in the SELECT clause to guide the selection of facets in a query. FACET ... ORDER BY allows you to override this default behavior by adding an aggregate function with the ORDER BY modifier to specify how facets are selected. Specifically, the clause will override the priority by which facets are chosen to be in the final result before being limited by the LIMIT clause. This clause can be used in querying but not for alerts or streaming. This example shows how to use FACET ... ORDER BY to find the average durations of app transactions, showing the top 10 (default limit) highest durations by apps which have the highest response size. In this case, if FACET ... ORDER BY is not used, the query results will instead show the top 10 by highest durations, with response size being irrelevant to the app selection. FROM Transaction SELECT average(duration) TIMESERIES FACET appName ORDER BY max(responseSize) Because the operations are performed before the LIMIT clause is applied, FACET ... ORDER BY does not impact the sort of the final query results, which will be particularly noticeable in the results for non-timeseries queries. The ORDER BY modifier in this case works differently than the ORDER BY clause. When parsing queries that follow the format FACET attribute1 ORDER BY attribute2, New Relic will read these as FACET ... ORDER BY queries, but only if ORDER BY appears immediately after FACET. Otherwise ORDER BY will be interpreted by New Relic as a clause. LIMIT clause SELECT ... LIMIT count ... Use the LIMIT clause to control the maximum number of facet values returned by FACET queries or the maximum number of items returned by SELECT * queries. This clause takes a single integer value as an argument. If the LIMIT clause is not specified, or no value is provided, the limit defaults to 10 for FACET queries and 100 in the case of SELECT * queries. The maximum allowed value for the LIMIT clause is 2,000. Query using LIMIT This query shows the top 20 countries by session count and provides 95th percentile of response time for each country for Windows users only. SELECT uniqueCount(session), percentile(duration, 95) FROM PageView WHERE userAgentOS = 'Windows' FACET countryCode LIMIT 20 SINCE YESTERDAY OFFSET clause SELECT ... LIMIT count OFFSET count ... Use the OFFSET clause with LIMIT to control the portion of rows returned by SELECT * or SELECT column queries. Like the LIMIT clause, OFFSET takes a single integer value as an argument. OFFSET sets the number of rows to be skipped before the selected rows of your query are returned. This is constrained by LIMIT. OFFSET rows are skipped starting from the most recent record. For example, the query SELECT interestingValue FROM Minute_Report LIMIT 5 OFFSET 1 returns the last 5 values from Minute_Report except for the most recent one. ORDER BY clause The ORDER BY clause allows you to specify how you want to sort your query results in queries that select event attributes by row. This query orders transactions by duration. FROM Transaction SELECT appName, duration ORDER BY duration The default sort order is ascending, but this can be changed by adding the ASC or DESC modifiers. SINCE clause SELECT ... SINCE [numerical units AGO | phrase] ... The default value is 1 hour ago. Use the SINCE clause to define the beginning of a time range for the returned data. When using NRQL, you can set a UTC timestamp or relative time range. You can specify a timezone for the query but not for the results. NRQL results are based on your system time. See Set time range on dashboards and charts for detailed information and examples. UNTIL clause SELECT ... UNTIL integer units AGO ... The default value is NOW. Only use UNTIL to specify an end point other than the default. Use the UNTIL clause to define the end of a time range across which to return data. Once a time range has been specified, the data will be preserved and can be reviewed after the time range has ended. You can specify a UTC timestamp or relative time range. You can specify a time zone for the query but not for the results. The returned results are based on your system time. See Set time range on dashboards and charts for detailed information and examples. WITH TIMEZONE clause SELECT ... WITH TIMEZONE (selected zone) ... By default, query results are displayed in the timezone of the browser you're using. Use the WITH TIMEZONE clause to select a time zone for a date or time in the query that hasn't already had a time zone specified for it. For example, the query clause SINCE Monday UNTIL Tuesday WITH TIMEZONE 'America/New_York' will return data recorded from Monday at midnight, Eastern Standard Time, until midnight Tuesday, Eastern Standard Time. Available Time Zone Selections Africa/Abidjan Africa/Addis_Ababa Africa/Algiers Africa/Blantyre Africa/Cairo Africa/Windhoek America/Adak America/Anchorage America/Araguaina America/Argentina/Buenos_Aires America/Belize America/Bogota America/Campo_Grande America/Cancun America/Caracas America/Chicago America/Chihuahua America/Dawson_Creek America/Denver America/Ensenada America/Glace_Bay America/Godthab America/Goose_Bay America/Havana America/La_Paz America/Los_Angeles America/Miquelon America/Montevideo America/New_York America/Noronha America/Santiago America/Sao_Paulo America/St_Johns Asia/Anadyr Asia/Bangkok Asia/Beirut Asia/Damascus Asia/Dhaka Asia/Dubai Asia/Gaza Asia/Hong_Kong Asia/Irkutsk Asia/Jerusalem Asia/Kabul Asia/Katmandu Asia/Kolkata Asia/Krasnoyarsk Asia/Magadan Asia/Novosibirsk Asia/Rangoon Asia/Seoul Asia/Tashkent Asia/Tehran Asia/Tokyo Asia/Vladivostok Asia/Yakutsk Asia/Yekaterinburg Asia/Yerevan Atlantic/Azores Atlantic/Cape_Verde Atlantic/Stanley Australia/Adelaide Australia/Brisbane Australia/Darwin Australia/Eucla Australia/Hobart Australia/Lord_Howe Australia/Perth Chile/EasterIsland Etc/GMT+10 Etc/GMT+8 Etc/GMT-11 Etc/GMT-12 Europe/Amsterdam Europe/Belfast Europe/Belgrade Europe/Brussels Europe/Dublin Europe/Lisbon Europe/London Europe/Minsk Europe/Moscow Pacific/Auckland Pacific/Chatham Pacific/Gambier Pacific/Kiritimati Pacific/Marquesas Pacific/Midway Pacific/Norfolk Pacific/Tongatapu UTC See Set time range on dashboards and charts for detailed information and examples. WITH METRIC_FORMAT clause For information on querying metric data, see Query metrics. COMPARE WITH clause SELECT ... (SINCE or UNTIL) (integer units) AGO COMPARE WITH (integer units) AGO ... Use the COMPARE WITH clause to compare the values for two different time ranges. COMPARE WITH requires a SINCE or UNTIL statement. The time specified by COMPARE WITH is relative to the time specified by SINCE or UNTIL. For example, SINCE 1 day ago COMPARE WITH 1 day ago compares yesterday with the day before. The time range for theCOMPARE WITH value is always the same as that specified by SINCE or UNTIL. For example, SINCE 2 hours ago COMPARE WITH 4 hours ago might compare 3:00pm through 5:00pm against 1:00 through 3:00pm. COMPARE WITH can be formatted as either a line chart or a billboard: With TIMESERIES, COMPARE WITH creates a line chart with the comparison mapped over time. Without TIMESERIES, COMPARE WITH generates a billboard with the current value and the percent change from the COMPARE WITH value. Example: This query returns data as a line chart showing the 95th percentile for the past hour compared to the same range one week ago. First as a single value, then as a line chart. SELECT percentile(duration) FROM PageView SINCE 1 week ago COMPARE WITH 1 week AGO SELECT percentile(duration) FROM PageView SINCE 1 week ago COMPARE WITH 1 week AGO TIMESERIES AUTO TIMESERIES clause SELECT ... TIMESERIES integer units ... Use the TIMESERIES clause to return data as a time series broken out by a specified period of time. Since TIMESERIES is used to trigger certain charts, there is no default value. To indicate the time range, use integer units. For example: TIMESERIES 1 minute TIMESERIES 30 minutes TIMESERIES 1 hour TIMESERIES 30 seconds Use a set interval The value provided indicates the units used to break out the graph. For example, to present a one-day graph showing 30 minute increments: SELECT ... SINCE 1 day AGO TIMESERIES 30 minutes Use automatically set interval TIMESERIES can also be set to AUTO, which will divide your graph into a reasonable number of divisions. For example, a daily chart will be divided into 30 minute intervals and a weekly chart will be divided into 6 hour intervals. This query returns data as a line chart showing the 50th and 90th percentile of client-side transaction time for one week with a data point every 6 hours. SELECT average(duration), percentile(duration, 50, 90) FROM PageView SINCE 1 week AGO TIMESERIES AUTO Use max interval You can set TIMESERIES to MAX, which will automatically adjust your time window to the maximum number of intervals allowed for a given time period. This allows you to update your time windows without having to manually update your TIMESERIES buckets and ensures your time window is being split into the peak number of intervals allowed. The maximum number of TIMESERIES buckets that will be returned is 366. For example, the following query creates 4-minute intervals, which is the ceiling for a daily chart. SELECT average(duration) FROM Transaction since 1 day ago TIMESERIES MAX For functions such as average( ) or percentile( ), a large interval can have a significant smoothing effect on outliers. EXTRAPOLATE clause You can use this clause with these data types: Transaction TransactionError Custom events reported via APM agent APIs The purpose of EXTRAPOLATE is to mathematically compensate for the effects of APM agent sampling of event data so that query results more closely represent the total activity in your system. This clause will be useful when a New Relic APM agent reports so many events that it often passes its harvest cycle reporting limits. When that occurs, the agent begins to sample events. When EXTRAPOLATE is used in a NRQL query that supports its use, the ratio between the reported events and the total events is used to extrapolate a close approximation of the total unsampled data. When it is used in a NRQL query that doesn’t support its use or that hasn’t used sampled data, it has no effect. Note that EXTRAPOLATE is most useful for homogenous data (like throughput or error rate). It's not effective when attempting to extrapolate a count of distinct things (like uniqueCount() or uniques()). This clause works only with NRQL queries that use one of the following aggregator functions: apdex average count histogram sum percentage (if function it takes as an argument supports EXTRAPOLATE) rate (if function it takes as an argument supports EXTRAPOLATE) stddev Example of extrapolating throughput A query that will show the extrapolated throughput of a service named interestingApplication. SELECT count(*) FROM Transaction WHERE appName='interestingApplication' SINCE 60 minutes ago EXTRAPOLATE Example of extrapolating throughput as a time series A query that will show the extrapolated throughput of a service named interestingApplication by transaction name, displayed as a time series. SELECT count(*) FROM Transaction WHERE appName='interestingApplication' SINCE 60 minutes ago FACET name TIMESERIES 1 minute EXTRAPOLATE Query metric data There are several ways to query metric data using NRQL: Query metric timeslice data, which is reported by New Relic APM, Mobile, Browser Query the Metric data type, which is reported by some of our integrations and Telemetry SDKs For more on understanding metrics in New Relic, see Metric data types. Aggregator functions Use aggregator functions to filter and aggregate data in a NRQL query. Some helpful information about using aggregator functions: See the New Relic University tutorials for Filter queries, Apdex queries, and Percentile queries. Or, go to the full online course Writing NRQL queries. Data type \"coercion\" is not supported. Read about available type conversion functions. Cohort analysis functions appear on the New Relic Insights Cohort analysis page. The cohort functions aggregate transactions into time segments. Here are the available aggregator functions. The definitions below contain example NRQL queries. Examples: SELECT histogram(duration, 10, 20) FROM PageView SINCE 1 week ago apdex(attribute, t: ) Use the apdex function to return an Apdex score for a single transaction or for all your transactions. The attribute can be any attribute based on response time, such as duration or backendDuration. The t: argument defines an Apdex T threshold in seconds. The Apdex score returned by the apdex( ) function is based only on execution time. It does not account for APM errors. If a transaction includes an error but completes in Apdex T or less, that transaction will be rated satisfying by the apdex ( ) function. Get Apdex for specific customers If you have defined custom attributes, you can filter based on those attributes. For example, you could monitor the Apdex for a particularly important customer: SELECT apdex(duration, t: 0.4) FROM Transaction WHERE customerName='ReallyImportantCustomer' SINCE 1 day ago Get Apdex for specific transaction Use the name attribute to return a score for a specific transaction, or return an overall Apdex by omitting name. This query returns an Apdex score for the Controller/notes/index transaction over the last hour: SELECT apdex(duration, t: 0.5) from Transaction WHERE name='Controller/notes/index' SINCE 1 hour ago The apdex function returns an Apdex score that measures user satisfaction with your site. Arguments are a response time attribute and an Apdex T threshold in seconds. Get overall Apdex for your app This example query returns an overall Apdex for the application over the last three weeks: SELECT apdex(duration, t: 0.08) FROM Transaction SINCE 3 week ago average(attribute) Use the average( ) function to return the average value for an attribute. It takes a single attribute name as an argument. If a value of the attribute is not numeric, it will be ignored when aggregating. If data matching the query's conditions is not found, or there are no numeric values returned by the query, it will return a value of null. buckets(attribute, ceiling [,number of buckets]) Use the buckets() function to aggregate data split up by a FACET clause into buckets based on ranges. You can bucket by any attribute that is stored as a numerical value in the New Relic database. It takes three arguments: Attribute name Maximum value of the sample range. Any outliers will appear in the final bucket. Total number of buckets For more information and examples, see Split your data into buckets. bucketPercentile(attribute) The bucketPercentile( ) function is the NRQL equivalent of the histogram_quantile function in Prometheus. It is intended to be used with dimensional metric data. Instead of the quantile, New Relic returns the percentile, which is the quantile * 100. Use the bucketPercentile( ) function to calculate the quantile from the histogram data in a Prometheus format. It takes the bucket name as an argument and reports percentiles along the bucket's boundaries: SELECT bucketPercentile(duration_bucket) FROM Metric SINCE 1 day ago Optionally, you can add percentile specifications as an argument: SELECT bucketPercentile(duration_bucket, 50, 75, 90) FROM Metric SINCE 1 day ago Because multiple metrics are used to make up Prometheus histogram data, you must query for specific Prometheus metrics in terms of the associated . For example, to compute percentiles from a Prometheus histogram, with the prometheus_http_request_duration_seconds using NRQL, use bucketPercentile(prometheus_http_request_duration_seconds_bucket, 50). Note how _bucket is added to the end of the as a suffix. See the Prometheus.io documentation for more information. cardinality(attribute) Use the cardinality( ) function to obtain the number of combinations of all the dimensions (attributes) on a metric. It takes three arguments, all optional: Metric name: if present, cardinality( ) only computes the metric specified. Include: if present, the include list restricts the cardinality computation to those attributes. Exclude: if present, the exclude list causes those attributes to be ignored in the cardinality computation. SELECT cardinality(metric_name, include:{attribute_list}, exclude:{attribute_list}) count(*) Use the count( ) function to return a count of available records. It takes a single argument; either *, an attribute, or a constant value. Currently, it follows typical SQL behavior and counts all records that have values for its argument. Since count(*) does not name a specific attribute, the results will be formatted in the default \"humanize\" format. derivative(attribute [,time interval]) derivative() finds the rate of change for a given dataset. The rate of change is calculated using a least-squares regression to approximate the derivative. The time interval is the period for which the rate of change is calculated. For example, derivative(attributeName, 1 minute) will return the rate of change per minute. dimensions(include: {attributes}, exclude: {attributes}) Use the dimensions( ) function to return all the dimensional values on a data type. You can explicitly include or exclude specific attributes using the optional arguments: Include: if present, the include list limits dimensions( ) to those attributes. Exclude: if present, the dimensions( ) calculation ignores those attributes. FROM Metric SELECT count(node_filesystem_size) TIMESERIES FACET dimensions() When used with a FACET clause, dimensions( ) produces a unique timeseries for all facets available on the event type, similar to how Prometheus behaves with non-aggregated queries. earliest(attribute) Use the earliest( ) function to return the earliest value for an attribute over the specified time range. It takes a single argument. Arguments after the first will be ignored. If used in conjunction with a FACET it will return the most recent value for an attribute for each of the resulting facets. Get earliest country per user agent from PageView This query returns the earliest country code per each user agent from the PageView event. SELECT earliest(countryCode) FROM PageView FACET userAgentName eventType() ...WHERE eventType() = 'EventNameHere'... ...FACET eventType()... Use the eventType() function in a FACET clause to break out results by the selected data type or in a WHERE clause to filter results to a specific data type. This is particularly useful for targeting specific data types with the filter() and percentage() functions. In this context, \"event type\" refers to the types of data you can access with a NRQL query. Use eventType() in filter() function This query returns the percentage of total TransactionError results out of the total Transaction results. You can use the eventType() function to target specific types of data with the filter() function. SELECT 100 * filter(count(*), where eventType() = 'TransactionError') / filter(count(*), where eventType() = 'Transaction') FROM Transaction, TransactionError WHERE appName = 'App.Prod' TIMESERIES 2 Minutes SINCE 6 hours ago Use eventType() with FACET This query displays a count of how many records each data type (Transaction and TransactionError) returns. SELECT count(*) FROM Transaction, TransactionError FACET eventType() TIMESERIES filter(function(attribute), WHERE condition) Use the filter( ) function to limit the results for one of the aggregator functions in your SELECT statement. You can use filter() in conjunction with FACET or TIMESERIES. Analyze purchases that used offer codes You could use filter() to compare the items bought in a set of transactions for those using an offer code versus those who aren't: Use the filter( ) function to limit the results for one of the aggregator functions in your SELECT statement. funnel(attribute, steps) Use the funnel() function to generate a funnel chart. It takes an attribute as its first argument. You then specify steps as WHERE clauses (with optional AS clauses for labels) separated by commas. For details and examples, see the funnels documentation. getField(attribute, field) Use the getField() function to extract a field from complex metrics. It takes the following arguments: Metric type Supported fields summary count, total, max, min gauge count, total, max, min, latest distribution count, total, max, min counter count Examples: SELECT max(getField(mySummary, count)) from Metric SELECT sum(mySummary) from Metric where getField(mySummary, count) > 10 histogram(attribute, ceiling [,number of buckets]) Use the histogram( ) function to generate histograms. It takes three arguments: Attribute name Maximum value of the sample range Total number of buckets Histogram of response times from PageView events This query results in a histogram of response times ranging up to 10 seconds over 20 buckets. SELECT histogram(duration, 10, 20) FROM PageView SINCE 1 week ago Prometheus histogram buckets histogram( ) accepts Prometheus histogram buckets: SELECT histogram(duration_bucket, 10, 20) FROM Metric SINCE 1 week ago New Relic distribution metric histogram( ) accepts Distribution metric as an input: SELECT histogram(myDistributionMetric, 10, 20) FROM Metric SINCE 1 week ago keyset() Using keyset() will allow you to see all of the attributes for a given data type over a given time range. It takes no arguments. It returns a JSON structure containing groups of string-typed keys, numeric-typed keys, boolean-typed keys, and all keys. See all attributes for a data type This query returns the attributes found for PageView events from the last day: SELECT keyset() FROM PageView SINCE 1 day ago latest(attribute) Use the latest( ) function to return the most recent value for an attribute over a specified time range. It takes a single argument. Arguments after the first will be ignored. If used in conjunction with a FACET it will return the most recent value for an attribute for each of the resulting facets. Get most recent country per user agent from PageView This query returns the most recent country code per each user agent from the PageView event. SELECT latest(countryCode) FROM PageView FACET userAgentName max(attribute) Use the max( ) function to return the maximum recorded value of a numeric attribute over the time range specified. It takes a single attribute name as an argument. If a value of the attribute is not numeric, it will be ignored when aggregating. If data matching the query's conditions is not found, or there are no numeric values returned by the query, it will return a value of null. median(attribute) Use the median( ) function to return an attribute's median, or 50th percentile. For more information about percentile queries, see percentile(). The median( ) query is only available when using the query builder. Median query This query will generate a line chart for the median value. SELECT median(duration) FROM PageView TIMESERIES AUTO min(attribute) Use the min( ) function to return the minimum recorded value of a numeric attribute over the time range specified. It takes a single attribute name as an argument. If a value of the attribute is not numeric, it will be ignored when aggregating. If data matching the query's conditions is not found, or there are no numeric values returned by the query, it will return a value of null. percentage(function(attribute), WHERE condition) Use the percentage( ) function to return the percentage of a target data set that matches some condition. The first argument requires an aggregator function against the desired attribute. Use exactly two arguments (arguments after the first two will be ignored). If the attribute is not numeric, this function returns a value of 100%. percentile(attribute [, percentile [, ...]]) Use the percentile( ) function to return an attribute's approximate value at a given percentile. It requires an attribute and can take any number of arguments representing percentile points. The percentile() function enables percentiles to displays with up to three digits after the decimal point, providing greater precision. Percentile thresholds may be specified as decimal values, but be aware that for most data sets, percentiles closer than 0.1 from each other will not be resolved. Percentile display examples Use TIMESERIES to generate a line chart with percentiles mapped over time. Omit TIMESERIES to generate a billboard and attribute sheet showing aggregate values for the percentiles. If no percentiles are listed, the default is the 95th percentile. To return only the 50th percentile value, the median, you can also use median(). Basic percentile query This query will generate a line chart with lines for the 5th, 50th, and 95th percentile. SELECT percentile(duration, 5, 50, 95) FROM PageView TIMESERIES AUTO predictLinear(attribute, [,time interval]) predictLinear() is an extension of the derivative() function. It uses a similar method of least-squares linear regression to predict the future values for a dataset. The time interval is how far the query will look into the future. For example, predictLinear(attributeName, 1 hour) is a linear prediction 1 hour into the future of the query time window. Generally, predictLinear() is helpful for continuously growing values like disk space, or predictions on large trends. Since predictLinear() is a linear regression, familiarity with the dataset being queried helps to ensure accurate long-term predictions. Any dataset which grows exponentially, logarithmically, or by other nonlinear means will likely only be successful in very short-term predictions. New Relic recommends against using predictLinear in TIMESERIES queries. This is because each bucket will be making an individual prediction based on its relative timeframe within the query, meaning that such queries will not show predictions from the end of the timeseries forward. rate(function(attribute) [,time interval]) Use the rate( ) function to visualize the frequency or rate of a given query per time interval. For example, you might want to know the number of pageviews per minute over an hour-long period or the count of unique sessions on your site per hour over a day-long period. Use TIMESERIES to generate a line chart with rates mapped over time. Omit TIMESERIES to generate a billboard showing a single rate value averaged over time. Basic rate query This query will generate a line chart showing the rate of throughput for APM transactions per 10 minutes over the past 6 hours. SELECT rate(count(*), 10 minute) FROM Transaction SINCE 6 hours ago TIMESERIES round(attribute) Use the round( ) function to return the rounded value of an attribute. Optionally round( ) can take a second argument, to_nearest, to round the first argument to the closest multiple of the second one. to_nearest can be fractional. SELECT round(n [, to_nearest]) stddev(attribute) Use the stddev( ) function to return one standard deviation for a numeric attribute over the time range specified. It takes a single argument. If the attribute is not numeric, it will return a value of zero. stdvar(attribute) Use the stdvar( ) function to return the standard variance for a numeric attribute over the time range specified. It takes a single argument. If the attribute is not numeric, it will return a value of zero. sum(attribute) Use the sum( ) function to return the sum recorded values of a numeric attribute over the time range specified. It takes a single argument. Arguments after the first will be ignored. If the attribute is not numeric, it will return a value of zero. uniqueCount(attribute) Use the uniqueCount( ) function to return the number of unique values recorded for an attribute over the time range specified. To optimize query performance, this function returns approximate results for queries that inspect more than 256 unique values. uniques(attribute [,limit]​) Use the uniques( ) function to return a list of unique values recorded for an attribute over the time range specified. When used along with the facet clause, a list of unique attribute values will be returned per each facet value. The limit parameter is optional. When it is not provided, the default limit of 1,000 unique attribute values per facet is applied. You may specify a different limit value, up to a maximum of 10,000. The uniques( ) function will return the first set of unique attribute values discovered, until the limit is reached. Therefore, if you have 5,000 unique attribute values in your data set, and the limit is set to 1,000, the operator will return the first 1,000 unique values that it discovers, regardless of their frequency. The maximum number of values that can be returned in a query result is the product of the uniques( ) limit times the facet limit. In the following query, the theoretical maximum number of values that can be returned is 5 million (5,000 x 1,000). From Transaction SELECT uniques(host,5000) FACET appName LIMIT 1000 However, depending on the data set being queried, and the complexity of the query, memory protection limits may prevent a very large query from being executed. Type conversion NRQL does not support \"coercion.\" This means that a float stored as a string is treated as a string and cannot be operated on by functions expecting float values. You can convert a string with a numeric value or a boolean with a string value to their numeric and boolean types with these functions: Use the numeric() function to convert a number with a string format to a numeric function. The function can be built into a query that uses math functions on query results or NRQL aggregator functions, such as average(). Use the boolean() function to convert a string value of \"true\" or \"false\" to the corresponding boolean value. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "info": "The command line tools for performing tasks against New Relic APIs", + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 85.89079, + "_score": 138.78436, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "NRQL syntax, clauses, and functions", - "sections": "NRQL syntax, clauses, and functions", - "info": "New Relic Query Language (NRQL) dictionary of clauses and aggregator functions. ", - "category_0": "Query your data", - "category_1": "NRQL: New Relic Query Language", - "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/nrql-syntax-clauses-functions", - "body": " NRQL is used for, what data you can query with it, and basic NRQL syntax Examine NRQL queries used to build New Relic charts Simulate SQL JOIN functions Use funnels to evaluate a series of related data Format NRQL for querying with the Event API Query components Every NRQL query will begin", - "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started" + "title": "New Relic CLI Reference", + "sections": "New Relic CLI commands", + "info": "The command line tools for performing tasks against New Relic APIs", + "tags": "new relic cli", + "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs" }, - "id": "5f2abcef28ccbcb0ee0c3aed" + "id": "5efa989ee7b9d2024b7bab97" }, { - "category_2": "Explore data", - "nodeid": 1131, + "image": "", + "url": "https://developer.newrelic.com/explore-docs/nr1-nerdpack/", "sections": [ - "Use Insights UI", - "Getting started", - "Explore data", - "Guides", - "Manage account data", - "Manage dashboards", - "Time settings", - "Export data", - "Troubleshooting", - "Query page: Create and edit NRQL queries", - "Use NRQL query history", - "For more help" + "New Relic One CLI Nerdpack commands", + "Command details", + "nr1 nerdpack:build", + "Builds a Nerdpack", + "Usage", + "Options", + "nr1 nerdpack:clone", + "Clone an existing Nerdpack", + "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", + "nr1 nerdpack:clean", + "Removes all built artifacts", + "nr1 nerdpack:validate", + "Validates artifacts inside your Nerdpack", + "nr1 nerdpack:Info", + "Shows the state of your Nerdpack in the New Relic's registry" ], - "title": "Query page: Create and edit NRQL queries", - "category_0": "Insights", - "type": "docs", - "category_1": "Use Insights UI", - "external_id": "e00d2b865680d15c361b4058e22270fe5103aa8e", - "image": "", - "url": "https://docs.newrelic.com/docs/insights/use-insights-ui/manage-account-data/query-page-create-edit-nrql-queries", - "published_at": "2020-09-24T08:35:43Z", - "updated_at": "2020-07-26T08:08:39Z", - "breadcrumb": "Contents / Insights / Use Insights UI / Explore data", + "published_at": "2020-09-25T01:51:37Z", + "title": "New Relic One CLI Nerdpack commands", + "updated_at": "2020-09-17T01:49:55Z", + "type": "developer", + "external_id": "7c1050a6a8624664b90c15111f7c72e96b2fbe17", "document_type": "page", "popularity": 1, - "info": "Use the New Relic Insights Query page to create and edit NRQL queries, favorite them for later use, and add query results to dashboards. ", - "body": "New Relic Insights' Query page is one place you can run NRQL queries of your data. To get started: Go to insights.newrelic.com > Query, then use any of the available NRQL syntax and functions. Use the Query page to: Create and run queries of your data. View your query history. View favorite queries. Use the NRQL query to create, view, organize, and share Insights dashboards. For a library of educational videos about how to use New Relic Insights, visit learn.newrelic.com. Use NRQL query history To view up to twenty of your most recent queries, select the History tab directly below the query command line interface. Use the query history to adjust and improve recent queries. If you want to... Do this... Run recent queries Select a recent query from the history list. The query will appear on the command line, where it can be edited. Delete queries Mouse over a query in the history list so the delete [trash] icon appears. The query history only retains the twenty most recent queries, so it can be useful to delete unwanted queries to make room for queries you like. Favorite queries Mouse over a query in the history list and the favorite star icon appears. Then, to view and use your favorite queries, select the Favorites tab. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.", + "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.", + "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:build Assembles your Nerdpack into bundles 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. nr1 nerdpack:clean Cleans your development folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. Command details nr1 nerdpack:build Builds a Nerdpack Runs a webpack process to assemble your Nerdpack into javascript and CSS bundles. As many other CLI commands, it should be run at the package.json level of your Nerdpack. Usage $ nr1 nerdpack:build OPTION Options --extra-metadata-path=extra-metadata-path Specify a json file path with extra metadata. [default: extra-metadata.json] --prerelease=prerelease If specififed, the value will be appended to the current version of generated files. ie: --prerelease=abc. Then the version will be \"1.2.3-abc\". --profile=profile The authencation profile you want to use. --verbose Adds extra information to the output. 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. nr1 nerdpack:clean Removes all built artifacts Cleans and removes the content and the developtment folders (dist/, tmp/). Usage $ nr1 nerdpack:clean OPTION Options --profile=profile The authentication profile you want to use --verbose Adds extra information to the output. nr1 nerdpack:validate Validates artifacts inside your Nerdpack Validates artifacts inside your Nerdpack. Usage $ nr1 nerdpack:validate OPTION Options -l, --force-local The authentication profile you want to use. -r, --force-remote Force download of new schema files. --profile=profile The authentication profile you want to uset. --verbose Adds extra information to the output. nr1 nerdpack:Info Shows the state of your Nerdpack in the New Relic's registry Shows the state of your Nerdpack in the New Relic's registry. The default amount of versions shown is 10 but all versions can be shown if the --all (or -a) flag is used Usage $ nr1 nerdpack:info OPTION Options -a, --all Show all versions. -i, --nerdpack-id=nerdpack-id Get info from the specified Nerdpack instead of local one. --profile=profile The authentication profile you want to use. --verbose Adds extra information to the output.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 76.34853, + "_score": 130.0455, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "Query page: Create and edit NRQL queries", - "sections": "Explore data", - "info": "Use the New Relic Insights Query page to create and edit NRQL queries, favorite them for later use, and add query results to dashboards. ", - "category_2": "Explore data", - "body": "New Relic Insights' Query page is one place you can run NRQL queries of your data. To get started: Go to insights.newrelic.com > Query, then use any of the available NRQL syntax and functions. Use the Query page to: Create and run queries of your data. View your query history. View favorite queries", - "breadcrumb": "Contents / Insights / Use Insights UI / Explore data" + "title": "New Relic One CLI Nerdpack commands", + "sections": "New Relic One CLI Nerdpack commands", + "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.", + "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:build Assembles your Nerdpack into bundles nr1 nerdpack:clone Clones a Nerdpack from" }, - "id": "59425a3c8e9c0f6937f1cda9" + "id": "5f28bd6a64441f9817b11a38" } ], "/build-apps/set-up-dev-env": [ @@ -7172,7 +7170,7 @@ "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-09-24T02:26:06Z", + "published_at": "2020-09-25T01:49:59Z", "updated_at": "2020-09-17T01:51:10Z", "document_type": "page", "popularity": 1, @@ -7180,7 +7178,7 @@ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. 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. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 305.8036, + "_score": 289.58234, "_version": null, "_explanation": null, "sort": null, @@ -7232,7 +7230,7 @@ "body": "You can send traces in the New Relic format to our Trace API without using a New Relic agent or integration. This is useful if you want to integrate with sources that emit tracing data and require a backend for trace storage. Since distributed systems can generate a lot of trace data, telemetry tools rely on data sampling (filtering) to find the most useful subset of that data. When you send us your trace data, you have two options related to sampling: Use your tool’s native sampling: This approach sends the telemetry data directly to the Trace API and assumes you are relying on your telemetry tool to sample the data before the integration passes the data to New Relic. Even though your tool may be sampling data before the New Relic integration sends it, our Trace API may randomly sample out traces that exceed your rate limit. Use Infinite Tracing (limited release): This approach assumes you turn off sampling in your telemetry tool and then send all your data to a New Relic trace observer in AWS. The trace observer selects the most important and actionable traces using tail-based sampling and then sends your traces to our UI. To send Zipkin-formatted data to the Trace API, see our Zipkin instructions. We'll look at two examples for sending your telemetry data to New Relic, as well as how to structure your data: Example: Use your tool’s native sampling Example: Use Infinite Tracing JSON requirements and recommendations Attributes Example: Use your tool’s native sampling If you are using a telemetry tool that is sampling your trace data, you can send the data directly to New Relic. The following procedure explains how to send a test payload to the Trace API using the newrelic format. For details about how to structure your data, see JSON requirements and recommendations. Get an Insert API key: Go to: one.newrelic.com > account dropdown > Account settings > API keys, and select Insights API keys. If you don't have a key, create a new one by selecting Insert keys +. Insert your Insert API key into the following JSON and then send the JSON to our endpoint. curl -i -H \"Content-Type: application/json\" \\ -H \"Api-Key: YOUR_INSERT_API_KEY\" \\ -H 'Data-Format: newrelic' \\ -H 'Data-Format-Version: 1' \\ -X POST \\ -d '[ { \"common\": { \"attributes\": { \"service.name\": \"Test Service A\", \"host\": \"host123.test.com\" } }, \"spans\": [ { \"trace.id\": \"123456\", \"id\": \"ABC\", \"attributes\": { \"duration.ms\": 12.53, \"name\": \"/home\" } }, { \"trace.id\": \"123456\", \"id\": \"DEF\", \"attributes\": { \"service.name\": \"Test Service A\", \"host\": \"host456.test.com\", \"duration.ms\": 2.97, \"name\": \"/auth\", \"parent.id\": \"ABC\" } } ] } ]' 'https://trace-api.newrelic.com/trace/v1' If you're sending more than one POST, change the trace.id to a unique value. Sending the same payload or span id multiple times for the same trace.id may result in fragmented traces in the UI. If your test returned HTTP/1.1 202 Accepted, go to our UI to see a query of your test data using the span attribute service.name = Test Service A. Traces may take up to one minute to be processed by both the trace observer and the Trace API. Example: Use Infinite Tracing Infinite Tracing can examine all of your data and find the most useful traces. To get the biggest benefit from Infinite Tracing, you should turn off sampling in your telemetry tool and send all your trace data to the trace observer. To start using Infinite Tracing, please go to our sign-up page. The following steps show you how to find or create a trace observer endpoint using GraphQL and how to send a test payload using the newrelic format. For details about how to structure your data, see JSON requirements and recommendations. If you send your data to a trace observer in one of our EU provider regions, you'll still need a US-based New Relic account because the tail-based sampling data is reported to data centers in the United States. If you have questions, contact your account representative. Step A. Open NerdGraph API explorer Prepare to execute some GraphQL: Open NerdGraph API explorer. In the API key dropdown next to Tools, select your personal API key for your account under one of these options: Select an existing API Key Create a new API Key Step B. See if anyone in your organization has already created a trace observer endpoint The following steps show you how to execute a GraphQL query to find out if you can use an existing trace observer in your AWS region. If one isn't available, you can go to Step C. Create a new one. Copy the following query into the middle pane of the NerdGraph API explorer and replace YOUR_ACCOUNT_ID with your account ID (the number next to your account name in NerdGraph API explorer): { actor { account(id: YOUR_ACCOUNT_ID) { edge { tracing { traceObservers { errors { message type } traceObservers { endpoints { agent { host port } endpointType https { host port url } status } id name providerRegion } } } } } } } Click the triangle button to execute the query or press Ctrl+Enter. Check the right pane showing the results: In traceObservers, if you see an AWS region (providerRegion) appropriate for your location, copy its associated https: url value to use later as YOUR_TRACE_OBSERVER_URL in Send test data to the trace observer. If you don't see any values in traceObservers as shown below, continue to Step C. Create a new one. Step C. If you can't find an existing trace observer endpoint, create a new one If you didn't find a trace observer after running the query in the previous section, you need to create one. To do this, you execute a GraphQL mutation that passes your configuration details. Copy the following into the middle pane of the NerdGraph API explorer. mutation { edgeCreateTraceObserver(accountId: YOUR_ACCOUNT_ID, traceObserverConfigs: {name: \"YOUR_DESCRIPTIVE_NAME\", providerRegion: YOUR_PROVIDER_REGION}) { responses { errors { message type } traceObserver { endpoints { agent { host port } endpointType https { host port url } status } id name providerRegion } } } } Insert your own values into the mutation: Value Description YOUR_ACCOUNT_ID Replace this with your account ID (the number next to your account name in NerdGraph API explorer). YOUR_DESCRIPTIVE_NAME Replace this with a name that describes the services that report to this trace observer (for example, production or query services). YOUR_PROVIDER_REGION Replace this with the provider region enum value for your location: AWS_EU_WEST_1 AWS_US_EAST_1 AWS_US_WEST_2 Click the triangle button to execute the mutation or press Ctrl+Enter. In the right pane showing the results, copy the value of https: url to a text file so you can use it later as YOUR_TRACE_OBSERVER_URL in Send test data to the trace observer: Step D. Send data to the trace observer Here's a test that includes a sample payload with one trace and two spans from the same service: Test Service A. Follow these steps to send a test request: Get or generate your Insert API key so you can use it later in the test. Copy the following curl request into a text editor: curl request curl -i -H \"Content-Type: application/json\" \\ -H \"Api-Key: YOUR_INSERT_API_KEY\" \\ -H 'Data-Format: newrelic' \\ -H 'Data-Format-Version: 1' \\ -X POST \\ -d '[ { \"common\": { \"attributes\": { \"environment\": \"staging\" } }, \"spans\": [ { \"trace.id\": \"123456\", \"id\": \"ABC\", \"attributes\": { \"duration.ms\": 12.53, \"host\": \"host123.test.com\", \"name\": \"/home\", \"service.name\": \"Test Service A\" } }, { \"trace.id\": \"123456\", \"id\": \"DEF\", \"attributes\": { \"duration.ms\": 2.97, \"host\": \"host456.test.com\", \"error.message\": \"Invalid credentials\", \"name\": \"/auth\", \"parent.id\": \"ABC\", \"service.name\": \"Test Service B\" } } ] } ]' \\ 'YOUR_TRACE_OBSERVER_URL' Insert your own values into the curl request: Value Description YOUR_INSERT_API_KEY Replace this with your Insert API key (not the same as your personal API key for NerdGraph API explorer) YOUR_TRACE_OBSERVER_URL Replace this with the value under https: url from above. Copy the content of the text editor into a terminal, and then execute the request. If the test does not return HTTP/1.1 202 Accepted indicating success, check the following and try again: Confirm that you substituted the url (not host) value for YOUR_TRACE_OBSERVER_URL. Confirm that you only have single quotes around the value you inserted for YOUR_TRACE_OBSERVER_URL. Check that you are using the Insert API Key (not a license). If your test returned HTTP/1.1 202 Accepted, go to our UI to see a query of your test data using the span attribute service.name = Test Service A. Because the sample payload contains an error attribute, the error sampler will mark it for keeping. If you modify the payload to remove the error attributes, the random sampler may not choose to keep this particular trace. Traces may take up to one minute to be processed by both the trace observer and the Trace API. JSON requirements and recommendations Requirements and guidelines for trace JSON using the newrelic format: Each JSON payload is an array of objects. Each object should contain a required spans key. Each object may contain an optional common key. Use this if you want share information across multiple spans in a object. Any keys on a span have precedence over the same key in the common block. The value for spans key is a list of span objects. Certain attributes are required, and must be included either in the optional common block, or in each span. Recommended and custom attributes may be optionally included in a list of key/value pairs under a key named attributes, in the optional common block and/or in each span. In the following example POST, there are two spans, both of which will have the trace.id 12345 and the custom attribute host: host123.test.com. The first span has no parent.id, so that is the root of the trace; the second span's parent.id points to the ID of the first. [ { \"common\": { \"attributes\": { \"host\": \"host123.test.com\" } }, \"spans\": [ { \"trace.id\": \"12345\", \"id\": \"abc\", \"attributes\": { \"user.email\": \"bob@newr.com\", \"service.name\": \"my-service\", \"duration.ms\": 750, \"name\": \"my-span\" } }, { \"trace.id\": \"12345\", \"id\": \"def\", \"attributes\": { \"parent.id\": \"abc\", \"service.name\": \"second-service\", \"duration.ms\": 750, \"name\": \"second-span\" } } ] } ] Attributes Review the sections below describing the attributes for the attributes block of a newrelic formatted JSON POST. Required attributes Requests without these attributes will be rejected, and an NrIntegrationError will be generated. These are the only attributes that don't belong under attributes. attribute description id string Unique identifier for this span. trace.id string Unique identifier shared by all spans within a single trace. Highly recommended attributes While not required, these attributes should be included for the best experience with your data. They are included in the attributes section. attribute default description duration.ms float none Duration of this span in milliseconds. name string none The name of this span. parent.id string none The id of the caller of this span. Value is null if this is the root span. Traces without a root span will not displayed. service.name string none The name of the entity that created this span. timestamp long Defaults to the current time in UTC timezone if not provided. The span's start time in Epoch milliseconds. Reserved attributes These attributes are currently reserved for internal New Relic usage. While they are not explicitly blocked, we recommend not using them. attribute default description entity.name string service.name This is derived from the service.name attribute. entity.type string service The entity type is assumed to be a service. entity.guid string None The entity.guid is a derived value that uniquely identifies the entity in New Relic's backend. Other attributes You can add any arbitrary attributes you want, with the exception of the restricted attributes. For example, you might want to add attributes like customer.id or user.id to help you analyze your trace data. To learn how to control how spans appear in New Relic (for example, adding errors or setting a span as a datastore span), see Decorate spans. Explore more about distributed tracing: Learn where Trace API data shows up in the UI. Learn how to decorate spans for a richer, more detailed UI experience. For example, you can have spans show up as datastore spans or display errors. Learn about general data limits, required metadata, and response validation. If you don't see your trace data, see Troubleshooting. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 173.50941, + "_score": 152.22778, "_version": null, "_explanation": null, "sort": null, @@ -7286,7 +7284,7 @@ "body": "Serverless monitoring for AWS Lambda offers in-depth performance monitoring for your Lambda functions. Read on to learn how to enable this feature and get started using it. Using this feature may result in AWS charges. For more information, see the Lambda monitoring requirements.​​​ How Lambda monitoring works Before enabling Lambda monitoring, understanding how data flows from your Lambda functions to New Relic may be helpful: Diagram showing how data flows from a Lambda function to New Relic. When our Lambda monitoring is enabled, this is how data moves from your Lambda function to New Relic: The Lambda function is instrumented with our code. When the Lambda is invoked, log data is sent to CloudWatch. CloudWatch collects Lambda log data and sends it to our log-ingestion Lambda. The log-ingestion Lambda sends that data to New Relic. Enable procedure overview If you already have a New Relic account and use Node.js or Python, we recommend you use our automated installer. If you do not use the automated installer, complete these steps to set up monitoring: Install our CLI tool (recommended) Connect AWS and New Relic (required) Enable instrumentation of your Lambda (required) Stream CloudWatch logs to New Relic (required) Step 1. Install the newrelic-lambda-cli tool We provide a command line interface (CLI) tool that's used in steps 2 through 4. We recommend the CLI because it simplifies some of the work, but you can also perform those steps manually. If you want to understand what it does before you install it, see the manual procedures that the CLI tool performs in Step 2, Step 3 (option 2), and Step 4. You can also see the CLI documentation on GitHub. If you prefer a manual install, skip to Step 2. Connect AWS to New Relic. CLI requirements To use the CLI too, you need: Python 3.3 or higher The AWS CLI You must be a user or admin with an infrastructure manager Add-on role. Your AWS account needs permissions for creating IAM resources (Role and Policy) and Lambda functions. These resources are created using CloudFormation stacks, so you'll need permissions to create those. For more on permissions, including setting custom policies, expand this collapser: AWS permissions details Resource: * Actions: \"cloudformation:CreateChangeSet\", \"cloudformation:CreateStack\", \"cloudformation:DescribeStacks\", \"cloudformation:ExecuteChangeSets\", \"iam:AttachRolePolicy\", \"iam:CreateRole\", \"iam:GetRole\", \"iam:PassRole\", \"lambda:AddPermission\", \"lambda:CreateFunction\", \"lambda:GetFunction\", \"logs:DeleteSubscriptionFilter\", \"logs:DescribeSubscriptionFilters\", \"logs:PutSubscriptionFilter\" \"s3:GetObject\" \"serverlessrepo:CreateCloudFormationChangeSet\" Resource: \"arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion\" Actions: \"serverlessrepo:CreateCloudFormationTemplate\" \"serverlessrepo:GetCloudFormationTemplate\" Be sure that the AWS account you use to execute the CLI has all of these permissions. If your AWS account permissions are restrictive and you're unable to use the CLI, you can optionally use a manually managed custom IAM policy. This policy would require, at minimum, the following permissions: Resource: \"*\" Action: \"cloudwatch:GetMetricStatistics\" \"cloudwatch:ListMetrics\" \"cloudwatch:GetMetricData\" \"lambda:GetAccountSettings\" \"lambda:ListFunctions\" \"lambda:ListAliases\" \"lambda:ListTags\" \"lambda:ListEventSourceMappings\" These permissions are the minimum required. We recommend granting a managed ReadOnlyAccess policy as described in Connect AWS to infrastructure monitoring. CLI installation To install the CLI tool: Ensure you have the required permissions for both your New Relic and AWS account. From the command line, run: pip install newrelic-lambda-cli You may need to use pip3 in the command above if you have Python 2.7 installed. The CLI requires Python >=3.3. Step 2. Connect AWS to New Relic You must complete this step, and steps 3 and 4, to enable our Lambda monitoring. This step connects AWS to New Relic and creates a newrelic-log-ingestion Lambda function that sends your instrumented data to New Relic. You can either use the CLI tool or do the steps manually. Use CLI tool When you use the CLI, you have one optional step and one required step: Optional: If you're using multiple AWS profiles or multiple regions, you may want to configure the AWS environment variables: AWS environment variable instructions Setting the region To configure your region, use this environment variable to override the default region: export AWS_DEFAULT_REGION=MY_REGION # us-west-2, for example The CLI tool also allows passing this per-command using --aws-region. Setting profiles If you have multiple AWS profiles and don't want to use the default, use AWS_PROFILE environment variable to set another profile name. Ensure the profile is properly configured (including the default region). Example: export AWS_PROFILE=MY_PROFILE Run the following command using the CLI tool: newrelic-lambda integrations install --nr-account-id YOUR_ACCOUNT_ID \\ --linked-account-name YOUR_LINKED_ACCOUNT_NAME \\ --nr-api-key YOUR_NR_API_KEY This command: Connects your AWS account to New Relic. Installs a newrelic-log-ingestion Lambda that will send your instrumented data to New Relic. More details: This defaults to U.S. region. If your account is in the EU region, add this argument: --nr-region \"eu\". If you're instrumenting functions in multiple AWS regions, this command must be run for each region using the --aws-region argument. YOUR_LINKED_ACCOUNT_NAME is either a new AWS account you want to link to New Relic, or it's the name of the AWS account that you linked to when setting up the AWS Lambda monitoring integration. YOUR_NR_API_KEY refers to your personal API key (not your REST API key). For more on the API key and other arguments, see our Lambda monitoring GitHub repo. Manual procedures Here are the manual procedures performed by the CLI tool: Connect AWS to New Relic The newrelic-lambda integration command connects the AWS account containing your Lambdas to New Relic. If you've already installed one of our AWS integrations, your accounts should be linked to New Relic and you can skip this section. To manually establish this connection, follow the instructions for connecting AWS to Infrastructure monitoring. Configure our log-ingestion Lambda The newrelic-lambda integration command sets up a newrelic-log-ingestion Lambda. This Lambda takes the logs generated by your Lambda functions and pushes those logs to New Relic. If you're configuring this manually, you must configure our Lambda for the regions you want. The CLI, by default, establishes our Lambda in all regions. To manually configure our Lambda, go to the AWS Serverless Application Repository, which is where the newrelic-log-ingestion Lambda is stored. This repo is a collection of serverless applications published by developers, companies, and partners in the serverless community. It allows developers to share their Lambda functions code with customers, who can then find and deploy the corresponding application Lambda function. Each application is packaged with an AWS Serverless Application Model (SAM) template that defines the AWS resources used. To manually configure our Lambda with the AWS Serverless Application Repository: From the AWS console, go to the Lambda section, select Create function, and select Serverless Application Repository. Search for newrelic and find the newrelic-log-ingestion Lambda. Follow the instructions in the Lambda's documentation to deploy it. A SAM template will build the Lambda. In the environment variable section in AWS console, set the LICENSE_KEY environment variable to your New Relic license key. Note: If you have multiple accounts or a master and sub-account hierarchy, make sure the license key you're using matches the same account connected to AWS. Optional: If you want to stream all your logs to New Relic, set the LOGGING_ENABLED environment variable to true. For more on this, see Stream all logs. Step 3. Enable Lambda instrumentation This step enables instrumentation of your Lambda function, which allows detailed monitoring and alerting functionality. Our instrumentation is designed to have minimal impact on your Lambda performance. If you're using Node.js or Python, we recommend the first two options. Option #1: Use Serverless Framework plugin (Node.js and Python) Requirements Available only for Node.js and Python. For other languages, see Manual instrumentation. Serverless Framework version 1.34.0 or higher. Features If you meet the requirements (above), you can use our Serverless Framework plugin, which allows you to add our AWS Lambda Layer to your functions without requiring a code change. Supports Node.js and Python runtimes No code change required to enable Lambda instrumentation Enables our APM agent functionality using a single layer Configures CloudWatch subscription filters automatically Gets the layer into your code base which is useful for redeploys Install To install our Serverless Framework plugin: Choose an install option: NPM: npm install --save-dev serverless-newrelic-lambda-layers yarn: yarn add --dev serverless-newrelic-lambda-layers Add the plugin to your serverless.yml: plugins: - serverless-newrelic-lambda-layers Get your account ID and put it in the serverless.yml: custom: newRelic: accountId: YOUR_ACCOUNT_ID Deploy it: sls deploy You can skip Step 4. Setting up CloudWatch Logs. This is automatically completed on deploy by our Serverless Framework plugin. For the next step, go to What's next? Option #2: Add Lambda Layer with our CLI (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework and don't intend to redeploy your function frequently, you can use the CLI to add our Lambda Layer: If you haven't already done so, install the CLI: pip install newrelic-lambda-cli List available functions: newrelic-lambda functions list Pass the option -f not-installed to see which functions have not yet been instrumented. Add the layer to your function: newrelic-lambda layers install --function FUNCTION_NAME --nr-account-id NEW_RELIC_ACCOUNT_ID Next, you will configure CloudWatch to send logs to New Relic. Option #3: Manually add our Lambda Layer (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework, you can manually add our Lambda Layer: Find the layer that matches your runtime and region. Copy the Amazon Resource Name (ARN) of the most recent version and add it in the AWS Lambda console for your function. Update your functions handler to point to the newly attached layer in the console for your function: Python: newrelic_lambda_wrapper.handler Node: newrelic-lambda-wrapper.handler Add these environment variables to your Lambda console: NEW_RELIC_ACCOUNT_ID: Your account ID NEW_RELIC_LAMBDA_HANDLER: Path to your initial handler. If you have Node 8 and get a Lambda can't find file error message, expand this collapser: Node 8 \"can't find file\" error troubleshooting If you have Node 8 and receive a Lambda can't find the file newrelic-lambda-wrapper.js message, it's likely that the Node runtime isn't resolving NPM_PATH for the newrelic-lambda module in /opt/nodejs/node_modules. These steps should fix this problem: Create a newrelic-wrapper-helper.js script in your project's root. The script's contents should be module.exports = require('newrelic-lambda-wrapper');. (That is all that needs to be in that script.) Update the handler for your layer declaration to newrelic-lambda-wrapper.handler. Next, you will configure CloudWatch to send logs to New Relic. Option #4: Manually instrument Lambda code for Go, Java, .NET Core, Node.js, and Python If none of the previous options work for you, you can manually instrument your Lambda code. Choose your language: Go To instrument your Go-language Lambda: Download our Go agent package and place it in the same directory as your function. Install the agent: go get -u github.com/newrelic/go-agent. In your Lambda code, import our components, create an application, and update how you start your Lambda. See our GitHub repo for an example of an instrumented Lambda. Optional: Add custom events that will be associated with your Lambda invocation by using the RecordCustomEvent API. For example: func handler(ctx context.Context) { if txn := newrelic.FromContext(ctx); nil != txn { txn.Application().RecordCustomEvent(\"MyEvent\", map[string]interface{}{ \"zip\": \"zap\", }) } fmt.Println(\"hello world!\") } Build and zip your Lambda function and upload it to AWS. Zip and upload recommendations Here are suggestions for zipping and uploading the Lambda: Build the binary for execution on Linux. This produces a binary file called main. You can use: $ GOOS=linux go build -o main Zip the binary into a deployment package using: $ zip deployment.zip main Upload the zip file to AWS using either the AWS Lambda console or the AWS CLI. Name the handler main (to match the name given during the binary build). The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this is the account ID for the root/parent account. Optional: To configure logging, see Go agent logging. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Java Monitoring for AWS Lambda in Java doesn't use our APM Java agent. Instead, it uses these two OpenTracing dependencies: AWS Lambda OpenTracing Java SDK: OpenTracing instrumentation for AWS Lambda RequestHandler and RequestStreamHandler. Our AWS Lambda OpenTracing Tracer: An OpenTracing Tracer implementation designed to monitor AWS Lambda. It generates spans, error events, transaction events, error traces, and provides distributed tracing support. Supported OpenTracing Versions OpenTracing 0.31.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:1.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:1.0.0 OpenTracing 0.32.0, 0.33.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:2.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:2.1.0 To instrument your Java Lambda: In your project’s build.gradle file, include our OpenTracing AWS Lambda Tracer and the AWS Lambda OpenTracing SDK dependencies: dependencies { compile(\"com.newrelic.opentracing:java-aws-lambda:2.1.0\") compile(\"com.newrelic.opentracing:newrelic-java-lambda:2.1.1\") compile(\"io.opentracing:opentracing-util:0.33.0\") } Implement the AWS Lambda RequestHandler interface as shown in the Java Lambda example and override the doHandleRequest method. In the doHandleRequest method, call the LambdaTracing.instrument(...) API to create a root span to trace the lambda function's execution. This is also where you will define your business logic for the lambda function. Register a LambdaTracer.INSTANCE as the OpenTracing Global tracer, as shown in the Java Lambda example. Create a ZIP deployment package and upload it to AWS Lambda. Or deploy it via other means. In the AWS Lambda console, set the handler. For the example Java Lambda, the handler would be com.handler.example.MyLambdaHandler::handleRequest. Because handleRequest is assumed, you could also use com.handler.example.MyLambdaHandler. The following AWS console environment variables are required if you want your Lambda function to be included in distributed tracing. This is recommended. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_PRIMARY_APPLICATION_ID. This is also your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this must be the account ID for the root/parent account. Optional: In the Lambda console, enable debug logging by adding this environment variable: NEW_RELIC_DEBUG is true. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Please see the AWS Lambda distributed tracing example for a complete project that illustrates common use cases such as: Distributed tracing between Lambda functions Manual span creation (aka custom instrumentation) Tracing external calls Adding custom attributes (aka Tags) to spans .NET Core Our monitoring of .NET Core-based AWS Lambda functions doesn't use our standard .NET Core APM agent. Instead, it uses a NuGet package. To instrument your .NET Core Lambda: In your Lambda Functions project, install the NewRelic.OpenTracing.AmazonLambda.Tracer NuGet package. Import the NuGet package and OpenTracing utils: using OpenTracing.Util; using NewRelic.OpenTracing.AmazonLambda; Instrument your function, as shown in this example: public class Function { static Function() { // Register The NewRelic Lambda Tracer Instance GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public object FunctionWrapper(ILambdaContext context) { // Instantiate NewRelic TracingWrapper and pass your FunctionHandler as // an argument return new TracingRequestHandler().LambdaWrapper(FunctionHandler, context); } /// /// A simple function that takes a string and does a ToUpper /// /// /// /// public object FunctionHandler(ILambdaContext context) { ... } } The arguments passed to FunctionWrapper must match the signature of FunctionHandler. If your handler function returns a Task, the Lambda wrapper will block on the return task until it completes, so that it can measure the duration and capture exceptions, if any are present. In addition, you may also inherit from the APIGatewayProxyFunction. For an example, see below: Async handler function public override Task FunctionHandlerAsync(ILambdaContext lambdaContext) { // This call will block by calling task.Result Task task = new TracingRequestHandler().LambdaWrapper( ActualFunctionHandlerAsync, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(ILambdaContext lambdaContext) { // Function can make other async operations here ... } Inheriting from APIGatewayProxyFunction public class LambdaFunction : APIGatewayProxyFunction { static LambdaFunction() { // Register The NewRelic Lambda Tracer Instance OpenTracing.Util.GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public override Task FunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { Task task = new TracingRequestHandler().LambdaWrapper(ActualFunctionHandlerAsync, request, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { return base.FunctionHandlerAsync(request, lambdaContext); } } Optional for SQS and SNS: Starting in version 1.0 of our .NET Lambda Tracer, distributed tracing support has been added for SQS and SNS. To enable distributed tracing for SQS or SNS you will need to complete the items in this step as well as setup the environment variables in the step that follows this one. Enabling distributed tracing support for SQS and SNS will disable automatic instrumentation for both of SQS and SNS and require the use of these wrappers to instrument them. Set the NEW_RELIC_USE_DT_WRAPPER environment variable to true. To instrument SQS and SNS calls you will need to use the provided wrappers. Using the SQS Wrapper The SQS wrapper supports wrapping the following methods: Amazon.SQS.AmazonSQSClient.SendMessageAsync(...) Amazon.SQS.AmazonSQSClient.SendMessageBatchAsync(...) Examples // SQS Client AmazonSQSClient client = new AmazonSQSClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // SendMessageRequest SendMessageRequest sendRequest = new SendMessageRequest(\"QUEUE_URI_STRING\", \"An SQS Message\"); Task responseOne = SQSWrapper.WrapRequest(client.SendMessageAsync, sendRequest); // String-based Task responseTwo = SQSWrapper.WrapRequest(client.SendMessageAsync, \"QUEUE_URI_STRING\", \"Another SQS Message\"); // SendMessageBatchRequest List batchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id1\", \"First SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id2\", \"Second SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id3\", \"Third SQS Message\")); SendMessageBatchRequest sendBatchRequest = new SendMessageBatchRequest(QUEUE_URI, batchEntries); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, sendBatchRequest); // SendMessageBatchRequestEntry List List moreBatchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id4\", \"Fourth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id5\", \"Fifth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id6\", \"Sixth SQS Message\")); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, moreBatchEntries); Using the SNS Wrapper The SNS wrapper supports wrapping the following methods: Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient.PublishAsync(...) Examples // SNS Client AmazonSimpleNotificationServiceClient client = new Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // PublishRequest - Phone Number PublishRequest phonePublishRequest = new PublishRequest(); phonePublishRequest.PhoneNumber = +1XXX5555100; phonePublishRequest.Message = \"An SNS Message for phones\"; Task phoneResponse = SNSWrapper.WrapRequest(client.PublishAsync, phonePublishRequest); // PublishRequest - ARN PublishRequest publishRequest = new PublishRequest(\"TOPIC_ARN\", \"An SNS Message\"); Task publishResponse = SNSWrapper.WrapRequest(client.PublishAsync, publishRequest); // String-based without subject Task ResponseOne = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Another SNS Message\"); // String-based with subject Task ResponseTwo = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Yet Another SNS Message\", \"A Subject\"); The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS Lambda console: NEW_RELIC_ACCOUNT_ID: The account ID the Lambda is reporting to. NEW_RELIC_TRUSTED_ACCOUNT_KEY: This is also the account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Ensure that the wrapper function (FunctionWrapper in above example) is set up as the function handler. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Node.js To instrument your Node.js Lambda: Download our Node.js agent package and place it in the same directory as your function, ensuring the agent is installed as a dependency in the node_modules directory. Use the Node Package Manager: npm install newrelic --save Install our AWS SDK module alongside the Node.js agent: npm install @newrelic/aws-sdk --save In your Lambda code, require the agent module and the AWS SDK at the top of the file, and wrap the handler function. For example: const newrelic = require('newrelic'); require('@newrelic/aws-sdk'); module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { // This is your handler function code console.log('Lambda executed'); callback(); }); Optional: You can also add custom events to your Lambda using the recordCustomEvent API. For example: module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { newrelic.recordCustomEvent(‘MyEventType’, {foo: ‘bar’}); console.log('Lambda executed'); callback(); }); Zip your Lambda function and the Node.js agent folder together. Requirements and recommendations: The New Relic files outside the New Relic agent folder don't need to be included. If your Lambda function file name is, for example, lambda_function.node, we recommend naming your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set these environment variables: NEW_RELIC_NO_CONFIG_FILE. Set to true if not using a configuration file. NEW_RELIC_APP_NAME: Your application name. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To run the agent in serverless mode outside of AWS in a local environment, set the environment variable NEW_RELIC_SERVERLESS_MODE_ENABLED to true. (When executing this in an AWS Lambda environment, the agent will automatically run in serverless mode. Do not use this variable if you're running in AWS.) Optional: To enable logging in serverless mode, set these environment variables: Set NEW_RELIC_LOG_ENABLED to true. Set NEW_RELIC_LOG to stdout for output to CloudWatch, or set to any writeable file location. The log level is set to info by default. See other log levels. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Python To instrument your Python Lambda: Download our Python agent package and place it in the same directory as your function. To do this, use pip: pip install -t . newrelic If you use Homebrew, you may get this error: DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both. For details, see the Homebrew GitHub post. In your Lambda code, import the Python agent module and decorate the handler function using the New Relic decorator. The New Relic package must be imported first in your code. Here's an example: import newrelic.agent newrelic.agent.initialize() @newrelic.agent.lambda_handler() def handler(event, context): ... Optional: You can also add custom events to your Lambda using the record_custom_event API. Here's an example: @newrelic.agent.lambda_handler() def handler(event, context): newrelic.agent.record_custom_event('CustomEvent', {'foo': 'bar'}) … Zip your lambda_function.py and newrelic/ folder together using these guidelines: The New Relic files outside the newrelic/ folder don't need to be included. If your Lambda function file name is, for example, lambda_function.py, name your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set this environment variable: NEW_RELIC_SERVERLESS_MODE_ENABLED. Set to true The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_DISTRIBUTED_TRACING_ENABLED. Set to true. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To configure logging, use the NEW_RELIC_LOG and NEW_RELIC_LOG_LEVEL environment variables in the AWS Console. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. The New Relic decorator gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, configure CloudWatch to send those logs to New Relic. Step 4. Configure CloudWatch logs to stream to New Relic Lambda In this step, you'll link your Lambda function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda that was configured in Step 2. For Node.js and Python: This step isn't necessary if you used the Serverless Framework plugin option in Step 3. This step can be done using the CLI tool or using manual procedures. Use CLI tool Run this command for every Lambda function you want to monitor: newrelic-lambda subscriptions install --function FUNCTION_NAME_#1 Or to set subscription filters for all supported functions run this command:: newrelic-lambda subscriptions install --function all Notes on this command: You should only need one newrelic-log-ingestion Lambda per AWS account and region. You can subscribe as many functions to it as you like. To see more detail about the arguments, including a region-specifying argument, see our GitHub documentation. You may receive a CloudWatch validation error. This doesn't affect data reporting. If you see data reporting in New Relic, disregard that error message. If you have our Logs and want to send all your log data to us (not just Lambda logs), see Stream all logs. Manual procedures Here are the manual procedures performed by the CLI tool: Manual process: Stream CloudWatch logs to New Relic Lambda In Step 2, you set up a newrelic-log-ingestion Lambda function. After you've instrumented your Lambda function (Step 3), the newrelic-lambda subscriptions command links that function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda. To do this manually: Open CloudWatch and select Logs in the left-hand menu, and then select the log group for the function you are monitoring. Select Actions and choose Stream to AWS Lambda. Under Lambda function, select the newrelic-log-ingestion function. Set the Log format to JSON. Set the Subscription filter pattern to ?REPORT ?NR_LAMBDA_MONITORING ?\"Task timed out\". Alternatively, if you are using the LOGGING_ENABLED environment variable stream all your logs to our Logs, leave this field blank. See notes and caveats about this procedure. Make sure the newrelic-log-ingestion Lambda function you select in the method above is in the same AWS region as your Lambda function. What's next? After you complete these steps, here's what you can do next: See data reporting in the Lambda monitoring UI. If you're having trouble finding your data, see Lambda enable troubleshooting. Use configuration settings to fine-tune your data. Our newrelic-log-ingestion function is not updated automatically. For best results and access to latest features, we recommend you occasionally update our Lambda monitoring. Optional: Stream all logs to New Relic If you have log management enabled and want to report all your logs to New Relic, follow these instructions: Go to our newrelic-log-ingestion Lambda and set the LOGGING_ENABLED environment variable to true. It isn't possible to edit existing filter patterns, so they must be removed and re-added: Set the Subscription filter pattern to \"\". Go to the Log group for each monitored Lambda, and remove the newrelic-log-ingestion subscription. Add the subscription filter back, leaving the Subscription filter pattern field blank. 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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 168.49886, + "_score": 149.90172, "_version": null, "_explanation": null, "sort": null, @@ -7318,7 +7316,7 @@ "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-09-24T02:28:37Z", + "published_at": "2020-09-25T01:48:39Z", "updated_at": "2020-09-17T01:48:42Z", "document_type": "page", "popularity": 1, @@ -7326,7 +7324,7 @@ "body": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application. In this guide, you are going to build a sample table using various New Relic One components. Before you begin If you haven't already installed the New Relic One CLI, step through the quick start in New Relic One. This process also gets you an API key. In addition, to complete the steps in this guide, you need a GitHub account and Node.js installed on your machine. See Setting up your development environment for more info. Clone and set up the example application Step 1 of 4 Clone the nr1-how-to example application from GitHub to your local machine. Then, navigate to the app directory. The example app lets you experiment with tables. git clone https://github.com/newrelic/nr1-how-to.git` cd nr1-how-to/create-a-table/nerdlets/create-a-table-nerdlet` Copy Step 2 of 4 Edit the index.json file and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install dependencies nr1 nerdpack:serve # Serve the demo app locally Copy Step 4 of 4 Open one.newrelic.com/?nerdpacks=local in your browser. Click Apps, and then in the Your apps section, you should see a Create a table launcher. That's the demo application you're going to work on. Go ahead and select it. Have a good look at the demo app. There's a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You'll use Table components to add a new table in the second row. Work with table components Step 1 of 10 Navigate to the nerdlets/create-a-table-nerdlet subdirectory and open the index.js file. Add the following components to the import statement at the top of the file so that it looks like the example: Table TableHeader TableHeaderCell TableRow TableRowCell import { Table, TableHeader, TableHeaderCell, TableRow, TableRowCell, PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart, } from 'nr1'; Copy Step 2 of 10 Add a basic Table component Locate the empty GridItem in index.js: This is where you start building the table. Add the initial component. The items property collects the data by calling _getItems(), which contains sample values.
; Copy Step 3 of 10 Add the header and rows As the Table component renders a fixed number of header cells and rows, your next step is adding header components, as well as a function that returns the required table rows. Inside of the Table component, add the TableHeader and then a TableHeaderCell child for each heading. Since you don't know how many rows you'll need, your best bet is to call a function to build as many TableRows as items returned by _getItems(). Application Size Company Team Commit ; { ({ item }) => ( {item.name} {item.value} {item.company} {item.team} {item.commit} ); } Copy Step 4 of 10 Take a look at the application running in New Relic One: you should see something similar to the screenshot below. Step 5 of 10 Replace standard table cells with smart cells The New Relic One library includes cell components that can automatically format certain data types, like users, metrics, and entity names. The table you've just created contains columns that can benefit from those components: Application (an entity name) and Size (a metric). Before you can use EntityTitleTableRowCell and MetricTableRowCell, you have to add them to the import statement first. import { EntityTitleTableRowCell, MetricTableRowCell, ... /* All previous components */ } from 'nr1'; Copy Step 6 of 10 Update your table rows by replacing the first and second TableRowCells with entity and metric cells. Notice that EntityTitleTableRowCell and MetricTableRowCell are self-closing tags. { ({ item }) => ( {item.company} {item.team} {item.commit} ); } Copy Step 7 of 10 Time to give your table a second look: The cell components you've added take care of properly formatting the data. Step 8 of 10 Add some action to your table! Tables are great, but interactive tables can be better: As a last update, you are going to allow users to act on each data row. Add the _getActions() method to your index.js file, right before _getItems(). As you may have guessed from the code, _getActions() spawns an alert box when you click Team or Commit cells. _getActions() { return [ { label: 'Alert Team', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__ALERT, onClick: (evt, { item, index }) => { alert(`Alert Team: ${item.team}`); }, }, { label: 'Rollback Version', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__UNDO, onClick: (evt, { item, index }) => { alert(`Rollback from: ${item.commit}`); }, }, ]; } Copy Step 9 of 10 Find the TableRow component in your return statement and point the actions property to _getActions(). The TableRow actions property defines a set of actions that appear when the user hovers over a table row. Actions have a mandatory text and an onClick callback, but can also display an icon or be disabled if needed. Copy Step 10 of 10 Go back to your application and try hovering over any of the rows: Notice how the two available actions appear. When you click them, a function triggers with the selected row data as an argument, and an alert displays in your browser. Next steps You've built a table into a New Relic One application, using components to format data automatically and provide contextual actions. Well done! Keep exploring the Table components, their properties, and how to use them, in our SDK documentation.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 154.42424, + "_score": 144.85452, "_version": null, "_explanation": null, "sort": null, @@ -7339,43 +7337,51 @@ "id": "5efa989ee7b9d2ad567bab51" }, { - "image": "", - "url": "https://developer.newrelic.com/explore-docs/nr1-subscription/", "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" + "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" ], - "published_at": "2020-09-24T02:30:06Z", - "title": "New Relic One CLI subscription commands", - "updated_at": "2020-08-06T01:44:54Z", + "title": "Get started with the New Relic CLI", "type": "developer", - "external_id": "12d2e1b06dede5b1272527f95a14518010aecc58", + "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-09-25T01:49:59Z", + "updated_at": "2020-08-08T01:41:47Z", "document_type": "page", "popularity": 1, - "info": "An overview of the CLI commands you can use to manage your Nerdpack subscriptions.", - "body": "New Relic One CLI subscription commands To manage your Nerdpack subscriptions, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 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", + "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", + "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.", "_index": "520d1d5d14cc8a32e600034b", "_type": "520d1d5d14cc8a32e600034c", - "_score": 125.569496, + "_score": 121.59511, "_version": null, "_explanation": null, "sort": null, "highlight": { - "title": "New Relic One CLI subscription commands", - "sections": "New Relic One CLI subscription commands", - "info": "An overview of the CLI commands you can use to manage your Nerdpack subscriptions.", - "body": "New Relic One CLI subscription commands To manage your Nerdpack subscriptions, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1" + "title": "Get started with the New Relic CLI", + "sections": "Get started with the New Relic CLI", + "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.", + "tags": "New Relic CLI", + "body": ". This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your" }, - "id": "5f2b6096e7b9d225ebc9de6f" + "id": "5efa999c196a67c4e1766461" } ] } \ No newline at end of file From bd7e3b2aad5da62e62fd47bd9f5c36ea2947fd94 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 25 Sep 2020 17:59:28 -0700 Subject: [PATCH 10/15] refactor: use child states for loading script/form --- src/components/MarketoForm/MarketoForm.js | 2 +- src/hooks/useMarketoForm.js | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/components/MarketoForm/MarketoForm.js b/src/components/MarketoForm/MarketoForm.js index 98f83da7b..11525cf13 100644 --- a/src/components/MarketoForm/MarketoForm.js +++ b/src/components/MarketoForm/MarketoForm.js @@ -44,7 +44,7 @@ const MarketoForm = ({ {title}

- {(state === 'loading' || state === 'scriptLoaded') && } + {state.matches('loading') && }
); diff --git a/src/hooks/useMarketoForm.js b/src/hooks/useMarketoForm.js index f0ea778a3..e6ff78ae8 100644 --- a/src/hooks/useMarketoForm.js +++ b/src/hooks/useMarketoForm.js @@ -12,15 +12,19 @@ const machine = Machine({ }, states: { loading: { - on: { LOADED: 'scriptLoaded', LOAD_ERROR: 'error', BLOCKED: 'blocked' }, - }, - scriptLoaded: { - entry: ['loadForm'], + initial: 'script', + states: { + script: { + on: { LOADED: 'form' }, + }, + form: { entry: ['loadForm'], type: 'final' }, + }, on: { READY: { target: 'ready', actions: assign({ form: (_context, event) => event.form }), }, + LOAD_ERROR: 'error', BLOCKED: 'blocked', }, }, @@ -82,10 +86,7 @@ const useMarketoForm = (munchkinId, id, publishableKey, redirectLink) => { }, }); - return [ - state.context.form, - { state: state.value, error: state.context.error }, - ]; + return [state.context.form, { state, error: state.context.error }]; }; export default useMarketoForm; From 76f16a5bef56cc664bc1e0d6628feeb28a845a12 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 25 Sep 2020 18:00:34 -0700 Subject: [PATCH 11/15] chore: useMarketoForm takes params --- src/components/MarketoForm/MarketoForm.js | 6 +++--- src/hooks/useMarketoForm.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/MarketoForm/MarketoForm.js b/src/components/MarketoForm/MarketoForm.js index 11525cf13..117765902 100644 --- a/src/components/MarketoForm/MarketoForm.js +++ b/src/components/MarketoForm/MarketoForm.js @@ -12,12 +12,12 @@ const MarketoForm = ({ publishableKey, redirectLink, }) => { - const [, { state }] = useMarketoForm( + const [, { state }] = useMarketoForm({ munchkinId, id, publishableKey, - redirectLink - ); + redirectLink, + }); return (
{ +const useMarketoForm = ({ munchkinId, id, publishableKey, redirectLink }) => { const [state, send] = useMachine(machine, { actions: { loadForm: asEffect(() => { From d4ce6f97018e630c9f53f43736d475eb5b03f75e Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 25 Sep 2020 18:04:22 -0700 Subject: [PATCH 12/15] feat: use an onSubmit option instead of redirecting in useMarketoForm --- src/components/MarketoForm/MarketoForm.js | 5 +++-- src/hooks/useMarketoForm.js | 10 +++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/components/MarketoForm/MarketoForm.js b/src/components/MarketoForm/MarketoForm.js index 117765902..1b50cec14 100644 --- a/src/components/MarketoForm/MarketoForm.js +++ b/src/components/MarketoForm/MarketoForm.js @@ -1,9 +1,10 @@ import React from 'react'; import PropTypes from 'prop-types'; import { css } from '@emotion/core'; -import './marketo.scss'; +import { navigate } from 'gatsby'; import useMarketoForm from '../../hooks/useMarketoForm'; import Spinner from '../Spinner'; +import './marketo.scss'; const MarketoForm = ({ title, @@ -16,7 +17,7 @@ const MarketoForm = ({ munchkinId, id, publishableKey, - redirectLink, + onSubmit: () => navigate(redirectLink), }); return ( diff --git a/src/hooks/useMarketoForm.js b/src/hooks/useMarketoForm.js index bc139da9d..59069bcac 100644 --- a/src/hooks/useMarketoForm.js +++ b/src/hooks/useMarketoForm.js @@ -1,4 +1,3 @@ -import { navigate } from 'gatsby'; import { assign, Machine } from 'xstate'; import { asEffect, useMachine } from '@xstate/react'; import useScript from './useScript'; @@ -46,7 +45,12 @@ const machine = Machine({ }, }); -const useMarketoForm = ({ munchkinId, id, publishableKey, redirectLink }) => { +const useMarketoForm = ({ + id, + munchkinId, + publishableKey, + onSubmit = () => {}, +}) => { const [state, send] = useMachine(machine, { actions: { loadForm: asEffect(() => { @@ -59,7 +63,7 @@ const useMarketoForm = ({ munchkinId, id, publishableKey, redirectLink }) => { }), defineFormActions: asEffect(({ form }) => { form.onSuccess(() => { - navigate(redirectLink); + onSubmit(); // prevent the default behavior of redirecting via marketo to another // page. We want to control the navigation ourselves. From 517b59a40e223595eebcb7e9876431f8d5bb825f Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 25 Sep 2020 18:04:38 -0700 Subject: [PATCH 13/15] chore: run prettier on marketo.scss --- src/components/MarketoForm/marketo.scss | 388 +++++++++++++----------- 1 file changed, 212 insertions(+), 176 deletions(-) diff --git a/src/components/MarketoForm/marketo.scss b/src/components/MarketoForm/marketo.scss index fb92c0a67..d421141af 100644 --- a/src/components/MarketoForm/marketo.scss +++ b/src/components/MarketoForm/marketo.scss @@ -1,179 +1,215 @@ - -.mktoForm{ - background-color:none; - border:none; - border-radius:0; - box-shadow:none; - padding-left:0; - padding-right:0; - padding-bottom:40px; - width:100% !important; - font-family:"Open Sans" !important -} -.mktoForm div{ - float:none -} -.mktoForm .mktoFormCol,.mktoForm .mktoFieldWrap{ - width:100% +.mktoForm { + background-color: none; + border: none; + border-radius: 0; + box-shadow: none; + padding-left: 0; + padding-right: 0; + padding-bottom: 40px; + width: 100% !important; + font-family: 'Open Sans' !important; +} +.mktoForm div { + float: none; +} +.mktoForm .mktoFormCol, +.mktoForm .mktoFieldWrap { + width: 100%; } .mktoForm .mktoFieldWrap { - margin-bottom: 1rem; -} -.mktoForm .mktoOffset,.mktoForm .mktoGutter{ - display:none -} -.mktoForm .mktoFormRow input[type=text],.mktoForm .mktoFormRow input[type=url],.mktoForm .mktoFormRow input[type=email],.mktoForm .mktoFormRow input[type=tel],.mktoForm .mktoFormRow input[type=number],.mktoForm .mktoFormRow input[type=date],.mktoForm .mktoFormRow select.mktoField,.mktoForm .mktoFormRow textarea.mktoField{ - -webkit-appearance:none; - background-color: var(--primary-background-color); - line-height:1.5em !important; - color: var(--primary-text-color); - border:1px solid var(--border-color); - border-radius:0 !important; - padding:0.5em 0.8em !important; - box-shadow:none !important; - width:100% !important; - margin:5px 0 !important -} -.mktoForm .mktoFormRow input[type=text]:focus,.mktoForm .mktoFormRow input[type=url]:focus,.mktoForm .mktoFormRow input[type=email]:focus,.mktoForm .mktoFormRow input[type=tel]:focus,.mktoForm .mktoFormRow input[type=number]:focus,.mktoForm .mktoFormRow input[type=date]:focus,.mktoForm .mktoFormRow select.mktoField:focus,.mktoForm .mktoFormRow textarea.mktoField:focus{ - border:1px solid #0086ed !important; - box-shadow:0 0 6px rgba(0,134,237,0.35) !important; - outline:0 -} -.mktoForm textarea.mktoField{ - height:80px -} -.mktoForm .mktoButtonWrap{ - margin-top:20px; - display:block; - margin-left:0 !important -} -.mktoForm .mktoFormRow,.mktoForm .mktoButtonRow{ - display:block; - padding-left:0 -} -.mktoForm .mktoField{ - font-size:14px !important; - color:var(--color-neutrals-700); - width:100% !important; - padding:0.4em 22px 0.4em 0.5em -} -.mktoForm .mktoLabel{ - padding:0; - margin:0; - float:left; - font-size:16px; - font-weight:600 !important; - line-height:1.2em; - max-width:100%; - width:auto !important; -} -.mktoForm .mktoRequiredField label.mktoLabel{ - font-weight:600 !important -} -.mktoForm .mktoLogicalField{ - width:50px !important; - font-weight:300 -} -.mktoForm .mktoLogicalField label{ - display:inline-block -} -.mktoForm .mktoRadioList,.mktoForm .mktoCheckboxList{ - padding:0.3em; - float:left -} -.mktoForm .mktoAsterix{ - display:none -} -.mktoForm .mktoRequiredField .mktoAsterix{ - display:inline-block -} -.mktoForm input:-moz-placeholder{ - color:var(--color-neutrals-600) -} -.mktoForm input::-moz-placeholder{ - color:var(--color-neutrals-600) -} -.mktoForm input:-ms-input-placeholder{ - color:var(--color-neutrals-600) -} -.mktoForm input placeholder{ - color:var(--color-neutrals-600) -} -.mktoForm input[type=radio]{ - width:20px !important -} -#mktoForm_0000{ - display:none -} -body .mktoForm .mktoButtonRow .mktoButtonWrap .mktoButton{ - position:relative; - display:inline-block; - font-weight:600; - text-align:center; - vertical-align:middle; - cursor:pointer; - white-space:nowrap; - border:1px solid var(--color-teal-400); - color:var(--color-white); - text-decoration:none; - text-shadow:none; - background-color:var(--color-teal-400) !important; - background-image:url("") !important; - margin:0; - -webkit-user-select:none; - -moz-user-select:none; - -ms-user-select:none; - user-select:none; - -webkit-font-smoothing:antialiased; - padding:16px 32px; - font-size:12px; - line-height:2; - border-radius:0 -} -@media (min-width: 991px){ - body .mktoForm .mktoButtonRow .mktoButtonWrap .mktoButton{ - padding:16px 32px; - font-size:16px; - line-height:1.625; - border-radius:0 - } - body .mktoForm .mktoButtonRow .mktoButtonWrap .mktoButton:hover{ - background-color:var(--color-teal-300) !important; - border:1px solid var(--color-teal-300) - } -} -@media (max-width: 767px){ - .mktoForm input[type=text],.mktoForm input[type=url],.mktoForm input[type=email],.mktoForm input[type=tel],.mktoForm input[type=number],.mktoForm input[type=date],.mktoForm select.mktoField,.mktoForm textarea.mktoField{ - border-radius:0; - padding:5px 10px !important; - height:40px !important - } - .mktoForm .mktoField{ - font-size:14px !important - } - .mktoForm .mktoLabel,.mktoForm .mktoCheckboxList label{ - font-size:14px; - font-weight:600 !important - } - .mktoForm input[type=checkbox]+label:before,.mktoForm input[type=radio]+label:before{ - margin-left:-1.25em; - line-height:1em; - font-size:24px; - margin-top:.05em - } - .mktoForm textarea.mktoField{ - height:6em !important - } - .mktoForm .mktoButtonWrap{ - margin-top:40px - } - .mktoForm .mktoFormCol{ - margin:0 0 5px !important - } -} -p,li,.btn,h1,h2,h3,h4,h5,h6,td,th{ - -moz-osx-font-smoothing:grayscale -} -html.with-featherlight{ - overflow:hidden + margin-bottom: 1rem; +} +.mktoForm .mktoOffset, +.mktoForm .mktoGutter { + display: none; +} +.mktoForm .mktoFormRow input[type='text'], +.mktoForm .mktoFormRow input[type='url'], +.mktoForm .mktoFormRow input[type='email'], +.mktoForm .mktoFormRow input[type='tel'], +.mktoForm .mktoFormRow input[type='number'], +.mktoForm .mktoFormRow input[type='date'], +.mktoForm .mktoFormRow select.mktoField, +.mktoForm .mktoFormRow textarea.mktoField { + -webkit-appearance: none; + background-color: var(--primary-background-color); + line-height: 1.5em !important; + color: var(--primary-text-color); + border: 1px solid var(--border-color); + border-radius: 0 !important; + padding: 0.5em 0.8em !important; + box-shadow: none !important; + width: 100% !important; + margin: 5px 0 !important; +} +.mktoForm .mktoFormRow input[type='text']:focus, +.mktoForm .mktoFormRow input[type='url']:focus, +.mktoForm .mktoFormRow input[type='email']:focus, +.mktoForm .mktoFormRow input[type='tel']:focus, +.mktoForm .mktoFormRow input[type='number']:focus, +.mktoForm .mktoFormRow input[type='date']:focus, +.mktoForm .mktoFormRow select.mktoField:focus, +.mktoForm .mktoFormRow textarea.mktoField:focus { + border: 1px solid #0086ed !important; + box-shadow: 0 0 6px rgba(0, 134, 237, 0.35) !important; + outline: 0; +} +.mktoForm textarea.mktoField { + height: 80px; +} +.mktoForm .mktoButtonWrap { + margin-top: 20px; + display: block; + margin-left: 0 !important; +} +.mktoForm .mktoFormRow, +.mktoForm .mktoButtonRow { + display: block; + padding-left: 0; +} +.mktoForm .mktoField { + font-size: 14px !important; + color: var(--color-neutrals-700); + width: 100% !important; + padding: 0.4em 22px 0.4em 0.5em; +} +.mktoForm .mktoLabel { + padding: 0; + margin: 0; + float: left; + font-size: 16px; + font-weight: 600 !important; + line-height: 1.2em; + max-width: 100%; + width: auto !important; +} +.mktoForm .mktoRequiredField label.mktoLabel { + font-weight: 600 !important; +} +.mktoForm .mktoLogicalField { + width: 50px !important; + font-weight: 300; +} +.mktoForm .mktoLogicalField label { + display: inline-block; +} +.mktoForm .mktoRadioList, +.mktoForm .mktoCheckboxList { + padding: 0.3em; + float: left; +} +.mktoForm .mktoAsterix { + display: none; +} +.mktoForm .mktoRequiredField .mktoAsterix { + display: inline-block; +} +.mktoForm input:-moz-placeholder { + color: var(--color-neutrals-600); +} +.mktoForm input::-moz-placeholder { + color: var(--color-neutrals-600); +} +.mktoForm input:-ms-input-placeholder { + color: var(--color-neutrals-600); +} +.mktoForm input placeholder { + color: var(--color-neutrals-600); +} +.mktoForm input[type='radio'] { + width: 20px !important; +} +#mktoForm_0000 { + display: none; +} +body .mktoForm .mktoButtonRow .mktoButtonWrap .mktoButton { + position: relative; + display: inline-block; + font-weight: 600; + text-align: center; + vertical-align: middle; + cursor: pointer; + white-space: nowrap; + border: 1px solid var(--color-teal-400); + color: var(--color-white); + text-decoration: none; + text-shadow: none; + background-color: var(--color-teal-400) !important; + background-image: url('') !important; + margin: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-font-smoothing: antialiased; + padding: 16px 32px; + font-size: 12px; + line-height: 2; + border-radius: 0; +} +@media (min-width: 991px) { + body .mktoForm .mktoButtonRow .mktoButtonWrap .mktoButton { + padding: 16px 32px; + font-size: 16px; + line-height: 1.625; + border-radius: 0; + } + body .mktoForm .mktoButtonRow .mktoButtonWrap .mktoButton:hover { + background-color: var(--color-teal-300) !important; + border: 1px solid var(--color-teal-300); + } +} +@media (max-width: 767px) { + .mktoForm input[type='text'], + .mktoForm input[type='url'], + .mktoForm input[type='email'], + .mktoForm input[type='tel'], + .mktoForm input[type='number'], + .mktoForm input[type='date'], + .mktoForm select.mktoField, + .mktoForm textarea.mktoField { + border-radius: 0; + padding: 5px 10px !important; + height: 40px !important; + } + .mktoForm .mktoField { + font-size: 14px !important; + } + .mktoForm .mktoLabel, + .mktoForm .mktoCheckboxList label { + font-size: 14px; + font-weight: 600 !important; + } + .mktoForm input[type='checkbox'] + label:before, + .mktoForm input[type='radio'] + label:before { + margin-left: -1.25em; + line-height: 1em; + font-size: 24px; + margin-top: 0.05em; + } + .mktoForm textarea.mktoField { + height: 6em !important; + } + .mktoForm .mktoButtonWrap { + margin-top: 40px; + } + .mktoForm .mktoFormCol { + margin: 0 0 5px !important; + } +} +p, +li, +.btn, +h1, +h2, +h3, +h4, +h5, +h6, +td, +th { + -moz-osx-font-smoothing: grayscale; +} +html.with-featherlight { + overflow: hidden; } From 5a670d5d5b7edd3ac6912bb8415ea4a2e82fd75d Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 25 Sep 2020 18:22:02 -0700 Subject: [PATCH 14/15] fix: show error states on the marketo form --- src/components/MarketoForm/MarketoForm.js | 33 ++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/src/components/MarketoForm/MarketoForm.js b/src/components/MarketoForm/MarketoForm.js index 1b50cec14..da54a8318 100644 --- a/src/components/MarketoForm/MarketoForm.js +++ b/src/components/MarketoForm/MarketoForm.js @@ -35,22 +35,49 @@ const MarketoForm = ({ padding: 1.25rem; `} > -

{title} -

+ + {state.matches('blocked') && ( + + Unable to load the form. Perhaps you have an ad blocker enabled? + + )} + {state.matches('error') && Unable to load the form.} {state.matches('loading') && }
); }; +const Error = ({ children }) => ( +
+ {children} +
+); + +Error.propTypes = { + children: PropTypes.node, +}; + MarketoForm.propTypes = { title: PropTypes.string.isRequired, id: PropTypes.number.isRequired, From d60bde5b633b44700c7505765a2849ef60d89e4d Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 25 Sep 2020 18:22:11 -0700 Subject: [PATCH 15/15] feat: update button styles on marketo form --- src/components/MarketoForm/marketo.scss | 49 ++++++++++--------------- 1 file changed, 19 insertions(+), 30 deletions(-) diff --git a/src/components/MarketoForm/marketo.scss b/src/components/MarketoForm/marketo.scss index d421141af..6fb02862d 100644 --- a/src/components/MarketoForm/marketo.scss +++ b/src/components/MarketoForm/marketo.scss @@ -5,9 +5,8 @@ box-shadow: none; padding-left: 0; padding-right: 0; - padding-bottom: 40px; - width: 100% !important; - font-family: 'Open Sans' !important; + padding-bottom: 0; + width: 100%; } .mktoForm div { float: none; @@ -123,40 +122,30 @@ display: none; } body .mktoForm .mktoButtonRow .mktoButtonWrap .mktoButton { + display: inline-flex; + align-items: center; + justify-content: center; position: relative; - display: inline-block; font-weight: 600; - text-align: center; - vertical-align: middle; + font-size: 0.875rem; cursor: pointer; white-space: nowrap; - border: 1px solid var(--color-teal-400); + border: 1px solid transparent; color: var(--color-white); - text-decoration: none; - text-shadow: none; - background-color: var(--color-teal-400) !important; - background-image: url('') !important; margin: 0; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; user-select: none; - -webkit-font-smoothing: antialiased; - padding: 16px 32px; - font-size: 12px; - line-height: 2; - border-radius: 0; -} -@media (min-width: 991px) { - body .mktoForm .mktoButtonRow .mktoButtonWrap .mktoButton { - padding: 16px 32px; - font-size: 16px; - line-height: 1.625; - border-radius: 0; - } - body .mktoForm .mktoButtonRow .mktoButtonWrap .mktoButton:hover { - background-color: var(--color-teal-300) !important; - border: 1px solid var(--color-teal-300); + padding: 0.5rem 1rem; + line-height: 1; + border-radius: 3px; + transition: all 0.15s ease-out; + + color: var(--color-white); + background-color: var(--color-brand-600); + + &:hover { + color: var(--color-white); + background-color: var(--color-brand-500); + transform: translate3d(0, -1px, 0); } } @media (max-width: 767px) {