+
{duration ? (
-
+
) : (
)}
{duration}
-
{title}
-
{description}
+
+ {title}
+
+
+ {description}
+
{children}
-
+
);
GuideTile.Button = Button;
@@ -61,10 +135,12 @@ GuideTile.propTypes = {
children: PropTypes.node,
as: PropTypes.elementType,
alignment: PropTypes.oneOf(Object.values(GuideTile.ALIGNMENT)),
+ featured: PropTypes.bool,
};
GuideTile.defaultProps = {
alignment: GuideTile.ALIGNMENT.CENTER,
+ featured: false,
};
export default GuideTile;
diff --git a/src/components/GuideTile/GuideTile.module.scss b/src/components/GuideTile/GuideTile.module.scss
deleted file mode 100644
index 9798585a2..000000000
--- a/src/components/GuideTile/GuideTile.module.scss
+++ /dev/null
@@ -1,87 +0,0 @@
-.tile {
- display: grid;
- grid-template-rows: auto auto 1fr auto;
- background: var(
- --surface-background-color,
- var(--primary-surface-background-color)
- );
- box-shadow: var(--boxshadow);
- padding: 1rem;
- border: 1px solid var(--border-color);
- border-radius: 0.25rem;
- position: relative;
- transition: all 0.15s ease-out;
-
- &:hover {
- transform: translateY(-2px);
- border-color: var(--border-hover-color);
- }
-}
-
-.tileWithIcon h2 {
- margin-top: 1rem;
-}
-
-.timeEstimate {
- font-size: 0.75rem;
- display: flex;
- align-items: center;
- text-align: right;
- color: var(--accent-text-color);
- padding: 0.3rem 0 0.2rem 1.2rem;
- justify-self: end;
-}
-
-.iconContainer {
- position: absolute;
- top: -2.75rem;
- left: 50%;
- margin-left: -2.75rem;
- width: 5.5rem;
- height: 5.5rem;
- border: 4px solid var(--surface-background-color);
- background-color: var(--color-neutrals-200);
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
-
- :global(.dark-mode) & {
- background-color: var(--color-dark-050);
- }
-}
-
-.description {
- font-size: 0.9rem;
- margin-bottom: 1.5rem;
- color: var(--secondary-text-color);
- flex: 1;
-
- &:last-child {
- margin-bottom: 0;
- }
-}
-
-.timeIcon {
- margin-right: 0.25rem;
-}
-
-.tileLeftAligned {
- .title,
- .description {
- text-align: left;
- }
- .description {
- padding: 0;
- }
-}
-
-.tileCenterAligned {
- .title,
- .description {
- text-align: center;
- }
- .description {
- padding: 0 0.5rem;
- }
-}
diff --git a/src/components/HamburgerMenu.js b/src/components/HamburgerMenu.js
deleted file mode 100644
index 080bb7f44..000000000
--- a/src/components/HamburgerMenu.js
+++ /dev/null
@@ -1,30 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-import cx from 'classnames';
-import styles from './HamburgerMenu.module.scss';
-
-const HamburgerMenu = ({ className, toggle, isOpen }) => (
-
toggle()}
- >
-
-
-
-
-);
-
-HamburgerMenu.propTypes = {
- className: PropTypes.string,
- toggle: PropTypes.func.isRequired,
- isOpen: PropTypes.bool,
-};
-
-HamburgerMenu.defaultProps = {
- isOpen: false,
-};
-
-export default HamburgerMenu;
diff --git a/src/components/HamburgerMenu.module.scss b/src/components/HamburgerMenu.module.scss
deleted file mode 100644
index c0cb0f550..000000000
--- a/src/components/HamburgerMenu.module.scss
+++ /dev/null
@@ -1,36 +0,0 @@
-button.hamburgerMenu {
- display: block;
- background: none;
- border: 0;
- cursor: pointer;
- width: 2rem;
- outline: none;
- padding: 0;
-
- div {
- width: 100%;
- height: 4px;
- background-color: var(--color-black);
- margin: 5px 0;
- border-radius: 2px;
- transition: 0.18s;
-
- :global(.dark-mode) & {
- background-color: var(--color-white);
- }
- }
-
- &.isOpen {
- :nth-child(1) {
- transform: rotate(-45deg) translate(-6.5px, 6.5px);
- }
-
- :nth-child(2) {
- opacity: 0;
- }
-
- :nth-child(3) {
- transform: rotate(45deg) translate(-6px, -6.5px);
- }
- }
-}
diff --git a/src/components/Iframe.js b/src/components/Iframe.js
new file mode 100644
index 000000000..e93d8fe69
--- /dev/null
+++ b/src/components/Iframe.js
@@ -0,0 +1,30 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { css } from '@emotion/core';
+
+const Iframe = (props) => {
+ // strip out width and then render iframe
+ // eslint-disable-next-line no-unused-vars
+ const { width, title, ...limitedProps } = props;
+
+ return (
+
+ );
+};
+
+Iframe.propTypes = {
+ width: PropTypes.string,
+ title: PropTypes.string,
+};
+
+Iframe.defaultProps = {
+ title: 'iFrame content',
+};
+
+export default Iframe;
diff --git a/src/components/Layout.js b/src/components/Layout.js
deleted file mode 100644
index af75b4793..000000000
--- a/src/components/Layout.js
+++ /dev/null
@@ -1,45 +0,0 @@
-import React, { useState } from 'react';
-import PropTypes from 'prop-types';
-import cx from 'classnames';
-
-import Footer from './Footer';
-import GlobalHeader from './GlobalHeader';
-import MobileHeader from './MobileHeader';
-import Sidebar from './Sidebar';
-import styles from './Layout.module.scss';
-import 'normalize.css';
-import './styles.scss';
-import '../theme.scss';
-
-const Layout = ({ children }) => {
- const [isMobileNavOpen, setIsMobileNavOpen] = useState(false);
-
- return (
-
-
-
setIsMobileNavOpen(!isMobileNavOpen)}
- />
-
-
- );
-};
-
-Layout.propTypes = {
- children: PropTypes.node.isRequired,
-};
-
-export default Layout;
diff --git a/src/components/Layout.module.scss b/src/components/Layout.module.scss
deleted file mode 100644
index 8f1743aa9..000000000
--- a/src/components/Layout.module.scss
+++ /dev/null
@@ -1,55 +0,0 @@
-.layout {
- --global-header-height: 30px;
- --sidebar-width: 300px;
-
- min-height: 100vh;
- display: grid;
- grid-template-rows: auto 1fr;
-}
-
-.main {
- display: grid;
- grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
- width: 100%;
-
- @media screen and (max-width: 760px) {
- grid-template-columns: minmax(0, 1fr);
- }
-}
-
-.contentContainer {
- display: flex;
- flex-direction: column;
- margin: 2rem;
-}
-
-.sidebar {
- position: fixed;
- top: var(--global-header-height);
- bottom: 0;
- width: var(--sidebar-width);
- height: calc(100vh - var(--global-header-height));
- overflow: auto;
-}
-
-.content {
- flex: 1;
- margin-bottom: 2rem;
-}
-
-.footer {
- border-top: 1px solid var(--divider-color);
- padding-top: 2rem;
-}
-
-.hideOnDesktop {
- @media (min-width: 760px + 1) {
- display: none;
- }
-}
-
-.hideOnMobile {
- @media (max-width: 760px) {
- display: none;
- }
-}
diff --git a/src/components/Logo.module.scss b/src/components/Logo.module.scss
index abe1fa7dc..9b61abf46 100644
--- a/src/components/Logo.module.scss
+++ b/src/components/Logo.module.scss
@@ -7,12 +7,12 @@
}
.brackets {
- stroke: var(--logo-bracket-color, var(--color-brand-800));
+ stroke: var(--logo-bracket-color, var(--color-brand-500));
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
:global(.dark-mode) & {
- stroke: var(--logo-bracket-color, var(--color-brand-400));
+ stroke: var(--logo-bracket-color, var(--color-brand-300));
}
}
diff --git a/src/components/MDXCodeBlock.js b/src/components/MDXCodeBlock.js
deleted file mode 100644
index c06bc6bd2..000000000
--- a/src/components/MDXCodeBlock.js
+++ /dev/null
@@ -1,36 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-import CodeBlock from './CodeBlock';
-
-const MDXCodeBlock = ({
- children,
- className,
- copy,
- lineNumbers,
- live,
- lineHighlight,
- ...props
-}) => (
-
- {children}
-
-);
-
-MDXCodeBlock.propTypes = {
- children: PropTypes.string,
- className: PropTypes.string,
- copy: PropTypes.oneOf(['true', 'false']),
- lineHighlight: PropTypes.string,
- lineNumbers: PropTypes.oneOf(['true', 'false']),
- live: PropTypes.oneOf(['true', 'false']),
-};
-
-export default MDXCodeBlock;
diff --git a/src/components/MDXContainer.js b/src/components/MDXContainer.js
index e081d4977..5b49416d6 100644
--- a/src/components/MDXContainer.js
+++ b/src/components/MDXContainer.js
@@ -4,14 +4,14 @@ import cx from 'classnames';
import { MDXRenderer } from 'gatsby-plugin-mdx';
import { MDXProvider } from '@mdx-js/react';
-import Video from './Video';
import Step from './Step';
import Steps from './Steps';
import Caution from './Caution';
import Important from './Important';
import Tip from './Tip';
import Intro from './Intro';
-import MDXCodeBlock from './MDXCodeBlock';
+import Iframe from './Iframe';
+import { MDXCodeBlock, Video } from '@newrelic/gatsby-theme-newrelic';
import styles from './MDXContainer.module.scss';
@@ -23,6 +23,7 @@ const components = {
Important,
Tip,
Intro,
+ iframe: Iframe,
code: MDXCodeBlock,
pre: (props) => props.children,
};
diff --git a/src/components/MDXContainer.module.scss b/src/components/MDXContainer.module.scss
index 925cdad5e..bc543d28d 100644
--- a/src/components/MDXContainer.module.scss
+++ b/src/components/MDXContainer.module.scss
@@ -5,10 +5,13 @@
code {
padding: 0.125rem;
- background: var(--tertiary-background-color);
border-radius: 2px;
}
+ :not(pre) > code {
+ background: var(--tertiary-background-color);
+ }
+
p:last-child {
margin-bottom: 0;
}
diff --git a/src/components/MobileHeader.js b/src/components/MobileHeader.js
index 088b25395..87f6d531c 100644
--- a/src/components/MobileHeader.js
+++ b/src/components/MobileHeader.js
@@ -1,40 +1,64 @@
import React, { useState } from 'react';
import PropTypes from 'prop-types';
+import { css } from '@emotion/core';
import { Link } from 'gatsby';
-import cx from 'classnames';
import Logo from './Logo';
import Navigation from './Navigation';
-import HamburgerMenu from './HamburgerMenu';
-import SearchInput from './SearchInput';
-import styles from './MobileHeader.module.scss';
+import { HamburgerMenu, SearchInput } from '@newrelic/gatsby-theme-newrelic';
const MobileHeader = ({ className, isOpen, toggle }) => {
const [searchTerm, setSearchTerm] = useState('');
return (
-
-
+
+
-
+
-
+
{isOpen && (
<>
setSearchTerm('')}
onChange={(e) => setSearchTerm(e.target.value)}
value={searchTerm}
/>
-
+
>
)}
diff --git a/src/components/MobileHeader.module.scss b/src/components/MobileHeader.module.scss
deleted file mode 100644
index dbdc1d881..000000000
--- a/src/components/MobileHeader.module.scss
+++ /dev/null
@@ -1,28 +0,0 @@
-.container {
- position: relative;
- border-bottom: 1px solid var(--divider-color);
- padding: 0 2rem;
-
- width: 100vw;
-}
-
-.menuBar {
- display: flex;
- align-items: center;
- justify-content: space-between;
- height: var(--height-mobile-nav-bar);
-}
-
-.logo {
- display: block;
- width: 160px;
-}
-
-.navigation {
- font-size: 1rem;
- padding: 1.5rem 3rem;
- position: absolute;
- height: calc(
- 100vh - (var(--height-mobile-nav-bar) + var(--height-global-header))
- );
-}
diff --git a/src/components/Navigation.js b/src/components/Navigation.js
index b1ee99d2e..ad11ed02a 100644
--- a/src/components/Navigation.js
+++ b/src/components/Navigation.js
@@ -45,13 +45,11 @@ const Navigation = ({ className, searchTerm }) => {
role="navigation"
aria-label="Navigation"
>
-
+
);
};
diff --git a/src/components/Navigation.module.scss b/src/components/Navigation.module.scss
index 2bb3a0cb3..025eb98eb 100644
--- a/src/components/Navigation.module.scss
+++ b/src/components/Navigation.module.scss
@@ -2,11 +2,6 @@
font-size: 0.875rem;
}
-.listNav {
- list-style: none;
- padding-left: 0;
-}
-
.emptyResults {
font-size: 0.875rem;
padding-top: 1rem;
diff --git a/src/components/NavigationItems.js b/src/components/NavigationItems.js
index 4b84c44c7..77ef8c058 100644
--- a/src/components/NavigationItems.js
+++ b/src/components/NavigationItems.js
@@ -1,4 +1,6 @@
-import React, { Fragment, useState, useContext } from 'react';
+import React, { Fragment, useState, useContext, useEffect } from 'react';
+import { css } from '@emotion/core';
+import usePrevious from '../hooks/usePrevious';
import PropTypes from 'prop-types';
import FeatherIcon from './FeatherIcon';
import NewRelicIcon from './NewRelicIcon';
@@ -7,13 +9,17 @@ import cx from 'classnames';
import { BreadcrumbContext } from './BreadcrumbContext';
import styles from './NavigationItems.module.scss';
import { link } from '../types';
+import CollectDataIcon from './CollectDataIcon';
+import { useLocation, useMatch } from '@reach/router';
const iconLibrary = {
'Collect data': 'collectData',
'Build apps': 'buildApps',
'Automate workflows': 'automation',
'Explore docs': 'developerDocs',
+ 'Attend events': 'event',
'Developer champions': 'developerChampions',
+ Podcasts: 'podcasts',
'Try our APIs': 'tryOurAPIs',
};
@@ -51,31 +57,42 @@ const NavigationItems = ({
(group &&
filteredPageNames &&
pages.some((el) => filteredPageNames.includes(el.displayName)));
+
return (
{showGroup && (
{group}
)}
- {pages.map((page, index) => (
-
- ))}
+ {pages.map((page, index) =>
+ filteredPageNames?.includes(page.displayName) ||
+ !filteredPageNames ? (
+
+ ) : null
+ )}
);
});
};
const NavIcon = ({ page }) => {
+ if (page.displayName === 'Collect data') {
+ return (
+
+ );
+ }
+
if (iconLibrary[page.displayName]) {
return (
);
}
@@ -84,40 +101,73 @@ const NavIcon = ({ page }) => {
};
const NavItem = ({ page, depthLevel, searchTerm, filteredPageNames }) => {
+ const location = useLocation();
const crumbs = useContext(BreadcrumbContext).flatMap((x) => x.displayName);
- const isHomePage = crumbs.length === 0 && depthLevel === 0;
-
- const [isExpanded, setIsExpanded] = useState(
- isHomePage || crumbs.includes(page.displayName)
- );
-
- const isCurrentPage = crumbs[crumbs.length - 1] === page.displayName;
+ const isBreadCrumb = crumbs.includes(page.displayName);
+ const matchesSearch = filteredPageNames?.includes(page.displayName);
+ const hasChangedPage = location.pathname !== usePrevious(location.pathname);
+ const [toggleIsExpanded, setToggleIsExpanded] = useState(isBreadCrumb);
+ const isExpanded = toggleIsExpanded || matchesSearch;
+
+ useEffect(() => {
+ if (hasChangedPage) {
+ setToggleIsExpanded(isBreadCrumb);
+ }
+ }, [hasChangedPage, isBreadCrumb]);
+
+ const isCurrentPage = Boolean(useMatch(page.url || '/'));
+
+ const isToggleable = [
+ 'Component library',
+ 'Explore docs',
+ 'Try our APIs',
+ 'New Relic One CLI',
+ ].includes(page.displayName);
const headerIcon = depthLevel === 0 &&
;
const display = filteredPageNames
? getHighlightedText(page.displayName, searchTerm)
: page.displayName;
- if (filteredPageNames && !filteredPageNames.includes(page.displayName))
- return null;
-
return (
-
- {page.url ? (
-
-
- {headerIcon}
- {page.displayName === 'Component library' && (
+ <>
+
+ {page.url ? (
+
setToggleIsExpanded(!toggleIsExpanded)
+ : null
+ }
+ className={cx(styles.navLink, {
+ [styles.isCurrentPage]: isCurrentPage,
+ })}
+ to={page.url}
+ >
+
+ {headerIcon}
+ {display}
+
+ {page.children && (
{
name="chevron-right"
/>
)}
- {display}
-
- {isCurrentPage && (
-
- )}
- {isExternal(page.url) && }
-
- ) : (
- setIsExpanded(!isExpanded)}
- onKeyPress={() => setIsExpanded(!isExpanded)}
- tabIndex={0}
- >
- {depthLevel > 0 && (
+ {isExternal(page.url) && }
+
+ ) : (
+ setToggleIsExpanded(!toggleIsExpanded)}
+ onKeyPress={() => setToggleIsExpanded(!toggleIsExpanded)}
+ tabIndex={0}
+ >
+
+ {headerIcon}
+ {display}
+
- )}
- {headerIcon}
- {display}
-
- )}
- {page.children && (
-
+ )}
+
+ {page.children && isExpanded && (
-
- )}
-
+ )}
+
+ >
);
};
diff --git a/src/components/NavigationItems.module.scss b/src/components/NavigationItems.module.scss
index 1c07a4c8f..d47d8040f 100644
--- a/src/components/NavigationItems.module.scss
+++ b/src/components/NavigationItems.module.scss
@@ -1,36 +1,24 @@
-.nestedNav {
- list-style: none;
-}
-
-.nestedNav {
- padding-left: 1rem;
- display: none;
-
- &.isExpanded {
- display: block;
- }
-
- [data-depth] > & {
- padding-left: calc(0.5rem + 1em);
- }
-}
-
.navLink {
color: var(--primary-text-color);
- margin-bottom: 1rem;
display: flex;
align-items: center;
justify-content: space-between;
text-decoration: none;
- transition: 0.1s;
-
- &:not(.isCurrentPage):hover {
+ transition: 0.2s ease-out;
+ padding: 0.5rem;
+ margin: 0 -0.5rem;
+ margin-left: calc((0.5rem + var(--icon-size)) * -1);
+ border-radius: 0.25rem;
+ padding-left: calc(0.5rem + var(--icon-size));
+
+ &:hover {
color: var(--primary-text-hover-color);
}
[data-depth='0'] > & {
- font-weight: 600;
- padding: 1em 0;
+ padding-left: 0.5rem;
+ margin-left: -0.5rem;
+ font-weight: bold;
}
}
@@ -42,7 +30,6 @@ button.navLink {
color: var(--primary-text-color);
background: inherit;
border: none;
- padding: 0;
font-size: inherit;
font-weight: inherit;
@@ -65,8 +52,7 @@ button.navLink {
}
.nestedChevron {
- margin-right: 0.5rem;
- stroke-width: 4;
+ stroke-width: 2;
transition: 0.2s;
&.isExpanded {
@@ -86,18 +72,15 @@ button.navLink {
}
.isCurrentPage {
- font-weight: bold !important;
-}
-
-.filterOn {
- ul {
- display: block;
- }
+ background: var(--color-neutrals-100);
- .nestedChevron {
- transform: rotate(90deg);
+ :global(.dark-mode) & {
+ color: var(--primary-text-hover-color);
+ background: var(--color-dark-100);
}
+}
+.filterOn {
.groupName {
margin-top: 0.5rem;
}
diff --git a/src/components/NewRelicIcon.js b/src/components/NewRelicIcon.js
index 5d354bc46..158fad11e 100644
--- a/src/components/NewRelicIcon.js
+++ b/src/components/NewRelicIcon.js
@@ -83,6 +83,20 @@ const NEWRELIC_ICONS = {
>
),
+ podcasts: (
+ <>
+
+
+
+
+
+ >
+ ),
+ event: (
+ <>
+
+ >
+ ),
};
NewRelicIcon.propTypes = {
diff --git a/src/components/PageLayout/Content.js b/src/components/PageLayout/Content.js
new file mode 100644
index 000000000..5a1c2d706
--- /dev/null
+++ b/src/components/PageLayout/Content.js
@@ -0,0 +1,7 @@
+import styled from '@emotion/styled';
+
+const Content = styled.div`
+ grid-area: content;
+`;
+
+export default Content;
diff --git a/src/components/PageLayout/Context.js b/src/components/PageLayout/Context.js
new file mode 100644
index 000000000..e3049cf1c
--- /dev/null
+++ b/src/components/PageLayout/Context.js
@@ -0,0 +1,5 @@
+import { createContext } from 'react';
+
+const PageLayoutContext = createContext();
+
+export default PageLayoutContext;
diff --git a/src/components/PageLayout/Header.js b/src/components/PageLayout/Header.js
new file mode 100644
index 000000000..bf5ae1a64
--- /dev/null
+++ b/src/components/PageLayout/Header.js
@@ -0,0 +1,48 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { css } from '@emotion/core';
+
+const Header = ({ title, children }) => (
+
+
+ {title}
+
+ {children}
+
+);
+
+Header.propTypes = {
+ children: PropTypes.node,
+ title: PropTypes.string.isRequired,
+};
+
+export default Header;
diff --git a/src/components/PageLayout/MarkdownContent.js b/src/components/PageLayout/MarkdownContent.js
new file mode 100644
index 000000000..a321fb2dd
--- /dev/null
+++ b/src/components/PageLayout/MarkdownContent.js
@@ -0,0 +1,8 @@
+import styled from '@emotion/styled';
+import MDXContainer from '../MDXContainer';
+
+const MarkdownContent = styled(MDXContainer)`
+ grid-area: content;
+`;
+
+export default MarkdownContent;
diff --git a/src/components/PageLayout/PageLayout.js b/src/components/PageLayout/PageLayout.js
new file mode 100644
index 000000000..a2a4012f1
--- /dev/null
+++ b/src/components/PageLayout/PageLayout.js
@@ -0,0 +1,80 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { css } from '@emotion/core';
+import { graphql, useStaticQuery } from 'gatsby';
+import Content from './Content';
+import Header from './Header';
+import MarkdownContent from './MarkdownContent';
+import RelatedContent from './RelatedContent';
+import Context from './Context';
+
+const TYPES = {
+ SINGLE_COLUMN: 'SINGLE_COLUMN',
+ RELATED_CONTENT: 'RELATED_CONTENT',
+};
+
+const LAYOUTS = {
+ [TYPES.RELATED_CONTENT]: css`
+ grid-template-areas:
+ 'page-header page-header'
+ 'content related-content';
+ grid-template-columns: minmax(0, 1fr) 300px;
+ grid-gap: 2rem;
+
+ @media (max-width: 1240px) {
+ grid-template-areas:
+ 'page-header'
+ 'content'
+ 'related-content';
+ grid-template-columns: minmax(0, 1fr);
+ }
+ `,
+ [TYPES.SINGLE_COLUMN]: css`
+ grid-template-areas:
+ 'page-header'
+ 'content';
+ grid-template-columns: minmax(0, 1fr);
+ `,
+};
+
+const PageLayout = ({ children, type }) => {
+ const {
+ site: { layout },
+ } = useStaticQuery(graphql`
+ query {
+ site {
+ layout {
+ contentPadding
+ }
+ }
+ }
+ `);
+
+ return (
+
+ {children}
+
+ );
+};
+
+PageLayout.propTypes = {
+ children: PropTypes.node,
+ type: PropTypes.oneOf(Object.values(TYPES)).isRequired,
+};
+
+PageLayout.TYPE = TYPES;
+
+PageLayout.Content = Content;
+PageLayout.Context = Context;
+PageLayout.Header = Header;
+PageLayout.MarkdownContent = MarkdownContent;
+PageLayout.RelatedContent = RelatedContent;
+
+export default PageLayout;
diff --git a/src/components/PageLayout/RelatedContent.js b/src/components/PageLayout/RelatedContent.js
new file mode 100644
index 000000000..a77deaf9f
--- /dev/null
+++ b/src/components/PageLayout/RelatedContent.js
@@ -0,0 +1,33 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { css } from '@emotion/core';
+import usePageContext from '../../hooks/usePageContext';
+
+const RelatedContent = ({ page, modules }) => {
+ const pageContext = usePageContext();
+
+ return (
+
+ {modules.map((Module, idx) => (
+
+ ))}
+
+ );
+};
+
+RelatedContent.propTypes = {
+ modules: PropTypes.arrayOf(PropTypes.elementType).isRequired,
+ page: PropTypes.object.isRequired,
+};
+
+export default RelatedContent;
diff --git a/src/components/PageLayout/index.js b/src/components/PageLayout/index.js
new file mode 100644
index 000000000..5f1db65f6
--- /dev/null
+++ b/src/components/PageLayout/index.js
@@ -0,0 +1 @@
+export { default } from './PageLayout';
diff --git a/src/components/PageTitle.js b/src/components/PageTitle.js
deleted file mode 100644
index 47badfa97..000000000
--- a/src/components/PageTitle.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-import cx from 'classnames';
-import styles from './PageTitle.module.scss';
-
-const PageTitle = ({ children, className }) => (
- {children}
-);
-
-PageTitle.propTypes = {
- children: PropTypes.node,
- className: PropTypes.string,
-};
-
-export default PageTitle;
diff --git a/src/components/PageTitle.module.scss b/src/components/PageTitle.module.scss
deleted file mode 100644
index 329b897ae..000000000
--- a/src/components/PageTitle.module.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-.pageTitle {
- font-family: var(--secondary-font-family);
- font-size: 2.5rem;
- font-weight: normal;
- margin-bottom: 0;
-}
diff --git a/src/components/ReferenceExample.js b/src/components/ReferenceExample.js
index 40d573f76..a16c3ccc4 100644
--- a/src/components/ReferenceExample.js
+++ b/src/components/ReferenceExample.js
@@ -2,7 +2,7 @@ import React, { useCallback, useMemo } from 'react';
import PropTypes from 'prop-types';
import styles from './ReferenceExample.module.scss';
import ReferencePreview from './ReferencePreview';
-import CodeBlock from './CodeBlock';
+import { CodeBlock } from '@newrelic/gatsby-theme-newrelic';
const platformStateContextMock = {
timeRange: {
diff --git a/src/components/ReferencePreview.js b/src/components/ReferencePreview.js
index c2348b1a6..ef94b9c79 100644
--- a/src/components/ReferencePreview.js
+++ b/src/components/ReferencePreview.js
@@ -5,6 +5,233 @@ import { LivePreview } from 'react-live';
import { CSS_BUNDLE } from '../utils/sdk';
const EXAMPLE_CSS = `
+:host {
+ --nr1--base-colors--ui--white: #fff;
+ --nr1--base-colors--ui--black: #000;
+ --nr1--base-colors--ui--gray--1: #fcfcfc;
+ --nr1--base-colors--ui--gray--2: #f7f8f8;
+ --nr1--base-colors--ui--gray--3: #eeefef;
+ --nr1--base-colors--ui--gray--4: #e0e2e2;
+ --nr1--base-colors--ui--gray--5: #cbcfcf;
+ --nr1--base-colors--ui--gray--6: #8c9393;
+ --nr1--base-colors--ui--gray--7: #727979;
+ --nr1--base-colors--ui--gray--8: #3e4c4c;
+ --nr1--base-colors--ui--gray--9: #223030;
+ --nr1--base-colors--ui--gray--10: #020303;
+ --nr1--base-colors--ui--gray-warm--1: #fcfcfc;
+ --nr1--base-colors--ui--gray-warm--2: #f7f7f8;
+ --nr1--base-colors--ui--gray-warm--3: #eeeeef;
+ --nr1--base-colors--ui--gray-warm--4: #e0e0e2;
+ --nr1--base-colors--ui--gray-warm--5: #cbcccf;
+ --nr1--base-colors--ui--gray-warm--6: #938c91;
+ --nr1--base-colors--ui--gray-warm--7: #7e777c;
+ --nr1--base-colors--ui--gray-warm--8: #4c4e5d;
+ --nr1--base-colors--ui--gray-warm--9: #25262d;
+ --nr1--base-colors--ui--gray-warm--10: #000e0e;
+ --nr1--base-colors--ui--red--1: #fcf3f3;
+ --nr1--base-colors--ui--red--2: #fce9e9;
+ --nr1--base-colors--ui--red--3: #f7c8c6;
+ --nr1--base-colors--ui--red--4: #ec847e;
+ --nr1--base-colors--ui--red--5: #e56059;
+ --nr1--base-colors--ui--red--6: #d8211a;
+ --nr1--base-colors--ui--red--7: #8e0000;
+ --nr1--base-colors--ui--red--8: #600;
+ --nr1--base-colors--ui--red--9: #390000;
+ --nr1--base-colors--ui--red--10: #1b0000;
+ --nr1--base-colors--ui--green--1: #f1fdf2;
+ --nr1--base-colors--ui--green--2: #d1f7d9;
+ --nr1--base-colors--ui--green--3: #7fe898;
+ --nr1--base-colors--ui--green--4: #22e749;
+ --nr1--base-colors--ui--green--5: #00d100;
+ --nr1--base-colors--ui--green--6: #00a500;
+ --nr1--base-colors--ui--green--7: #008200;
+ --nr1--base-colors--ui--green--8: #004d00;
+ --nr1--base-colors--ui--green--9: #0d290a;
+ --nr1--base-colors--ui--green--10: #021200;
+ --nr1--base-colors--ui--blue--1: #f6fafd;
+ --nr1--base-colors--ui--blue--2: #e1edff;
+ --nr1--base-colors--ui--blue--3: #a8cdfc;
+ --nr1--base-colors--ui--blue--4: #81b8fa;
+ --nr1--base-colors--ui--blue--5: #4689d9;
+ --nr1--base-colors--ui--blue--6: #0069ce;
+ --nr1--base-colors--ui--blue--7: #2e528a;
+ --nr1--base-colors--ui--blue--8: #1d3c6d;
+ --nr1--base-colors--ui--blue--9: #002051;
+ --nr1--base-colors--ui--blue--10: #00122f;
+ --nr1--base-colors--ui--yellow--1: #f9faec;
+ --nr1--base-colors--ui--yellow--2: #fff9cc;
+ --nr1--base-colors--ui--yellow--3: #fff089;
+ --nr1--base-colors--ui--yellow--4: #f9e66a;
+ --nr1--base-colors--ui--yellow--5: #f0d100;
+ --nr1--base-colors--ui--yellow--6: #ccb100;
+ --nr1--base-colors--ui--yellow--7: #8a7800;
+ --nr1--base-colors--ui--yellow--8: #473e00;
+ --nr1--base-colors--ui--yellow--9: #262100;
+ --nr1--base-colors--ui--yellow--10: #141100;
+ --nr1--base-colors--ui--orange--1: #fdf9f2;
+ --nr1--base-colors--ui--orange--2: #fef6e6;
+ --nr1--base-colors--ui--orange--3: #ffe2a8;
+ --nr1--base-colors--ui--orange--4: #ffdb94;
+ --nr1--base-colors--ui--orange--5: #f7c14a;
+ --nr1--base-colors--ui--orange--6: #f5a802;
+ --nr1--base-colors--ui--orange--7: #9f6d01;
+ --nr1--base-colors--ui--orange--8: #573b00;
+ --nr1--base-colors--ui--orange--9: #332300;
+ --nr1--base-colors--ui--orange--10: #1a1100;
+ --nr1--base-colors--ui--teal--1: #f1fbfc;
+ --nr1--base-colors--ui--teal--2: #d2f3f6;
+ --nr1--base-colors--ui--teal--3: #85e0e7;
+ --nr1--base-colors--ui--teal--4: #70ccd3;
+ --nr1--base-colors--ui--teal--5: #00b3c3;
+ --nr1--base-colors--ui--teal--6: #008c99;
+ --nr1--base-colors--ui--teal--7: #006c75;
+ --nr1--base-colors--ui--teal--8: #00484e;
+ --nr1--base-colors--ui--teal--9: #003539;
+ --nr1--base-colors--ui--teal--10: #002123;
+ --nr1--base-colors--dataviz--bright--1: #21a793;
+ --nr1--base-colors--dataviz--bright--2: #16b3d5;
+ --nr1--base-colors--dataviz--bright--3: #a35ebf;
+ --nr1--base-colors--dataviz--bright--4: #85c956;
+ --nr1--base-colors--dataviz--bright--5: #f86e40;
+ --nr1--base-colors--dataviz--bright--6: #c21684;
+ --nr1--base-sizing--4: 4px;
+ --nr1--base-sizing--8: 8px;
+ --nr1--base-sizing--12: 12px;
+ --nr1--base-sizing--16: 16px;
+ --nr1--base-sizing--24: 24px;
+ --nr1--base-sizing--32: 32px;
+ --nr1--base-sizing--40: 40px;
+ --nr1--base-sizing--48: 48px;
+ --nr1--base-sizing--64: 64px;
+ --nr1--base-sizing--80: 80px;
+ --nr1--colors--background--app: #fff;
+ --nr1--colors--background--app-theme-light: #fff;
+ --nr1--colors--background--surface: #fff;
+ --nr1--colors--background--surface-theme-light: #fff;
+ --nr1--colors--background--surface-inverted: #223030;
+ --nr1--colors--background--surface-inverted-theme-light: #223030;
+ --nr1--colors--interactive--primary: #008c99;
+ --nr1--colors--interactive--primary-theme-light: #008c99;
+ --nr1--colors--interactive--secondary: #eeefef;
+ --nr1--colors--interactive--secondary-theme-light: #eeefef;
+ --nr1--colors--interactive--danger: #e56059;
+ --nr1--colors--interactive--danger-theme-light: #e56059;
+ --nr1--colors--states--success: #00d100;
+ --nr1--colors--states--success-theme-light: #00d100;
+ --nr1--colors--states--warning: #f0d100;
+ --nr1--colors--states--warning-theme-light: #f0d100;
+ --nr1--colors--states--error: #e56059;
+ --nr1--colors--states--error-theme-light: #e56059;
+ --nr1--colors--states--disabled: #cbcfcf;
+ --nr1--colors--states--disabled-theme-light: #cbcfcf;
+ --nr1--colors--border--subtle: #f7f8f8;
+ --nr1--colors--border--subtle-theme-light: #f7f8f8;
+ --nr1--colors--border--regular: #eeefef;
+ --nr1--colors--border--regular-theme-light: #eeefef;
+ --nr1--colors--border--strong: #e0e2e2;
+ --nr1--colors--border--strong-theme-light: #e0e2e2;
+ --nr1--colors--text--primary: #223030;
+ --nr1--colors--text--primary-theme-light: #223030;
+ --nr1--colors--text--secondary: #3e4c4c;
+ --nr1--colors--text--secondary-theme-light: #3e4c4c;
+ --nr1--colors--text--emphasis: #020303;
+ --nr1--colors--text--emphasis-theme-light: #020303;
+ --nr1--colors--text--muted: #8c9393;
+ --nr1--colors--text--muted-theme-light: #8c9393;
+ --nr1--colors--text--disabled: #727979;
+ --nr1--colors--text--disabled-theme-light: #727979;
+ --nr1--colors--entity-status--degraded: #ccb100;
+ --nr1--colors--entity-status--degraded-theme-light: #ccb100;
+ --nr1--colors--entity-status--operational: #00a500;
+ --nr1--colors--entity-status--operational-theme-light: #00a500;
+ --nr1--colors--entity-status--unavailable: #d8211a;
+ --nr1--colors--entity-status--unavailable-theme-light: #d8211a;
+ --nr1--colors--entity-status--unknown: #8c9393;
+ --nr1--colors--entity-status--unknown-theme-light: #8c9393;
+ --nr1--colors--entity-status--anomaly: #f5a802;
+ --nr1--colors--entity-status--anomaly-theme-light: #f5a802;
+ --nr1--spacing--4: 4px;
+ --nr1--spacing--8: 8px;
+ --nr1--spacing--12: 12px;
+ --nr1--spacing--16: 16px;
+ --nr1--spacing--24: 24px;
+ --nr1--spacing--32: 32px;
+ --nr1--spacing--40: 40px;
+ --nr1--spacing--48: 48px;
+ --nr1--spacing--64: 64px;
+ --nr1--spacing--80: 80px;
+ --nr1--spacing--small: 4px;
+ --nr1--spacing--medium: 8px;
+ --nr1--spacing--large: 12px;
+ --nr1--spacing--extra-large: 24px;
+ --nr1--typography--body--1--font-family: Open Sans,"Segoe UI","Tahoma",sans-serif;
+ --nr1--typography--body--1--font-size: 12px;
+ --nr1--typography--body--1--line-height: 16px;
+ --nr1--typography--body--1--font-weight: 400;
+ --nr1--typography--body--1--color: #223030;
+ --nr1--typography--body--1--color-theme-light: #223030;
+ --nr1--typography--body--2--font-family: Open Sans,"Segoe UI","Tahoma",sans-serif;
+ --nr1--typography--body--2--font-size: 12px;
+ --nr1--typography--body--2--line-height: 20px;
+ --nr1--typography--body--2--font-weight: 400;
+ --nr1--typography--body--2--color: #223030;
+ --nr1--typography--body--2--color-theme-light: #223030;
+ --nr1--typography--body--3--font-family: Open Sans,"Segoe UI","Tahoma",sans-serif;
+ --nr1--typography--body--3--font-size: 14px;
+ --nr1--typography--body--3--line-height: 20px;
+ --nr1--typography--body--3--font-weight: 400;
+ --nr1--typography--body--3--color: #3e4c4c;
+ --nr1--typography--body--3--color-theme-light: #3e4c4c;
+ --nr1--typography--heading--1--font-family: Open Sans,"Segoe UI","Tahoma",sans-serif;
+ --nr1--typography--heading--1--font-size: 32px;
+ --nr1--typography--heading--1--line-height: 40px;
+ --nr1--typography--heading--1--font-weight: 400;
+ --nr1--typography--heading--1--color: #223030;
+ --nr1--typography--heading--1--color-theme-light: #223030;
+ --nr1--typography--heading--2--font-family: Open Sans,"Segoe UI","Tahoma",sans-serif;
+ --nr1--typography--heading--2--font-size: 24px;
+ --nr1--typography--heading--2--line-height: 32px;
+ --nr1--typography--heading--2--font-weight: 400;
+ --nr1--typography--heading--2--color: #223030;
+ --nr1--typography--heading--2--color-theme-light: #223030;
+ --nr1--typography--heading--3--font-family: Open Sans,"Segoe UI","Tahoma",sans-serif;
+ --nr1--typography--heading--3--font-size: 18px;
+ --nr1--typography--heading--3--line-height: 28px;
+ --nr1--typography--heading--3--font-weight: 400;
+ --nr1--typography--heading--3--color: #223030;
+ --nr1--typography--heading--3--color-theme-light: #223030;
+ --nr1--typography--heading--4--font-family: Open Sans,"Segoe UI","Tahoma",sans-serif;
+ --nr1--typography--heading--4--font-size: 16px;
+ --nr1--typography--heading--4--line-height: 20px;
+ --nr1--typography--heading--4--font-weight: 400;
+ --nr1--typography--heading--4--color: #223030;
+ --nr1--typography--heading--4--color-theme-light: #223030;
+ --nr1--typography--heading--5--font-family: Open Sans,"Segoe UI","Tahoma",sans-serif;
+ --nr1--typography--heading--5--font-size: 14px;
+ --nr1--typography--heading--5--line-height: 20px;
+ --nr1--typography--heading--5--font-weight: 400;
+ --nr1--typography--heading--5--color: #223030;
+ --nr1--typography--heading--5--color-theme-light: #223030;
+ --nr1--typography--heading--6--font-family: Open Sans,"Segoe UI","Tahoma",sans-serif;
+ --nr1--typography--heading--6--font-size: 12px;
+ --nr1--typography--heading--6--line-height: 16px;
+ --nr1--typography--heading--6--font-weight: 600;
+ --nr1--typography--heading--6--color: #223030;
+ --nr1--typography--heading--6--color-theme-light: #223030;
+ --nr1--typography--code--1--font-family: Menlo,"Consolas",monospace;
+ --nr1--typography--code--1--font-size: 11px;
+ --nr1--typography--code--1--line-height: 16px;
+ --nr1--typography--code--1--font-weight: 400;
+ --nr1--typography--code--1--color: #223030;
+ --nr1--typography--code--1--color-theme-light: #223030;
+ --nr1--typography--code--2--font-family: Menlo,"Consolas",monospace;
+ --nr1--typography--code--2--font-size: 12px;
+ --nr1--typography--code--2--line-height: 20px;
+ --nr1--typography--code--2--font-weight: 400;
+ --nr1--typography--code--2--color: #223030;
+ --nr1--typography--code--2--color-theme-light: #223030;
+}
+
.nr1-ReferenceExample {
line-height: 1.36;
font-weight: 400;
diff --git a/src/components/RelatedContentModules/Contribute.js b/src/components/RelatedContentModules/Contribute.js
new file mode 100644
index 000000000..9ba748c54
--- /dev/null
+++ b/src/components/RelatedContentModules/Contribute.js
@@ -0,0 +1,95 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { css } from '@emotion/core';
+import { Button, ExternalLink, Icon } from '@newrelic/gatsby-theme-newrelic';
+import { graphql, useStaticQuery } from 'gatsby';
+import Section from './Section';
+
+const Contribute = ({ pageContext }) => {
+ const { site } = useStaticQuery(graphql`
+ query {
+ site {
+ siteMetadata {
+ repository
+ }
+ }
+ }
+ `);
+
+ const { fileRelativePath } = pageContext;
+
+ const {
+ siteMetadata: { repository },
+ } = site;
+
+ return (
+
+
+
+ File an issue
+
+
+
+ Edit this page
+
+
+ Read our{' '}
+
+ guide
+ {' '}
+ on how to contribute
+
+
+ );
+};
+
+Contribute.propTypes = {
+ pageContext: PropTypes.shape({
+ fileRelativePath: PropTypes.string,
+ }),
+};
+
+export default Contribute;
diff --git a/src/components/RelatedContentModules/PageUpdated.js b/src/components/RelatedContentModules/PageUpdated.js
new file mode 100644
index 000000000..71af63786
--- /dev/null
+++ b/src/components/RelatedContentModules/PageUpdated.js
@@ -0,0 +1,48 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { css } from '@emotion/core';
+import { graphql } from 'gatsby';
+import Section from './Section';
+
+const PageUpdated = ({ page }) => {
+ const {
+ fields: { gitAuthorTime },
+ } = page;
+
+ // If there is no date available, do not render the component
+ if (gitAuthorTime === 'Invalid date') return null;
+
+ return (
+
+ {`Page last modified on ${gitAuthorTime}`}
+
+ );
+};
+
+PageUpdated.propTypes = {
+ page: PropTypes.shape({
+ fields: PropTypes.shape({
+ gitAuthorTime: PropTypes.string,
+ }),
+ }),
+};
+
+export const query = graphql`
+ fragment PageUpdated_page on Mdx {
+ fields {
+ gitAuthorTime(formatString: "MMMM DD, YYYY")
+ }
+ }
+`;
+
+export default PageUpdated;
diff --git a/src/components/RelatedContentModules/Resources.js b/src/components/RelatedContentModules/Resources.js
new file mode 100644
index 000000000..f57971f6a
--- /dev/null
+++ b/src/components/RelatedContentModules/Resources.js
@@ -0,0 +1,143 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { css } from '@emotion/core';
+import { graphql, Link } from 'gatsby';
+import { ExternalLink, Icon, Tag } from '@newrelic/gatsby-theme-newrelic';
+import Section from './Section';
+import Title from './Title';
+
+const SITE_TAGS = {
+ developer: 'https://developer.newrelic.com',
+ 'open source': 'https://opensource.newrelic.com',
+ docs: 'https://docs.newrelic.com',
+ github: 'https://github.com',
+ terraform: 'https://terraform.io',
+ kubernetes: 'https://kubernetes.io',
+ youtube: 'https://youtube.com',
+ discuss: 'https://discuss.newrelic.com',
+ blog: 'https://blog.newrelic.com',
+ 'newrelic.com': 'https://newrelic.com',
+ 'visual studio': 'https://marketplace.visualstudio.com',
+};
+
+const findTag = (resource) =>
+ resource.url.startsWith('/')
+ ? 'developer'
+ : Object.keys(SITE_TAGS).find((tag) =>
+ resource.url.startsWith(SITE_TAGS[tag])
+ );
+
+const normalizeDeveloperUrl = (url) =>
+ url.replace('https://developer.newrelic.com', '');
+
+const Resources = ({ page }) => {
+ const { relatedResources, frontmatter } = page;
+ const resources = (frontmatter.resources || []).concat(relatedResources);
+
+ return resources.length > 0 ? (
+
+ Related resources
+
+
+ {resources.map((resource) => {
+ const tag = findTag(resource);
+ const isDeveloperSite = tag === 'developer';
+ const LinkElement = isDeveloperSite ? Link : ExternalLink;
+ const props = isDeveloperSite
+ ? { to: normalizeDeveloperUrl(resource.url) }
+ : { href: resource.url };
+
+ return (
+
+
+
+ {resource.title}
+
+
+ {!isDeveloperSite && (
+
+ )}
+
+
+
+ {tag}
+
+
+ );
+ })}
+
+
+
+ ) : null;
+};
+
+Resources.propTypes = {
+ page: PropTypes.shape({
+ frontmatter: PropTypes.shape({
+ resources: PropTypes.arrayOf(
+ PropTypes.shape({
+ title: PropTypes.string,
+ url: PropTypes.string,
+ })
+ ),
+ }).isRequired,
+ relatedResources: PropTypes.shape({
+ title: PropTypes.string,
+ url: PropTypes.string,
+ }),
+ }).isRequired,
+};
+
+export const query = graphql`
+ fragment Resources_page on Mdx {
+ frontmatter {
+ resources {
+ title
+ url
+ }
+ }
+ relatedResources(limit: $relatedResourceLimit) {
+ title
+ url
+ }
+ }
+`;
+
+export default Resources;
diff --git a/src/components/RelatedContentModules/Section.js b/src/components/RelatedContentModules/Section.js
new file mode 100644
index 000000000..33f922f3e
--- /dev/null
+++ b/src/components/RelatedContentModules/Section.js
@@ -0,0 +1,12 @@
+import styled from '@emotion/styled';
+
+const Section = styled.section`
+ padding: 1rem;
+
+ &:first-child {
+ border-top-left-radius: 0.25rem;
+ border-top-right-radius: 0.25rem;
+ }
+`;
+
+export default Section;
diff --git a/src/components/RelatedContentModules/Title.js b/src/components/RelatedContentModules/Title.js
new file mode 100644
index 000000000..cc8078c98
--- /dev/null
+++ b/src/components/RelatedContentModules/Title.js
@@ -0,0 +1,10 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+
+const Title = ({ children }) => {children} ;
+
+Title.propTypes = {
+ children: PropTypes.node,
+};
+
+export default Title;
diff --git a/src/components/RelatedContentModules/index.js b/src/components/RelatedContentModules/index.js
new file mode 100644
index 000000000..61e77b744
--- /dev/null
+++ b/src/components/RelatedContentModules/index.js
@@ -0,0 +1,3 @@
+export { default as Contribute } from './Contribute';
+export { default as PageUpdated } from './PageUpdated';
+export { default as Resources } from './Resources';
diff --git a/src/components/Seo.js b/src/components/Seo.js
index 8a9ff885f..dcd318910 100644
--- a/src/components/Seo.js
+++ b/src/components/Seo.js
@@ -1,9 +1,9 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Helmet } from 'react-helmet';
-import { useStaticQuery, graphql } from 'gatsby';
+import { useStaticQuery, graphql, withPrefix } from 'gatsby';
-function SEO({ description, lang, meta, title }) {
+function SEO({ description, lang, meta, title, tags }) {
const { site } = useStaticQuery(
graphql`
query {
@@ -24,12 +24,7 @@ function SEO({ description, lang, meta, title }) {
const globalMetadata = [
{ name: 'description', content: metaDescription },
{ 'http-equiv': 'Content-Type', content: 'text/html', charset: 'utf-8' },
- {
- name: 'type',
- class: 'swiftype',
- 'data-type': 'enum',
- content: 'developer',
- },
+
{
name: 'google-site-verification',
content: 'eT8TSNhvMuDmAtqbtq5jygZKVkhDmz565fYQ3DVop4g',
@@ -46,10 +41,47 @@ function SEO({ description, lang, meta, title }) {
{ name: 'twitter:description', content: metaDescription },
];
+ // if we decide we need this elsewhere, abstract into gatsby-theme-newrelic
+ const swiftype = [
+ {
+ name: 'type',
+ class: 'swiftype',
+ 'data-type': 'enum',
+ content: 'developer',
+ },
+ {
+ name: 'title',
+ class: 'swiftype',
+ 'data-type': 'string',
+ content: title,
+ },
+ {
+ name: 'document_type',
+ class: 'swiftype',
+ 'data-type': 'enum',
+ content: 'page',
+ },
+ {
+ name: 'info',
+ class: 'swiftype',
+ 'data-type': 'string',
+ content: description,
+ },
+ ...(tags ?? []).map((tag) => ({
+ name: 'tags',
+ class: 'swiftype',
+ 'data-type': 'string',
+ content: tag,
+ })),
+ ];
+
// only add metadata if we have content
- const validMetadata = [...globalMetadata, ...social, ...meta].filter(
- (m) => m.content !== ''
- );
+ const validMetadata = [
+ ...globalMetadata,
+ ...social,
+ ...meta,
+ ...swiftype,
+ ].filter((m) => m.content !== '');
return (
+ >
+
+
);
}
@@ -72,6 +106,7 @@ SEO.propTypes = {
lang: PropTypes.string,
meta: PropTypes.arrayOf(PropTypes.object),
title: PropTypes.string,
+ tags: PropTypes.arrayOf(PropTypes.string),
};
export default SEO;
diff --git a/src/components/SideBySide.js b/src/components/SideBySide.js
index 03e67d881..878e6a400 100644
--- a/src/components/SideBySide.js
+++ b/src/components/SideBySide.js
@@ -1,10 +1,15 @@
import React, { Children, Fragment } from 'react';
import PropTypes from 'prop-types';
-import cx from 'classnames';
-import styles from './SideBySide.module.scss';
+import { css } from '@emotion/core';
import splitUsing from '../utils/splitUsing';
import splitWhen from '../utils/splitWhen';
import { isMdxType } from '../utils/mdx';
+import usePageLayout from '../hooks/usePageLayout';
+
+const BREAKPOINTS = {
+ SINGLE_COLUMN: '1240px',
+ RELATED_CONTENT: '1520px',
+};
const SideBySide = ({ className, children, type }) => {
const types = Array.isArray(type) ? type : [type];
@@ -32,11 +37,35 @@ const SideBySide = ({ className, children, type }) => {
)
);
+ const pageLayout = usePageLayout();
+
return (
-
+
{sections.map(([left, right], idx) => (
-
+
{left}
{rendersRightColumn &&
{right}
}
diff --git a/src/components/SideBySide.module.scss b/src/components/SideBySide.module.scss
deleted file mode 100644
index 4d7fc524e..000000000
--- a/src/components/SideBySide.module.scss
+++ /dev/null
@@ -1,18 +0,0 @@
-.container {
- display: grid;
- grid-template-columns: repeat(2, calc(50% - 0.5rem));
- grid-gap: 1rem;
-
- p:last-child {
- margin-bottom: 0;
- }
-
- @media (max-width: 1240px) {
- grid-template-columns: minmax(0, 1fr);
- grid-gap: 0;
- }
-}
-
-.spanColumns {
- grid-column: span 2;
-}
diff --git a/src/components/Sidebar.js b/src/components/Sidebar.js
index 97d0572c2..f9bcf4240 100644
--- a/src/components/Sidebar.js
+++ b/src/components/Sidebar.js
@@ -1,28 +1,64 @@
import React, { useState } from 'react';
import PropTypes from 'prop-types';
+import { css } from '@emotion/core';
import { Link } from 'gatsby';
-import cx from 'classnames';
import Logo from './Logo';
import Navigation from './Navigation';
-import SearchInput from './SearchInput';
-import styles from './Sidebar.module.scss';
+import { SearchInput } from '@newrelic/gatsby-theme-newrelic';
const Sidebar = ({ className }) => {
const [searchTerm, setSearchTerm] = useState('');
return (
-
-
-
-
- setSearchTerm('')}
- onChange={(e) => setSearchTerm(e.target.value)}
- value={searchTerm}
- />
-
+
+
+
+
+
+ setSearchTerm('')}
+ onChange={(e) => setSearchTerm(e.target.value)}
+ value={searchTerm}
+ />
+
+
);
};
diff --git a/src/components/Sidebar.module.scss b/src/components/Sidebar.module.scss
deleted file mode 100644
index 83ae5a1b1..000000000
--- a/src/components/Sidebar.module.scss
+++ /dev/null
@@ -1,25 +0,0 @@
-.sidebar {
- padding: 2rem;
- border-right: 1px solid var(--divider-color);
-
- @media screen and (max-width: 760px) {
- height: 60px;
- border-bottom: 1px solid var(--divider-color);
- }
-}
-
-.logo {
- width: 200px;
-
- @media screen and (max-width: 760px) {
- width: 160px;
- }
-}
-
-.nav {
- margin-top: 1rem;
-}
-
-.searchInput {
- margin: 1rem 0;
-}
diff --git a/src/components/__tests__/__snapshots__/Footer.js.snap b/src/components/__tests__/__snapshots__/Footer.js.snap
new file mode 100644
index 000000000..8afccf25c
--- /dev/null
+++ b/src/components/__tests__/__snapshots__/Footer.js.snap
@@ -0,0 +1,47 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Footer renders correctly 1`] = `
+
+
+
+
+
+ Copyright © 2020 New Relic Inc.
+
+
+
+
+
+
+
+`;
diff --git a/src/components/styles.scss b/src/components/styles.scss
index 437a7547b..8a916618f 100644
--- a/src/components/styles.scss
+++ b/src/components/styles.scss
@@ -1,153 +1,12 @@
-/*-- Imports --*/
-@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap');
-@import url('https://use.typekit.net/pnb6qnj.css');
-@import url('https://fonts.googleapis.com/css2?family=Ovo&display=swap');
-
-/*-- CSS Variables --*/
:root {
- --color-black: #000;
- --color-white: #fff;
- --color-neutrals-050: #fafbfb;
- --color-neutrals-100: #f4f5f5;
- --color-neutrals-200: #edeeee;
- --color-neutrals-300: #e3e4e4;
- --color-neutrals-400: #d5d7d7;
- --color-neutrals-500: #b9bdbd;
- --color-neutrals-600: #8e9494;
- --color-neutrals-700: #464e4e;
- --color-neutrals-800: #2a3434;
- --color-neutrals-900: #000d0d;
-
- --color-dark-050: #131f23;
- --color-dark-100: #22353c;
- --color-dark-200: #233940;
- --color-dark-300: #2a4249;
- --color-dark-400: #37484e;
- --color-dark-500: #495b5c;
- --color-dark-600: #7c9799;
- --color-dark-700: #a5bbbd;
- --color-dark-800: #cedede;
- --color-dark-900: #e8eaea;
-
- --color-brand-050: #f7ffff;
- --color-brand-100: #edffff;
- --color-brand-400: #70ccd2;
- --color-brand-800: #007e8a;
- --color-brand-900: #005054;
-
- --color-red-050: #fcf3f3;
- --color-red-100: #fce9e9;
- --color-red-200: #f7c8c6;
- --color-red-300: #ec847e;
- --color-red-400: #e56059;
- --color-red-500: #d8211a;
- --color-red-600: #8e0000;
- --color-red-700: #600;
- --color-red-800: #390000;
- --color-red-900: #1b0000;
-
- --color-green-050: #f1fdf2;
- --color-green-100: #d1f7d9;
- --color-green-200: #7fe898;
- --color-green-300: #22e749;
- --color-green-400: #00d100;
- --color-green-500: #00a500;
- --color-green-600: #008200;
- --color-green-700: #004d00;
- --color-green-800: #0d290a;
- --color-green-900: #021200;
-
- --color-yellow-050: #f9faec;
- --color-yellow-100: #fff9cc;
- --color-yellow-200: #fff089;
- --color-yellow-300: #f3e66a;
- --color-yellow-400: #f0d100;
- --color-yellow-500: #ccb100;
- --color-yellow-600: #8a7800;
- --color-yellow-700: #473e00;
- --color-yellow-800: #262100;
- --color-yellow-900: #141100;
-
- --color-teal-050: #f1fbfc;
- --color-teal-100: #d2f3f6;
- --color-teal-200: #85e0e7;
- --color-teal-300: #70ccd3;
- --color-teal-400: #00b3c3;
- --color-teal-500: #008c99;
- --color-teal-600: #006c75;
- --color-teal-700: #00484e;
- --color-teal-800: #003539;
- --color-teal-900: #002123;
-
- // https://www.nordtheme.com/docs/colors-and-palettes
- --color-nord-0: #2e3440;
- --color-nord-1: #3b4252;
- --color-nord-2: #434c5e;
- --color-nord-3: #4c566a;
- --color-nord-4: #d8dee9;
- --color-nord-5: #e5e9f0;
- --color-nord-6: #eceff4;
- --color-nord-7: #8fbcbb;
- --color-nord-8: #88c0d0;
- --color-nord-9: #81a1c1;
- --color-nord-10: #5e81ac;
- --color-nord-11: #bf616a;
- --color-nord-12: #d08770;
- --color-nord-13: #ebcb8b;
- --color-nord-14: #a3be8c;
- --color-nord-15: #b48ead;
-
- --primary-font-family: 'open sans', sans-serif;
- --secondary-font-family: 'effra', sans-serif;
- --tertiary-font-family: 'Ovo', serif;
- --code-font: 'Menlo', 'Consolas', monospace;
-
- --height-global-header: 30px;
+ --height-global-header: 36px;
--height-mobile-nav-bar: 60px;
-
--ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
-* {
- box-sizing: border-box;
-}
-
-body {
- font-size: 16px;
- font-family: var(--primary-font-family);
- color: var(--primary-text-color);
- background-color: var(--primary-background-color);
- line-height: 1.5;
-}
-
-a {
- cursor: pointer;
- text-decoration: none;
- color: var(--link-color);
-}
-
-p {
- margin-top: 0;
- margin-bottom: 1em;
-}
-
-h1,
-h2,
-h3,
-h4,
-h5,
-h6 {
- margin-top: 0;
- margin-bottom: 8px;
- font-weight: 600;
- font-family: var(--primary-font-family);
- color: var(--heading-text-color);
-}
-
input[type='text'] {
border: 1px solid var(--border-color);
border-radius: 4px;
- height: 2rem;
box-sizing: border-box;
transition: all 0.1s var(--ease-out-quad);
@@ -156,33 +15,6 @@ input[type='text'] {
}
}
-ul {
- margin: 0;
- padding-left: 2rem;
-}
-
-code {
- font-family: var(--code-font);
-}
-
-blockquote {
- border-left: 4px solid var(--border-color);
- padding: 15px 5px 20px 20px;
- margin: 25px 50px 25px 20px;
-}
-
-pre {
- margin: 0;
-}
-
-::placeholder {
- color: var(--color-neutrals-500);
-
- .dark-mode & {
- color: var(--color-dark-500);
- }
-}
-
:global {
.intro-text {
color: var(--secondary-text-color);
diff --git a/src/data/additionalDocs.js b/src/data/additionalDocs.js
new file mode 100644
index 000000000..3f0d1f8c8
--- /dev/null
+++ b/src/data/additionalDocs.js
@@ -0,0 +1,51 @@
+const additionalDocs = {
+ nerdlet: {
+ methods: [
+ {
+ name: 'nerdlet.setUrlState',
+ description: `
+Updates the current nerdlet's URL state that can be read from
+[\`NerdletStateContext.Consumer\`](/components/nerdlet-state-context).
+
+If you wish to update nerdlet's state without persisting its value in the
+url, use React's built-in \`setState()\`.
+
+This method behaves like React's \`setState()\`, meaning that it performs a
+shallow merge between the current URL state and the provided state in the
+\`urlState\` parameter.
+
+If you wish to navigate without adding an entry to the browser history, set
+\`urlStateOptions.replaceHistory\` to \`true\`.
+ `.trim(),
+ returnValue: { type: 'void' },
+ params: [
+ {
+ name: 'urlState',
+ type: 'Object',
+ description: 'New nerdlet URL state.',
+ },
+ {
+ name: 'urlStateOptions',
+ type: 'UrlStateOptions',
+ description: 'Options for the URL state.',
+ },
+ ],
+ examples: [
+ {
+ label: 'Example 1',
+ sourceCode: `
+nerlet.setUrlState({
+ foo: 'bar',
+});
+ `.trim(),
+ options: {
+ live: false,
+ },
+ },
+ ],
+ },
+ ],
+ },
+};
+
+export default additionalDocs;
diff --git a/src/data/related-pages.json b/src/data/related-pages.json
new file mode 100644
index 000000000..70350c814
--- /dev/null
+++ b/src/data/related-pages.json
@@ -0,0 +1,6379 @@
+{
+ "/automate-workflows/5-mins-tag-resources": [
+ {
+ "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.",
+ "sections": [
+ "Get started with the New Relic CLI",
+ "Before you begin",
+ "Install the New Relic CLI",
+ "Linux",
+ "macOS",
+ "Windows",
+ "Create your New Relic CLI profile",
+ "Get your application details",
+ "Add a simple tag to your application",
+ "Bonus step: Create a deployment marker",
+ "Next steps"
+ ],
+ "title": "Get started with the New Relic CLI",
+ "popularity": 1,
+ "tags": [
+ "api key",
+ "New Relic CLI",
+ "Tags",
+ "Entity",
+ "Deployment markers"
+ ],
+ "external_id": "531f2f3985bf64bb0dc92a642445887095048882",
+ "image": "",
+ "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/",
+ "published_at": "2020-08-18T02:06:05Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 19.977236,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the New Relic CLI ",
+ "sections": "Get started with the New Relic CLI ",
+ "info": "Learn the essentials of the New Relic CLI , from install and configuration to basic usage.",
+ "tags": "New Relic CLI ",
+ "body": " Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead"
+ },
+ "id": "5efa999c196a67c4e1766461"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
+ "type": "developer",
+ "document_type": "page",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "sections": [
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
+ ],
+ "title": "New Relic CLI Reference",
+ "popularity": 1,
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-08-18T02:11:50Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 16.580233,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic CLI Reference",
+ "sections": "New Relic CLI Reference",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "tags": "new relic cli ",
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs"
+ },
+ "id": "5efa989ee7b9d2024b7bab97"
+ },
+ {
+ "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform",
+ "type": "developer",
+ "document_type": "page",
+ "info": "",
+ "sections": [
+ "Automate workflows",
+ "Guides to automate workflows",
+ "Quickly tag resources",
+ "Automate common tasks",
+ "Set up New Relic using the Kubernetes operator",
+ "Set up New Relic using Terraform"
+ ],
+ "title": "Automate workflows",
+ "popularity": 1,
+ "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871",
+ "image": "",
+ "url": "https://developer.newrelic.com/automate-workflows/",
+ "published_at": "2020-08-18T02:04:53Z",
+ "updated_at": "2020-08-17T01:55:15Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.37249726,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Set up New Relic using the Kubernetes operator",
+ "body": " solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform"
+ },
+ "id": "5efa999c196a67dfb4766445"
+ },
+ {
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "Tip",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "popularity": 1,
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-18T01:50:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.25086987,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI reference",
+ "sections": "New Relic One CLI reference",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "tags": "New Relic One app",
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI . The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "Contain the complexity - Observability made simple New Relic’s Kubernetes cluster explorer empowers Kubernetes nerds to move beyond infrastructure metrics and investigate deeper into applications, traces, logs, and events—with a single click—while staying grounded in a centralized UI. Join us at KubeCon and CloudNativeCon Europe August 17-20 to learn more. Check out the complete schedule of New Relic talks to make the most of your KubeCon experience. Learn more. Get coding Create a free account 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events Start the guide 7 min Add tags to apps Add tags to applications you instrument for easier filtering and organization Start the guide 12 min Build a Hello, World! app Build a Hello, World! app and publish it to your local New Relic One Catalog Start the guide Get inspired 30 min Add a table to your app Add a table to your New Relic One app 15 min Collect data - any source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add a time picker to your app Add a time picker to a sample application Add custom attributes Use custom attributes for deeper analysis Show 18 more guides Looking for more inspiration? Check out the open source projects built by the New Relic community. New Relic developer champions New Relic Champions are solving big problems using New Relic as their linchpin and are recognized as experts and leaders in the New Relic technical community. Nominate a developer champion Learn more about developer champions New Relic Podcasts We like to talk, especially to developers about developer things. Join us for conversations on open source, observability, software design and industry news. Listen",
+ "type": "developer",
+ "document_type": "page",
+ "info": "",
+ "sections": [
+ "Contain the complexity - Observability made simple",
+ "Get coding",
+ "Create custom events",
+ "Add tags to apps",
+ "Build a Hello, World! app",
+ "Get inspired",
+ "Add a table to your app",
+ "Collect data - any source",
+ "Automate common tasks",
+ "Create a custom map view",
+ "Add a time picker to your app",
+ "Add custom attributes",
+ "New Relic developer champions",
+ "New Relic Podcasts"
+ ],
+ "title": "New Relic Developers",
+ "popularity": 1,
+ "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab",
+ "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png",
+ "url": "https://developer.newrelic.com/",
+ "published_at": "2020-08-18T02:03:42Z",
+ "updated_at": "2020-08-15T01:36:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.24943998,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic Developers",
+ "sections": "New Relic developer champions",
+ "body": " to your app Add a table to your New Relic One app 15 min Collect data - any source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add"
+ },
+ "id": "5d6fe49a64441f8d6100a50f"
+ }
+ ],
+ "/automate-workflows/get-started-kubernetes": [
+ {
+ "body": "You can create alert conditions using NRQL queries. Create NRQL alert condition To create a NRQL condition: When you start to create a condition, where it prompts you to Select a product, click NRQL. Tips on creating a NRQL condition: NRQL conditions Tips Condition types NRQL condition types include static, baseline, and outlier. Create a description For some condition types, you can create a Description. Query results Queries must return a number. The condition works by evaluating that returned number against the thresholds you set. Time period As with all alert conditions, NRQL conditions evaluate one single minute at a time. The implicit SINCE ... UNTIL clause specifying which minute to evaluate is controlled by your Evaluation offset setting. Since very recent data may be incomplete, you may want to query data from 3 minutes ago or longer, especially for: Applications that run on multiple hosts. SyntheticCheck data: Timeouts can take 3 minutes, so 5 minutes or more is recommended. Also, if a query will generate intermittent data, consider using the sum of query results option. Condition settings Use the Condition settings to: Configure whether and how open violations are force-closed. Adjust the evaluation offset. Create a concise and descriptive condition name. (NerdGraph API Only) Provide a text description for the condition that will be included in violations and notifications. Troubleshooting procedures Optional: To include your organization's procedures for handling the incident, add the runbook URL to the condition. Limits on conditions See the maximum values. Examples For more information, see: Expected NRQL syntax Examples of NRQL condition queries Alert threshold types When you create a NRQL alert, you can choose from different types of thresholds: NRQL alert threshold types Description Static This is the simplest type of NRQL threshold. It allows you to create a condition based on a NRQL query that returns a numeric value. Optional: Include a FACET clause. Baseline Uses a self-adjusting condition based on the past behavior of the monitored values. Uses the same NRQL query form as the static type, except you cannot use a FACET clause. Outlier Looks for group behavior and values that are outliers from those groups. Uses the same NRQL query form as the static type, but requires a FACET clause. NRQL alert syntax Here is the basic syntax for creating all NRQL alert conditions. Depending on the threshold type, also include a FACET clause as applicable. SELECT function(attribute) FROM Event WHERE attribute [comparison] [AND|OR ...] Clause Notes SELECT function(attribute) Required Supported functions that return numbers include: apdex average count latest max min percentage percentile sum uniqueCount If you use the percentile aggregator in a faceted alert condition with many facets, this may cause the following error to appear: An error occurred while fetching chart data. If you see this error, use average instead. FROM data type Required Only one data type can be targeted. Supported data types: Event Metric (RAW data points will be returned) WHERE attribute [comparison] [AND|OR ...] Optional Use the WHERE clause to specify a series of one or more conditions. All the operators are supported. FACET attribute Static: Optional Baseline: Not allowed Outlier: Required Including a FACET clause in your NRQL syntax depends on the threshold type: static, baseline, or outlier. Use the FACET clause to separate your results by attribute and alert on each attribute independently. Faceted queries can return a maximum of 5000 values for static conditions and a maximum of 500 values for outlier conditions. If the query returns more than this number of values, the alert condition cannot be created. If you create the condition and the query returns more than this number later, the alert will fail. Sum of query results (limited or intermittent data) Available only for static (basic) threshold types. If a query returns intermittent or limited data, it may be difficult to set a meaningful threshold. Missing or limited data will sometimes generate false positives or false negatives. To avoid this problem when using the static threshold type, you can set the selector to sum of query results. This lets you set the alert on an aggregated sum instead of a value from a single harvest cycle. Up to two hours of the one-minute data checks can be aggregated. The duration you select determines the width of the rolling sum, and the preview chart will update accordingly. Offset the query time window Every minute, we evaluate the NRQL query in one-minute time windows. The start time depends on the value you select in the NRQL condition's Advanced settings > Evaluation offset. Example: Using the default time window to evaluate violations With the Evaluation offset at the default setting of three minutes, the NRQL time window applied to your query will be: SINCE 3 minutes ago UNTIL 2 minutes ago If the event type is sourced from an APM language agent and aggregated from many app instances (for example, Transactions, TransactionErrors, etc.), we recommend evaluating data from three minutes ago or longer. An offset of less than 3 minutes will trigger violations sooner, but you might see more false positives and negatives due to data latency. For cloud data, such as AWS integrations, you may need an offset longer than 3 minutes. Check our AWS polling intervals documentation to determine your best setting. NRQL alert threshold examples Here are some common use cases for NRQL alert conditions. These queries will work for static and baseline threshold types. The outlier threshold type will require additional FACET clauses. Alert on specific segments of your data Create constrained alerts that target a specific segment of your data, such as a few key customers or a range of data. Use the WHERE clause to define those conditions. SELECT average(duration) FROM Transaction WHERE account_id in (91290, 102021, 20230) SELECT percentile(duration, 95) FROM Transaction WHERE name LIKE 'Controller/checkout/%' Alert on Nth percentile of your data Create alerts when an Nth percentile of your data hits a specified threshold; for example, maintaining SLA service levels. Since we evaluate the NRQL query in one-minute time windows, percentiles will be calculated for each minute separately. SELECT percentile(duration, 95) FROM Transaction SELECT percentile(databaseDuration, 75) FROM Transaction Alert on max, min, avg of your data Create alerts when your data hits a certain maximum, minimum, or average; for example, ensuring that a duration or response time does not pass a certain threshold. SELECT max(duration) FROM Transaction SELECT average(duration) FROM Transaction Alert on a percentage of your data Create alerts when a proportion of your data goes above or below a certain threshold. SELECT percentage(count(*), WHERE duration > 2) FROM Transaction SELECT percentage(count(*), WHERE httpResponseCode = '500') FROM Transaction Alert on Apdex with any T-value Create alerts on Apdex, applying your own T-value for certain transactions. For example, get an alert notification when your Apdex for a T-value of 500ms on transactions for production apps goes below 0.8. SELECT apdex(duration, t:0.5) FROM Transaction WHERE appName like '%prod%' Create a description You can define a description that passes useful information downstream for better violation responses or for use by downstream systems. For details, see Description. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert conditions",
+ "info": "How to define thresholds that trigger alert notifications based on your NRQL queries.",
+ "nodeid": 9231,
+ "sections": [
+ "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": "Create NRQL alert conditions",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions",
+ "popularity": 1,
+ "external_id": "956a7a0b84d2afac5e6236df3143085ebc4f7459",
+ "category_1": "New Relic Alerts",
+ "category_2": "Alert conditions",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions",
+ "published_at": "2020-08-18T21:58:59Z",
+ "updated_at": "2020-08-15T23:05:02Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.38054845,
+ "_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 condition: When you start to create a condition, where it prompts you to Select a product, click NRQL . Tips on creating a NRQL condition: NRQL conditions Tips Condition types NRQL condition types",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert conditions "
+ },
+ "id": "5f2d992528ccbc489d88dfc1"
+ },
+ {
+ "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform",
+ "type": "developer",
+ "document_type": "page",
+ "info": "",
+ "sections": [
+ "Automate workflows",
+ "Guides to automate workflows",
+ "Quickly tag resources",
+ "Automate common tasks",
+ "Set up New Relic using the Kubernetes operator",
+ "Set up New Relic using Terraform"
+ ],
+ "title": "Automate workflows",
+ "popularity": 1,
+ "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871",
+ "image": "",
+ "url": "https://developer.newrelic.com/automate-workflows/",
+ "published_at": "2020-08-18T02:04:53Z",
+ "updated_at": "2020-08-17T01:55:15Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.19427466,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Set up New Relic using the Kubernetes operator ",
+ "body": " solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform"
+ },
+ "id": "5efa999c196a67dfb4766445"
+ },
+ {
+ "body": "You can manage alerts conditions using our GraphQL NerdGraph API. Here are some conditions queries and mutations you can develop in our NerdGraph API explorer. See the NerdGraph introduction for help getting started with NerdGraph API explorer. This document covers the following: Steps to create a NRQL condition NRQL static condition NRQL baseline condition NRQL outlier condition Update a condition Update mutations List and filter NRQL conditions Singular NRQL condition queries Create a description Delete conditions Steps to create a NRQL condition Follow these steps: Decide which condition type you want to create (see NRQL Condition threshold types). Find your relevant policyID by doing one of the following: Use the NerdGraph policies API. Go to one.newrelic.com, in the top nav click Alerts & AI, then click Policies. Choose a policy. Find the ID under the policy name. Provide the appropriate mutation for your NRQL condition type and the relevant values. The NerdGraph GraphiQL explorer is the best place to find up-to-date documentation about the per-field specifics of the NerdGraph NRQL Conditions API. For example, questions like \"What does the valueFunction field accept?\" are best answered with the inline NerdGraph documentation. NRQL static condition Here's an example of creating a static condition: mutation { alertsNrqlConditionStaticCreate(accountId: YOUR_ACCOUNT_ID, policyId: YOUR_POLICY_ID, condition: { name: \"Low Host Count - Catastrophic\" enabled: true nrql: { query: \"SELECT uniqueCount(host) from Transaction where appName='my-app-name'\" evaluationOffset: 3 } terms: { threshold: 2 thresholdOccurrences: AT_LEAST_ONCE thresholdDuration: 600 operator: BELOW priority: CRITICAL } valueFunction: SINGLE_VALUE violationTimeLimit: TWENTY_FOUR_HOURS }) { id name } } NRQL baseline condition Here's an example of creating a baseline condition: mutation { alertsNrqlConditionBaselineCreate(accountId: YOUR_ACCOUNT_ID, policyId: YOUR_POLICY_ID, condition: { name: \"Baseline Condition\" enabled: true baselineDirection: UPPER_ONLY nrql: { query: \"SELECT average(duration) FROM Transaction\" evaluationOffset: 3 } terms: { threshold: 13 thresholdDuration: 180 thresholdOccurrences: ALL operator: ABOVE priority: CRITICAL } violationTimeLimit: TWENTY_FOUR_HOURS }) { id name baselineDirection } } NRQL outlier condition Here's an example of creating an outlier condition: mutation { alertsNrqlConditionOutlierCreate(accountId: YOUR_ACCOUNT_ID, policyId: YOUR_POLICY_ID, condition: { name: \"Outlier Condition\" enabled: true expectedGroups: 4 openViolationOnGroupOverlap: false nrql: { query: \"SELECT average(duration) FROM Transaction FACET httpResponseCode\" evaluationOffset: 3 } terms: { threshold: 1 thresholdDuration: 300 thresholdOccurrences: ALL operator: ABOVE priority: CRITICAL } violationTimeLimit: TWENTY_FOUR_HOURS }) { id name expectedGroups openViolationOnGroupOverlap } } Update a condition Complete the following: Determine the type of your existing condition by requesting the type field in a nrqlConditionsSearch query like this: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch { nrqlConditions { id type } } } } } } The type returned is what you use for your update mutation. For example, if the type returned is STATIC, use alertsNrqlConditionStaticUpdate. If the type returned is BASELINE, use alertsNrqlConditionBaselineUpdate. If the type returned is OUTLIER, use alertsNrqlConditionOutlierUpdate. Provide the id of your condition to your relevant condition type mutation. Note that you can only update conditions of the relevant type. Only provide update mutations for the fields you want to update. Fields you don't provide in the update are not touched. Update mutations Only fields that you provide in the update are changed. In the following example, baselineDirection returns unchanged, but name is updated. mutation { alertsNrqlConditionBaselineUpdate(id: YOUR_CONDITION_ID, accountId: YOUR_ACCOUNT_ID, condition: { name: \"Your updated name\" }) { id name baselineDirection } } List and filter NRQL conditions To list or filter your NRQL conditions, use the nrqlConditionsSearch query in NerdGraph. Use cursor pagination The basic of list functionality for NRQL conditions allows you to paginate through your NRQL conditions as well as request the total count of conditions per account. The nrqlConditionsSearch query utilizes cursor pagination to paginate through resources. The idea behind cursor pagination is that the client will request a cursor in a programmatic loop until the cursor comes back empty. An initial list response will look something like this: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch { nextCursor nrqlConditions { id name type } totalCount } } } } } This example returns a JSON response like this: { \"data\": { \"actor\": { \"account\": { \"alerts\": { \"nrqlConditionsSearch\": { \"nextCursor\": \"WOwfJ4+TWm9QTFeKMGyg+w==:QqkI8S4+Wwnpno6z+uk8kQ==\", \"nrqlConditions\": [ { \"id\": \"4432\", \"name\": \"Baseline Condition\", \"type\": \"BASELINE\" }, { \"id\": \"443\", \"name\": \"A static condition\", \"type\": \"STATIC\" }, // more conditions here in reality ], \"totalCount\": 435 } } } } }, } In order to paginate through conditions in the response, have the client request the cursor to be returned until the nextCursor returns from the response as null: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch(cursor: \"WOwfJ4+TWm9QTFeKMGyg+w==:QqkI8S4+Wwnpno6z+uk8kQ==\", ) { nextCursor nrqlConditions { id name type } totalCount } } } } } Request type-specific fields Certain fields are only available on specific NRQL condition types. The main reason that mutations are split between the different condition types is because they have minor differences between the fields they accept. For example, valueFunction is only relevant for static NRQL conditions and baselineDirection is only relevant on baseline NRQL conditions. But if these fields are only available on these certain condition types, how do we return them in a list of all of our condition types? The answer is a GraphQL convention known as inline fragments. Inline fragments allow you to access the data on a specific type of NRQL condition: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch { nrqlConditions { id name type ...on AlertsNrqlStaticCondition { valueFunction } ...on AlertsNrqlBaselineCondition { baselineDirection } ...on AlertsNrqlOutlierCondition { expectedGroups } } } } } } } In the previous example query, we are asking GraphQL to do the hard work for us to determine which NRQL conditions are the correct type. So, when the returned type is a static condition, it will return the valueFunction in the object. When the returned type is a baseline condition, it will return baselineDirection instead, and when the type is an outlier condition, it will return expectedGroups. Here is an example response: { \"data\": { \"actor\": { \"account\": { \"alerts\": { \"nrqlConditionsSearch\": { \"nrqlConditions\": [ { \"baselineDirection\": \"UPPER_ONLY\", \"id\": \"342\", \"name\": \"My baseline condition\", \"type\": \"BASELINE\" }, { \"id\": \"553\", \"name\": \"My static condition\", \"type\": \"STATIC\", \"valueFunction\": \"SINGLE_VALUE\" }, { \"expectedGroups\": 4, \"id\": \"802\", \"name\": \"My outlier condition\", \"type\": \"OUTLIER\" } ] } } } } } } Filter NRQL conditions You can filter NRQL conditions with the searchCriteria argument of the nrqlConditionsSearch query: Here's an example of filtering NRQL conditions with matching by name. This query returns NRQL conditions that match the provided name. Note that this match is case insensitive. { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch(searchCriteria: { name: \"Baseline Condition\" }) { nrqlConditions { id name type } } } } } } Singular NRQL condition queries You can use the NRQL condition API to query for a singular condition. Run the nrqlCondition query in the alerts namespace. Similar to type specific fields on the nrqlConditionSearch query, you can also use these inline fragmentsto request fields that are restricted to a NRQL condition type. { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlCondition(id: YOUR_CONDITION_ID) { id name ...on AlertsNrqlStaticCondition { valueFunction } } } } } } Update the description This will walk you through the procedure to create a description for a NRQL alert condition. 1. Get all the conditions for a policy: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditions(policyId: YOUR_POLICY_ID) { nextCursor results { id name description enabled nrql { query sinceValue } policyId runbookUrl terms { duration operator priority timeFunction threshold } type violationTimeLimit } } } } } } 2. Get the details for a single condition: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlCondition(id: \"YOUR_CONDITION_ID\") { description id enabled name nrql { query evaluationOffset } policyId runbookUrl terms { operator priority threshold thresholdDuration thresholdOccurrences } type violationTimeLimit } } } } } 3. Create a mutation with the description. Here's an empty mutation template: mutation { alertsNrqlConditionStaticUpdate(accountId: YOUR_ACCOUNT_ID, id: \"YOUR_CONDITION_ID\", condition: {description: \"\"}) { description } } Here'a an example mutation with an included example description: mutation { alertsNrqlConditionStaticUpdate(accountId: 123456, id: \"123456\", condition: {description: \"timestamp : {{timestamp}} \\n accountId : {{accountId}} \\n type : {{type}} \\n event : {{event}} \\n description : {{description}} \\n policyId : {{policyId}} \\n policyName: {{policyName}} \\n conditionName : {{conditionName}} \\n conditionId : {{conditionId}} \\n product : {{product}} \\n conditionType : {{conditionType}} \\n RunbookUrl : {{runbookUrl}} \\n nrqlQuery : {{nrqlQuery}} \\n nrqlEventType : {{nrqlEventType}} \\n targetID : {{targetId}} \\n targetName : {{targetName}} \\n commandLine : {{tag.commandLine}} \\n entityGuid : {{tag.entityGuid}} \\n entityName : {{tag.entityName}} \\n fullHostname : {{tag.fullHostname}} \\n instanceType : {{tag.instanceType}} \\n processDisplayName : {{tag.processDisplayName}}\"}) { description } } Delete conditions You can use the alertsConditionDelete mutation to delete any type of condition. You can only request the id field on a delete mutation; for example: mutation { alertsConditionDelete(accountId: YOUR_ACCOUNT_ID, id: YOUR_CONDITION_ID) { id } } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph",
+ "info": "Examples of how to use the NerdGraph API explorer to create alert conditions, queries, and mutations.",
+ "nodeid": 37711,
+ "sections": [
+ "New Relic Alerts",
+ "Get started",
+ "Alert policies",
+ "Alert conditions",
+ "Alert violations",
+ "Alert Incidents",
+ "Alert notifications",
+ "Troubleshooting",
+ "Rules, limits, and glossary",
+ "Alerts and Nerdgraph",
+ "REST API alerts",
+ "NerdGraph API: NRQL condition alerts",
+ "Steps to create a NRQL condition",
+ "NRQL static condition",
+ "NRQL baseline condition",
+ "NRQL outlier condition",
+ "Update a condition",
+ "Update mutations",
+ "List and filter NRQL conditions",
+ "Singular NRQL condition queries",
+ "Update the description",
+ "Delete conditions",
+ "For more help"
+ ],
+ "title": "NerdGraph API: NRQL condition alerts ",
+ "popularity": 1,
+ "external_id": "86591bd20017930f1e4eef1b1a76e3806298dbb9",
+ "category_1": "New Relic Alerts",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alerts-nerdgraph/nerdgraph-api-nrql-condition-alerts",
+ "published_at": "2020-08-18T18:15:13Z",
+ "updated_at": "2020-08-11T04:56:49Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.15523642,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NerdGraph API: NRQL condition alerts ",
+ "sections": "NerdGraph API: NRQL condition alerts ",
+ "info": "Examples of how to use the NerdGraph API explorer to create alert conditions , queries, and mutations.",
+ "category_0": "Alerts and Applied intelligence",
+ "category_1": "New Relic Alerts ",
+ "body": " the conditions for a policy: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditions (policyId: YOUR_POLICY_ID) { nextCursor results { id name description enabled nrql { query sinceValue } policyId runbookUrl terms { duration operator priority timeFunction threshold } type violationTimeLimit"
+ },
+ "id": "5f2dee1128ccbc562e88dfc1"
+ },
+ {
+ "body": "Use the entity explorer to access the performance data from all your monitored applications, services, and hosts. For more about entities, see What is an entity? View entities To use the entity explorer: Go to one.newrelic.com and select Entity explorer. Your monitored entities are on the left. You may need to scroll your list of entities to see them all. one.newrelic.com > Entity explorer: Use the entity explorer to locate and examine the entities you monitor. The entity explorer brings together data reported from across all of New Relic. Entity categories include: Services: APM-monitored applications and services monitored. Hosts: your monitored infrastructure (your servers and hosts). Mobile applications: your mobile apps. Browser applications: your front-end browser apps. Integration-reported data: data from services monitored by our integrations, including our on-host integrations (like Kubernetes, StatsD, and NGINX), and cloud platform integrations, like Amazon, Microsoft Azure, and Google Cloud Platform (GCP). Health (alert) status The entity explorer shows a color-coded alert status for entities. For example, you may see a red alert status indicating a critical violation in progress. To see what an alert status means, mouse over it. To see details about an entity's alerting status, select the entity. NRQL alert conditions aren't used to determine alert status because they aren't associated with specific entities. Starting June 8, 2020, New Relic One will not continue to display any APM application that hasn't reported data for 93 days. To match our published APM data retention guidelines, applications that have not reported data will be available within the New Relic UI for 90 days. After 90 days, those applications will be removed from the UI; however, key metrics will continue to be available via the New Relic REST API based on subscription level. For more information, see New Relic's Explorers Hub post. Filter by tag or entity name There are a couple ways to filter down to specific types of entities: Filter entities by tags: Use Filter with tags at the top of the page. For example, you may want to filter down to only entities tagged with production, or only entities with a specific AWS region tag. For more about tags, see Tagging. Filter by entity name: Use Search services by name at the top of the page. Entity data retention Availability of data depends on these factors: Scope Data retention Entity explorer and search In the UI, data is available for eight days after an entity no longer exists, with one exception: data reported by integrations, such as Amazon AWS, is only available for one day after an entity ceases to exist. Our database (accessible via NRQL query) For querying our database (for example, via the query builder or data explorer), availability is dependent on the data retention for that data type. As a result of these factors, a short-lived entity (like a cloud host) may not be available in the entity explorer list or via search, but its data may still be available via NRQL query. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / New Relic One / Use New Relic One / UI and data",
+ "info": "Use New Relic's entity explorer to see all your monitored entities in one place and explore the reported data. ",
+ "nodeid": 34316,
+ "sections": [
+ "Use New Relic One",
+ "Get started",
+ "Core concepts",
+ "UI and data",
+ "Workloads",
+ "Build on New Relic One",
+ "Entity explorer: View performance across apps, services, hosts",
+ "View entities",
+ "Health (alert) status",
+ "Filter by tag or entity name",
+ "Entity data retention",
+ "For more help"
+ ],
+ "title": "Entity explorer: View performance across apps, services, hosts",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/new-relic-one/use-new-relic-one/ui-data/new-relic-one-entity-explorer-view-performance-across-apps-services-hosts",
+ "popularity": 1,
+ "external_id": "4a6bab9713737af90dbcc516f3c61501354f15d2",
+ "category_1": "Use New Relic One",
+ "category_2": "UI and data",
+ "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-one-entity-explorer.png",
+ "url": "https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/ui-data/new-relic-one-entity-explorer-view-performance-across-apps-services-hosts",
+ "published_at": "2020-08-18T14:54:15Z",
+ "updated_at": "2020-08-10T23:54:20Z",
+ "category_0": "New Relic One",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.089622304,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Health (alert ) status",
+ "body": " in progress. To see what an alert status means, mouse over it. To see details about an entity's alerting status, select the entity. NRQL alert conditions aren't used to determine alert status because they aren't associated with specific entities. Starting June 8, 2020, New Relic One will not continue"
+ },
+ "id": "5d244a5864441fe577a72a1b"
+ },
+ {
+ "body": "New Relic's Kubernetes integration can be installed directly on a server or VM, or through several cloud platforms, such as GKE, EKS, AKS, or OpenShift. Each has a different compatibility with our integration. Compatibility Our Kubernetes integration is compatible with the following versions, depending on the installation mode: Install mode or feature Kubernetes versions Kubernetes cluster Currently tested with versions 1.10 to 1.18 Kubernetes cluster GKE Currently tested with versions 1.10 and 1.17 Kubernetes cluster EKS Currently tested with version 1.11 Kubernetes cluster AKS Currently tested with version 1.11 Kubernetes cluster OpenShift Currently tested with versions 3.7, 3.9, 4.2, 4.3, 4.4 and 4.5 Control plane monitoring Compatible with version 1.11 or higher Service monitoring Compatible with version 1.13 or higher Requirements The New Relic Kubernetes integration has the following requirements: Linux distribution compatible with New Relic infrastructure agent. kube-state-metrics version 1.9.5 running on the cluster. Install using Helm For compatibility and requirements when installing the Kubernetes integration using Helm, see Alternative install using Helm. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Integrations / Kubernetes integration / Get started",
+ "info": "Compatibility and requirements of the New Relic Kubernetes integration.",
+ "nodeid": 38331,
+ "sections": [
+ "Kubernetes integration",
+ "Get started",
+ "Installation",
+ "Understand and use data",
+ "Link apps and services",
+ "Kubernetes events",
+ "Logs",
+ "Troubleshooting",
+ "Kubernetes integration: compatibility and requirements",
+ "Compatibility",
+ "Requirements",
+ "Install using Helm",
+ "For more help"
+ ],
+ "title": "Kubernetes integration: compatibility and requirements",
+ "popularity": 1,
+ "external_id": "dd40c3bef40e68d873d909dbff75708e20a1141e",
+ "category_1": "Kubernetes integration",
+ "category_2": "Get started",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/integrations/kubernetes-integration/get-started/kubernetes-integration-compatibility-requirements",
+ "published_at": "2020-08-18T17:13:01Z",
+ "updated_at": "2020-08-18T17:13:00Z",
+ "category_0": "Integrations",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.08006527,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Kubernetes integration: compatibility and requirements",
+ "sections": "Kubernetes integration",
+ "info": "Compatibility and requirements of the New Relic Kubernetes integration.",
+ "category_1": "Kubernetes integration",
+ "body": "New Relic's Kubernetes integration can be installed directly on a server or VM, or through several cloud platforms, such as GKE, EKS, AKS, or OpenShift. Each has a different compatibility with our integration. Compatibility Our Kubernetes integration is compatible with the following versions",
+ "breadcrumb": "Contents / Integrations / Kubernetes integration / Get started"
+ },
+ "id": "5ea87c3be7b9d2c533748090"
+ }
+ ],
+ "/build-apps/map-pageviews-by-region": [
+ {
+ "body": "Set up your development environment 20 min If you've decided to build a custom app or modify one of our open source apps, you need a few essential tools: The New Relic One command line interface (CLI) An API key, which you get when you download the CLI Depending on what you want to do with your app, you might have some additional setup and configuration. This guide covers: Downloading the New Relic One CLI to build or modify apps Contribute content to this website Before you begin You must have: A github account account - While not strictly necessary for building apps, a GitHub account enables you to download and customize our open source apps, and contribute an open source project. A New Relic developer account - if you don't already have one, you can get a free trial account for developing New Relic applications. npm - If you've installed Node.js, then you already have npm, which is used to share, reuse, and update JavaScript code, and is necessary for working with React components that are the framework for New Relic apps and this website. Tip Use the NR1 VS Code extension to build your apps. Prepare to build or modify apps Step 1 of 2 Download the CLI and API key On the Build New Relic One applications page, complete the Quick start steps. These six Quick start steps get you an API key for use with developing apps, and the New Relic One CLI, for building and deploying apps. At the end of the Quick start, you have a project consisting of the following: A Nerdpack - The package containing all the files required by your application. It contains two types of files that you customize to build your app: Nerdlets, and the launcher. One or more Nerdlet files - A specific UI view or window. A Nerdlet is a React JavaScript package that includes an index.js file, a stylesheet, and a JSON-format config file. It can contain any JS functionality (charts, interactive fields, tooltips, etc.). A launcher file: This is the basis for the launcher, which is used to open your application from New Relic One after you publish your app. Step 2 of 2 Start building If you're ready to code, cd to your Nerdpack and get started. If you want to learn more about building applications, try these step-by-step guides: Build a \"Hello, World!\" application shows how to create a little application, publish it to New Relic One, and share it with others by subscribing accounts to it. Map pageviews by region takes you through the steps to create one of our popular open source apps. You learn to add a custom query to an app and view it in a table, then add that data to a map. Contributing to developer.newrelic.com This site is open source, and we want your input. Create a pull request if you see a mistake you know how to fix. Drop us a GitHub issue if you see some content gaps you want us to work on. Or write up a whole new guide if you have one you'd like to share. Read on to learn how. Step 1 of 3 Fork the developer-website GithHub repo Forking the repo enables you to work on your own copy of the developer.newrelic.com files, and build the site locally. It also enables us to more easily manage incomimg pull requests. On the developer-website page in GitHub, select the Fork button on the top right of the page, choose the account you want to fork to, and wait a few seconds while the fork is created. Sync regularly to keep your fork up to date with changes and additions to the main branch upstream. Step 2 of 3 Make a feature or documentation request On any page, select the GitHub button at the top of the page, and then select the kind of change you want, and fill out the GitHub form. Step 3 of 3 Contribute a new guide Check out our contributors guidelines, which will walk you through the process.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Prepare to build apps and contribute to this site",
+ "sections": [
+ "Set up your development environment",
+ "Before you begin",
+ "Tip",
+ "Prepare to build or modify apps",
+ "Download the CLI and API key",
+ "Start building",
+ "Contributing to developer.newrelic.com",
+ "Fork the developer-website GithHub repo",
+ "Make a feature or documentation request",
+ "Contribute a new guide"
+ ],
+ "title": "Set up your development environment",
+ "popularity": 1,
+ "external_id": "c45638a9cd548d1ffffc9f1c7708f115a92ae04a",
+ "image": "",
+ "url": "https://developer.newrelic.com/build-apps/set-up-dev-env/",
+ "published_at": "2020-08-18T02:08:12Z",
+ "updated_at": "2020-08-18T01:45:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.20750418,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Prepare to build or modify apps ",
+ "info": "Prepare to build apps and contribute to this site",
+ "body": " pageviews by region takes you through the steps to create one of our popular open source apps. You learn to add a custom query to an app and view it in a table, then add that data to a map . Contributing to developer.newrelic.com This site is open source, and we want your input. Create a pull request"
+ },
+ "id": "5efa9973e7b9d242237bab39"
+ },
+ {
+ "body": "New Relic APM's Summary page provides general information about the selected app, including web transactions and non-web transactions, Apdex score, CPU usage, throughput (requests per minute or rpm), transaction times, error rate, application activity, and hosts. To get a high-level overview of all your applications and services, use the entity explorer. View your app's summary page Here are two ways to reach the Summary page: Entity explorer: Go to one.newrelic.com > Entity explorer > (select an app). APM: Go to one.newrelic.com > APM > (select an app). For more information, see the documentation about navigating core UI components in New Relic One. View app performance Use the Summary page for a quick summary of your website's performance. Overview charts Some charts include links to APM pages where you can drill down into additional details. APM Summary chart Comments Transactions response time This stacked chart represents the response time of web transactions or non-web transactions in your app. Segments in the chart vary depending on which agent you are using. Some charts may have an independent line for response time that represents the relationship between response time and total time. Also, for your external or background services, you may see data labeled as Web external. For more information about these out-of-process services, use the Externals page. Apdex score This chart measures the performance of your app based on its Apdex T value during the selected time window. To view additional details, hover over the question question circle icon or the chart's End user and App server lines. The End user line charts the Apdex for your Browser apps, and the App server line charts the Apdex for your APM apps. Throughput This chart illustrates the requests per minute for either web transactions or non-web transactions. To change the type of transaction, select the Transaction response time chart's dropdown arrow, then select Web or Non-web. Error rate This chart shows the number of errors that have occurred in the current time window. The tooltip that appears when you hover over the Error rate chart shows the combined throughput for both web and non-web transactions. To understand how error rate is calculated, see Application error rate example. Event markers Markers on the main Summary chart indicate events and changes to the app: Black vertical bar: Apdex settings have changed. Blue vertical bar: A deployment marker has been created or another event has occurred, such as a settings change for the app. Yellow or red area: This indicates alert thresholds have been violated. To view additional information, mouse over the marker. Drill-down details Use any of New Relic's standard page functions to drill down into detailed information. Here is a summary of additional options with the APM Summary page. If you want to... Do this... Change how data appears on the main chart Select the chart title's drop-down arrow, and then select your choice of view options, including histograms or percentiles if available. View threshold levels for your app's Apdex score Mouse over the Apdex score ? icon. For non-web transactions, the Apdex chart is blank because Apdex is not applicable to this class of apps. View trends in transaction time, Apdex, and throughput Select the Compare with yesterday and last week checkbox. The checkbox is only available when viewing the Web transaction response time chart with the time picker window Ending now. The checkbox is unavailable if you are viewing histograms, percentiles, or custom dates. View app performance since the last deployment From the time picker, select Performance since the last deployment. For detailed information about all deployments, select the Deployments page. View the Transactions page Select the Transactions table's heading on the APM Summary page. Or, to view details about a specific transaction (including operations, transaction traces, and key transactions), select its name. View the Databases or External services pages Click on a related time band in the Web transactions response time chart. View the Errors page Select the Error rate chart's title on the APM Summary page. You can also view the Errors page from one.newrelic.com > (select an app) > Events > Errors. Browser details In order to view Browser details, you must enable this feature from Browser settings. However, if your app has never reported any browser monitoring data, you must first enable it from the application's settings: Go to one.newrelic.com > (select an app) > Settings > Application. From the New Relic Browser section, select the Enable browser monitoring? checkbox. Select Apdex values for browser monitoring and app server requests, or leave the defaults. Optional: Select up to five countries or regions for browser monitoring to highlight on the Geography page. Select Save application settings. To enable additional features, follow standard procedures from Browser > (selected app) > Settings. After New Relic Browser instrumentation is set up, the APM Summary page provides summary information and direct links to detailed information on the app's corresponding Browser Summary page. To view chart details with browser page load time, select the main chart's Browser link. To view the Apdex score for browsers, select the Apdex chart's Browser link. Link app performance to resources The APM Summary page shows a table with averages about your app's instances on their hosts, including: Apdex Response time Throughput Error rate CPU usage Memory CPU usage percentage is calculated as though the application is running on one CPU core. For more information about this calculation, see CPU usage is over 100%. Examine app performance within system context Use any of these options to examine your app's performance within the context of your system's architecture and resources, such as individual hosts: Select your choice from the table at the bottom of the APM Summary page for infrastructure. Toggle between a table view or breakout metric details. If applicable, select your choice from the drop-down at the top of the APM Summary page for servers or JVMs. Examine details within infrastructure To help you understand the full context of your app's performance within your environment, New Relic APM includes options to view performance from inside the application, as well as from outside the application with the infrastructure agent. To view detailed information from your resources' point of view, click any host link. The link takes you directly to the infrastructure Compute page. When you click, the Compute data may not immediately appear. If that happens, follow the prompt to validate your account and complete the conversion process for the infrastructure agent. If you need additional help, get support at support.newrelic.com. Troubleshoot host link To troubleshoot the host link from the APM Summary page, use these tips: Host link from APM Summary Troubleshooting tips Your infrastructure agent is not installed on the host. Follow standard procedures to install our infrastructure agent. The application is operating within a container, and your infrastructure agent is installed on the container’s host. Set the hostname for the container to be the hostname of the underlying server. Docker containers: Run your Docker container with the argument: --uts=\"host\" This will cause the container to share the UTS Linux Namespace with the underlying host. However, by using this set, a privileged container could change the host's hostname. The application is running on a Windows container, and your infrastructure agent is installed on the Windows host. To get a direct link to infrastructure metric data for your application, enable process metrics in the infrastructure agent's configuration. Your infrastructure agent is installed, but it only reports the short hostname, not the long hostname. Configure your server's hostname settings so that the infrastructure agent and the APM agent return the exact same name string. If possible, do so by editing your server's fully qualified domain name (FQDN) settings. The APM and infrastructure agents both read their hostname from the operating system's FQDN settings, so setting the hostname there ensures both agents share a single hostname. For more information, see the Java agent troubleshooting example. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / APM / APM UI pages / Monitoring",
+ "info": "New Relic APM's Summary page provides charts and tables that you can drill down into details about your selected app’s performance.",
+ "nodeid": 3106,
+ "sections": [
+ "APM UI pages",
+ "Monitoring",
+ "Error analytics",
+ "Features",
+ "Events",
+ "APM Summary page: View transaction, Apdex, usage data",
+ "View your app's summary page",
+ "View app performance",
+ "Link app performance to resources",
+ "For more help"
+ ],
+ "title": "APM Summary page: View transaction, Apdex, usage data",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/apm/apm-ui-pages/monitoring/apm-summary-page-view-transaction-apdex-usage-data",
+ "popularity": 1,
+ "external_id": "107da0571b646cfe203af6c1114369e164edb390",
+ "category_1": "APM UI pages",
+ "category_2": "Monitoring",
+ "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/crop-apm-overview-hosts112116.png",
+ "url": "https://docs.newrelic.com/docs/apm/apm-ui-pages/monitoring/apm-summary-page-view-transaction-apdex-usage-data",
+ "published_at": "2020-08-18T12:28:49Z",
+ "updated_at": "2020-08-15T05:47:46Z",
+ "category_0": "APM",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.1375314,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "APM Summary page : View transaction, Apdex, usage data",
+ "sections": "View your app's summary page ",
+ "info": "New Relic APM's Summary page provides charts and tables that you can drill down into details about your selected app’s performance.",
+ "category_1": "APM UI pages ",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/apm/apm-ui-pages /monitoring/apm-summary-page -view -transaction-apdex-usage-data",
+ "body": " your applications and services, use the entity explorer. View your app 's summary page Here are two ways to reach the Summary page : Entity explorer: Go to one.newrelic.com > Entity explorer > (select an app ). APM: Go to one.newrelic.com > APM > (select an app ). For more information, see"
+ },
+ "id": "5f377702196a67008755e629"
+ },
+ {
+ "body": "Browser monitoring's Geography page provides a world view with color-coded Apdex scores and other performance information about your end users' experience. You can select specific geographic regions, such as countries or states, and then you can drill down to detailed information about page load performance and historical performance. Contents View performance data by region Firewalls may have an impact on the geographical data collected about your end users. To view or sort the performance information by location: one.newrelic.com > Browser > (select an app) > Geo: This page provides a world view and drill-down details of color-coded performance information for geographic locations. Go to one.newrelic.com > Browser > (select an app) > Geo > Global (for a world view). OR Go to one.newrelic.com > Browser > (select an app) > Geo > (select a location) (for a specific location you identified in the Browser application settings). To drill down to a specific area, select a location from the list, or select any area on the geographical map. To view additional details about the selected location, select the Page load performance or Historical performance links. To return to the main Geography page, select X (Close). one.newrelic.com > Browser > (select an app) > Geo > (select a location): If you selected specific locations from Settings > Application settings, the Geography page includes tabs to view their performance data directly. Use page functions Use any of our standard user interface functions and page functions to drill down into detailed information. Here is a summary of additional options with the Geography page: If you want to... Do this... Change how the performance data appears Select your choice from the Sort by menu. Adjust the amount of information that appears Select or clear the Hide <% throughput checkbox (<1% for global view, <2% for selected locations). View a map of a specific location Do any of these as applicable: Select the location's name from the Geo > Global list. Select its physical location on the map. If you have pre-selected the location from Application settings, select its tab. View summary performance information about a specific location Mouse over any colored area. View drill-down details After you select a specific location, the Page load performance page shows: Average page load time in seconds Number of page views and active sessions as pages per minute (ppm) Recent browser traces if applicable one.newrelic.com > Browser > (select an app) > Geo > (select a location): After you select a specific location, you can view specific details about Page load performance and Historical performance. In addition, the Historical performance page shows comparison data for the selected time period, yesterday, and last week for the selected location. This includes: Response time Apdex Throughput in pages per minute (ppm) For more help Additional documentation resources include the Page views page (details about end users' overall experience with your site). If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Browser monitoring / Browser monitoring / Additional standard features",
+ "info": "Browser's Geography feature shows color-coded Apdex scores and page load performance for your end users' experience around the world.",
+ "nodeid": 1921,
+ "sections": [
+ "Browser monitoring",
+ "Getting started",
+ "Guides",
+ "Installation",
+ "Configuration",
+ "Browser agent and SPA API",
+ "Page load timing resources",
+ "Browser Pro features",
+ "Additional standard features",
+ "Performance quality",
+ "Troubleshooting",
+ "Browser Geography: Webpage performance by location",
+ "Contents",
+ "View performance data by region",
+ "Use page functions",
+ "View drill-down details",
+ "For more help"
+ ],
+ "title": "Browser Geography: Webpage performance by location",
+ "popularity": 1,
+ "external_id": "ccbfe8376f2aee5d35b31dbcee84ff1cbff5b094",
+ "category_1": "Browser monitoring",
+ "category_2": "Additional standard features",
+ "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/geo_overview.png",
+ "url": "https://docs.newrelic.com/docs/browser/new-relic-browser/additional-standard-features/browser-geography-webpage-performance-location",
+ "published_at": "2020-08-18T11:30:40Z",
+ "updated_at": "2020-08-15T09:25:45Z",
+ "category_0": "Browser monitoring",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.118906915,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "View performance data by region ",
+ "info": "Browser's Geography feature shows color-coded Apdex scores and page load performance for your end users' experience around the world.",
+ "body": " performance and historical performance. Contents View performance data by region Firewalls may have an impact on the geographical data collected about your end users. To view or sort the performance information by location: one.newrelic.com > Browser > (select an app ) > Geo: This page provides a world"
+ },
+ "id": "561c8bbc827a6617ad000172"
+ },
+ {
+ "body": "Browser monitoring supports the uploading of source maps, which are used to un-minify error stack traces on the JS errors page. This document explains how to use the API to publish (upload) source maps to Browser. Prepare for using the source map API In order to upload source maps to Browser via the API, you'll need this information: An admin API key for the New Relic account The New Relic application ID for the deployed app The full JavaScript file URL Optionally, if the JavaScript URL doesn't automatically have release info appended to it, the release name and ID What is the JavaScript URL? Every time the agent captures an error in your code, it's associated with the URL of the JavaScript in which it occurred. This is the src attribute of the script tag in your HTML. This full JavaScript URL is required when sending source maps to Browser. You can find the URL for an error's JavaScript file in Browser, on the JS errors page. See Browser monitoring source maps for more on finding these errors in the UI. Is a release name and ID required? Many organizations include a version number or hash in the JavaScript URL. This is generally added to \"bust\" caches to ensure your users get the most recent version of your code. This type of URL might look something like: https://example.com/assets/application-59.min.js https://example.com/assets/bundle-d6d031.min.js https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.js If your app's URLs automatically have the version info appended to it, the Browser agent has everything it needs in order to match errors with your code. You can move ahead to generating source maps. If this doesn't apply to you, and JS URLs do not have version info appended, you’ll have to assist the agent by specifying a release name and ID with the API. Are there limits to source map uploads? There is no limit to the overall number of source maps you can upload. However, the API is rate-limited: You can upload a maximum of 100 source maps per minute You can upload a maximum of 5,000 source maps per day Source map files can be a maximum of 50Mb in size. Push source maps to New Relic Now that you have one or more source maps, you are ready to publish it to Browser. You can use any of these methods to send source maps to Browser: Use the New Relic npm module with the API via the command line or via a client-side JavaScript build/deploy script like Gulp or Grunt. Use API curl commands. Use the Browser UI. Use npm module via command line or client-side script The easiest and recommended way to upload source maps to Browser is to use the our new @newrelic/publish-sourcemap npm module. It provides a command line tool and Javascript API to accomplish this task. More documentation is available in the npm repo. Here are some examples of using the npm module via the command line. The following examples are for US accounts. For EU accounts, the endpoint is https://sourcemaps.service.eu.newrelic.com. For more information, see Introduction to the EU region data center. npm command line: Publish Here's an example of uploading source maps using the npm module via the command line. Note that the source map can come from a local file or a remote URL. npm install -g @newrelic/publish-sourcemap publish-sourcemap PATH_TO_SOURCE_MAP_FILE (local or remote) PATH_TO_ORIGINAL_FILE --nrAdminKey=YOUR_NEW_RELIC_ADMIN_API_KEY --applicationId=YOUR_NEW_RELIC_APP_ID npm command line: List published maps Here's an example of listing published source maps: list-sourcemaps --applicationId=YOUR_APP_ID --nrAdminKey=YOUR_NEW_RELIC_ADMIN_KEY Options: --applicationId Browser application id --nrAdminKey New Relic admin API key npm command line: Delete Here's an example of deleting a source map: delete-sourcemap --applicationId=YOUR_APP_ID --nrAdminKey=YOUR_NEW_RELIC_ADMIN_API_KEY --sourcemapId=YOUR_SOURCE_MAP_ID Options: --applicationId Browser application id --nrAdminKey New Relic admin API key --sourcemapId Unique id generated for a source map Here are some examples of using the npm module to publish from client-side JavaScript: npm via Node.js script: Publish Here's an example of publishing a source map via a Node.js script: var publishSourcemap = require(‘@newrelic/publish-sourcemap’).publishSourcemap publishSourcemap({ sourcemapPath: 'SOURCE_MAP_FULL_PATH', javascriptUrl: 'JS_URL', applicationId: YOUR_NEW_RELIC_APP_ID, nrAdminKey: 'YOUR_NEW_RELIC_ADMIN_API_KEY' }, function (err) { console.log(err || 'Sourcemap upload done')}) npm via Node.js script: List published maps Here's an example of listing all published source maps: var listSourcemaps = require(‘@newrelic/publish-sourcemap’).listSourcemaps listSourcemaps({ sourcemapPath: 'SOURCE_MAP_FULL_PATH', javascriptUrl: 'JS_URL', applicationId: YOUR_NEW_RELIC_APP_ID, nrAdminKey: 'YOUR_NEW_RELIC_ADMIN_API_KEY', }, function (err, res) { console.log(err || res.body)}) npm via Node.js script: Delete Here's an example of deleting a source map file via a Node.js script: var deleteSourcemap = require(‘@newrelic/publish-sourcemap’).deleteSourcemap deleteSourcemap({ sourcemapId: 'SOURCE_MAP_ID', applicationId: YOUR_NEW_RELIC_APP_ID, nrAdminKey: 'YOUR_NEW_RELIC_ADMIN_API_KEY', }, function (err) { console.log(err || 'Deleted source map')}) When you're done, go to the JS errors page in Browser, select an error grouping, and see if your error stack traces have been un-minified. Use API via curl Below are some examples of using curl to publish, list, and delete source maps: curl: Upload maps An example of using API via curl to publish maps to Browser: curl -H \"Newrelic-Api-Key: YOUR_NEW_RELIC_ADMIN_API_KEY\" \\ -F \"sourcemap=@SOURCE_MAP_PATH\" \\ -F \"javascriptUrl=JS_URL\" \\ -F \"releaseId=YOUR_RELEASE_ID\" \\ -F \"releaseName=YOUR_UI_PAGE\" \\ https://sourcemaps.service.newrelic.com/v2/applications/YOUR_NEW_RELIC_APP_ID/sourcemaps curl: List existing maps Below is an example of how to get a list of source maps previously uploaded to New Relic via curl. New Relic returns the source map's unique SOURCEMAP_ID and its components: curl \\ -H \"Newrelic-Api-Key: YOUR_NEW_RELIC_ADMIN_API_KEY\" \\ https://sourcemaps.service.newrelic.com/v2/applications/YOUR_NEW_RELIC_APP_ID/sourcemaps curl: Delete map To delete a source map: Use the GET endpoint to list existing source maps and locate the SOURCEMAP_ID. Run the following command via curl: curl -X DELETE \\ -H \"Newrelic-Api-Key: YOUR_NEW_RELIC_ADMIN_API_KEY\" \\ https://sourcemaps.service.newrelic.com/v2/applications/YOUR_NEW_RELIC_APP_ID/sourcemaps/SOURCEMAP_ID When you're done, go to the JS errors page in Browser, select an error grouping, and see if your error stack traces have been un-minified. Troubleshoot source maps If you are having trouble generating source maps from your build system, or if your errors in Browser are remaining minified, see the source maps troubleshooting documentation. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Browser monitoring / Browser monitoring / Browser Pro features",
+ "info": "For Browser, how to upload and use source maps with the Browser API.",
+ "nodeid": 11696,
+ "sections": [
+ "Browser monitoring",
+ "Getting started",
+ "Guides",
+ "Installation",
+ "Configuration",
+ "Browser agent and SPA API",
+ "Page load timing resources",
+ "Browser Pro features",
+ "Additional standard features",
+ "Performance quality",
+ "Troubleshooting",
+ "Upload source maps via API",
+ "Prepare for using the source map API",
+ "Push source maps to New Relic",
+ "Use npm module via command line or client-side script",
+ "Use API via curl",
+ "Troubleshoot source maps",
+ "For more help"
+ ],
+ "title": "Upload source maps via API",
+ "popularity": 1,
+ "external_id": "6bc1cf3a1c7f6a2b7bdf464b7a6578b093950182",
+ "category_1": "Browser monitoring",
+ "category_2": "Browser Pro features",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/browser/new-relic-browser/browser-pro-features/upload-source-maps-api",
+ "published_at": "2020-08-18T16:05:37Z",
+ "updated_at": "2020-08-15T08:45:07Z",
+ "category_0": "Browser monitoring",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.09365238,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Upload source maps via API",
+ "sections": "Page load timing resources",
+ "info": "For Browser, how to upload and use source maps with the Browser API.",
+ "body": ": 'SOURCE_MAP _ID', applicationId: YOUR_NEW_RELIC_APP _ID, nrAdminKey: 'YOUR_NEW_RELIC_ADMIN_API_KEY', }, function (err) { console.log(err || 'Deleted source map ')}) When you're done, go to the JS errors page in Browser, select an error grouping, and see if your error stack traces have been un-minified. Use API"
+ },
+ "id": "5c6905d607552356e245ca12"
+ },
+ {
+ "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,000 documents, plus storage type. Each document can have a maximum length of 64 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Intro to NerdStorage on New Relic One",
+ "sections": [
+ "Intro to NerdStorage",
+ "Use NerdStorage in your apps",
+ "Data model",
+ "Limits",
+ "Data access",
+ "Permissions for working with NerdStorage"
+ ],
+ "title": "Intro to NerdStorage",
+ "popularity": 1,
+ "external_id": "709e06c25376d98b2191ca369b4d139e5084bd62",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nerdstorage/",
+ "published_at": "2020-08-18T02:11:48Z",
+ "updated_at": "2020-08-14T01:50:34Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.07781543,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Use NerdStorage in your apps ",
+ "body": " as a nested key-value map . Data is inside documents, which are nested inside collections: { 'YourNerdpack Uuid': { 'collection-1': { 'document-1-of-collection-1': '{"lastNumber": 42, "another": [1]}', 'document-2-of-collection-1': '"userToken"', // ... }, 'another-collection': { 'fruits': '["pear", "apple"
+ },
+ "id": "5efa989ee7b9d2048e7bab92"
+ }
+ ],
+ "/collect-data/custom-attributes": [
+ {
+ "body": "New Relic allows you to collect custom attributes. For example, you can create a custom attribute to track the user name associated with a slow or failing request. This document contains links to docs on how to do this for APM, infrastructure monitoring, browser monitoring, and mobile monitoring. APM: Record custom attributes Review the list of reserved terms used by NRQL. Using reserved terms can cause issues. To enable and use custom attributes for APM, follow the procedure for your APM agent: C SDK To add custom attributes to applications monitored by the C SDK, call one of the attribute functions; for example, newrelic_add_attribute_double(). The key name for your custom attribute depends on what you specify when you call the function. Go Custom attribute collection is enabled by default in the Go agent. However, you can disable custom attribute collection. Java Custom attribute collection is enabled by default in Java. You can collect custom attributes using XML and the Java agent APIs. These two methods can be used in conjunction with each other. Method How to do it Specify attributes in XML XML allows you to specify custom attributes without changing any of your source code. You can have multiple XML files for custom attributes that are grouped by some logical facet. To set custom attributes for your Java app via XML: Review the New Relic Java agent's documentation about XML file format, methods and classes, and examples. From your Extensions directory within the New Relic Java agent, create a single XML file. Define the methods you want New Relic to monitor by editing your XML file directly. Define an XML instrumentation file using the New Relic UI. This may require additional config in the common: block of your newrelic.yml. See Report custom attributes under Instrumentation options for more detail. Call the agent's API Example 1: Adding custom attributes to transactions To collect custom attributes using the agent's API, call the relevant methods: For each method you want to record an attribute for, call NewRelic.addCustomParameter(...). Optional: Include or exclude certain attributes with attributes.include and attributes.exclude. For example, to record a variable named userId, include this code in the parent method: NewRelic.addCustomParameter(\"userId\", userId); Example 2: Adding custom attributes to spans in distributed traces To collect custom attributes using the agent's API, call the relevant methods: For each span (currently executing method) that you want to record an attribute for, call NewRelic.getAgent().getTracedMethod().addCustomAttribute(...). Optional: Include or exclude certain attributes with span_events.attributes.include and span_events.attributes.exclude. For example, to record a variable named userId on the current span, include this code in the associated method: NewRelic.getAgent().getTracedMethod().addCustomAttribute(\"userId\", userId); Collect user attributes The Java agent also includes a built-in mechanism to enable user attributes and collect user information from HttpServletRequest.getUserPrincipal() as custom attributes. .NET Custom attribute collection is enabled by default in .NET. To collect custom attributes, call the relevant API methods: For each method for which you want to record an attribute, call AddCustomAttribute. Optional: Include or exclude attributes with the include and exclude configuration options. For example, to record attributes for a coupon code (string) and an item ID code (number), you could include this code in the parent method: IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); ITransaction transaction = agent.CurrentTransaction; transaction .AddCustomAttribute(\"Discount Code\", \"Summer Super Sale\") .AddCustomAttribute(\"Item Code\", 31456); Node.js Custom attribute collection is enabled by default in Node.js. To collect custom attributes, call the relevant API method: For each attribute you want to record, call newrelic.addCustomAttribute. To record multiple attributes using a single call, use newrelic.addCustomAttributes. For example, to record attributes for a coupon code and an item ID code, you could include this in the parent method: newrelic.addCustomAttributes({ \"Discount Code\": \"Summer Super Sale\", \"Item Code\": 31456 }); PHP Custom attribute collection is enabled by default in PHP. To collect custom attributes, call the relevant API method for each method that you want to record an attribute; newrelic_add_custom_parameter for transaction events and spans newrelic_add_custom_span_parameter for only spans For example, to record a variable named $userId, include this code in the parent method: newrelic_add_custom_parameter ('userID', $userId) Python Custom attribute collection is enabled by default in Python. To collect custom attributes, call add_custom_parameter for each method that you want to record an attribute. For example, to record a variable named user_id, include this code in the parent method: newrelic.agent.add_custom_parameter('user_id', user_id) Ruby Custom attribute collection is enabled by default in Ruby. To collect custom attributes, call the relevant API methods: For Ruby agent version 3.12.0 or higher, use the add_custom_attributes method. For example, to record a variable named @user_id, include this code in the parent method: ::NewRelic::Agent.add_custom_attributes({ user_id: @user.id }) For Ruby agent version 3.11.2 or lower, use the add_custom_parameters method. For example, to record a variable named @user_id, include this code in the parent method: ::NewRelic::Agent.add_custom_parameters({ user_id: @user.id }) Browser monitoring: Record custom attributes The browser agent provides an API to specify extra details associated with a page view or browser interaction, either by forwarding attributes from APM to browser monitoring or by specifying custom attributes through JavaScript. Values forwarded from the APM agent are encoded and injected into browser attributes by our browser agent. Infrastructure monitoring: Record custom attributes Our Infrastructure monitoring lets you create custom attributes that are used to annotate the data from the infrastructure agent. You can use this metadata to build filter sets, group your results, and annotate your data. Mobile monitoring: Record custom attributes Mobile agents include API calls to record custom attributes: For an overview of mobile monitoring custom data, see Insert custom events and attributes Android method: setAttribute iOS method: setAttribute For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Using New Relic / Cross-product functions / Install and configure",
+ "info": "How to add custom attributes to data reported from some New Relic products. ",
+ "nodeid": 2726,
+ "sections": [
+ "Cross-product functions",
+ "Install and configure",
+ "Troubleshooting",
+ "Collect custom attributes",
+ "APM: Record custom attributes",
+ "Browser monitoring: Record custom attributes",
+ "Infrastructure monitoring: Record custom attributes",
+ "Mobile monitoring: Record custom attributes",
+ "For more help"
+ ],
+ "title": "Collect custom attributes",
+ "popularity": 1,
+ "external_id": "5a43638e8ef969ce9f0b16fedf433317e67bb4a6",
+ "category_1": "Cross-product functions",
+ "category_2": "Install and configure",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/using-new-relic/data/customize-data/collect-custom-attributes",
+ "published_at": "2020-08-18T14:20:45Z",
+ "updated_at": "2020-08-11T00:28:22Z",
+ "category_0": "Using New Relic",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.73719656,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Collect custom attributes ",
+ "sections": "Collect custom attributes ",
+ "info": "How to add custom attributes to data reported from some New Relic products. ",
+ "body": ". APM: Record custom attributes Review the list of reserved terms used by NRQL . Using reserved terms can cause issues. To enable and use custom attributes for APM, follow the procedure for your APM agent: C SDK To add custom attributes to applications monitored by the C SDK, call one of the attribute"
+ },
+ "id": "5e9a9d9728ccbc90cdd949ca"
+ },
+ {
+ "body": "In New Relic, attributes are key-value pairs containing information that determines the properties of an event or transaction. These key-value pairs can help you gain greater insight into your application and query your data. View and use attributes Both default APM attributes and custom attributes for your C application appear in: APM transaction traces and error analytics APM events C-specific attributes Before creating custom attributes, review New Relic's list of reserved terms used by NRQL. Otherwise unexpected results may occur. To add custom attributes to your C application, call one of the attribute functions in the C SDK API; for example, newrelic_add_attribute_double(). The key name for your custom attribute depends on what you specify when you call the function. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / APM agents / C SDK / Instrumentation",
+ "info": "You can create custom attributes for your C app to supplement the New Relic event data that automatically includes default APM attributes.",
+ "nodeid": 15891,
+ "sections": [
+ "C SDK",
+ "Get started",
+ "Install and configure",
+ "Instrumentation",
+ "Troubleshooting",
+ "Use default or custom attributes (C SDK)",
+ "View and use attributes",
+ "C-specific attributes",
+ "For more help"
+ ],
+ "title": "Use default or custom attributes (C SDK)",
+ "popularity": 1,
+ "external_id": "45876c14a1d258566a824f7c49a50bb8c8fb709d",
+ "category_1": "C SDK",
+ "category_2": "Instrumentation",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/agents/c-sdk/instrumentation/use-default-or-custom-attributes-c-sdk",
+ "published_at": "2020-08-18T08:14:25Z",
+ "updated_at": "2020-08-15T02:11:23Z",
+ "category_0": "APM agents",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.6753373,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Use default or custom attributes (C SDK)",
+ "sections": "Use default or custom attributes (C SDK)",
+ "info": "You can create custom attributes for your C app to supplement the New Relic event data that automatically includes default APM attributes .",
+ "body": " for your C application appear in: APM transaction traces and error analytics APM events C-specific attributes Before creating custom attributes , review New Relic's list of reserved terms used by NRQL . Otherwise unexpected results may occur. To add custom attributes to your C application, call one"
+ },
+ "id": "5cd8abf7e621f45d85a089a9"
+ },
+ {
+ "body": "When adding custom attribute values to transactions, custom events, spans, and errors, the APIs accept an object. This describes how these values are processed and how they will appear in APM. In all cases, NULL values are not recorded. .NET type How the value will be represented byte, Int16, Int32, Int64 sbyte, UInt16, UInt32, UInt64 As an integral value float, double, decimal A decimal-based number string A string truncated after 255-bytes. Empty strings are supported. bool True or false DateTime A string representation following the ISO-8601 format, including time zone information: 2020-02-13T11:31:19.5767650-08:00 TimeSpan A decimal-based number representing number of seconds. everything else the ToString() method will be applied. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / APM agents / .NET agent / Attributes",
+ "info": "APM's .NET agent: how custom attribute values are processed and how they will appear in APM.",
+ "nodeid": 37891,
+ "sections": [
+ ".NET agent",
+ "Getting started",
+ "Install",
+ "Azure installation",
+ "Other installation",
+ "Configuration",
+ "Other features",
+ "Custom instrumentation",
+ "API guides",
+ ".NET agent API",
+ "Attributes",
+ "Troubleshooting",
+ "Azure troubleshooting",
+ "Custom attributes (.NET)",
+ "For more help"
+ ],
+ "title": "Custom attributes (.NET)",
+ "popularity": 1,
+ "external_id": "c3b5f5db21c8e5f07ee67eb3b58ab5028e242a9a",
+ "category_1": ".NET agent",
+ "category_2": "Attributes",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/agents/net-agent/attributes/custom-attributes-net",
+ "published_at": "2020-08-18T18:23:33Z",
+ "updated_at": "2020-08-18T18:23:32Z",
+ "category_0": "APM agents",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.529183,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Custom attributes (.NET)",
+ "sections": "Custom attributes (.NET)",
+ "info": "APM's .NET agent: how custom attribute values are processed and how they will appear in APM.",
+ "category_2": "Attributes ",
+ "body": "When adding custom attribute values to transactions, custom events, spans, and errors, the APIs accept an object. This describes how these values are processed and how they will appear in APM. In all cases, NULL values are not recorded. .NET type How the value will be represented byte, Int16, Int32",
+ "breadcrumb": "Contents / APM agents / .NET agent / Attributes "
+ },
+ "id": "5e7d76e628ccbcb3d13419d6"
+ },
+ {
+ "body": "Collect data Through our opensource agents or APIs, New Relic makes it easy to collect data from any source. The guides in this section provide strategies for collecting and querying data for use in your existing implementation, or in apps you build. The opportunities are endless. Guides to collect data Add custom attributes Use custom attributes for deeper analysis 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 10 min Query data with NRQL Query default event data, custom events, and attributes 15 min Collect data - any source APIs, agents, OS emitters - get any data",
+ "type": "developer",
+ "document_type": "page",
+ "info": "",
+ "sections": [
+ "Collect data",
+ "Guides to collect data",
+ "Add custom attributes",
+ "Create custom events",
+ "Build queries with NerdGraph",
+ "Query data with NRQL",
+ "Collect data - any source"
+ ],
+ "title": "Collect data",
+ "popularity": 1,
+ "external_id": "fb5d6f75b61858b09e3e8c63f3b2af97813f47b6",
+ "image": "",
+ "url": "https://developer.newrelic.com/collect-data/",
+ "published_at": "2020-08-18T02:08:12Z",
+ "updated_at": "2020-08-18T01:45:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.46906766,
+ "_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 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 10 min Query data with NRQL Query default event data, custom events, and attributes 15 min Collect data - any source APIs, agents, OS emitters - get any data"
+ },
+ "id": "5efa997328ccbc768c307de2"
+ },
+ {
+ "body": "newrelic.agent.add_custom_parameters(items) Adds one or more custom attributes to a transaction. Description This call records one or more custom attributes (a key/value tuple attached to your transaction). The call name is add_custom_parameters because \"custom attributes\" were previously called \"custom parameters\". Attributes may be found in New Relic APM if the transaction is associated with an error or if a transaction trace is generated for that transaction. Attributes can also be found and queried in Insights or New Relic One. Before you create custom attributes, review New Relic's list of reserved terms used by NRQL and Insights. Parameters Parameter Description items list Required. Each item in the list must be a tuple, with the first element being a key, and the second its value. Each key is a string representing the name of an attribute, and each corresponding value is the value to add to the current transaction for this attribute. Values can be int, float, string, or boolean. Only the first 255 characters are retained for both keys and values. Return value(s) Returns True if all attributes were added successfully. Example(s) Adding custom parameters to background task An example of adding custom parameters to a background task: @newrelic.agent.background_task() def send_request(): response = requests.get(\"http://example.com\") newrelic.agent.add_custom_parameters( [(\"url_path_status_code\", response.status_code)] ) Using custom parameters to troubleshoot You can also use custom parameters to troubleshoot performance issues. For example, you might see occasional slow response times from a pool of memcache instances, but you don't know what instance is causing the problem. You might add an attribute to the transaction indicating the server, like so: # Set server_ip to be the current server processing the transaction newrelic.agent.add_custom_parameters([ (\"memcache_query_frontend_lookup\", \"server_ip\") ])",
+ "type": "docs",
+ "document_type": "api_doc",
+ "breadcrumb": "Contents » APM agents / Python agent / Python agent API",
+ "info": "New Relic Python API: This call adds a custom attribute (key/value tuple) to a transaction.",
+ "nodeid": 27406,
+ "sections": [
+ "Python agent",
+ "Getting started",
+ "Installation",
+ "Configuration",
+ "Supported features",
+ "Back-end services",
+ "Custom instrumentation",
+ "API guides",
+ "Python agent API",
+ "Web frameworks and servers",
+ "Hosting services",
+ "Attributes",
+ "Troubleshooting",
+ "add_custom_parameters",
+ "Description",
+ "Parameters",
+ "Return value(s)",
+ "Example(s)",
+ "Adding custom parameters to background task",
+ "Using custom parameters to troubleshoot",
+ "For more help"
+ ],
+ "title": "add_custom_parameters (Python agent API)",
+ "popularity": 1,
+ "external_id": "4a0759cb3bd46dfabe6d34a678cc7c644ff79773",
+ "category_1": "Python agent",
+ "category_2": "Python agent API",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/agents/python-agent/python-agent-api/addcustomparameters-python-agent-api",
+ "published_at": "2020-08-18T12:18:44Z",
+ "updated_at": "2020-08-15T10:25:58Z",
+ "category_0": "APM agents",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.379156,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Attributes ",
+ "info": "New Relic Python API: This call adds a custom attribute (key/value tuple) to a transaction.",
+ "body": "newrelic.agent.add_custom _parameters(items) Adds one or more custom attributes to a transaction. Description This call records one or more custom attributes (a key/value tuple attached to your transaction). The call name is add_custom _parameters because "custom attributes " were previously called"
+ },
+ "id": "5c4055440cc37f4ab32ef6be"
+ }
+ ],
+ "/automate-workflows/get-started-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 in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
+ "type": "developer",
+ "document_type": "page",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "sections": [
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
+ ],
+ "title": "New Relic CLI Reference",
+ "popularity": 1,
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-08-18T02:11:50Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 9.215137,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic CLI Reference",
+ "sections": "New Relic CLI Reference",
+ "info": "The command line tools for performing tasks against New Relic APIs ",
+ "tags": "new relic cli ",
+ "body": " the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql"
+ },
+ "id": "5efa989ee7b9d2024b7bab97"
+ },
+ {
+ "body": "Quickly tag a set of resources 5 min Tags help you group, search, filter, and focus the data about your entities, which can be anything from applications to hosts to services. Tagging entities using the New Relic CLI is a good candidate for automation. In this 5-minute guide, you use the New Relic CLI to add multiple tags to one of your entities. Before you begin For this guide you need your New Relic personal API Key: Create it at the Account settings screen for your account. Step 1 of 6 Install the New Relic CLI You can download the New Relic CLI via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 6 Create your New Relic CLI profile New Relic CLI profiles contain credentials and settings that you can apply to any CLI command. To create your first CLI profile, run the profiles add command. Don't forget to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey API_KEY -r us # Set the profile as default newrelic profiles default -n tutorial Copy Step 3 of 6 Search for an entity Your New Relic account might have hundreds of entities: Have a quick look by opening the Entity explorer. In the terminal, run entity search to retrieve a list of entities from your account as JSON. In the example, you're searching for all entities with \"test\" in their name. # Change the `name` to match any of your existing entities newrelic entity search --name \"test\" Copy Step 4 of 6 If there are matching entities in your account, the query yields data in JSON format, similar to this workload example. Select an entity from the results and look for its guid value; the guid is the unique identifier of the entity. Write it down. { \"accountId\": 123456789, \"domain\": \"NR1\", \"entityType\": \"WORKLOAD_ENTITY\", \"guid\": \"F7B7AE59FDED4204B846FB08423DB18E\", \"name\": \"Test workload\", \"reporting\": true, \"type\": \"WORKLOAD\" }, Copy Step 5 of 6 Add tags and tag lists to your entity With your entity guid, you can add tags right away. You can do so by invoking the entities tags create command. What if you want to add multiple tags? You can use tag sets for that: While tags are key-value pairs separated by colons, tag sets are comma-separated lists of tags. For example: tag1:value1,tag2:value2 Note Adding tags is an asynchronous operation: it could take a little while for the tags to get created. # Adding a single tag newrelic entity tags create --guid GUID --tag key:value # Adding multiple tags newrelic entity tags create --guid GUID --tag tag1:test,tag2:test Copy Step 6 of 6 Check that the tags are there To make sure that the tags have been added to your entities, retrieve them using the entity tags get command. All tags associated with your entity are retrieved as a JSON array. newrelic entity tags get --guid GUID Tip Tags can be deleted at any time by invoking the entity tags delete command followed by the same arguments you used to create them. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Next steps Have a look at all the New Relic CLI commands. For example, you could create a New Relic workflow using workload create. If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Add tags to applications you instrument for easier filtering and organization.",
+ "sections": [
+ "Quickly tag a set of resources",
+ "Before you begin",
+ "Install the New Relic CLI",
+ "Linux",
+ "macOS",
+ "Windows",
+ "Create your New Relic CLI profile",
+ "Search for an entity",
+ "Add tags and tag lists to your entity",
+ "Note",
+ "Check that the tags are there",
+ "Tip",
+ "Next steps"
+ ],
+ "title": "Quickly tag a set of resources",
+ "popularity": 1,
+ "external_id": "c7c374812f8295e409a9b06d552de51ceefc666b",
+ "image": "",
+ "url": "https://developer.newrelic.com/automate-workflows/5-mins-tag-resources/",
+ "published_at": "2020-08-18T02:08:12Z",
+ "updated_at": "2020-08-14T01:45:08Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.42740965,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Quickly tag a set of resources",
+ "sections": "Install the New Relic CLI ",
+ "info": "Add tags to applications you instrument for easier filtering and organization.",
+ "body": " by invoking the entity tags delete command followed by the same arguments you used to create them. [ { Key : 'tag 1', Values: ['true'], }, { Key : 'tag 2', Values: ['test'], }, { Key : 'tag 3', Values: ['testing'], }, // ... ]; Copy Next steps Have a look at all the New Relic CLI commands. For example"
+ },
+ "id": "5efa999d64441fa74a5f7e2d"
+ },
+ {
+ "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform",
+ "type": "developer",
+ "document_type": "page",
+ "info": "",
+ "sections": [
+ "Automate workflows",
+ "Guides to automate workflows",
+ "Quickly tag resources",
+ "Automate common tasks",
+ "Set up New Relic using the Kubernetes operator",
+ "Set up New Relic using Terraform"
+ ],
+ "title": "Automate workflows",
+ "popularity": 1,
+ "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871",
+ "image": "",
+ "url": "https://developer.newrelic.com/automate-workflows/",
+ "published_at": "2020-08-18T02:04:53Z",
+ "updated_at": "2020-08-17T01:55:15Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.3421702,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Set up New Relic using the Kubernetes operator",
+ "body": " solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform"
+ },
+ "id": "5efa999c196a67dfb4766445"
+ },
+ {
+ "body": "Contain the complexity - Observability made simple New Relic’s Kubernetes cluster explorer empowers Kubernetes nerds to move beyond infrastructure metrics and investigate deeper into applications, traces, logs, and events—with a single click—while staying grounded in a centralized UI. Join us at KubeCon and CloudNativeCon Europe August 17-20 to learn more. Check out the complete schedule of New Relic talks to make the most of your KubeCon experience. Learn more. Get coding Create a free account 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events Start the guide 7 min Add tags to apps Add tags to applications you instrument for easier filtering and organization Start the guide 12 min Build a Hello, World! app Build a Hello, World! app and publish it to your local New Relic One Catalog Start the guide Get inspired 30 min Add a table to your app Add a table to your New Relic One app 15 min Collect data - any source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add a time picker to your app Add a time picker to a sample application Add custom attributes Use custom attributes for deeper analysis Show 18 more guides Looking for more inspiration? Check out the open source projects built by the New Relic community. New Relic developer champions New Relic Champions are solving big problems using New Relic as their linchpin and are recognized as experts and leaders in the New Relic technical community. Nominate a developer champion Learn more about developer champions New Relic Podcasts We like to talk, especially to developers about developer things. Join us for conversations on open source, observability, software design and industry news. Listen",
+ "type": "developer",
+ "document_type": "page",
+ "info": "",
+ "sections": [
+ "Contain the complexity - Observability made simple",
+ "Get coding",
+ "Create custom events",
+ "Add tags to apps",
+ "Build a Hello, World! app",
+ "Get inspired",
+ "Add a table to your app",
+ "Collect data - any source",
+ "Automate common tasks",
+ "Create a custom map view",
+ "Add a time picker to your app",
+ "Add custom attributes",
+ "New Relic developer champions",
+ "New Relic Podcasts"
+ ],
+ "title": "New Relic Developers",
+ "popularity": 1,
+ "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab",
+ "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png",
+ "url": "https://developer.newrelic.com/",
+ "published_at": "2020-08-18T02:03:42Z",
+ "updated_at": "2020-08-15T01:36:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.2277025,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic Developers",
+ "sections": "New Relic developer champions",
+ "body": " to your app Add a table to your New Relic One app 15 min Collect data - any source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add"
+ },
+ "id": "5d6fe49a64441f8d6100a50f"
+ },
+ {
+ "body": "Explore NerdGraph using the API Explorer 25 min NerdGraph is New Relic's GraphQL API. It allows you to get all the information you need in a single request. With NerdGraph API Explorer you don't need to know the query format: using the Query Builder you can browse our entire graph and compose queries just by selecting the items you want and filling out their required values. Before you begin Go to api.newrelic.com/graphiql and log in using your New Relic user ID and password: the NerdGraph API Explorer loads up. Make sure you have a valid New Relic API key. You can create one directly from the NerdGraph API Explorer. Step 1 of 5 Build a query to retrieve your name Time for your first NerdGraph query. Search for your name in the New Relic database: Erase everything in the query editor. Select the following fields in the query explorer in this order: actor, user, name. This GraphQL snippet appears in the editor. { actor { user { name } } } Copy Step 2 of 5 Click the play button to see the result With this query, you're telling NerdGraph to retrieve your name. You're asking for the name field, which is nested within the user field. This refers to the user who owns the API key, which in turn is nested within actor. Click the play button to see the result: It has almost the same shape as the request. All the fields in the Query Builder make up what's called the GraphQL schema, which describes all the available data types and their attributes. To learn more about each field, click the Docs button, or hover over a field in the editor. Step 3 of 5 Add more fields to your query Now you can try adding more fields to your query. The simplest way is clicking the fields in the Query Builder: The API Explorer knows where the attributes should go in the query. In the example, you add the account id and email fields. Once again, running the GraphQL query results in just the data you need, without over or under-fetching data. Notice that the id field has an argument: passing arguments is a powerful way of customizing your NerdGraph queries. Every field and object can contain arguments, so instead of running multiple queries, you just compose the one that you need. { actor { user { name email } account(id: 12345678) } } Copy Step 4 of 5 Experiment with mutations In GraphQL, mutations are a way to execute queries with side effects that can alter the data by creating, updating, or deleting objects (Commonly referred to as CRUD operations in REST APIs). Ready for your first mutation? Erase what's in the editor. Scroll down the Query Builder and expand mutation. Select the fields in the following screenshot: In this case, you're trying to add a custom tag to an entity. Notice that the editor complains if you don't select errors: mutations must have a way of telling you how the operation performed in the backend (failed requests result in null responses). Tip Unlike REST, GraphQL APIs like NerdGraph can return partial responses. For example, if you try adding tags to multiple entities, some mutations can fail and others succeed; all is logged in the GraphQL response you get. Step 5 of 5 Try your NerdGraph query in the terminal Let's say that you've built a NerdGraph query you're happy with and you want to test it elsewhere. To capture code-ready queries and mutations: Select the Tools menu. Copy the query as a curl call or as a New Relic CLI command. # cURL version curl https://api.newrelic.com/graphql \\ -H 'Content-Type: application/json' \\ -H 'API-Key: API_KEY_REDACTED' \\ --data-binary '{\"query\":\"{\\n actor {\\n user {\\n name\\n email\\n }\\n account(id: 12345678)\\n }\\n}\\n\", \"variables\":\"\"}' # New Relic CLI version newrelic nerdgraph query '{ actor { user { name email } account(id: 12345678) } } ' Copy Next steps Now you know the basics of composing and testing NerdGraph queries, but how do you turn them into client or server code? Solutions such as GraphQL Code Generator can help you turn the NerdGraph queries into code for your implementation. Try creating more complex queries by clicking fields and expanding objects in the Query Builder (be careful with mutations though, since they could write data to your account). For more information on NerdGraph and explore other projects from the developer community, check out the threads on the Explorer’s Hub.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Learn to explore NerdGraph, our GraphQL API, and build the queries you need.",
+ "sections": [
+ "Explore NerdGraph using the API Explorer",
+ "Before you begin",
+ "Build a query to retrieve your name",
+ "Click the play button to see the result",
+ "Add more fields to your query",
+ "Experiment with mutations",
+ "Tip",
+ "Try your NerdGraph query in the terminal",
+ "Next steps"
+ ],
+ "title": "Explore NerdGraph using the API Explorer",
+ "popularity": 1,
+ "external_id": "df1f04edc2336c69769d946edbaf263a5339bc92",
+ "image": "https://developer.newrelic.com/static/0ce8c387a290d7fbd6be155322be9bce/bc8d6/create-account.png",
+ "url": "https://developer.newrelic.com/collect-data/get-started-nerdgraph-api-explorer/",
+ "published_at": "2020-08-18T02:08:12Z",
+ "updated_at": "2020-08-14T01:45:09Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.19488293,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Explore NerdGraph using the API Explorer",
+ "sections": "Explore NerdGraph using the API Explorer",
+ "info": "Learn to explore NerdGraph, our GraphQL API , and build the queries you need.",
+ "body": " and mutations: Select the Tools menu. Copy the query as a curl call or as a New Relic CLI command. # cURL version curl https://api .newrelic.com/graphql \\ -H 'Content-Type: application/json' \\ -H 'API -Key : API_KEY _REDACTED' \\ --data-binary '{"query":"{\\n actor {\\n user {\\n name\\n email\\n }\\n account(id"
+ },
+ "id": "5efa9973196a6791f4766402"
+ }
+ ],
+ "/explore-docs/newrelic-cli": [
+ {
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "Tip",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "popularity": 1,
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-18T01:50:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.6042674,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI reference",
+ "sections": "New Relic One CLI reference",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "tags": "New Relic One app",
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI . The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of common commands you can use with the New Relic One CLI.",
+ "sections": [
+ "New Relic One CLI common commands",
+ "Command details",
+ "nr1 help",
+ "See commands and get details",
+ "Usage",
+ "Arguments",
+ "Examples",
+ "nr1 update",
+ "Update your CLI",
+ "nr1 create",
+ "Create a new component",
+ "Options",
+ "nr1 profiles",
+ "Manage your profiles keychain",
+ "Commands",
+ "nr1 autocomplete",
+ "See autocomplete installation instructions",
+ "nr1 nrql",
+ "Query using NRQL"
+ ],
+ "title": "New Relic One CLI common commands",
+ "popularity": 1,
+ "external_id": "503e515e1095418f8d19329517344ab209d143a4",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-common/",
+ "published_at": "2020-08-18T02:06:04Z",
+ "updated_at": "2020-08-14T01:48:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.36333603,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI common commands",
+ "sections": "New Relic One CLI common commands",
+ "info": "An overview of common commands you can use with the New Relic One CLI .",
+ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI . You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1"
+ },
+ "id": "5f28bd6ae7b9d267996ade94"
+ },
+ {
+ "body": "New Relic One CLI catalog commands To manage your catalog, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder. Command details nr1 catalog:info Get catalog details Shows the information about your application that's displayed in the catalog. If run within a specific Nerdpack folder, the info from that Nerdpack will be shown. If you don't want to get info from your local Nerdpack, use the --nerdpack-id=NERDPACK_ID option to query from a specific Nerdpack. Usage $ nr1 catalog:info Options -f, --field=FIELD Specifies which field you want info from. -i, --nerdpack-id=NERDPACK_ID Specifies which Nerdpack to get info from. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 catalog:submit Send info to the catalog Gathers the information you add to the catalog directory for your application and saves it to the catalog. See our catalog docs for details on adding screenshots and metadata to your applications to make them easy to find, attractive, and informative. This command must be run on a Nerdpack folder. The command will search for specific files using convention names. Usage $ nr1 catalog:submit Options -P, --skip-screenshots Skips upload of screenshot assets. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI commands you can use to manage your New Relic One catalog information.",
+ "sections": [
+ "New Relic One CLI catalog commands",
+ "Command details",
+ "nr1 catalog:info",
+ "Get catalog details",
+ "Usage",
+ "Options",
+ "nr1 catalog:submit",
+ "Send info to the catalog"
+ ],
+ "title": "New Relic One CLI catalog commands",
+ "popularity": 1,
+ "external_id": "e94d6ad2cd04e2c01aecef526778d341867b3031",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-catalog/",
+ "published_at": "2020-08-18T02:06:04Z",
+ "updated_at": "2020-08-14T01:49:24Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.3152471,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI catalog commands",
+ "sections": "New Relic One CLI catalog commands",
+ "info": "An overview of the CLI commands you can use to manage your New Relic One catalog information.",
+ "body": "New Relic One CLI catalog commands To manage your catalog, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits"
+ },
+ "id": "5f28bd6a64441f805eb11a26"
+ },
+ {
+ "body": "New Relic One CLI plugin commands To install and manage your plugins, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Command details nr1 plugins:install Install a plugin Installs a plugin into the CLI. You can install plugins from npm or a Git URL. Please note that installing a plugin will override the core plugin. For example, if you have a core plugin that has a 'hello' command, then installing a plugin with a 'hello' command will override the core plugin implementation. This is useful if you want to update the core plugin functionality without patching and updating the whole CLI. Usage $ nr1 plugins:install PLUGIN Arguments PLUGIN: the name, path, or URL of the plugin you want to install. required Options -f, --force Runs yarn install --force. This forces a re-download of all the plugin's packages. -h, --help Shows CLI help. --verbose Adds extra information to the output. Examples $ nr1 plugins:install myplugin $ nr1 plugins:install https://github.com/someuser/someplugin $ nr1 plugins:install someuser/someplugin Aliases $ nr1 plugins:add nr1 plugins:link Link your plugin Links a local plugin into the CLI for development. Please note that linking a plugin will override your user-installed plugin or core plugin. For example, if you have a user-installed or core plugin that has a 'hello' command, linking a plugin with a 'hello' command will override the user-installed or core plugin implementation. This is useful for development work. Usage $ nr1 plugins:link PLUGIN Arguments PLUGIN: the name, path, or URL of the plugin you want to link. required Options -h, --help Shows CLI help. --verbose Adds extra information to the output. Examples $ nr1 plugins:link myplugin $ nr1 plugins:link someuser/someplugin nr1 plugins:update Update your plugins Updates all of your installed plugins. Usage $ nr1 plugins:update Options -h, --help Shows CLI help. --verbose Adds extra information to the output. nr1 plugins:uninstall Uninstall your plugin Removes a plugin from the CLI. Usage $ nr1 plugins:uninstall PLUGIN Arguments PLUGIN: the name of the plugin you want to uninstall. required Options -h, --help Shows CLI help. --verbose Adds extra information to the output. Aliases $ nr1 plugins:unlink $ nr1 plugins:remove",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI commands you can use to install and manage your plugins.",
+ "sections": [
+ "New Relic One CLI plugin commands",
+ "Command details",
+ "nr1 plugins:install",
+ "Install a plugin",
+ "Usage",
+ "Arguments",
+ "Options",
+ "Examples",
+ "Aliases",
+ "nr1 plugins:link",
+ "Link your plugin",
+ "nr1 plugins:update",
+ "Update your plugins",
+ "nr1 plugins:uninstall",
+ "Uninstall your plugin"
+ ],
+ "title": "New Relic One CLI plugin commands",
+ "popularity": 1,
+ "external_id": "6e94c2de165c2b01c2b15c9297a7314f1895112e",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-plugins/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-14T01:50:34Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.29591545,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI plugin commands",
+ "sections": "New Relic One CLI plugin commands",
+ "info": "An overview of the CLI commands you can use to install and manage your plugins.",
+ "body": "New Relic One CLI plugin commands To install and manage your plugins, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 plugins:install Installs a plugin into the CLI . nr1 plugins:link Links a plugin"
+ },
+ "id": "5f28bd6a196a670ddd19d000"
+ },
+ {
+ "body": "New Relic One CLI config commands To configure your New Relic One CLI preferences, use the commands below. You can click any command to see its usage options and additional details about the command. Run nr1 config:list to see all your existing configurations and their keys. Command Description nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Command details nr1 config:set Set a configuration Sets a specific configuration value given a configuration key. By default, the command will prompt you for a new value after providing a key, but you can also use the --k, --key=KEY option to skip this step. Usage $ nr1 config:set OPTION Options -k, --key=KEY The key of the config. (required) -V, --value=VALUE The value of the config. --profile=PROFILE The authentication profile you want to use. -t, --this-profile-only If present, this configuration will only apply while running with the specified profile. --verbose Adds extra information to the output. Examples $ nr1 config:set --key=proxyEnabled $ nr1 config:set --key=proxyEnabled --value=ENABLED nr1 config:get See your configuration Shows the value for a specific configuration. Usage $ nr1 config:get OPTION Options -k, --key=KEY The key of the config. (required) --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 config:list See all your configurations Shows a list of all your configuration choices, including the configuration key, value, and origin. Usage $ nr1 config:list Options --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. Aliases $ nr1 config:ls nr1 config:delete Remove a configuration Removes the value of a specific configuration. Usage $ nr1 config:delete OPTION Options -k, --key=KEY The key of the config. (required) --profile=PROFILE The authentication profile you want to use. -t, --this-profile-only If present, this configuration will only apply while running with the specified profile. --verbose Adds extra information to the output. Aliases nr1 config:remove nr1 config:rm Examples: $ nr1 config:delete --key=proxyHttp",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the commands you can use to configure your New Relic One CLI preferences.",
+ "sections": [
+ "New Relic One CLI config commands",
+ "Command details",
+ "nr1 config:set",
+ "Set a configuration",
+ "Usage",
+ "Options",
+ "Examples",
+ "nr1 config:get",
+ "See your configuration",
+ "nr1 config:list",
+ "See all your configurations",
+ "Aliases",
+ "nr1 config:delete",
+ "Remove a configuration",
+ "Examples:"
+ ],
+ "title": "New Relic One CLI config commands",
+ "popularity": 1,
+ "external_id": "a6e1583bae1b92f3fcee75cd8a5196d13f28f08d",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-config/",
+ "published_at": "2020-08-18T02:11:49Z",
+ "updated_at": "2020-08-04T01:44:08Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.24779199,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI config commands",
+ "sections": "New Relic One CLI config commands",
+ "info": "An overview of the commands you can use to configure your New Relic One CLI preferences.",
+ "body": "New Relic One CLI config commands To configure your New Relic One CLI preferences, use the commands below. You can click any command to see its usage options and additional details about the command. Run nr1 config:list to see all your existing configurations and their keys. Command Description nr1"
+ },
+ "id": "5f28bd6828ccbca2072376f4"
+ }
+ ],
+ "/build-apps/howto-use-nrone-table-components": [
+ {
+ "body": "TableHeaderCell Usage Copy Props There are no props for this component.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "A TableHeaderCell component!",
+ "sections": [
+ "TableHeaderCell",
+ "Usage",
+ "Props"
+ ],
+ "title": "TableHeaderCell",
+ "popularity": 1,
+ "external_id": "2a4be1419d1a6e501a8eed915b8acf7c9798259d",
+ "image": "",
+ "url": "https://developer.newrelic.com/components/table-header-cell/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-03T04:46:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 3.722324,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "TableHeaderCell ",
+ "sections": "TableHeaderCell ",
+ "info": "A TableHeaderCell component !",
+ "body": "TableHeaderCell Usage Copy Props There are no props for this component ."
+ },
+ "id": "5efa9906196a67523e76646e"
+ },
+ {
+ "body": "TableRow Usage Copy Props There are no props for this component.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "A TableRow component!",
+ "sections": [
+ "TableRow",
+ "Usage",
+ "Props"
+ ],
+ "title": "TableRow",
+ "popularity": 1,
+ "external_id": "b9ca0d4e07a506dd961eb2194c5344bfa9ab770d",
+ "image": "",
+ "url": "https://developer.newrelic.com/components/table-row/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-03T04:45:42Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 3.6806536,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "TableRow ",
+ "sections": "TableRow ",
+ "info": "A TableRow component !",
+ "body": "TableRow Usage Copy Props There are no props for this component ."
+ },
+ "id": "5efa98d564441f93435f7e24"
+ },
+ {
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "Tip",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "popularity": 1,
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-18T01:50:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 3.2519772,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI reference ",
+ "sections": "Installing the New Relic One CLI",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps .",
+ "tags": "New Relic One app ",
+ "body": ". For more on how to serve and publish your application, see our guide on Deploying your New Relic One app . Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "Table Usage Copy Props There are no props for this component.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "A Table component!",
+ "sections": [
+ "Table",
+ "Usage",
+ "Props"
+ ],
+ "title": "Table",
+ "popularity": 1,
+ "external_id": "878b3ab08dbd0a7df42558a970648013adde957f",
+ "image": "",
+ "url": "https://developer.newrelic.com/components/table/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-03T04:46:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 1.4275227,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Table ",
+ "sections": "Table ",
+ "info": "A Table component !",
+ "body": "Table Usage Copy Props There are no props for this component ."
+ },
+ "id": "5efa98d428ccbcebbd307dfb"
+ },
+ {
+ "body": "UserTableRowCell Usage Copy Props There are no props for this component.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "A UserTableRowCell component!",
+ "sections": [
+ "UserTableRowCell",
+ "Usage",
+ "Props"
+ ],
+ "title": "UserTableRowCell",
+ "popularity": 1,
+ "external_id": "765e8c8ba01ca8ae96c8e45e2223941812e17294",
+ "image": "",
+ "url": "https://developer.newrelic.com/components/user-table-row-cell/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-03T04:46:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 1.3801258,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "info": "A UserTableRowCell component !",
+ "body": "UserTableRowCell Usage Copy Props There are no props for this component ."
+ },
+ "id": "5efa98d464441f3b815f7e72"
+ }
+ ],
+ "/collect-data/get-started-nerdgraph-api-explorer": [
+ {
+ "body": "You can manage your policies, conditions, and muting rules programmatically using our GraphQL NerdGraph API. This is a powerful alternative to managing them in New Relic One or through the REST API. Alerts features you can manage with NerdGraph Here's what you can do in NerdGraph: Manage policies Use NRQL conditions Muting rules: suppress notifications The easiest way to discover alerts queries and mutations is through the NerdGraph API explorer. NerdGraph API explorer Our NerdGraph API explorer is a GraphiQL editor where you can prototype queries and mutations. Here are some examples showing how to find fields for queries and mutations. For general information about NerdGraph, see Introduction to NerdGraph. Queries To explore the various queries, look for the available queries under the actor.account.alerts namespace in NerdGraph API explorer: Mutations To explore various mutations, look in the alerts dropdown in the NerdGraph API explorer: For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph",
+ "info": "Read about how you can manage alerts conditions, policies, and muting rules using NerdGraph.",
+ "nodeid": 37751,
+ "sections": [
+ "New Relic Alerts",
+ "Get started",
+ "Alert policies",
+ "Alert conditions",
+ "Alert violations",
+ "Alert Incidents",
+ "Alert notifications",
+ "Troubleshooting",
+ "Rules, limits, and glossary",
+ "Alerts and Nerdgraph",
+ "REST API alerts",
+ "NerdGraph API: Examples",
+ "Alerts features you can manage with NerdGraph",
+ "NerdGraph API explorer",
+ "Queries",
+ "Mutations",
+ "For more help"
+ ],
+ "title": "NerdGraph API: Examples ",
+ "popularity": 1,
+ "external_id": "017d6c34d340b9bc035e91483d675915fa5252eb",
+ "category_1": "New Relic Alerts",
+ "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/alerts_query_0.png",
+ "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alerts-nerdgraph/nerdgraph-api-examples",
+ "published_at": "2020-08-18T18:16:49Z",
+ "updated_at": "2020-08-11T04:59:00Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.5397293,
+ "_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"
+ },
+ {
+ "body": "You can manage alerts conditions using our GraphQL NerdGraph API. Here are some conditions queries and mutations you can develop in our NerdGraph API explorer. See the NerdGraph introduction for help getting started with NerdGraph API explorer. This document covers the following: Steps to create a NRQL condition NRQL static condition NRQL baseline condition NRQL outlier condition Update a condition Update mutations List and filter NRQL conditions Singular NRQL condition queries Create a description Delete conditions Steps to create a NRQL condition Follow these steps: Decide which condition type you want to create (see NRQL Condition threshold types). Find your relevant policyID by doing one of the following: Use the NerdGraph policies API. Go to one.newrelic.com, in the top nav click Alerts & AI, then click Policies. Choose a policy. Find the ID under the policy name. Provide the appropriate mutation for your NRQL condition type and the relevant values. The NerdGraph GraphiQL explorer is the best place to find up-to-date documentation about the per-field specifics of the NerdGraph NRQL Conditions API. For example, questions like \"What does the valueFunction field accept?\" are best answered with the inline NerdGraph documentation. NRQL static condition Here's an example of creating a static condition: mutation { alertsNrqlConditionStaticCreate(accountId: YOUR_ACCOUNT_ID, policyId: YOUR_POLICY_ID, condition: { name: \"Low Host Count - Catastrophic\" enabled: true nrql: { query: \"SELECT uniqueCount(host) from Transaction where appName='my-app-name'\" evaluationOffset: 3 } terms: { threshold: 2 thresholdOccurrences: AT_LEAST_ONCE thresholdDuration: 600 operator: BELOW priority: CRITICAL } valueFunction: SINGLE_VALUE violationTimeLimit: TWENTY_FOUR_HOURS }) { id name } } NRQL baseline condition Here's an example of creating a baseline condition: mutation { alertsNrqlConditionBaselineCreate(accountId: YOUR_ACCOUNT_ID, policyId: YOUR_POLICY_ID, condition: { name: \"Baseline Condition\" enabled: true baselineDirection: UPPER_ONLY nrql: { query: \"SELECT average(duration) FROM Transaction\" evaluationOffset: 3 } terms: { threshold: 13 thresholdDuration: 180 thresholdOccurrences: ALL operator: ABOVE priority: CRITICAL } violationTimeLimit: TWENTY_FOUR_HOURS }) { id name baselineDirection } } NRQL outlier condition Here's an example of creating an outlier condition: mutation { alertsNrqlConditionOutlierCreate(accountId: YOUR_ACCOUNT_ID, policyId: YOUR_POLICY_ID, condition: { name: \"Outlier Condition\" enabled: true expectedGroups: 4 openViolationOnGroupOverlap: false nrql: { query: \"SELECT average(duration) FROM Transaction FACET httpResponseCode\" evaluationOffset: 3 } terms: { threshold: 1 thresholdDuration: 300 thresholdOccurrences: ALL operator: ABOVE priority: CRITICAL } violationTimeLimit: TWENTY_FOUR_HOURS }) { id name expectedGroups openViolationOnGroupOverlap } } Update a condition Complete the following: Determine the type of your existing condition by requesting the type field in a nrqlConditionsSearch query like this: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch { nrqlConditions { id type } } } } } } The type returned is what you use for your update mutation. For example, if the type returned is STATIC, use alertsNrqlConditionStaticUpdate. If the type returned is BASELINE, use alertsNrqlConditionBaselineUpdate. If the type returned is OUTLIER, use alertsNrqlConditionOutlierUpdate. Provide the id of your condition to your relevant condition type mutation. Note that you can only update conditions of the relevant type. Only provide update mutations for the fields you want to update. Fields you don't provide in the update are not touched. Update mutations Only fields that you provide in the update are changed. In the following example, baselineDirection returns unchanged, but name is updated. mutation { alertsNrqlConditionBaselineUpdate(id: YOUR_CONDITION_ID, accountId: YOUR_ACCOUNT_ID, condition: { name: \"Your updated name\" }) { id name baselineDirection } } List and filter NRQL conditions To list or filter your NRQL conditions, use the nrqlConditionsSearch query in NerdGraph. Use cursor pagination The basic of list functionality for NRQL conditions allows you to paginate through your NRQL conditions as well as request the total count of conditions per account. The nrqlConditionsSearch query utilizes cursor pagination to paginate through resources. The idea behind cursor pagination is that the client will request a cursor in a programmatic loop until the cursor comes back empty. An initial list response will look something like this: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch { nextCursor nrqlConditions { id name type } totalCount } } } } } This example returns a JSON response like this: { \"data\": { \"actor\": { \"account\": { \"alerts\": { \"nrqlConditionsSearch\": { \"nextCursor\": \"WOwfJ4+TWm9QTFeKMGyg+w==:QqkI8S4+Wwnpno6z+uk8kQ==\", \"nrqlConditions\": [ { \"id\": \"4432\", \"name\": \"Baseline Condition\", \"type\": \"BASELINE\" }, { \"id\": \"443\", \"name\": \"A static condition\", \"type\": \"STATIC\" }, // more conditions here in reality ], \"totalCount\": 435 } } } } }, } In order to paginate through conditions in the response, have the client request the cursor to be returned until the nextCursor returns from the response as null: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch(cursor: \"WOwfJ4+TWm9QTFeKMGyg+w==:QqkI8S4+Wwnpno6z+uk8kQ==\", ) { nextCursor nrqlConditions { id name type } totalCount } } } } } Request type-specific fields Certain fields are only available on specific NRQL condition types. The main reason that mutations are split between the different condition types is because they have minor differences between the fields they accept. For example, valueFunction is only relevant for static NRQL conditions and baselineDirection is only relevant on baseline NRQL conditions. But if these fields are only available on these certain condition types, how do we return them in a list of all of our condition types? The answer is a GraphQL convention known as inline fragments. Inline fragments allow you to access the data on a specific type of NRQL condition: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch { nrqlConditions { id name type ...on AlertsNrqlStaticCondition { valueFunction } ...on AlertsNrqlBaselineCondition { baselineDirection } ...on AlertsNrqlOutlierCondition { expectedGroups } } } } } } } In the previous example query, we are asking GraphQL to do the hard work for us to determine which NRQL conditions are the correct type. So, when the returned type is a static condition, it will return the valueFunction in the object. When the returned type is a baseline condition, it will return baselineDirection instead, and when the type is an outlier condition, it will return expectedGroups. Here is an example response: { \"data\": { \"actor\": { \"account\": { \"alerts\": { \"nrqlConditionsSearch\": { \"nrqlConditions\": [ { \"baselineDirection\": \"UPPER_ONLY\", \"id\": \"342\", \"name\": \"My baseline condition\", \"type\": \"BASELINE\" }, { \"id\": \"553\", \"name\": \"My static condition\", \"type\": \"STATIC\", \"valueFunction\": \"SINGLE_VALUE\" }, { \"expectedGroups\": 4, \"id\": \"802\", \"name\": \"My outlier condition\", \"type\": \"OUTLIER\" } ] } } } } } } Filter NRQL conditions You can filter NRQL conditions with the searchCriteria argument of the nrqlConditionsSearch query: Here's an example of filtering NRQL conditions with matching by name. This query returns NRQL conditions that match the provided name. Note that this match is case insensitive. { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditionsSearch(searchCriteria: { name: \"Baseline Condition\" }) { nrqlConditions { id name type } } } } } } Singular NRQL condition queries You can use the NRQL condition API to query for a singular condition. Run the nrqlCondition query in the alerts namespace. Similar to type specific fields on the nrqlConditionSearch query, you can also use these inline fragmentsto request fields that are restricted to a NRQL condition type. { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlCondition(id: YOUR_CONDITION_ID) { id name ...on AlertsNrqlStaticCondition { valueFunction } } } } } } Update the description This will walk you through the procedure to create a description for a NRQL alert condition. 1. Get all the conditions for a policy: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlConditions(policyId: YOUR_POLICY_ID) { nextCursor results { id name description enabled nrql { query sinceValue } policyId runbookUrl terms { duration operator priority timeFunction threshold } type violationTimeLimit } } } } } } 2. Get the details for a single condition: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { nrqlCondition(id: \"YOUR_CONDITION_ID\") { description id enabled name nrql { query evaluationOffset } policyId runbookUrl terms { operator priority threshold thresholdDuration thresholdOccurrences } type violationTimeLimit } } } } } 3. Create a mutation with the description. Here's an empty mutation template: mutation { alertsNrqlConditionStaticUpdate(accountId: YOUR_ACCOUNT_ID, id: \"YOUR_CONDITION_ID\", condition: {description: \"\"}) { description } } Here'a an example mutation with an included example description: mutation { alertsNrqlConditionStaticUpdate(accountId: 123456, id: \"123456\", condition: {description: \"timestamp : {{timestamp}} \\n accountId : {{accountId}} \\n type : {{type}} \\n event : {{event}} \\n description : {{description}} \\n policyId : {{policyId}} \\n policyName: {{policyName}} \\n conditionName : {{conditionName}} \\n conditionId : {{conditionId}} \\n product : {{product}} \\n conditionType : {{conditionType}} \\n RunbookUrl : {{runbookUrl}} \\n nrqlQuery : {{nrqlQuery}} \\n nrqlEventType : {{nrqlEventType}} \\n targetID : {{targetId}} \\n targetName : {{targetName}} \\n commandLine : {{tag.commandLine}} \\n entityGuid : {{tag.entityGuid}} \\n entityName : {{tag.entityName}} \\n fullHostname : {{tag.fullHostname}} \\n instanceType : {{tag.instanceType}} \\n processDisplayName : {{tag.processDisplayName}}\"}) { description } } Delete conditions You can use the alertsConditionDelete mutation to delete any type of condition. You can only request the id field on a delete mutation; for example: mutation { alertsConditionDelete(accountId: YOUR_ACCOUNT_ID, id: YOUR_CONDITION_ID) { id } } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph",
+ "info": "Examples of how to use the NerdGraph API explorer to create alert conditions, queries, and mutations.",
+ "nodeid": 37711,
+ "sections": [
+ "New Relic Alerts",
+ "Get started",
+ "Alert policies",
+ "Alert conditions",
+ "Alert violations",
+ "Alert Incidents",
+ "Alert notifications",
+ "Troubleshooting",
+ "Rules, limits, and glossary",
+ "Alerts and Nerdgraph",
+ "REST API alerts",
+ "NerdGraph API: NRQL condition alerts",
+ "Steps to create a NRQL condition",
+ "NRQL static condition",
+ "NRQL baseline condition",
+ "NRQL outlier condition",
+ "Update a condition",
+ "Update mutations",
+ "List and filter NRQL conditions",
+ "Singular NRQL condition queries",
+ "Update the description",
+ "Delete conditions",
+ "For more help"
+ ],
+ "title": "NerdGraph API: NRQL condition alerts ",
+ "popularity": 1,
+ "external_id": "86591bd20017930f1e4eef1b1a76e3806298dbb9",
+ "category_1": "New Relic Alerts",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alerts-nerdgraph/nerdgraph-api-nrql-condition-alerts",
+ "published_at": "2020-08-18T18:15:13Z",
+ "updated_at": "2020-08-11T04:56:49Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.27475727,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NerdGraph API: NRQL condition alerts ",
+ "sections": "Update mutations ",
+ "info": "Examples of how to use the NerdGraph API explorer to create alert conditions, queries , and mutations .",
+ "body": "You can manage alerts conditions using our GraphQL NerdGraph API. Here are some conditions queries and mutations you can develop in our NerdGraph API explorer. See the NerdGraph introduction for help getting started with NerdGraph API explorer. This document covers the following: Steps to create",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph "
+ },
+ "id": "5f2dee1128ccbc562e88dfc1"
+ },
+ {
+ "body": "This document provides examples of how to use New Relic NerdGraph to query and modify your cloud integration configuration data, including Amazon AWS, Microsoft Azure, and Google Cloud Platform (GCP). Using the NerdGraph GraphiQL explorer, you can also query NRQL data. These examples for querying cloud integration configuration data use GraphQL queries and mutations: Queries: requests that are intended to only fetch data Mutations: requests that create or update data on the server Requirements Before querying cloud integration data with NerdGraph, ensure you have: Followed the instructions to connect cloud integrations with New Relic. Created an API key. Access the NerdGraph GraphiQL explorer To access the NerdGraph GraphiQL explorer: Go to https://api.newrelic.com/graphiql. Add any of the following examples. Query examples Queries are requests that are intended to only fetch data (no side effects). Queries in NerdGraph are not static, meaning that you can ask for more or less data depending on your needs. For each query, you can specify exactly what data you want to retrieve, as long as it is supported by the schema. Available provider accounts This query returns a list of all provider accounts available in your infrastructure data. Depending on the provider, additional properties can be requested. For example, for GCP, you can also ask for the serviceAccountId property, which is needed when linking a new GCP project to New Relic. Anonymous: { actor { account(id: ) { cloud { providers { id name slug ... on CloudGcpProvider { serviceAccountId } } } } } } Named: query cloudProviders { actor { account(id: ) { cloud { providers { id name slug } } } } } Specific provider account information This query returns information about a specific provider account for your Amazon AWS integration. The properties id, name, slug are requested, along with a list of integrations available to be monitored. { actor { account(id: ) { cloud { provider(slug: \"aws\") { id slug name services { id slug name } } } } } } Specific integration data from a specific cloud provider This query returns information about a specific cloud service integration of a provider. In this example, the integration is the Amazon AWS ALB monitoring integration and the provider is AWS. The properties id, name, slug, and isAllowed are requested with the available configuration parameters. { actor { account(id: ) { cloud { provider(slug: \"aws\") { service(slug: \"alb\") { id name slug isEnabled } } } } } } List of enabled cloud accounts This query returns the list of cloud accounts enabled with your New Relic account. (Your cloud account associates your New Relic account and a specific provider account with your integration.) You can enable multiple cloud provider accounts in the same New Relic account, even with the same cloud provider. { actor { account(id: ) { cloud { linkedAccounts { id name createdAt provider { id name } } } } } } Specific linked account data This query returns information about a linked account, including the properties name, providerId, and a list of the cloud integrations enabled for monitoring. { actor { account(id: ) { cloud { linkedAccount(id: ) { name provider { id name } integrations { id name createdAt updatedAt } } } } } } Enabled cloud integrations for all linked accounts This query returns all monitored integrations for all the provider cloud accounts. { actor { account(id: ) { cloud { linkedAccounts { name provider { id name } integrations { id name service { id name } createdAt updatedAt } } } } } } Specific cloud integration data for a specific linked account This query returns information about a specific integration from a specific linked account. { actor { account(id: ) { cloud { linkedAccount(id: ) { name provider { id name } integration(id: ) { id name service { id name } createdAt updatedAt } } } } } } Mutation examples Mutations are requests that are intended to have side effects, such as creating or updating data on the server. Mutations require the keyword mutation and the name of the mutation. NerdGraph mutations are restricted to a subset of all possible mutations. Link an account This mutation allows linking cloud provider accounts to a New Relic account, creating one or more linked accounts. It can link one specific cloud provider account (for example aws) to the New Relic account or multiple cloud provider accounts to one New Relic account. Required: The parameter is required and cannot be empty. It must be unique in your New Relic account. Other parameters are specific to the provider (AWS, GCP, and Azure) and are also required. In the following sections, you can see which parameters are required for each provider account. After linking an account the createdAt and updatedAt values are equal. mutation { cloudLinkAccount( accounts: { accountId: , aws: [{ name: , }] azure: [{ name: , }] gcp: [{ name: , }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } } } } Link an Amazon AWS account This mutation links an Amazon AWS provider account to your New Relic account. mutation { cloudLinkAccount( accountId: , accounts: { aws: [{ name: , arn: }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } } } } Link a Microsoft Azure account This mutation links a Microsoft Azure cloud subscription to the New Relic account. mutation { cloudLinkAccount( accountId: , accounts: { azure: [{ name: , applicationId: , clientSecret: , tenantId: , subscriptionId: }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } } } Link a Google Cloud Platform (GCP) project This mutation links a GCP project to the New Relic account. mutation { cloudLinkAccount( accountId: , accounts: { gcp: [{ name: , projectId: }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } } } Rename one or more cloud accounts This mutation allows you to rename one or more linked provider accounts. The name parameter is required, cannot be empty, and must be unique within your New Relic account. mutation { cloudRenameAccount( accountId: , accounts: [ { id: , name: }, { id: , name: } ] ) { linkedAccounts { id name } } } Enable an integration in a cloud account This mutation allows you to enable the monitoring of one or more specific cloud integrations in an existing cloud account. With this mutation, New Relic records data for the enabled integration from the provider account. For each provider account you have access to different input parameters, matching each available service. mutation { cloudConfigureIntegration ( accountId: , integrations: { : { : [{ linkedAccountId: , }] } } ) { integrations { id name integration { id slug } ... on SqsIntegration { awsRegions } } } } Enable an integration in multiple cloud accounts If you have many provider accounts linked, you can enable the same integration in the many cloud accounts at the same time. For the output of the operation, you can use GraphQL fragments for integration specific configuration parameters. mutation { cloudConfigureIntegration ( accountId: , integrations: { : { : [ { linkedAccountId: }, { linkedAccountId: } ] } } ) { integrations { id name integration { id name } ... on SqsIntegration { awsRegions } } } } Enable multiple integrations in multiple cloud accounts If you have multiple cloud accounts linked, you can also enable multiple integrations in multiple linked cloud accounts at the same time. For the output of the operation, you can use GraphQL fragments to ask for integration specific configuration parameters. mutation { cloudConfigureIntegration ( accountId: , integrations: { : { : [ { linkedAccountId: } ] : [ { linkedAccountId: } ] }, : { : [ { linkedAccountId: }, { linkedAccountId: } ] } } ) { integrations { id name service { id name } ... on SqsIntegration { awsRegions } } } } Modify an integration's configuration (regions, polling intervals, etc.) This mutation also allows you to modify one or more cloud integrations and change one or more configuration parameters. Each service will have specific parameters that you can modify. For parameters of a type list (for example, awsRegion) supply the full list. For the output of the operation, you can use GraphQL fragments to ask for integration specific configuration parameters. mutation { cloudConfigureIntegration ( accountId: , integrations: { : { : [{ linkedAccountId: , metricsPollingInterval: , : , : , }] } } ) { integrations { id name service { id slug } ... on SqsIntegration { metricsPollingInterval, , } } errors { type message } } } Disable (remove) an integration This mutation allows you to disable an integration and stop data collection for the specific cloud integration. mutation { cloudDisableIntegration ( accountId: , integrations: { : { : [ { linkedAccountId: } ] } } ) { disabledIntegrations { id name authLabel provider { id } } errors { type message } } } Unlink account This mutation allows you to unlink cloud provider accounts from New Relic account. This action can not be undone. However, you can link the account again, but account history will still be lost. mutation { cloudUnlinkAccount ( accountId: , accounts: { { linkedAccountId: } } ) { unlinkedAccounts { id name } errors { type message } } } Enable an Amazon AWS integration This example uses an Amazon AWS SQS integration and assumes you have connected an AWS account to New Relic. To enable an Amazon AWS integration: Send query to fetch account data Send a query to fetch data about the account, specifically available providers and already created provider accounts: { actor { account(id: ) { cloud { providers { id name slug } linkedAccounts { name integrations { id name } } } } } } Link AWS provider account Link an AWS provider account, if there is not one already linked or if you want to link another AWS account: Use your New Relic account identifier in the parameter. Provide a name for the provider account in the . Include the ARN of the AWS role used to fetch data from your AWS account. mutation { cloudLinkAccount( accountId: , accounts: { aws: [{ name: , arn: }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } errors { type message } } } Enable Amazon AWS SQS integration Use your New Relic account ID in the parameter and the ID of the provider account in the parameter value. mutation { cloudConfigureIntegration ( accountId: , integrations: { aws: { sqs: [ { linkedAccountId: } ] } } ) { integrations { id name service { id name } } errors { type message } } } Enable integration in multiple provider accounts If you have multiple accounts with the same provider account, you can enable the same integration in multiple provider accounts at the same time. Use your New Relic account ID in the parameter and the ID of the provider accounts in the parameter value. mutation { cloudConfigureIntegration ( accountId: , integrations: { aws: { sqs: [ { linkedAccountId: }, { linkedAccountId: , configuration_param_1: value_1, configuration_param_2: value_2 } ] } } }) { integrations { id name service { id name } } errors { type message } } } Change polling interval for Amazon AWS integration This example uses an Amazon AWS SQS integration and assumes you have connected an AWS account to New Relic. To change the polling interval of an AWS integration: Update the polling interval To update the polling interval for an Amazon AWS SQS integration, use your New Relic account ID in the parameter and the id of the linked provider account in the parameter value: mutation { cloudConfigureIntegration( accountId: , integrations: { aws : { sqs: [ { linkedAccountId: , metricsPollingInterval: 300 } ] } } ) { integrations { id name service { id slug } ... on SqsIntegration { metricsPollingInterval } } errors { type message } } } Disable Amazon AWS integration This example uses an Amazon AWS SQS integration and assumes you have connected an AWS account to New Relic. To disable an AWS integration: Disable the SQS integration Use your New Relic account identifier in the parameter and the ID of the linked cloud account the parameter value. mutation { cloudDisableIntegration ( accountId: , integrations: { aws: { sqs : [ { linkedAccountId: } ] } } ) { disabledIntegrations { id accountId name } errors { type message } } } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / APIs / NerdGraph / Examples",
+ "info": "Use New Relic's NerdGraph (our GraphQL API) to query your New Relic Infrastructure cloud integration data. ",
+ "nodeid": 17141,
+ "sections": [
+ "NerdGraph",
+ "Get started",
+ "Examples",
+ "NerdGraph cloud integrations API tutorial",
+ "Requirements",
+ "Access the NerdGraph GraphiQL explorer",
+ "Query examples",
+ "Mutation examples",
+ "Enable an Amazon AWS integration",
+ "Change polling interval for Amazon AWS integration",
+ "Disable Amazon AWS integration",
+ "For more help"
+ ],
+ "title": "NerdGraph cloud integrations API tutorial",
+ "popularity": 1,
+ "external_id": "15caa0b35be84f2e6245826a5c9ac8e49cad6a89",
+ "category_1": "NerdGraph",
+ "category_2": "Examples",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-cloud-integrations-api-tutorial",
+ "published_at": "2020-08-18T03:42:15Z",
+ "updated_at": "2020-08-10T23:22:01Z",
+ "category_0": "APIs",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.2695496,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "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": "5d83537b28ccbc263a1b7bf7"
+ },
+ {
+ "body": "You can manage your alerts policies using our GraphQL NerdGraph API. Here are some queries and mutations you can develop in our NerdGraph API explorer. See the NerdGraph introduction for help getting started with NerdGraph API explorer. List and filter policies The policiesSearch query allows you to paginate through all of your policies per account. It also allows some filtering functionality on the account policies. Listing all policies for an account Here's an example: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { policiesSearch { policies { id name incidentPreference } } } } } } Paginating through policies with cursor pagination In order to paginate through your policies, you must request the nextCursor field on your initial query. With cursor pagination, you continue to make a request through the result set until the nextCursor that is returned from the response comes back empty. This signifies that you reached the end of your results. Here's an example: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { policiesSearch { nextCursor policies { id name incidentPreference } totalCount } } } } } The code above returns a set of results like this: { \"data\": { \"actor\": { \"account\": { \"alerts\": { \"policiesSearch\": { \"nextCursor\": \"/8o0y2qiR54m6thkdgHgwg==:jZTXDFKbTkhKwvMx+CtsPVM=\", \"policies\": [ { \"id\": \"3455\", \"incidentPreference\": \"PER_POLICY\", \"name\": \"First Policy Name\" }, { \"id\": \"2123\", \"incidentPreference\": \"PER_POLICY\", \"name\": \"Another Policy\" }, // ... more policies here in reality ], \"totalCount\": 745 } } } } } } So, in your subsequent request, provide the cursor like so, until the cursor is empty: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { policiesSearch(cursor: \"/8o0y2qiR54m6thkdgHgwg==:jZTXDFKbTkhKwvMx+CtsPVM=\") { nextCursor policies { id name incidentPreference } totalCount } } } } } Find all policies by selected ids The API allows policy queries by a sub-select of ids. This will only return the information for these policies that you provide. { actor { account(id: YOUR_ACCOUNT_ID) { alerts { policiesSearch(searchCriteria: { ids: [A_POLICY_ID, ANOTHER_POLICY_ID] }) { policies { id name incidentPreference } } } } } } Find policy by id The API lets you query by policy id: { actor { account(id: YOUR_ACCOUNT_ID) { alerts { policy(id: YOUR_POLICY_ID) { id name incidentPreference } } } } } Create a policy In order to create a policy, supply a name and an incidentPreference. The incident preference will configure how incidents get created for each condition created in the policy. For more information, refer to the documentation about choosing your incident preference. mutation { alertsPolicyCreate(accountId: YOUR_ACCOUNT_ID, policy: { name: \"Your Policy Name\" incidentPreference: PER_CONDITION }) { id name incidentPreference } } Update a policy When you update a policy, note that you don't need to supply all of the attributes on the policy. For example, you only need to supply the name if you only intend to update the name: mutation { alertsPolicyUpdate(accountId: YOUR_ACCOUNT_ID, id: YOUR_POLICY_ID, policy: { name: \"Updated Policy Name\" }) { id name incidentPreference } } Delete a policy You can delete policies via the NerdGraph API. Note that only the id may be requested back from a deleted resource: mutation { alertsPolicyDelete(accountId: YOUR_ACCOUNT_ID, id: YOUR_POLICY_ID) { id } } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph",
+ "info": "Read about how you can list, create, update, and delete policies using the NerdGraph API.",
+ "nodeid": 37716,
+ "sections": [
+ "New Relic Alerts",
+ "Get started",
+ "Alert policies",
+ "Alert conditions",
+ "Alert violations",
+ "Alert Incidents",
+ "Alert notifications",
+ "Troubleshooting",
+ "Rules, limits, and glossary",
+ "Alerts and Nerdgraph",
+ "REST API alerts",
+ "NerdGraph API: Alerts policies",
+ "List and filter policies",
+ "Create a policy",
+ "Update a policy",
+ "Delete a policy",
+ "For more help"
+ ],
+ "title": "NerdGraph API: Alerts policies ",
+ "popularity": 1,
+ "external_id": "cde6b52e96940389d03ae58acbfce482b5d455e6",
+ "category_1": "New Relic Alerts",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alerts-nerdgraph/nerdgraph-api-alerts-policies",
+ "published_at": "2020-08-18T18:15:13Z",
+ "updated_at": "2020-08-11T04:56:49Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.2629376,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NerdGraph API: Alerts policies ",
+ "sections": "Alerts and Nerdgraph ",
+ "info": "Read about how you can list, create, update, and delete policies using the NerdGraph API.",
+ "body": "You can manage your alerts policies using our GraphQL NerdGraph API. Here are some queries and mutations you can develop in our NerdGraph API explorer. See the NerdGraph introduction for help getting started with NerdGraph API explorer. List and filter policies The policiesSearch query allows you",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alerts and Nerdgraph "
+ },
+ "id": "5f2dee1128ccbc65b688dfc1"
+ },
+ {
+ "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Intro to New Relic One API components",
+ "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",
+ "popularity": 1,
+ "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.22751394,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Query and storage components",
+ "body": " is with NerdGraph , our GraphQL endpoint. This can be queried using NerdGraphQuery . To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph , see Queries and mutations . We also provide storage for storing small data sets, such as configuration"
+ },
+ "id": "5efa989e28ccbc4071307de5"
+ }
+ ],
+ "/build-apps/add-time-picker-guide": [
+ {
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "Tip",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "popularity": 1,
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-18T01:50:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.87591255,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps .",
+ "tags": "New Relic One app ",
+ "body": "New Relic One CLI reference To build a New Relic One app , you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app . We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "PlatformStateContext Usage Copy Props There are no props for this component.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "A PlatformStateContext component!",
+ "sections": [
+ "PlatformStateContext",
+ "Usage",
+ "Props"
+ ],
+ "title": "PlatformStateContext",
+ "popularity": 1,
+ "external_id": "aa6b86b3dc0dcd7cd758b20655318b108875cce7",
+ "image": "",
+ "url": "https://developer.newrelic.com/components/platform-state-context/",
+ "published_at": "2020-08-18T02:04:52Z",
+ "updated_at": "2020-08-01T01:47:08Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.3045187,
+ "_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"
+ },
+ {
+ "body": "Build apps You know better than anyone what information is crucial to your business, and how best to visualize it. Sometimes, this means going beyond dashboards to creating your own app. With React and GraphQL, you can create custom views tailored to your business. These guides are designed to help you start building apps, and dive into our library of components. We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a \"Hello, World!\" application Build a \"Hello, World!\" app and publish it to New Relic One 20 min Publish and deploy apps Start sharing the apps you build 20 min Set up your development environment Prepare to build apps and contribute to this site 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 30 min Add a table to your app Add a table to your New Relic One app 30 min Create a custom map view Build an app to show page view data on a map",
+ "type": "developer",
+ "document_type": "page",
+ "info": "",
+ "sections": [
+ "Build apps",
+ "Guides to build apps",
+ "Create a \"Hello, World!\" application",
+ "Publish and deploy apps",
+ "Set up your development environment",
+ "Add the NerdGraphQuery component to an application",
+ "Add a time picker to your app",
+ "Add, query, and mutate data using NerdStorage",
+ "Add a table to your app",
+ "Create a custom map view"
+ ],
+ "title": "Build apps",
+ "popularity": 1,
+ "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d",
+ "image": "",
+ "url": "https://developer.newrelic.com/build-apps/",
+ "published_at": "2020-08-18T02:08:12Z",
+ "updated_at": "2020-08-18T01:45:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.23860641,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Build apps ",
+ "sections": "Add a time picker to your app ",
+ "body": " it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one"
+ },
+ "id": "5efa999d64441fc0f75f7e21"
+ },
+ {
+ "body": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application. In this guide, you are going to build a sample table using various New Relic One components. Before you begin If you haven't already installed the New Relic One CLI, step through the quick start in New Relic One. This process also gets you an API key. In addition, to complete the steps in this guide, you need a GitHub account, and to have Node.js installed on your machine. See [Setting up your development environment](/build-apps/set-up-dev-env) for more info. Clone and set up the example application Step 1 of 4 Clone the nr1-how-to example application from GitHub to your local machine. Then, navigate to the app directory. The example app lets you experiment with tables. git clone https://github.com/newrelic/nr1-how-to.git` cd nr1-how-to/create-a-table/nerdlets/create-a-table-nerdlet` Copy Step 2 of 4 Edit the index.json file and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install dependencies nr1 nerdpack:serve # Serve the demo app locally Copy Step 4 of 4 Open one.newrelic.com/?nerdpacks=local in your browser. Click Apps*, and then in the Other apps section, you should see a Create a table** launcher. That's the demo application you're going to work on. Go ahead and select it. Have a good look at the demo app. There's a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You'll use Table components to add a new table in the second row. Work with table components Step 1 of 10 Navigate to the `nerdlets/create-a-table-nerdlet` subdirectory and open the `index.js` file. Add the following components to the import statement at the top of the file so that it looks like the example: Table TableHeader TableHeaderCell TableRow TableRowCell import { Table, TableHeader, TableHeaderCell, TableRow, TableRowCell, PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart, } from 'nr1'; Copy Step 2 of 10 Add a basic Table component Locate the empty GridItem in index.js: This is where you start building the table. Add the initial component. The items property collects the data by calling _getItems(), which contains sample values. ; Copy Step 3 of 10 Add the header and rows As the Table component renders a fixed number of header cells and rows, your next step is adding header components, as well as a function that returns the required table rows. Inside of the Table component, add the TableHeader and then a TableHeaderCell child for each heading. Since you don't know how many rows you'll need, your best bet is to call a function to build as many TableRows as items returned by _getItems(). Application Size Company Team Commit ; { ({ item }) => ( {item.name} {item.value} {item.company} {item.team} {item.commit} ); } Copy Step 4 of 10 Take a look at the application running in New Relic One: you should see something similar to the screenshot below. Step 5 of 10 Replace standard table cells with smart cells The New Relic One library includes cell components that can automatically format certain data types, like users, metrics, and entity names. The table you've just created contains columns that can benefit from those components: Application (an entity name) and Size (a metric). Before you can use EntityTitleTableRowCell and MetricTableRowCell, you have to add them to the import statement first. import { EntityTitleTableRowCell, MetricTableRowCell, ... /* All previous components */ } from 'nr1'; Copy Step 6 of 10 Update your table rows by replacing the first and second TableRowCells with entity and metric cells. Notice that EntityTitleTableRowCell and MetricTableRowCell are self-closing tags. { ({ item }) => ( {item.company} {item.team} {item.commit} ); } Copy Step 7 of 10 Time to give your table a second look: The cell components you've added take care of properly formatting the data. Step 8 of 10 Add some action to your table! Tables are great, but interactive tables can be better: As a last update, you are going to allow users to act on each data row. Add the _getActions() method to your index.js file, right before _getItems(). As you may have guessed from the code, _getActions() spawns an alert box when you click Team or Commit cells. _getActions() { return [ { label: 'Alert Team', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__ALERT, onClick: (evt, { item, index }) => { alert(`Alert Team: ${item.team}`); }, }, { label: 'Rollback Version', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__UNDO, onClick: (evt, { item, index }) => { alert(`Rollback from: ${item.commit}`); }, }, ]; } Copy Step 9 of 10 Find the TableRow component in your return statement and point the actions property to _getActions(). The TableRow actions property defines a set of actions that appear when the user hovers over a table row. Actions have a mandatory text and an onClick callback, but can also display an icon or be disabled if needed. Copy Step 10 of 10 Go back to your application and try hovering over any of the rows: Notice how the two available actions appear. When you click them, a function triggers with the selected row data as an argument, and an alert displays in your browser. Next steps You've built a table into a New Relic One application, using components to format data automatically and provide contextual actions. Well done! Keep exploring the Table components, their properties, and how to use them, in our SDK documentation.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Add a table to your New Relic One app.",
+ "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",
+ "popularity": 1,
+ "external_id": "7ff7a8426eb1758a08ec360835d9085fae829936",
+ "image": "https://developer.newrelic.com/static/e637c7eb75a9dc01740db8fecc4d85bf/1d6ec/table-new-cells.png",
+ "url": "https://developer.newrelic.com/build-apps/howto-use-nrone-table-components/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-14T01:46:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.20037782,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Add tables to your New Relic One application ",
+ "sections": "Add tables to your New Relic One application ",
+ "info": "Add a table to your New Relic One app .",
+ "body": " and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create"
+ },
+ "id": "5efa989ee7b9d2ad567bab51"
+ },
+ {
+ "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Intro to New Relic One API components",
+ "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",
+ "popularity": 1,
+ "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.19302298,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "body": ". They can be divided into these categories: PlatformStateContext : provides read access to the platform URL state variables. Example: time Range 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"
+ }
+ ],
+ "/terms": [
+ {
+ "body": "The REST API endpoints allow you to create conditions for your policies. This glossary contains the names and descriptions of each of the fields that you can use to define or update a condition. Required and optional fields The API includes four types of New Relic Alerts conditions: APM External services Synthetic monitoring Plugins All of the fields used with a specific condition type are required except for these optional fields: enabled (defaults to false) runbook_url user_defined Field definitions Not every field listed in this glossary is required for every condition type. The condition type for which a field must be used is listed in each description. condition_scope This field allows you to scope a condition to either a JVM instance or to a whole application. This may be one of the strings: instance application Used for: Conditions Entity conditions For instance-based and JVM health metrics, see also violation_close_timer. enabled This is the status of your alert condition and is optional. The default is false. This field may be used to enable or disable a condition for maintenance or testing periods. Used for: Conditions External service conditions Synthetic monitoring conditions Plugin conditions entities This is an array of entity IDs identifying the objects which will be monitored with your condition. These may be application IDs, browser IDs, plugin IDs, key transaction IDs, external service IDs, etc. These are entered as a series of comma separated integers if there is more than one. Used for: Conditions External service conditions Plugin conditions expected_groups This is the number of groups you expect to see at any given time. It is used in combination with the ignore_overlap option. Used for: NRQL outlier conditions external_service_url This is the URL of the external service to be monitored. This string must not include the protocol. For example, use example.com, not https://example.com. Used for: External service conditions ignore_overlap If disabled, this looks for a convergence (or overlapping) of groups. If the condition is looking for two or more groups, and the returned values can't be separated into that number of distinct groups, then that will also produce a violation. This type of overlap event is represented on a chart by group bands touching. Used for: NRQL outlier conditions metric The metric field is used for three alert categories. The exact parameters available for use depend on the setting in the type field. These are listed below according to their alert type field. Alerts plugin conditions For Plugin conditions this is the metric, which has been defined in a plugin, that will be used to trigger a notification. Alerts conditions The value specified in the type field controls which of the parameters may be specified. The type field and corresponding available parameter names are listed in the following table. Only one may be specified. type Parameter apm_app_metric apdex error_percentage response_time_web response_time_background throughput_web throughput_background user_defined apm_kt_metric apdex error_percentage error_count response_time throughput browser_metric end_user_apdex total_page_load page_rendering web_application network dom_processing request_queuing ajax_response_time page_views_with_js_errors page_view_throughput ajax_throughput user_defined browser_metric_baseline page_view_throughput average_response_time ajax_response_time ajax_application_time mobile_metric database images json, network view_loading network_error_percentage status_error_percentage user_defined Alerts external service conditions The value specified in the type field controls which of the parameters may be specified. The type field and corresponding available parameter names are listed in the following table. Only one may be specified. type Parameter apm_external_service apdex error_percentage response_time_web response_time_background throughput_web throughput_background user_defined apm_app_metric_baseline external_service_transaction_time error_count database_transaction_time throughput_web response_time_web non_web_transaction_time web_transaction_database_time non_web_transaction_database_time mobile_external_service response_time_average response_time_minimum response_time_maximum throughput network_failure_percentage http_status_error_percentage metric_description This is a title for the metric which is displayed in notifications. Make this descriptive and unique so the reader will understand the nature of plugin metric being used to trigger an alert. Used for: Plugin conditions monitor_id This is the GUID of the Synthetic monitoring to alert on. Used for: Synthetic monitoring conditions name This condition title will allow to you identify it in the UI. Follow the guidelines for making this descriptive but short. Used for: Conditions External service conditions Synthetic monitoring conditions Plugin conditions nrql[query] This is the NRQL query that alerts monitors as part of a NRQL condition. Used for: NRQL conditions nrql[since_value] This is the timeframe (in minutes) in which to evaluate the specified NRQL query. since_value must be between 1 and 20. Used for: NRQL conditions plugin[guid] This is the GUID of the plugin for which the trigger is being defined. Used for: Plugin conditions plugin[id] This is the ID of the plugin for which the trigger is being defined. Used for: Plugin conditions runbook_url The runbook URL to display in notifications. This field is optional. Used for: Conditions External service conditions Synthetic monitoring conditions Plugin conditions terms[duration] This is the time (in minutes) for the condition to persist before triggering an event. It corresponds to the duration set when adding a threshold in the UI. Used for: Conditions terms[operator] This determines what comparison will be used between the value_function and the terms[threshold] value to trigger an event. It corresponds to the operation selected when adding a threshold in the UI. It must be one of the following strings: above below equal Used for: Conditions External service conditions Plugin conditions terms[priority] This corresponds to the severity level selected when setting the threshold values for the condition in the UI. This must be one of the following strings: critical warning Used for: Conditions External service conditions Plugin conditions terms[threshold] This is the threshold that the value_function must be compared to using the terms[operator] for an event to be triggered. It corresponds to the numeric value specified in the UI when adding the threshold values. This is a numeric value and must be 0 (zero) or greater. Used for: Conditions External service conditions Plugin conditions terms[time_function] This corresponds to the settings made in the UI when adding the threshold values. The choices are: all (corresponding to for at least in the UI) any (corresponding to at least once in in the UI) Used for: Conditions External service conditions Plugin conditions type This defines the type of metric that will be used for the alert. Allowable content for the metric field depends on the type value chosen. There are two product categories : Alerts conditions For this category, type is set to one of the following strings indicating the type of alerts condition. type Use apm_app_metric APM application metric will trigger an alert. apm_app_metric_baseline APM application metric will trigger an alert (using a baseline threshold). apm_kt_metric APM key transaction metric will trigger an alert. browser_metric Browser metric will trigger an alert. browser_metric_baseline Browser metric will trigger an alert (using a baseline threshold). mobile_metric Mobile metric will trigger an alert. Used for: Conditions Alerts external service conditions For this category, type is set to one of the following strings indicating the type of external service condition. type Use apm_external_service APM external metric will trigger an alert. mobile_external_service Mobile external metric will trigger an alert. Used for: External service conditions user_defined[metric] (optional) This is the name of a user defined custom metric to be used to determine if an event should be triggered. The user_defined[value_function] associated with the metric is compared with the terms[threshold] value when evaluating if an incident should be triggered. The comparison is performed using the operator defined by terms[operator]. Used for: Conditions External service conditions Synthetic monitoring conditions Plugin conditions user_defined[value_function] (optional) This is the numeric value obtained from the custom metric specified by user_defined[metric]. It is compared with the terms[threshold] value when evaluating if an incident should be triggered. The comparison is performed using the operator defined by terms[operator]. One of these value functions must be specified: average min max total sample_size Used for: Conditions value_function This is the value function used from the plugin metric. This may be one of the strings: min max average sample_size total percent Used for: Plugin conditions When used for a NRQL condition, the options are: single_value (condition is evaluated based on each query's returned value) sum (condition is evaluated based on the sum of each query's returned values over the specified duration) violation_time_limit_seconds Use to automatically close instance-based violations after the number of seconds specified. Must be one of these values: 3600 7200 14400 28800 43200 86400 Used for: Location conditions NRQL conditions violation_close_timer Use to automatically close instance-based violations, including JVM health metric violations, after the number of hours specified. Must be one of these values: 1 2 4 8 12 24 Used for: apm_app_metric (with condition_scope set to instance) apm_jvm_metric For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / REST API alerts",
+ "info": "This glossary defines the alerts API fields, and provides links to relevant content to help better understand each one.",
+ "nodeid": 9276,
+ "sections": [
+ "New Relic Alerts",
+ "Get started",
+ "Alert policies",
+ "Alert conditions",
+ "Alert violations",
+ "Alert Incidents",
+ "Alert notifications",
+ "Troubleshooting",
+ "Rules, limits, and glossary",
+ "Alerts and Nerdgraph",
+ "REST API alerts",
+ "Alerts conditions API field names",
+ "Required and optional fields",
+ "Field definitions",
+ "For more help"
+ ],
+ "title": "Alerts conditions API field names",
+ "popularity": 1,
+ "external_id": "08f92bd7e576017eb032cdd843c616c7c04fba11",
+ "category_1": "New Relic Alerts",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/rest-api-alerts/alerts-conditions-api-field-names",
+ "published_at": "2020-08-18T04:25:33Z",
+ "updated_at": "2020-08-15T13:54:16Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.0668915,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Alerts conditions API field names",
+ "sections": "Alert conditions ",
+ "info": "This glossary defines the alerts API fields, and provides links to relevant content to help better understand each one.",
+ "category_0": "Alerts and Applied intelligence",
+ "body": ". Used for: Plugin conditions runbook_url The runbook URL to display in notifications. This field is optional. Used for: Conditions External service conditions Synthetic monitoring conditions Plugin conditions terms [duration] This is the time (in minutes) for the condition to persist before triggering"
+ },
+ "id": "5f2dee1128ccbc1e7588dff5"
+ },
+ {
+ "body": "As a customer, you are eligible to participate in New Relic’s Developer Program. Additional information and resources are available at New Relic’s Developer Program site. By downloading, accessing, or using the developer resources (including the CLI), you agree that usage of the developer resources is pursuant to the New Relic Developers Terms and Conditions and that you have the authority to bind your organization. Such terms do not have to be signed in order to be binding. If you do not agree to these terms and conditions, your sole remedy is to not use these developer resources. If your use of the New Relic developer resources are covered under a separate agreement, the above does not apply to you. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Licenses / Product or service licenses / Developer Edition",
+ "info": "New Relic Developer edition policy",
+ "nodeid": 39641,
+ "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",
+ "popularity": 1,
+ "external_id": "98308cfffa652e4c25967e1be5b848b9c28ca410",
+ "category_1": "Product or service licenses",
+ "category_2": "Developer Edition",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/licenses/product-or-service-licenses/new-relic-developer-edition/developer-program-resources",
+ "published_at": "2020-08-18T17:43:42Z",
+ "updated_at": "2020-08-08T19:17:02Z",
+ "category_0": "Licenses",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.060060218,
+ "_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"
+ },
+ {
+ "body": "logo-newrelic Search Products Pricing Solutions Help Center About New Relic for iOS or Android New Relic Insights App for iOS Search icon Sign Up Log In Products New Relic One Platform Overview Telemetry Data Platform Full-Stack Observability Applied Intelligence Solutions By Topic DevOps Cloud Adoption Cloud Native Digital Customer Experience By Industry E-commerce and Retail Media Public Sector By Technology Amazon Web Services Pivotal Cloud Foundry Microsoft Azure Google Cloud Platform Kubernetes Help Center Learn Docs Build on New Relic Explore open source projects Training Get help Community forum Global technical support Expert services About Our Customers Over 17,000 customers love New Relic, from Fortune 500 enterprises to small businesses around the globe. Our Blog The latest news, tips, and insights from the world of New Relic and digital intelligence. Our Company About Us Leadership Meetups and Events Resources Investor Relations Newsroom Partner Program Contact Us logo-newrelic Want to use our logo? There's a page for that, including instructions and different styles and formats. Sorry about grabbing your right-click. Just trying to be helpful. You can also go home. Back to top icon New Relic Inc. Terms of Service Paid Accounts Customers that access New Relic’s platform through a paid subscription are governed by the Terms of Service set forth immediately above. Unpaid Accounts Customers that access New Relic’s platform on an unpaid (e.g. trials, proof of concepts, New Relic Developer Edition or ‘lite’) basis are governed by the Terms of Service set forth immediately above. Community Forums Community Forum participants ask and answer questions about New Relic’s platform. Use of the Community Form is governed by the terms and conditions set forth immediately above. New Relic Data Processing Addendum Customers who currently send, or intend to send, personal data to the New Relic Services for processing should download and complete the Data Processing Addendum set forth immediately above. Data Processing Addendum FAQ This guide is designed to assist customers in their completion of the New Relic Data Processing Addendum. COMPANY Careers and Culture Partner Program Investor Relations NewRelic.org Suppliers Portal CONNECT Contact Us Request Demo Events international newrelic.co.jp (Japanese) newrelic.fr (French) newrelic.de (German) Terms of Service DMCA Policy Privacy Policy Cookie Policy UK Slavery Act of 2015 ©2008-20 New Relic, Inc. All rights reserved",
+ "type": "",
+ "info": "",
+ "sections": [
+ "Terms of Service",
+ "COMPANY",
+ "CONNECT",
+ "international"
+ ],
+ "title": "Terms of Service Agreement | New Relic",
+ "popularity": 1,
+ "external_id": "f1539ad0dbd46a29c243907400c646ed11c33bd1",
+ "image": "https://newrelic.com/content/dam/new-relic/opengraph/NROG_Image.png",
+ "url": "https://newrelic.com/termsandconditions/terms",
+ "published_at": "2020-08-18T02:00:39Z",
+ "updated_at": "2020-07-30T07:25:28Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.059077285,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Terms of Service Agreement | New Relic",
+ "sections": "Terms of Service",
+ "body": " of concepts, New Relic Developer Edition or ‘lite’) basis are governed by the Terms of Service set forth immediately above. Community Forums Community Forum participants ask and answer questions about New Relic’s platform. Use of the Community Form is governed by the terms and conditions set forth"
+ },
+ "id": "5ac68e78c75d077fcb6edc38"
+ },
+ {
+ "body": "As a customer with a paid subscription to New Relic products, you are eligible to participate in preview access of the New Relic One platform (e.g. Telemetry Data Platform, Full Stack Observability, and Applied Intelligence products) for the period beginning July 31, 2020 and ending December 31, 2020 (“Preview Access”). BY DOWNLOADING, ACCESSING, INDICATING YOUR AGREEMENT TO, OR USING THE PREVIEW ACCESS PRODUCTS, YOU AGREE THAT YOUR PREVIEW ACCESS USAGE IS PURSUANT TO THESE SEPARATE TERMS AND CONDITIONS IN LIEU OF ANY OTHER TERMS. These terms do not have to be signed in order to be binding. If you do not agree to these terms and conditions, your sole remedy is to not participate in Preview Access. New Relic reserves the right to terminate or restrict Preview Access, in whole or in part, at any time. Notwithstanding the foregoing and any other materials provided by New Relic, select customers are ineligible for the Preview Access. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Licenses / Product or service licenses / New Relic One",
+ "info": "",
+ "nodeid": 39366,
+ "sections": [
+ "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",
+ "popularity": 1,
+ "external_id": "eae3865081d3bd8ad2dd8b6eaf0fe0147355360c",
+ "category_1": "Product or service licenses",
+ "category_2": "New Relic One",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/licenses/product-or-service-licenses/new-relic-one/preview-access-new-relic-one",
+ "published_at": "2020-08-18T11:19:02Z",
+ "updated_at": "2020-07-31T04:41:27Z",
+ "category_0": "Licenses",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.050509326,
+ "_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"
+ },
+ {
+ "body": "New Relic Open Source External Projects Highlighted Projects New Relic Projects Menu External Projects Highlighted Projects New Relic Projects NEW RELIC, INC. INDIVIDUAL CONTRIBUTOR LICENSE AGREEMENT Thank you for your interest in contributing to the open source projects of New Relic, Inc. (“New Relic”). In order to clarify the intellectual property license granted with Contributions from any person or entity, New Relic must have a Contributor License Agreement (\"Agreement\") on file that has been signed by each Contributor, indicating agreement to the license terms below. This Agreement is for your protection as a Contributor as well as the protection of New Relic; it does not change your rights to use your own Contributions for any other purpose. You accept and agree to the following terms and conditions for Your present and future Contributions submitted to New Relic. Except for the licenses granted herein to New Relic and recipients of software distributed by New Relic, You reserve all right, title, and interest in and to Your Contributions. Definitions. \"You\" (or \"Your\") shall mean the copyright owner or legal entity authorized by the copyright owner that is entering into this Agreement with New Relic. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. \"Contribution\" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to New Relic for inclusion in, or documentation of, any of the products managed or maintained by New Relic (the \"Work\"). For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to New Relic or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, New Relic for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as \"Not a Contribution.\" Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to New Relic and to recipients of software distributed by New Relic a perpetual, worldwide, non-exclusive, no-charge, royalty-free, transferable, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to New Relic and to recipients of software distributed by New Relic a perpetual, worldwide, non-exclusive, no-charge, royalty-free, transferable, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contributions alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that Your Contribution, or the Work to which You have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed. You represent that You are legally entitled to grant the above licenses. If Your employer(s) has rights to intellectual property that You create that includes Your Contributions, You represent that You have received permission to make Contributions on behalf of that employer, that Your employer has waived such rights for Your Contributions to New Relic, or that Your employer has executed a separate Agreement with New Relic. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which You are personally aware and which are associated with any part of Your Contributions. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. Should You wish to submit work that is not Your original creation, You may submit it to New Relic separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which You are personally aware, and conspicuously marking the work as \"Submitted on behalf of a third-party: [named here] \". You agree to notify New Relic of any facts or circumstances of which You become aware that would make these representations inaccurate in any respect. New Relic Open Source Standards External Projects Highlighted Projects New Relic Projects Edit this page Create an issue Copyright © 2020 New Relic Inc.Version 1.8.4",
+ "type": "opensource",
+ "document_type": "page",
+ "info": "",
+ "sections": [
+ "NEW RELIC, INC.",
+ "INDIVIDUAL CONTRIBUTOR LICENSE AGREEMENT",
+ "Definitions."
+ ],
+ "title": "New Relic Open Source Contributor License Agreement",
+ "popularity": 1,
+ "external_id": "478151b2a97835e82c3cd1eaa49610793dc56783",
+ "image": "",
+ "url": "https://opensource.newrelic.com/cla/",
+ "published_at": "2020-08-18T02:21:01Z",
+ "updated_at": "2020-08-13T01:57:04Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.04286772,
+ "_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"
+ },
+ "id": "5f31822264441fcbe056a984"
+ }
+ ],
+ "/collect-data/collect-data-from-any-source": [
+ {
+ "body": "Our Telemetry SDKs are an open source set of API client libraries that send metrics and trace data to the New Relic platform. We offer open-source integrations for telemetry tools like Prometheus, Istio, and OpenCensus that were created using our Telemetry SDKs. If those solutions (or our other integrations) don't meet your needs, you can use the Telemetry SDKs to create your own telemetry data solutions. Requirements and compatibility To build with the Telemetry SDKs, you will need an Event API insert key. New Relic has contributed the Telemetry SDK to the open source community under an Apache 2.0 license. Available libraries The Telemetry SDKs are open source software on GitHub. Use the language-specific GitHub links below to get library details, coding examples, and procedures for how to use the SDKs. We currently support the following libraries, with more to be created in the future: Language Library Supported data types Java Java library on GitHub New Relic Metrics New Relic Traces Node/TypeScript NodeJS library on GitHub New Relic Metrics New Relic Traces Python Python library on GitHub New Relic Metrics New Relic Events New Relic Traces Go Go library on Github New Relic Metrics New Relic Traces .NET .NET library on GitHub .NET package in NuGet New Relic Metrics New Relic Traces For more on the supported data types: Metrics: see the Metric API Traces: see the Trace API Write your own Telemetry SDK or contribute to an existing one If you need a Telemetry SDK in a language that does not currently exist or want to contribute to an existing library, please see the Telemetry SDK specifications. Integrations built with the Telemetry SDKs To see the integrations built using our Telemetry SDKs, see Open source telemetry integrations. For all monitoring solutions, see our integrations page. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs",
+ "info": "Report custom telemetry data with New Relic's open-source Telemetry SDKs.",
+ "nodeid": 35471,
+ "sections": [
+ "Ingest and manage data",
+ "Get started",
+ "Understand data",
+ "Manage data",
+ "Ingest APIs",
+ "Telemetry SDKs: Report custom telemetry data",
+ "Requirements and compatibility",
+ "Available libraries",
+ "Write your own Telemetry SDK or contribute to an existing one",
+ "Integrations built with the Telemetry SDKs",
+ "For more help"
+ ],
+ "title": "Telemetry SDKs: Report custom telemetry data",
+ "popularity": 1,
+ "external_id": "47a4c8f38c1b1674504ea302d865fd499e90ea39",
+ "category_1": "Ingest and manage data",
+ "category_2": "Ingest APIs",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/telemetry-data-platform/get-started/capabilities/telemetry-sdks-send-custom-telemetry-data-new-relic",
+ "published_at": "2020-08-18T15:15:03Z",
+ "updated_at": "2020-08-11T01:15:34Z",
+ "category_0": "Telemetry Data Platform",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.16237712,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Telemetry SDKs : Report custom telemetry data",
+ "sections": "Telemetry SDKs : Report custom telemetry data",
+ "info": "Report custom telemetry data with New Relic's open-source Telemetry SDKs .",
+ "category_0": "Telemetry Data Platform",
+ "category_2": "Ingest APIs ",
+ "body": " Metrics New Relic Traces .NET .NET library on GitHub .NET package in NuGet New Relic Metrics New Relic Traces For more on the supported data types: Metrics: see the Metric API Traces: see the Trace API Write your own Telemetry SDK or contribute to an existing one If you need a Telemetry SDK ",
+ "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs"
+ },
+ "id": "5d89fefbe7b9d2537ed30dc1"
+ },
+ {
+ "body": "There are many ways to get data into your New Relic account. Any New Relic user can use any of our data ingest methods to report data to our Telemetry Data Platform. New Relic-built agents and integrations When you enable New Relic solutions like APM, browser monitoring, mobile monitoring, infrastructure monitoring, or any of our wide array of integrations, by default you'll receive data from your monitored applications, hosts, services, or other entities. To browse all New Relic-built tools and solutions, see New Relic integrations. Agent APIs Some of our monitoring solutions come with APIs and/or SDKs that allow you to customize the data reported and how it reports. For more information, see the relevant product: APM agent APIs Browser API Mobile API Infrastructure monitoring: the Flex integration tool Telemetry SDKs If our more curated solutions don't work for you, our open source Telemetry SDKs let you build your own solution. These SDKs are language wrappers for our data-ingest APIs (below) that let you send telemetry data to New Relic without requiring install of an agent. APIs for sending metrics, traces, logs, and events If our more curated solutions don't work for you, we also have data-ingest APIs: Trace API Event API Metric API Log API To learn about the differences between these data types, see Data types. New Relic One applications You can build entirely custom applications that reside in New Relic One and make use of any data you want. You can use existing open source New Relic One apps, or share your own with the open source community. For details, see New Relic One applications. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Get started",
+ "info": "An introduction to how to get data into New Relic. ",
+ "nodeid": 36051,
+ "sections": [
+ "Ingest and manage data",
+ "Get started",
+ "Understand data",
+ "Manage data",
+ "Ingest APIs",
+ "Get data into New Relic",
+ "New Relic-built agents and integrations",
+ "Agent APIs",
+ "Telemetry SDKs",
+ "APIs for sending metrics, traces, logs, and events",
+ "New Relic One applications",
+ "For more help"
+ ],
+ "title": "Get data into New Relic",
+ "popularity": 1,
+ "external_id": "7a413b4d7e5bd81088a08507ae4bad64c7e24b2d",
+ "category_1": "Ingest and manage data",
+ "category_2": "Get started",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/telemetry-data-platform/get-data-new-relic/getting-started/introduction-new-relic-data-ingest-apis-sdks",
+ "published_at": "2020-08-18T15:33:40Z",
+ "updated_at": "2020-08-10T23:16:39Z",
+ "category_0": "Telemetry Data Platform",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.148056,
+ "_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"
+ },
+ "id": "5f24aa60196a67ede394f5f3"
+ },
+ {
+ "body": "New Relic products report a variety of default event data to your account. This document will explain how to report your own custom events and attributes. Overview of reporting custom events and attributes Event data is one of the fundamental New Relic data types. Events are reported by most New Relic products, and we give you several options for reporting your own custom events. Reporting custom events allows you to create more useful and customized queries and charts of your data, and is a key part of optimizing how New Relic works for you. Before beginning, it's important to know that reporting a large number of custom events and/or attributes can cause degraded query performance, or cause you to approach or pass data collection rate limits. For optimal performance, first think about what data you want to analyze, and then create only the events and/or attributes necessary to meet these specific goals. Be aware of the following data and subscription requirements for inserting and accessing custom data: Ensure you follow limits and requirements around event/attribute data types, naming syntax, and size. The amount of data you have access to over time depends on your data retention policy. Send custom events and attributes Methods for sending custom events and attributes include: Source How to send custom data APM agent Use APM agent APIs to report custom events and custom attributes. Browser agent Add custom attributes to the PageView event via the Browser API call addCustomAttribute. Send PageAction event and attributes via Browser API. Forward APM agent custom attributes to PageView event. Event API To report custom events not associated with other New Relic products, use the Event API. Infrastructure Add custom attributes to default Infrastructure events. Use the Flex integration tool to report your own custom event data. Mobile agent Use the mobile agent API to send custom events and attributes. Synthetics Add custom attributes to the SyntheticCheck event via the $util.insights tools. For ways to report other types of custom data, see: Metric API Logs Trace API Extend data retention To learn about how to extend how long events are retained in your account, see Event data retention. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Insights / Event data sources / Custom events",
+ "info": "An overview of the options for sending custom event data to New Relic. ",
+ "nodeid": 13806,
+ "sections": [
+ "Event data sources",
+ "Default events",
+ "Custom events",
+ "Report custom event data",
+ "Overview of reporting custom events and attributes",
+ "Send custom events and attributes",
+ "Extend data retention",
+ "For more help"
+ ],
+ "title": "Report custom event data",
+ "popularity": 1,
+ "external_id": "afb5f5a81ae06b22935d98c470ed9cabd7c9da6b",
+ "category_1": "Event data sources",
+ "category_2": "Custom events",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/report-custom-event-data",
+ "published_at": "2020-08-18T07:15:53Z",
+ "updated_at": "2020-07-26T05:52:23Z",
+ "category_0": "Insights",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.12379804,
+ "_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"
+ },
+ "id": "5e8e7f9de7b9d2aa122cf0f6"
+ },
+ {
+ "body": "New Relic offers a variety of APIs and SDKs you can use to: Retrieve data from New Relic. Send data to New Relic. Adjust settings. This section of the docs provides examples and reference documentation for our API endpoints. For developer-focused content on how to use and customize New Relic, see developer.newrelic.com. NerdGraph (GraphQL) NerdGraph is New Relic's GraphQL API, an efficient and flexible query language that lets you request exactly the data you need, without over-fetching or under-fetching. While typical REST APIs require loading from multiple URLs, NerdGraph calls get all the data you need in a single request. NerdGraph also makes it easier to evolve APIs over time and enables powerful developer tools. New Relic provides a powerful GraphQL tool to explore the API with embedded schema definitions. To get started, go to api.newrelic.com/graphiql. For sample queries and mutations, use our NerdGraph tutorials. REST APIs by capability New Relic capabilities, like APM, infrastructure monitoring, or alerts, are often used together, and sometimes they overlap in functionality. This is why multiple APIs may be relevant to each area. Some API functionality will depend on your access to features and data. To learn more about different API key types, see Understand New Relic API keys. Alerts Use the REST API for alerts and the API Explorer to: Create and manage policies, conditions, and notification channels. Create alert conditions based on NRQL queries. Create alert conditions based on data from other New Relic capabilities. APM API resources for application monitoring include: Resource Details REST API REST API features include: Retrieve APM data, including metrics, Apdex, error rates, and host data. Report deployments. Change the app name in the UI. Agent APIs Every APM language agent has an API that lets you customize the agent's default behavior, including reporting custom data. APM agent APIs include: C SDK API Go agent API Java agent API .NET agent API Node.js agent API PHP agent API Python agent API Ruby agent API Query API To query APM data, use the Query API. Account management APIs For APIs related to accounts and subscription usage, see the account-related APIs. Browser monitoring The Browser API resources include: Resource Details Browser agent API Use the Browser agent API for tasks such as: Report custom end user data to browser monitoring. Monitor asynchronous browser activity using SPA API calls. Insert custom data into New Relic dashboards . Manage source maps. REST API With the REST API you can: Retrieve page load timing data and throughput. Add or list apps monitored by browser monitoring. Manage alerts conditions for your browser data. Query API To retrieve browser monitoring data, use the Query API. Account management APIs For APIs related to accounts and subscription usage, see the account-related APIs. Infrastructure monitoring The Infrastructure API resources include: Resource Details Query API To retrieve infrastructure data, use the Query API. This API can also be used to retrieve subscription usage data. Infrastructure alert API To manage your infrastructure alerts, use the Infrastructure alert API. Integrations SDK To make your own custom integrations for reporting data to infrastructure monitoring, use the Integrations SDK. NerdGraph You can use NerdGraph (our GraphQL API) to query your cloud integration data and make changes to cloud integration settings. Mobile monitoring Mobile API resources include: Resource Details Mobile agent APIs Mobile APIs let you custom instrument your own code and send events to New Relic. See the platform-specific documentation: iOS Android Unity REST API Use the REST API for such tasks as: Retrieve a list of monitored apps. Get subscription usage data. Get metric names and data. Get crash count and crash rate data. Manage New Relic alerts conditions for your mobile apps. Query API To retrieve Mobile data from New Relic, use the Query API. Account management APIs For account-related APIs, see Account APIs. Synthetic monitoring Synthetics API resources include: Resource Details Synthetics REST API The Synthetics REST API functionality includes: Create and manage synthetics monitors. Manage synthetics alert notifications. Add labels to monitors, and retrieve monitors with specific labels. Query API To retrieve synthetics event data, use the Query API. Alerts API To create and manage alert conditions that target synthetics monitors, use the Alerts API. Telemetry APIs for core data types We offer several APIs that allow you to get our core data types (metrics, logs, traces, and events) into New Relic without the use of an installed agent. Data type Description Trace API Send distributed tracing data to New Relic. Event API Send event data to New Relic. Metric API Send metrics to New Relic from any source (including other telemetry monitoring services). Log API Send your log data to New Relic. Account management, admin, and usage APIs Like any other New Relic product or service, you want to be confident that your APIs protect you and your customers' data privacy. The following are API resources related to New Relic account administration and usage. For more information about API capabilities, see the specific New Relic API. For more information about New Relic's security measures, see our security and privacy documentation, or visit the New Relic security website. Resource Details REST API REST API features include: Find your API keys, account ID, and information needed to use the REST API. Return a list of account users. Get SLA report data for browser and application monitoring. Subscription usage You can use the Query API to retrieve subscription usage data. This can be helpful to see how usage compares to your current subscription level, or for doing departmental chargebacks. If you implemented the REST API for querying subscription usage data prior to July 10, 2018, those usage-related REST APIs are now deprecated. You should use the Query API, which requires creating an API key. For more on switching to the new API format, see the transition guide. Partner API To retrieve information about your New Relic partner account, sub-accounts, and users, use the Partner API. Other APIs Insights API resources for Insights include: Resource Details Insert events API To report custom data use the Event insertion API. Query API To query your Insights data using NRQL-formatted queries, use the Query API. This API can also be used to retrieve subscription usage data. Dashboard API To create, read, update, and delete dashboards, use the Dashboard API. Other New Relic product APIs You can also report custom data from other New Relic features. For more information, see the API sections for other products. NerdGraph You can use NerdGraph (our GraphQL API) to query data with NRQL. Plugins Use the REST API for New Relic plugins and the API Explorer to: Get a list of plugins, including their names, IDs, and GUIDs. List one or more plugin components, their output, and their metric timeslice data. Developers and New Relic partners can also use New Relic's Plugin API to write an agent in any language that can work directly with the API for plugins. This allows you to send your own metric data to our plugins and view data received from the API in New Relic. See APIs in action For more on how you as a developer can optimize your ability to solve problems using New Relic, go to developer.newrelic.com. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / APIs / Get started / Intro to APIs",
+ "info": "An introduction to all of the available New Relic APIs. ",
+ "nodeid": 15691,
+ "sections": [
+ "Get started",
+ "Intro to APIs",
+ "Introduction to New Relic APIs",
+ "NerdGraph (GraphQL)",
+ "REST APIs by capability",
+ "Telemetry APIs for core data types",
+ "Account management, admin, and usage APIs",
+ "Other APIs",
+ "See APIs in action",
+ "For more help"
+ ],
+ "title": "Introduction to New Relic APIs",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/apis/get-started/intro-apis/introduction-new-relic-apis",
+ "popularity": 1,
+ "external_id": "bb3a7314b2407cfa765425553484cb364e27e7e3",
+ "category_1": "Get started",
+ "category_2": "Intro to APIs",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/apis/get-started/intro-apis/introduction-new-relic-apis",
+ "published_at": "2020-08-18T02:45:47Z",
+ "updated_at": "2020-08-10T01:40:52Z",
+ "category_0": "APIs",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.10374672,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Introduction to New Relic APIs ",
+ "sections": "Telemetry APIs for core data types",
+ "info": "An introduction to all of the available New Relic APIs . ",
+ "category_0": "APIs ",
+ "category_2": "Intro to APIs ",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/apis /get-started/intro-apis /introduction-new-relic-apis ",
+ "body": ". Telemetry APIs for core data types We offer several APIs that allow you to get our core data types (metrics, logs, traces, and events) into New Relic without the use of an installed agent . Data type Description Trace API Send distributed tracing data to New Relic. Event API Send event data to New"
+ },
+ "id": "5d4ae71be7b9d211b4d535a4"
+ },
+ {
+ "body": "New Relic offers several tools to help obtain the information needed to provide useful metrics about your Node.js application. These include: Reading the route names (if used) from the Express and Restify routers Using the API to name the current request, either with simple names or groups of controllers with actions Support rules that are stored in your agent's configuration that can mark requests to be renamed or ignored based on regular expressions matched against the request's raw URLs (also available as API calls) The number of names that New Relic tracks needs to be small enough so that the user experience is robust. It also needs to be large enough to provide the right amount of information (without overwhelming you with data) so that you can identify problem spots in your applications more easily. For more information, see the Node.js agent configuration documentation and the Node.js agent API documentation on Github. Request names The Node.js agent captures the HTTP method along with a potentially parameterized path (such as /user/:id) or a regular expression (such as /^/user/([-0-9a-f]+)$/). These pieces of information become part of the request name. If you have support for slow transaction traces and have enabled capture_params in your config file, the transaction trace will also have the request's parameters and their values attached to it. If you are dissatisfied with the request names that the Node.js agent uses, you can use API calls to create more descriptive names. If grouping your requests under the generic name, then /* is sufficient, and you do not need to customize your configuration file or API calls. Requirements New Relic uses request names to group requests for many charts and tables. The value of these visualizations will drop as the number of different request names increases. For example, do not include potentially dynamic data like GUIDs, numerical IDs, or timestamps in the request names you create. If your request is slow enough to generate a transaction trace, that trace will contain the original URL. If you enable parameter capture, the parameters will also be attached to the trace. Avoid having more than 50 different transaction names. For example, if you have more than a couple hundred different request names, rethink your naming strategy. Avoid metric grouping issues The request naming API helps New Relic avoid problems with trying to handle too many metrics, which sometimes is referred to as \"metric explosion.\" New Relic has several strategies to deal with these issues; the most severe is simply to add offending applications to your deny list. The main reason for you to be careful in using these request-naming tools is to prevent that from happening to your applications. For more information, see Metric grouping issues. Guidelines Define your configuration rules from the most specific to the most general. The first rules listed in your config file or added with the Node.js transaction naming API will be applied first and should be narrowly targeted. More general \"fall-through\" rules should be added toward the end of the list, because they will be evaluated in the order they were configured or added using the Node.js transaction naming API. URL pattern matching An online retailer has a URL pattern like this: /user/customers/all/prospects /user/customers/all/current /user/customers/all/returning /user/customers/John /user/customers/Jane The retailer could create rules like this: // newrelic.js exports.config={ //other configuration rules:{ name:[ { pattern: \"/user/customers/all/prospects/\", name: \"/user/customers/all/prospects\" }, { pattern: \"/user/customers/all/.*\", name: \"/user/customers/all\" }, { pattern: \"/user/customers/.*\", name: \"/user/customers/:customer\" } ] } } With these rules, the retailer would create three transaction names: /user/customers/:customer /user/customers/all /user/customers/all/prospects If the retailer reversed the order, the rules would catch all transactions in :customer, which would not be as useful. Load the request naming API Make sure that loading the New Relic module is the first thing your application does, as it needs to bootstrap itself before the rest of your application loads: var newrelic = require('newrelic'); This returns the request naming API. You can safely require the module from multiple modules in your application, as it only initializes itself once. Request API calls Here is a summary of the Request API calls for New Relic's Node.js agent. newrelic.setTransactionName(name) Name the current request, following the request naming requirements. You can call this function anywhere within the context of an HTTP request handler, at any time after handling of the request has started, but before the request has finished. In general, if the request and response objects are in scope, you can set the name. Explicitly calling newrelic.setTransactionName() will override any names set by Express or Restify routes. Also, calls to newrelic.setTransactionName() and newrelic.setControllerName() will overwrite each other. The last one to run before the request ends wins. newrelic.setControllerName(name, [action]) Name the current request using a controller-style pattern, optionally including the current controller action. If the action is omitted, New Relic will include the HTTP method (GET, POST, etc.) as the action. The rules for when you can call newrelic.setControllerName() are the same as they are for newrelic.setTransactionName(), including the request naming requirements. Explicitly calling newrelic.setControllerName() will override any names set by Express or Restify routes. Also, calls to newrelic.setTransactionName() and newrelic.setControllerName() will overwrite each other. The last one to run before the request ends wins. Custom instrumentation API calls Use these API calls to expand your instrumentation with custom instrumentation. newrelic.instrument(moduleName, onRequire [, onError]) Sets an instrumentation callback for a specific module. The provided onRequire callback will be fired when the given module is loaded with require. The moduleName parameter should be the string that will be passed to require; for example, 'express' or 'amqplib/callback_api'. The optional onError callback is called if the onRequire parameters throws an error. This is useful for debugging your instrumentation. Use this method to: Add instrumentation for modules not currently instrumented by New Relic. Instrument your own code. Replace the Node.js agent's built-in instrumentation with your own. For more information, see New Relic's Node.js instrumentation tutorial on Github. newrelic.instrumentDatastore(moduleName, onRequire [, onError]) Sets an instrumentation callback for a datastore module. This method is just like newrelic.instrument(), except it provides a datastore-specialized shim. For more information, see New Relic's Node.js datastore instrumentation tutorial on Github. newrelic.instrumentLoadedModule(moduleName, moduleInstance) The instrumentLoadedModule method allows you to add stock instrumentation to specific modules in situations where it's impossible to have require('newrelic'); as the first line of your app's main module. // load the agent const newrelic = require('newrelic') // module loaded before newrelic const expressModule = require('express') // instrument express _after_ the agent has been loaded newrelic.instrumentLoadedModule( 'express', // the module's name, as a string expressModule // the module instance ); This method cannot instrument any arbitrary module. Its purpose is to add modules that were missed because the agent was not loaded as the first thing in your program. The instrumentLoadedModule method can only instrument modules the agent would normally instrument. You can see a list of these modules in the agent's lib/instrumentations module. newrelic.instrumentMessages(moduleName, onRequire [, onError]) Sets an instrumentation callback for a message service client module. This method is just like newrelic.instrument(), except it provides a message-service-specialized shim. For more information, see New Relic's Node.js message service instrumentation tutorial on Github. newrelic.instrumentWebframework(moduleName, onRequire [, onError]) Sets an instrumentation callback for a web framework module. This method is just like newrelic.instrument(), except it provides a web-framework-specialized shim. For more information, see New Relic's Node.js web framework instrumentation tutorial on Github. newrelic.startWebTransaction(url, handle) Instrument the specified web transaction. Using this API call, you can instrument transactions that New Relic does not automatically detect. The url defines the transaction name and needs to be static. Do not include variable data such as user ID. The handle defines the function you want to instrument. New Relic will capture any metrics that would be captured by auto-instrumentation, as well as manual instrumentation via startSegment(). You must handle custom transactions manually by calling newrelic.getTransaction() at the start of your transaction, and then call transaction.end() when you are finished. New Relic begins timing the transaction when newrelic.startWebTransaction() is called and ends the transaction when transaction.end() is called. You can also return a promise to indicate the end of the transaction. Please note that if this promise rejects, it does not automatically hook into New Relic’s error tracking. This needs to be done manually with noticeError(). newrelic.startBackgroundTransaction(name, [group], handle) Instrument the specified background transaction. Using this API call, you can expand New Relic's instrumentation to capture data from background transactions. The name defines the transaction name and needs to be static. Do not include variable data such as user ID. The group is optional, and it allows you to group similar jobs together via the transaction type in the user interface. Like name, the group needs to be static. The handle defines a function that includes the entire background job you want to instrument. New Relic will capture any metrics that would be captured by auto-instrumentation, as well as manual instrumentation via startSegment(). You must handle custom transactions manually by calling newrelic.getTransaction() at the start of your transaction, and then call transaction.end() when you are finished. New Relic begins timing the transaction when newrelic.startBackgroundTransaction() is called and ends the transaction when transaction.end() is called. You can also return a promise to indicate the end of the transaction. Please note that if this promise rejects, it does not automatically hook into New Relic’s error tracking. This needs to be done manually with noticeError(). newrelic.getTransaction() Returns a handle on the currently executing transaction. This handle can then be used to interact with a given transaction safely from any context. It is best used with newrelic.startWebTransaction() and newrelic.startBackgroundTransaction(). Please refer to the transaction handle section for more details. newrelic.endTransaction() End the current web or background custom transaction. This method requires being in the correct transaction context when called. This API call takes no arguments. newrelic.startSegment(name, record, handler, callback) Instrument a particular method to improve visibility into a transaction, or optionally turn it into a metric. The name defines a name for the segment. This name will be visible in transaction traces and as a new metric in the New Relic UI. The record flag defines whether the segment should be recorded as a metric. The handler is the function you want to track as a segment. The optional callback is a function passed to the handler to fire after its work is done. The agent begins timing the segment when startSegment is called. The segment is ended when either the handler finishes executing, or callback is fired, if it is provided. Custom metrics API calls Use these API calls to record additional arbitrary metrics: newrelic.recordMetric(name, value) Use recordMetric to record an event-based metric, usually associated with a particular duration. The name must be a string following standard metric naming rules. The value will usually be a number, but it can also be an object. When value is a numeric value, it should represent the magnitude of a measurement associated with an event; for example, the duration for a particular method call. When value is an object, it must contain count, total, min, max, and sumOfSquares keys, all with number values. This form is useful to aggregate metrics on your own and report them periodically; for example, from a setInterval. These values will be aggregated with any previously collected values for the same metric. The names of these keys match the names of the keys used by the platform API. newrelic.incrementMetric(name, [amount]) Use incrementMetric to update a metric that acts as a simple counter. The count of the selected metric will be incremented by the specified amount, defaulting to 1. Custom events API calls Use these API calls to record additional events: newrelic.recordCustomEvent(eventType, attributes) Use recordCustomEvent to record an event-based metric, usually associated with a particular duration. The eventType must be an alphanumeric string less than 255 characters. The attributes must be an object of key and value pairs. The keys must be shorter than 255 characters, and the values must be string, number, or boolean. Recording a custom event The following example demonstrates recording a custom event with multiple attributes. const attributes = { attribute1: 'value1', attribute2: 2 } newrelic.recordCustomEvent('MessagingEvent', attributes) Transaction handle methods This section details the methods provided by the TransactionHandle class instance that can be obtained through newrelic.getTransaction(). Use these methods to interact directly with the current transaction: transactionHandle.end([callback]) Use transactionHandle.end to end the transaction referenced by the handle instance. The callback is invoked when the transaction has fully ended. The finished transaction passed to the callback as the first argument. transactionHandle.ignore() Use transactionHandle.ignore to ignore the transaction referenced by the handle instance. transactionHandle.insertDistributedTraceHeaders(headers) This API requires distributed tracing to be enabled. For context on how to use this call and its partner call acceptDistributedTraceHeaders, first read Enable distributed tracing with agent APIs. transactionHandle.insertDistributedTraceHeaders is used to implement distributed tracing. It modifies the headers map that is passed in by adding W3C Trace Context headers and New Relic Distributed Trace headers. The New Relic headers can be disabled with distributed_tracing.exclude_newrelic_header: true in the config. This method replaces the deprecated createDistributedTracePayload method, which only creates New Relic Distributed Trace payloads. Generating distributed trace headers In the following example, by calling insertDistributedTraceHeaders with an empty object, the appropriate Distributed Trace headers and W3C Trace Context headers will be generated for the transaction. // Call newrelic.getTransaction to retrieve a handle on the current transaction. const transactionHandle = newrelic.getTransaction() // This could be a header object from an incoming request as well const headersObject = {} newrelic.startBackgroundTransaction('background task', function executeTransaction() { const transaction = newrelic.getTransaction() // generate the headers transaction.insertDistributedTraceHeaders(headersObject) }) transactionHandle.acceptDistributedTraceHeaders(transportType, headers) This API requires distributed tracing to be enabled. For context on how to use this call and its partner call insertDistributedTraceHeaders, first read Enable distributed tracing with agent APIs. transactionHandle.acceptDistributedTraceHeaders is used to instrument the called service for inclusion in a distributed trace. It links the spans in a trace by accepting a payload generated by insertDistributedTraceHeaders or generated by some other W3C Trace Context compliant tracer. This method accepts the headers of an incoming request, looks for W3C Trace Context headers, and if not found, falls back to New Relic distributed trace headers. This method replaces the deprecated acceptDistributedTracePayload method, which only handles New Relic distributed trace payloads. transportType should be one of the following strings: AMQP HTTP HTTPS IronMQ JMS Kafka Other Queue Unknown headers should be an object containing all the headers in the incoming request. The keys must be lowercase. Accept incoming distributed trace headers The following example demonstrates adding distributed trace headers retrieved from a Kafka message. In this example, we assume that the incoming Kafka message has Distributed Trace headers inserted. // incoming Kafka message headers const headersObject = message.headers // Call newrelic.getTransaction to retrieve a handle on the current transaction. const transactionHandle = newrelic.getTransaction() newrelic.startBackgroundTransaction('background task', function executeTransaction() { const transaction = newrelic.getTransaction() // accept the headers transaction.acceptDistributedTraceHeaders('Kafka', headersObject) }) transactionHandle.createDistributedTracePayload() This method is deprecated and will be fully removed in the next major release! Please use insertDistributedTraceHeaders This API requires distributed tracing to be enabled. For instructions on how to use this call, along with its partner call acceptDistributedTracePayload, see Enable distributed tracing with agent APIs. This call is used to implement distributed tracing. It generates a payload that is read by the receiving application with acceptDistributedTracePayload. Note: In order to maintain proper ordering of spans in a trace, you must generate the payload in the context of the span that sends it. The DistributedTracePayload object has two available methods used for generating the payload in different formats: DistributedTracePayload#text: returns a JSON representation of the payload. Link a nested background transaction // Call newrelic.getTransaction to retrieve a handle on the current transaction. var transactionHandle = newrelic.getTransaction() var payload = transactionHandle.createDistributedTracePayload() var jsonPayload = payload.text() newrelic.startBackgroundTransaction('background task', function executeTransaction() { var backgroundHandle = newrelic.getTransaction() // Link the nested transaction by accepting the payload with the background transaction's handle backgroundHandle.acceptDistributedTracePayload(jsonPayload) }) DistributedTracePayload#httpSafe: returns a base64 encoded JSON representation of the payload. Place payload on an outgoing request // Call newrelic.getTransaction to retrieve a handle on the current transaction. var transactionHandle = newrelic.getTransaction() var payload = transactionHandle.createDistributedTracePayload() // Place the base64 encoded value on an outbound request header. req.headers[myTracingHeader] = payload.httpSafe() transactionHandle.acceptDistributedTracePayload(payload) This method is deprecated and will be fully removed in the next major release! Please use acceptDistributedTraceHeaders This API requires distributed tracing to be enabled. For context on how to use this call and its partner call createDistributedTracePayload, first read Enable distributed tracing with agent APIs. transactionHandle.acceptDistributedTracePayload is used to instrument the called service for inclusion in a distributed trace. It links the spans in a trace by accepting the payload generated by createDistributedTracePayload. transactionHandle.isSampled() Returns whether this trace is being sampled. Other API calls New Relic's Node.js agent includes additional API calls. newrelic.addCustomAttribute(name, value) Set a custom attribute value to be displayed along with the transaction trace in the New Relic UI. This must be called within the context of a transaction so it has a place to set the custom attributes. Custom attributes will appear in New Relic APM's transaction trace detail view and in errors for the transaction. Add custom attribute newrelic.addCustomAttribute('attribute1', 'value1') If you want to use your custom attributes, avoid using any of the reserved terms used by NRQL when naming them. newrelic.addCustomAttributes(attributes) Set multiple custom attribute values to be displayed along with the transaction trace in the New Relic UI. The attributes should be passed as a single object. This must be called within the context of a transaction so it has a place to set the custom attributes. Custom attributes will appear in the transaction trace detail view and in errors for the transaction. Adding custom attributes const attributes = { attribute1: 'value1', attribute2: 2 } newrelic.addCustomAttributes(attributes) If you want to use your custom attributes, avoid using any of the reserved terms used by NRQL when naming them. newrelic.addCustomSpanAttribute(name, value) Set a custom span attribute value to be displayed along with a transaction trace span in the New Relic UI. This must be called within the context of an active segment/span so it has a place to set the custom span attributes. Custom span attributes will appear in the Attributes section of the span detail view. Add custom span attribute newrelic.addCustomSpanAttribute('attribute1', 'value') This API requires distributed tracing and span events to be enabled. If you want to use your custom span attributes, avoid using any of the reserved terms used by NRQL when naming them. newrelic.addCustomSpanAttributes(attributes) Set multiple custom span attribute values to be displayed along with the transaction trace spans in the New Relic UI. The attributes should be passed as a single object. This must be called within the context of an active segment/span so it has a place to set the custom span attributes. Custom span attributes will appear in the Attributes section of the span detail view. Add custom span attributes const attributes = { attribute1: 'value1', attribute2: 'value2' } newrelic.addCustomSpanAttributes(attributes) This API requires distributed tracing and span events to be enabled. If you want to use your custom span attributes, avoid using any of the reserved terms used by NRQL when naming them. newrelic.getBrowserTimingHeader() Returns the HTML snippet to be inserted into the header of HTML pages to enable New Relic Browser. The HTML will instruct the browser to fetch a small JavaScript file and start the page timer. newrelic.setIgnoreTransaction(ignored) Tell the module whether or not to ignore a given request. This allows you to explicitly filter long-polling, irrelevant routes or requests you know will be time-consuming. This also allows you to gather metrics for requests that otherwise would be ignored. To ignore the transaction, set the parameter to true will ignore the transaction. To prevent a transaction from being ignored with this function, pass the parameter false. Passing null or undefined will not change whether the transaction is ignored. newrelic.noticeError(error, [customParameters]) Use this call if your app is doing its own error handling with domains or try/catch clauses, but you want all of the information about how many errors are coming out of the app to be centrally managed. Unlike other Node.js calls, this can be used outside of route handlers, but it will have additional context if called from within transaction scope. Errors recorded using this method do not obey the ignore_status_codes configuration value. newrelic.shutdown([options], callback) Use this method to gracefully shut down the agent. options options.collectPendingData - type boolean - Tell the agent whether to send any pending data to the New Relic collector before shutting down. options.timeout - type number (ms) - The default time before forcing a shutdown. When collectPendingData is true, the agent will wait for a connection before shutting down. This timeout is useful for short lived processes, like AWS Lambda, in order to keep the process from staying open too long, while trying to connect. Example: newrelic.shutdown({collectPendingData: true, timeout: 3000}, (error) => { process.exit() }) newrelic.getLinkingMetadata() Returns key/value pairs which can be used to link traces or entities. It will only contain items with meaningful values. For instance, if distributed tracing is disabled, trace.id will not be included. newrelic.getTraceMetadata() Returns and object containing the current trace ID and span ID. This API requires distributed tracing to be enabled or an empty object will be returned. Rules for naming and ignoring requests If you do not want to put calls to the New Relic module directly into your application code, you can use pattern-based rules to name requests. There are two sets of rules: one for renaming requests, and one to mark requests to be ignored by New Relic's instrumentation. Here is the structure for rules in New Relic's Node.js agent. rules.name A list of rules of the format {pattern : \"pattern\", name : \"name\"} for matching incoming request URLs to pattern and naming the matching New Relic transaction's name. This acts as a regex replace, where you can set the pattern either as a string, or as a JavaScript regular expression literal, and both pattern and name are required. When passing a regex as a string, escape backslashes, as the agent does not keep them when given as a string in a pattern. Define your configuration rules from the most specific to the most general, as the patterns will be evaluated in order and are terminal in nature. For more information, see the naming guidelines. This can also be set with the environment variable NEW_RELIC_NAMING_RULES, with multiple rules passed in as a list of comma-delimited JSON object literals: NEW_RELIC_NAMING_RULES='{\"pattern\":\"^t\",\"name\":\"u\"},{\"pattern\":\"^u\",\"name\":\"t\"}' Optional rules attributes Additional optional attributes are available: Optional rules attributes Description terminate_chain Default: true When set to true (default), no further rules will be evaluated if this rule is a match. Setting this to false is useful when multiple rules should be used together. For example, one rule could be replacing a common pattern in many different URLs, while subsequent rule(s) would be more specific. replace_all Default: false When set to true, all matches of the pattern will be replaced. Otherwise, only the first match will be replaced. Using the g flag with regular expression literal will have the same effect. For example: pattern: '[0-9]+', replace_all: true This has the same effect as pattern: /[0-9]+/g. precedence By default the rules are evaluated in order, from first to last. If you prefer to have complete control over the order, you can give each rule a precedence attribute. The precedence is an integer number, and rules are evaluated in ascending order. If precedence is not explicitly defined, it will be set to 500 by default. Additional attributes are ignored. Testing your naming rules The Node.js agent comes with a command-line tool for testing naming rules. For more information, run the following command in terminal window in a directory where your app is installed: node node_modules/.bin/newrelic-naming-rules Naming rule examples Here are some examples of naming rules and the results. Match full URL pattern: \"^/items/[0-9]+$\", name: \"/items/:id\" will result in: /items/123 => /items/:id /orders/123 => /orders/123 (not replaced since the rule is a full match) Replace first match in URL pattern: \"[0-9]+\", name: \":id\" will result in: /orders/123 => /orders/:id /items/123 => /items/:id /orders/123/items/123 => /orders/:id/items/123 Replace all matches in any URL pattern: \"[0-9]+\", name: \":id\", replace_all: true will result in: /orders/123/items/123 => /orders/:id/items/:id Match group references Using regular expression match group references: pattern: '^/(items|orders)/[0-9]+$', name: '/\\\\1/:id' will result in: /orders/123 => /orders/:id /items/123 => /items/:id rules.ignore This can also be set via the environment variable NEW_RELIC_IGNORING_RULES, with multiple rules passed in as a list of comma-delimited patterns. Currently there is no way to escape commas in patterns. NEW_RELIC_IGNORING_RULES='^/socket\\.io/\\*/xhr-polling,ignore_me' Here are full examples of how rules are included in the configuration file: Naming rule example // newrelic.js exports.config = { // other configuration rules : { name : [ { pattern: \"/tables/name-here\", name: \"/name-hererule1\" } ] } Ignoring rule example If you are using socket.io, you will have a use case for ignoring rules right out of the box. To keep socket.io long-polling from dominating your response-time metrics and affecting the Apdex metrics for your application, add a rule such as: // newrelic.js exports.config = { // other configuration rules : { ignore : [ '^\\/socket\\.io\\/.*\\/xhr-polling' ] } }; API calls for rules Here are the API calls for naming and ignoring rules with New Relic's Node.js agent. newrelic.addNamingRule(pattern, name) Programmatic version of rules.name. Once naming rules are added, they cannot be removed until the Node process is restarted. They can also be added via the Node.js agent's configuration. Both parameters are required. newrelic.addIgnoringRule(pattern) Programmatic version of rules.ignore. Once ignoring rules are added, they cannot be removed until the Node process is restarted. They can also be added via the Node.js agent's configuration. This parameter is required. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / APM agents / Node.js agent / API guides",
+ "info": "How to use the Node.js API to name, rename, and ignore requests, and to read router names with New Relic's Node.js agent.",
+ "nodeid": 1596,
+ "sections": [
+ "Node.js agent",
+ "Getting started",
+ "Installation and configuration",
+ "Supported features",
+ "Attributes",
+ "API guides",
+ "Hosting services",
+ "Troubleshooting",
+ "Node.js agent API",
+ "Request names",
+ "Requirements",
+ "Avoid metric grouping issues",
+ "Guidelines",
+ "Load the request naming API",
+ "Request API calls",
+ "Custom instrumentation API calls",
+ "Custom metrics API calls",
+ "Custom events API calls",
+ "Transaction handle methods",
+ "Other API calls",
+ "Rules for naming and ignoring requests",
+ "Optional rules attributes",
+ "Testing your naming rules",
+ "Naming rule examples",
+ "API calls for rules",
+ "For more help"
+ ],
+ "title": "Node.js agent API",
+ "popularity": 1,
+ "external_id": "fb49a4025c716c56046403d960b0802bc7485af2",
+ "category_1": "Node.js agent",
+ "category_2": "API guides",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/agents/nodejs-agent/api-guides/nodejs-agent-api",
+ "published_at": "2020-08-18T08:18:21Z",
+ "updated_at": "2020-08-18T08:18:21Z",
+ "category_0": "APM agents",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.10157165,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Node.js agent API ",
+ "sections": "Node.js agent API ",
+ "info": "How to use the Node.js API to name, rename, and ignore requests, and to read router names with New Relic's Node.js agent .",
+ "category_0": "APM agents ",
+ "category_1": "Node.js agent ",
+ "category_2": "API guides",
+ "body": " for slow transaction traces and have enabled capture_params in your config file, the transaction trace will also have the request's parameters and their values attached to it. If you are dissatisfied with the request names that the Node.js agent uses, you can use API calls to create more",
+ "breadcrumb": "Contents / APM agents / Node.js agent / API guides"
+ },
+ "id": "540a92a2c75d073d3d0006f7"
+ }
+ ],
+ "/collect-data/custom-events": [
+ {
+ "body": "Collect data from any source 15 min New Relic products report a lot of data “out of the box.” When you use products like APM, Browser, Mobile, Infrastructure monitoring, or an integration, by default you receive performance data. But you may want to bring data into New Relic that isn't collected by default. Maybe you want an API-based solution that doesn't require install of an agent. Maybe you want to bring telemetry data from another analysis service into New Relic. This page describes several ways to get data into New Relic. Step 1 of 6 Agent APIs If you use our APM, Browser, or Mobile agents to report data, you can use their associated APIs to report custom data. For example, if you monitor your application with the our APM Python agent, you can use the Python agent API to set up custom instrumentation. See the agent APIs. Step 2 of 6 Telemetry SDK Our Telemetry SDKs are language wrappers for our Trace API and Metric API (and eventually our Log API and Event API). These SDKs let you easily send metrics and trace data to New Relic without needing to install an agent. For customers, we offer open-source exporters and integrations that use the Telemetry SDKs to send metrics and trace data: Istio adaptor Prometheus OpenMetrics (for Docker | for Kubernetes) OpenCensus exporter (for Go | for Python) DropWizard exporter Micrometer exporter Want to build your own solution? See our Telemetry SDK docs. Step 3 of 6 Trace API Our Trace API lets you send distributed tracing data to New Relic and consolidate tracing data from multiple sources in one place. We accept trace data in two formats: Zipkin format New Relic format (if you don’t have Zipkin-format data, you’d use this) 1 curl -i -X POST https://trace-api.newrelic.com/trace/v1 \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"Api-Key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -H 'Data-Format: newrelic' \\ 5 -H 'Data-Format-Version: 1' \\ 6 -d '[ 7 { 8 \"common\": { 9 \"attributes\": { 10 \"service.name\": \"Test Service A\", 11 \"host\": \"host123.test.com\" 12 } 13 }, 14 \"spans\": [ 15 { 16 \"trace.id\": \"123456\", 17 \"id\": \"ABC\", 18 \"attributes\": { 19 \"duration.ms\": 12.53, 20 \"name\": \"/home\" 21 } 22 }, 23 { 24 \"trace.id\": \"123456\", 25 \"id\": \"DEF\", 26 \"attributes\": { 27 \"service.name\": \"Test Service A\", 28 \"host\": \"host456.test.com\", 29 \"duration.ms\": 2.97, 30 \"name\": \"/auth\", 31 \"parent.id\": \"ABC\" 32 } 33 } 34 ] 35 } 36 ]' Copy Step 4 of 6 Metric API You can use our Metric API to send metric data to New Relic from any source. 1 curl -i -X POST https://metric-api.newrelic.com/metric/v1 \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"Api-Key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -d '[ 5 { 6 \"metrics\": [ 7 { 8 \"name\": \"memory.heap\", 9 \"type\": \"gauge\", 10 \"value\": 2.3, 11 \"timestamp\": 1531414060739, 12 \"attributes\": { 13 \"host.name\": \"dev.server.com\" 14 } 15 } 16 ] 17 } 18 ]' Copy Step 5 of 6 Event API For sending arbitrary events to New Relic, you can use our Event API. We save these events as a new event type, which can then be queried via NRQL. (Eventually, the Telemetry SDKs will support the Event API.) 1 curl -i -X POST https://insights-collector.newrelic.com/v1/accounts/$ACCOUNT_ID/events \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"x-insert-key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -d '[ 5 { 6 \"eventType\": \"LoginEvent\", 7 \"service\": \"login-service\", 8 \"customerId\": \"xyz\" 9 } 10 ]' Copy Step 6 of 6 Log API If our existing logging integrations don’t meet your needs, you can use our Log API to send any arbitrary log data to New Relic. (Eventually, the Telemetry SDKs will support the Log API.) 1 curl -i -X POST https://log-api.newrelic.com/log/v1 \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"Api-Key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -d '[ 5 \"logs\": [ 6 { 7 \"timestamp\": 1593538496000, 8 \"message\": \"User xyz logged in\", 9 \"service\": \"login-service\", 10 \"hostname\": \"login.example.com\" 11 } 12 ] 13 ]' Copy",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Open source emitters. APIs. New Relic agents. Get data from anywhere. ",
+ "sections": [
+ "Collect data from any source",
+ "Agent APIs",
+ "Telemetry SDK",
+ "Trace API",
+ "Metric API",
+ "Event API",
+ "Log API"
+ ],
+ "title": "Collect data from any source",
+ "popularity": 1,
+ "tags": [
+ "Agent API",
+ "Telemetry SDK",
+ "Trace API",
+ "Metric API",
+ "Event API"
+ ],
+ "external_id": "5bfb043fffe42ea4a78d5a90bf8e92aa8b8f8c33",
+ "image": "",
+ "url": "https://developer.newrelic.com/collect-data/collect-data-from-any-source/",
+ "published_at": "2020-08-18T02:04:53Z",
+ "updated_at": "2020-08-14T01:45:09Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 8.521867,
+ "_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"
+ },
+ "id": "5efa997128ccbc3c9a307dfd"
+ },
+ {
+ "body": "New Relic products report a variety of default event data to your account. This document will explain how to report your own custom events and attributes. Overview of reporting custom events and attributes Event data is one of the fundamental New Relic data types. Events are reported by most New Relic products, and we give you several options for reporting your own custom events. Reporting custom events allows you to create more useful and customized queries and charts of your data, and is a key part of optimizing how New Relic works for you. Before beginning, it's important to know that reporting a large number of custom events and/or attributes can cause degraded query performance, or cause you to approach or pass data collection rate limits. For optimal performance, first think about what data you want to analyze, and then create only the events and/or attributes necessary to meet these specific goals. Be aware of the following data and subscription requirements for inserting and accessing custom data: Ensure you follow limits and requirements around event/attribute data types, naming syntax, and size. The amount of data you have access to over time depends on your data retention policy. Send custom events and attributes Methods for sending custom events and attributes include: Source How to send custom data APM agent Use APM agent APIs to report custom events and custom attributes. Browser agent Add custom attributes to the PageView event via the Browser API call addCustomAttribute. Send PageAction event and attributes via Browser API. Forward APM agent custom attributes to PageView event. Event API To report custom events not associated with other New Relic products, use the Event API. Infrastructure Add custom attributes to default Infrastructure events. Use the Flex integration tool to report your own custom event data. Mobile agent Use the mobile agent API to send custom events and attributes. Synthetics Add custom attributes to the SyntheticCheck event via the $util.insights tools. For ways to report other types of custom data, see: Metric API Logs Trace API Extend data retention To learn about how to extend how long events are retained in your account, see Event data retention. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Insights / Event data sources / Custom events",
+ "info": "An overview of the options for sending custom event data to New Relic. ",
+ "nodeid": 13806,
+ "sections": [
+ "Event data sources",
+ "Default events",
+ "Custom events",
+ "Report custom event data",
+ "Overview of reporting custom events and attributes",
+ "Send custom events and attributes",
+ "Extend data retention",
+ "For more help"
+ ],
+ "title": "Report custom event data",
+ "popularity": 1,
+ "external_id": "afb5f5a81ae06b22935d98c470ed9cabd7c9da6b",
+ "category_1": "Event data sources",
+ "category_2": "Custom events",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/report-custom-event-data",
+ "published_at": "2020-08-18T07:15:53Z",
+ "updated_at": "2020-07-26T05:52:23Z",
+ "category_0": "Insights",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.5126784,
+ "_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 "
+ },
+ "id": "5e8e7f9de7b9d2aa122cf0f6"
+ },
+ {
+ "body": "Custom events are useful to explore data for a single event you are interested in, including data from external sources, at a particular moment in time. To track arbitrary event data for apps monitored by your New Relic Go agent, add RecordCustomEvent to the apps. You can then query and visualize the event data. RecordCustomEvent parameters To add RecordCustomEvent to your Go app, use this format: RecordCustomEvent(eventType string, params map[string]interface{}) Parameter Description eventType string Required. The name of the event type to record. Must consist of alphanumeric characters, underscores _, or colons :. Must contain no more than 255 bytes. Must follow New Relic Insights data requirements for names, limits, and restricted characters. params map number, string, or boolean Required. Specify key/value pairs of attributes to annotate the event. Each value in the params map must be a number, string, or boolean. Keys must be less than 255 bytes. The params map must not contain more than 64 attributes. Example Here is an example of a custom event for a Go app: func customEvent(w http.ResponseWriter, r *http.Request) { io.WriteString(w, \"recording a custom event\") app.RecordCustomEvent(\"my_event_type\", map[string]interface{}{ \"myString\": \"hello\", \"myFloat\": 0.603, \"myInt\": 123, \"myBool\": true, }) } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / APM agents / Go agent / Features",
+ "info": "To track arbitrary event data in New Relic Insights for apps monitored by your New Relic Go agent, use RecordCustomEvent.",
+ "nodeid": 13766,
+ "sections": [
+ "Go agent",
+ "Get started",
+ "Installation",
+ "Configuration",
+ "Instrumentation",
+ "API guides",
+ "Features",
+ "Troubleshooting",
+ "Create custom events (Go)",
+ "RecordCustomEvent parameters",
+ "Example",
+ "For more help"
+ ],
+ "title": "Create custom events (Go)",
+ "popularity": 1,
+ "external_id": "b4d19e4ff9eee2b00a40c4add7119820a5f4d3dc",
+ "category_1": "Go agent",
+ "category_2": "Features",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/agents/go-agent/features/create-custom-events-go",
+ "published_at": "2020-08-18T03:19:16Z",
+ "updated_at": "2020-08-15T02:23:50Z",
+ "category_0": "APM agents",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.47695023,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Create custom events (Go)",
+ "sections": "Create custom events (Go)",
+ "info": "To track arbitrary event data in New Relic Insights for apps monitored by your New Relic Go agent , use RecordCustomEvent.",
+ "category_0": "APM agents ",
+ "category_1": "Go agent ",
+ "body": "Custom events are useful to explore data for a single event you are interested in, including data from external sources, at a particular moment in time. To track arbitrary event data for apps monitored by your New Relic Go agent , add RecordCustomEvent to the apps. You can then query and visualize",
+ "breadcrumb": "Contents / APM agents / Go agent / Features"
+ },
+ "id": "5f374736e7b9d2653b909280"
+ },
+ {
+ "body": "NewRelic.Api.Agent.NewRelic.RecordCustomEvent(string eventType, IEnumerable attributeValues) Records a custom event with the given name and attributes. Requirements Agent version 4.6.29.0 or higher. Compatible with all app types. Description Records a custom event with the given name and attributes, which you can query in the query builder. To verify if an event is being recorded correctly, look for the data in dashboards. For related API calls, see the .NET agent API guide. Sending a lot of events can increase the memory overhead of the agent. Additionally, posts greater than 1MB in size will not be recorded regardless of the maximum number of events. Custom Events are limited to 64-attributes. For more information about how custom attribute values are processed, see the custom attributes guide. Parameters Parameter Description eventType string Required. The name of the event type to record. Strings over 255 characters will result in the API call not being sent to New Relic. The name can only contain alphanumeric characters, underscores _, and colons :. For additional restrictions on event type names, see Reserved words. attributeValues IEnumerable Required. Specify key/value pairs of attributes to annotate the event. Example(s) Record values var eventAttributes = new Dictionary() { {\"foo\", \"bar\"}, {\"alice\", \"bob\"}, {\"age\", 32}, {\"height\",21.3f} }; NewRelic.Api.Agent.NewRelic.RecordCustomEvent(\"MyCustomEvent\", eventAttributes);",
+ "type": "docs",
+ "document_type": "api_doc",
+ "breadcrumb": "Contents » APM agents / .NET agent / .NET agent API",
+ "info": "New Relic .NET agent API call to report custom event data to New Relic.",
+ "nodeid": 11631,
+ "sections": [
+ ".NET agent",
+ "Getting started",
+ "Install",
+ "Azure installation",
+ "Other installation",
+ "Configuration",
+ "Other features",
+ "Custom instrumentation",
+ "API guides",
+ ".NET agent API",
+ "Attributes",
+ "Troubleshooting",
+ "Azure troubleshooting",
+ "RecordCustomEvent",
+ "Requirements",
+ "Description",
+ "Parameters",
+ "Example(s)",
+ "Record values",
+ "For more help"
+ ],
+ "title": "RecordCustomEvent (.NET agent API)",
+ "popularity": 1,
+ "external_id": "2a0a0d5ed597c962d9c7c2b02d2ae40380ec6d3d",
+ "category_1": ".NET agent",
+ "category_2": ".NET agent API",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api",
+ "published_at": "2020-08-18T16:02:14Z",
+ "updated_at": "2020-08-18T16:02:14Z",
+ "category_0": "APM agents",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.42349094,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "RecordCustomEvent (.NET agent API )",
+ "sections": ".NET agent API ",
+ "info": "New Relic .NET agent API call to report custom event data to New Relic.",
+ "category_0": "APM agents ",
+ "category_1": ".NET agent ",
+ "category_2": ".NET agent API ",
+ "body": "NewRelic.Api.Agent.NewRelic.RecordCustomEvent (string event Type, IEnumerable<string, object> attributeValues) Records a custom event with the given name and attributes. Requirements Agent version 4.6.29.0 or higher. Compatible with all app types. Description Records a custom event with the given",
+ "breadcrumb": "Contents » APM agents / .NET agent / .NET agent API "
+ },
+ "id": "5f3bfb86196a674f83618a39"
+ },
+ {
+ "body": "The New Relic Event API is one way to report custom events to New Relic. The Event API lets you send custom event data to your New Relic account with a POST command. These events are then queryable and chartable using NRQL. If your account hosts data in the EU data center, ensure you are using the proper API endpoints for EU region accounts. Related content: Learn about all options for reporting custom events. For details about how event data is retained, see Event data retention. For how to add attributes to existing events, see Add custom attributes. Check out New Relic University’s tutorial Adding custom events with the Event API (aka the Insights API). Or, go directly to the full online course Custom data. Basic workflow The Event API is an asynchronous endpoint. This allows you to send a very large volume of POSTS, reliably, with very low response latency. To send a custom event to your New Relic account: Register an Insert API key. Before creating custom events or attributes, review New Relic's list of reserved terms used by NRQL. Generate JSON for the event by instrumenting your application, querying an API, or some other method. Submit a compressed JSON payload (for example, gzip or deflate) to the HTTPS endpoint using curl in a POST request. Recommendation: Set up NRQL alert conditions to notify you when parsing errors occur. This method will send the events directly into your account, where they will be accessible from any NRQL interface or with the Query API. The Event API limits the size, rate, and characters allowed in custom events. Also, like other events available in NRQL, custom events cannot be updated or deleted after they are created. If you have problems with your custom event, follow the troubleshooting procedures or create a new custom event. Register an Insert API key You must have the correct user permissions to register Insert API keys. Insert API keys are generated for an account. They aren't associated with a specific user. Anyone in the account with access to the Insert API key can use it. You submit multiple event types under a single Insert API key. However, to help ensure security, we recommend that you use different keys for different applications or data sources. To register an Insert API key: From one.newrelic.com, click the account dropdown and then click Account settings. Click API keys. On the next page, click Insights API keys. Next to the Insert keys heading, select the plus symbol and follow the instructions. The Insert key page lists the curl command necessary to add event data for the key. For security reasons, the Insert API key cannot be altered or read using the API. To change or read a key, use the New Relic UI. Format the JSON The Event API accepts specific formats for attributes included in the payload. Only float or string values are allowed. JSON format guidelines When defining attributes for your custom events, follow these JSON format guidelines. Attributes JSON format guidelines eventType Required: The event's name. Float and string values Float value format: \"label\":value String value format: \"label\":\"value\" Data types The API only accepts key-value pairs, not map/object or array values. Supported data types for this API are strings and numbers (integers or floats). For more information, see Data requirements. Digits in strings For performance-related reasons, we do not cast values submitted to the API. For example, we treat 123 as a number and \"123\" as a string. The database will only store up to 64 bit numbers. Any numbers larger than 64 bits will be truncated. Dates For attributes that contain date information, use an unformatted Unix timestamp in the Insights data formatter. You can define the date attribute either in seconds or in milliseconds, both relative to the Unix epoch. Time Unless otherwise specified, the timestamp for a submitted event is the time it was submitted to New Relic. To specify a different time for the event, use the timestamp attribute. The timestamp must be a 64-bit integer within 24 hours of the time the event is submitted to New Relic. JSON example Here is an example of a typical JSON data set for sending with the API. This call sends two Purchase type events as a JSON array. You can add multiple events in a single HTTP call using a JSON array. [ { \"eventType\":\"Purchase\", \"account\":3, \"amount\":259.54 }, { \"eventType\":\"Purchase\", \"account\":5, \"amount\":12309, \"product\":\"Item\" } ] When generating the JSON, make sure your attributes are properly formatted. Limits and restricted characters The following size and rate limits apply to events sent to the Event API: Payload total size: 1MB maximum per POST. We highly recommend using compression. Number of attributes per event: 255 maximum Length of attribute name: 255 characters Length of attribute value: 4096 maximum character length There are rate limits on the number of HTTP requests per minute sent to the Event API. Some specific attributes have additional restrictions: accountId: This is a reserved attribute name. If it is included, it will be dropped during ingest. appId: Value must be an integer. If it is not an integer, the attribute name and value will be dropped during ingest. eventType: Can be a combination of alphanumeric characters, _ underscores, and : colons. timestamp: Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds. Submit the custom event Data submitted to the Event API uses a compressed JSON format in a simple HTTPS POST request. The Insert key page in the Insights UI automatically generates a sample curl query for you to use as a template. This example uses gzip, but you can also use deflate. Linux/bash example gzip -c example_events.json | curl -X POST -H \"Content-Type: application/json\" -H \"X-Insert-Key: YOUR_KEY_HERE\" -H \"Content-Encoding: gzip\" https://insights-collector.newrelic.com/v1/accounts/YOUR_ACCOUNT_ID/events --data-binary @- Windows/PowerShell example $accountId = \"YOUR_ACCOUNT_ID\" $insertkey = \"YOUR_KEY_HERE\" # Replace with your custom event for the body $body = '[{\"eventType\": \"powershell\", \"account\": 4, \"amount\": 123, \"fileLocation\": \"c:\\\\temp2\", \"zipped\": \"true\" }]' $headers = @{} $headers.Add(\"X-Insert-Key\", \"$insertkey\") $headers.Add(\"Content-Encoding\", \"gzip\") $encoding = [System.Text.Encoding]::UTF8 $enc_data = $encoding.GetBytes($body) $output = [System.IO.MemoryStream]::new() $gzipStream = New-Object System.IO.Compression.GzipStream $output, ([IO.Compression.CompressionMode]::Compress) $gzipStream.Write($enc_data, 0, $enc_data.Length) $gzipStream.Close() $gzipBody = $output.ToArray() Invoke-WebRequest -Headers $headers -Method Post -Body $gzipBody \"https://insights-collector.newrelic.com/v1/accounts/$accountId/events\" Always use compression with every payload. This allows you to send more data, and it saves resources during parsing. Before generating your HTTP request, make sure it is properly formatted, including: The X-Insert-Key contains the correct Insert API key. The Content-Type is application/json. The request uses POST only. The API does not accept PUT and GET requests. The API supports HTTP/1.1 persistent connections. This is helpful to manage client-side performance under heavy event loads. Verify or troubleshoot request response The Event API follows a two-step process to process requests: The Event API synchronously acknowledges or rejects the request based on validation of the headers and payload size. The Event API asynchronously parses the payload after a successful HTTP response is provided to the client. This may generate an error due to missing or malformed data. These are classified as submission errors or parsing errors. All successful submissions receive a 200 response, regardless of any data errors that may exist within the payload. The response includes a uuid, which is a unique ID created for each request. The uuid also appears in any error events created for the request. Other potential issues: 10-second timeout: API calls exceeding 10 seconds will time out. Large payloads: Payloads exceeding 100 KB may see increased response times. Recommendation: In addition to checking for a success message, use the Insights data explorer to ensure your events are reporting correctly and to generate queries. Success response code Success message Comments 200 {\"success\":true,\"uuid\":\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"} Submission errors Payloads with submission errors are handled and returned to the sender through an HTTP response code. To troubleshoot payload submission errors, refer to these HTTP response codes. Submission errors Troubleshooting 400 Missing or invalid content length: Unable to process empty request. 403 Missing or invalid API key: Invalid Insert key, or the account does not have access to Insights. Register a valid Insert key. 408 Request timed out: Request took too long to process. 413 Content too large: Request is too large to process. Refer to the limits and restricted characters to troubleshoot. 415 Invalid content type: Must be application/JSON. The Event API accepts any content type except multi-part/related and assumes it can be parsed to JSON. 429 Too many requests due to rate limiting. 503 Service temporarily unavailable: Retry request Parsing errors Parsing errors occur if: An event is sent within a payload, but it is either missing data or is exceeding maximum limits. New Relic will drop the individual event from the payload, generate an NrIntegrationError event, and process the rest. The JSON payload includes malformed JSON or missing required data. Payloads with parsing errors receive a 200 response to indicate a successful submission. To help resolve parsing errors, a new NrIntegrationError event type is created. All parsing errors are due to NRQL queries. For error messages related to dropped events, New Relic will include the number of events that were dropped as part of the message. To troubleshoot requests with parsing errors, refer to these error messages. Parsing errors Troubleshooting X event(s) rejected because attribute appId was not an integer An appId attribute has a non-integer value, such as a decimal value or string. X event(s) rejected because eventType cannot contain the following characters: [., \\] An eventType attributed included an invalid character, such as a period or backslash. X event(s) rejected because attribute is missing attribute name An attribute name was set to null or an empty string. X event(s) rejected because attribute name exceeded maximum length An attribute name has more than 255 characters. X event(s) rejected because attribute value exceeded maximum length An attribute value was longer than 4096 characters. X event(s) rejected because event exceeded maximum number of attributes An event has more than 255 attributes. X event(s) rejected because missing required attributes eventType The eventType attribute is required for the custom event. Error parsing JSON payload There was an error parsing the request JSON because of formatting problems or corrupted data. Query and alert with NrIntegrationError The NrIntegrationError event allows you to query and set alerts on custom data being sent to your New Relic account. Recommendation: To have New Relic Alerts notify you about parsing errors, create a NRQL condition for NrIntegrationError. Use this example NRQL query: SELECT message FROM NrIntegrationError WHERE newRelicFeature = 'Event API' AND category = 'EventApiException' NrIntegrationError attributes Troubleshooting timestamp The timestamp when the request was received. The timestamp attribute takes an unformatted Unix timestamp. You can define timestamps either in seconds or in milliseconds, both relative to the Unix epoch. Do not use a decimal for the timestamp. If a decimal is used, the attribute will default to the timestamp when the custom event was created. newRelicFeature The name of the feature experiencing errors. For all custom event parsing errors, this will be Event API. apiKeyPrefix The first six characters of the Insert API key used for the request that generated an error. requestId The uuid returned by the the API for the request that generated an error. Category The category of the error. For custom events, this is EventApiException. Message Contents of the error message. Name The error's name. For custom events, this is always EventValidationException. eventTypeSample One of the event types that generated the error, when available. Find your data To find data sent via the Event API (and from integrations that use this API), you can query it. For example, to query a custom event using NRQL, you would run: SELECT * FROM YOUR_CUSTOM_EVENT For more on how to query, see Query data. Limit on HTTP requests The Event API has a rate limit of 100,000 HTTP requests (POSTs) per minute, per account. (Note that this is not a limit on the number of events per minute; only on the number of POSTs per minute.) This limit helps ensure that large traffic spikes in accounts across our multi-tenant platform do not negatively affect how the service performs for you. If your API usage exceeds 100k POSTs in a 1-minute window, we will reject subsequent API requests with a 429 response code for the remainder of the 1-minute window. At the end of the 1-minute window, the counter will be reset and allow traffic to resume. This limit is intended to be an upper threshold that you shouldn't hit under normal scenarios. If you have a high number of 429 responses, consider using the API less. If you are expecting a higher-than-normal activity level in the near future and want to prepare for that, contact technical support. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs",
+ "info": "Intro to New Relic's Event API, which lets you send custom event data to your New Relic account. ",
+ "nodeid": 17376,
+ "sections": [
+ "Ingest and manage data",
+ "Get started",
+ "Understand data",
+ "Manage data",
+ "Ingest APIs",
+ "Use the Event API to report custom events",
+ "Basic workflow",
+ "Register an Insert API key",
+ "Format the JSON",
+ "Submit the custom event",
+ "Verify or troubleshoot request response",
+ "Query and alert with NrIntegrationError",
+ "Find your data",
+ "Limit on HTTP requests",
+ "For more help"
+ ],
+ "title": "Use the Event API to report custom events",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/telemetry-data-platform/ingest-manage-data/ingest-apis/use-event-api-report-custom-events",
+ "popularity": 1,
+ "external_id": "589a1cbf9b6b64be620689b3af3cbadff0c67da2",
+ "category_1": "Ingest and manage data",
+ "category_2": "Ingest APIs",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/telemetry-data-platform/ingest-manage-data/ingest-apis/use-event-api-report-custom-events",
+ "published_at": "2020-08-18T14:06:57Z",
+ "updated_at": "2020-08-15T09:07:03Z",
+ "category_0": "Telemetry Data Platform",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.39592767,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Use the Event API to report custom events ",
+ "sections": "Use the Event API to report custom events ",
+ "info": "Intro to New Relic's Event API , which lets you send custom event data to your New Relic account. ",
+ "category_2": "Ingest APIs ",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/telemetry-data-platform/ingest-manage-data/ingest-apis /use-event -api -report-custom -events ",
+ "body": "The New Relic Event API is one way to report custom events to New Relic. The Event API lets you send custom event data to your New Relic account with a POST command. These events are then queryable and chartable using NRQL. If your account hosts data in the EU data center, ensure you are using",
+ "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs "
+ },
+ "id": "5f37a5b7196a6743a355e613"
+ }
+ ],
+ "/automate-workflows/get-started-terraform": [
+ {
+ "body": "In order to provide a unified experience, we're deprecating Synthetics monitor alert notifications and alert conditions violations, and replacing these pages with a new synthetic monitor overview experience in New Relic One. This new experience provides visibility into a monitor's open violations and alert conditions with the monitor results in a single view, removing the need to open multiple tabs to view violations or alert conditions. For more information, check the EoL Announcements page. If you want to receive alert notifications when a synthetic monitor fails, you can configure the alert notification either while creating a monitor or after you have created one. You can configure your monitor's alert policy directly from the Synthetics UI or via the Alerts UI for existing monitors. To identify which monitors do not have policies assigned to them, review their color-coded health status. Add a synthetic monitor to alert policies A monitor can be included in multiple alert policies. You can view the alert policies and conditions for the selected monitor from the Synthetics UI or from the Alerts UI. To add an existing monitor to an alert policy: Go to one.newrelic.com > Alerts & AI > Policies. From the list of existing alert policies, use the search box or scroll the list to locate one or more alert policies where the monitor has not already been added. Open the policy, then click Add a condition. Click Synthetics and then select the monitor. Fill out the remaining settings and click Create condition. Existing monitor: Remove from alert policy To remove an existing monitor from an existing alert policy: Go to one.newrelic.com > Alerts & AI > Policies. From the list of existing alert policies, use the search box or scroll the list to locate one or more alert policies where the monitor has not already been added. Select the trash can (delete) icon on the monitor's row. Receive alert notifications on a three-strike basis Synthetic alert notifications operate on a three-strike basis, sending an alert after three monitor attempts from a single location return an error. Your alert policy configuration and notification channel settings will determine when you receive alerts for specific monitors and locations. If you monitor a non-public app and add your selected public minion IPs to your allow list, you may very infrequently receive a false downtime alert. When a synthetic monitoring data center goes down, New Relic may decide to temporarily use an alternate host, which results in the temporary server's IP being blocked by your app. Mute (disable) monitor's alert notifications To temporarily disable alerting for a monitor, mute it: Go to one.newrelic.com > Synthetics > Monitors > (select a monitor). Click General under the Settings menu in the left menu sidebar. Click the Notifications button to Off. Muting a monitor's alert notifications will not mute multi-location alerts or NRQL alerts. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Synthetic monitoring / Synthetic monitoring / Using monitors",
+ "info": "New Relic can use alerts to notify you about synthetic monitors's failures.",
+ "nodeid": 6371,
+ "sections": [
+ "Synthetic monitoring",
+ "Getting started",
+ "Guides",
+ "Using monitors",
+ "Monitor scripting",
+ "Administration",
+ "Private locations",
+ "UI pages",
+ "Synthetics API",
+ "Troubleshooting",
+ "Alerts for synthetic monitoring",
+ "Add a synthetic monitor to alert policies",
+ "Existing monitor: Remove from alert policy",
+ "Receive alert notifications on a three-strike basis",
+ "Mute (disable) monitor's alert notifications",
+ "For more help"
+ ],
+ "title": "Alerts for synthetic monitoring",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/synthetics/synthetic-monitoring/using-monitors/alerts-synthetic-monitoring",
+ "popularity": 1,
+ "external_id": "b69353439d3cc180ca46c64bef5e8470cdda1636",
+ "category_1": "Synthetic monitoring",
+ "category_2": "Using monitors",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/synthetics/synthetic-monitoring/using-monitors/alerts-synthetic-monitoring",
+ "published_at": "2020-08-18T11:09:08Z",
+ "updated_at": "2020-08-14T00:47:54Z",
+ "category_0": "Synthetic monitoring",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.5598317,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Alerts for synthetic monitoring ",
+ "sections": "Mute (disable) monitor's alert notifications ",
+ "info": "New Relic can use alerts to notify you about synthetic monitors's failures.",
+ "category_0": "Synthetic monitoring ",
+ "category_1": "Synthetic monitoring ",
+ "category_2": "Using monitors ",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/synthetics /synthetic -monitoring /using-monitors /alerts-synthetic -monitoring ",
+ "body": " the alert notification either while creating a monitor or after you have created one. You can configure your monitor 's alert policy directly from the Synthetics UI or via the Alerts UI for existing monitors . To identify which monitors do not have policies assigned to them, review their color-coded health",
+ "breadcrumb": "Contents / Synthetic monitoring / Synthetic monitoring / Using monitors "
+ },
+ "id": "5f31b60e196a6742d2fbd6c8"
+ },
+ {
+ "body": "If you delete a channel, you cannot restore it. If you want to keep the notification channel, you can remove it from any associated policy. Delete a channel To delete a channel permanently: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Optional: To find the notification channel easily, search the Notification channels index. From the Notification channels index, select the channel's delete icon, and then select the confirmation prompt to cancel or continue. When you delete (or remove) a channel, any policies associated with it will still remain. You must delete policies separately. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert notifications",
+ "info": "You can delete alerts notification channels permanently or you can keep channels but remove them from associated policies.",
+ "nodeid": 6471,
+ "sections": [
+ "New Relic Alerts",
+ "Get started",
+ "Alert policies",
+ "Alert conditions",
+ "Alert violations",
+ "Alert Incidents",
+ "Alert notifications",
+ "Troubleshooting",
+ "Rules, limits, and glossary",
+ "Alerts and Nerdgraph",
+ "REST API alerts",
+ "Delete alert notification channels",
+ "Delete a channel",
+ "For more help"
+ ],
+ "title": "Delete alert notification channels",
+ "popularity": 1,
+ "external_id": "dcea3b60f23ddeb74a7a0a0f44a5130cd9e2885d",
+ "category_1": "New Relic Alerts",
+ "category_2": "Alert notifications",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/delete-alert-notification-channels",
+ "published_at": "2020-08-18T18:07:05Z",
+ "updated_at": "2020-08-15T07:46:52Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.5424085,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Delete alert notification channels ",
+ "sections": "Delete alert notification channels ",
+ "info": "You can delete alerts notification channels permanently or you can keep channels but remove them from associated policies.",
+ "category_2": "Alert notifications ",
+ "body": "If you delete a channel , you cannot restore it. If you want to keep the notification channel , you can remove it from any associated policy. Delete a channel To delete a channel permanently: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Optional: To find"
+ },
+ "id": "5f2dbb3628ccbc65c788dfcb"
+ },
+ {
+ "body": "Depending on the selected channel type, different values appear. Reference for updating channels Here's a quick reference for updating channels which also includes links to more detailed information and procedures. Add or remove policies assigned to a channel To add or remove policies assigned to a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. Choose a channel, and then click Alert policies. From the selected policy, use the windows to select, remove, or clear all notification channels. Assign a channel to policies To add a notification channel to one or more policies: Go to one.newrelic.com, in the top nav click Alerts & AI, click Policies. Choose a policy, click Notification channels, and then click Add notification channels. Choose a channel, and then click Update policy. Change a channel's name To rename an existing notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels, then choose a channel. From the Channel details, change the name (maximum 64 characters) based on the channel type if applicable, and then save. Check for policies assigned to a user To check whether an account user has any policies assigned: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. Optional: Search by \"user\" to browse users or a specific username or email. Choose the user, then click Alert policies. Check how many policies are assigned to a channel To check whether a notification channel has any policies assigned: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. The Policy subscriptions column lists how many policies are assigned to the channel. Create more channels To create a new notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. Click New notification channel. Delete a channel To delete a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. In the list, click the Delete icon. Test a saved channelView assigned alert policies To view the policies assigned to a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels, choose a channel, and then click Alert policies. OR To view the notification channels assigned to a policy: Go to one.newrelic.com, in the top nav click Alerts & AI, click Policies, choose a policy, then click Notification channels. Basic process Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels, then choose a channel. From the Channel details page, make any necessary changes, and then save. The user interface shows a Last modified time stamp for any changes to policies, including their conditions and notification channels. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert notifications",
+ "info": "Read about how to update alerts notification channels. ",
+ "nodeid": 6481,
+ "sections": [
+ "New Relic Alerts",
+ "Get started",
+ "Alert policies",
+ "Alert conditions",
+ "Alert violations",
+ "Alert Incidents",
+ "Alert notifications",
+ "Troubleshooting",
+ "Rules, limits, and glossary",
+ "Alerts and Nerdgraph",
+ "REST API alerts",
+ "Update alert notification channels",
+ "Reference for updating channels",
+ "Basic process",
+ "For more help"
+ ],
+ "title": "Update alert notification channels",
+ "popularity": 1,
+ "external_id": "ee8bce401d0623e8b85d84a6a20bd8a72b9764ef",
+ "category_1": "New Relic Alerts",
+ "category_2": "Alert notifications",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/update-alert-notification-channels",
+ "published_at": "2020-08-18T18:07:05Z",
+ "updated_at": "2020-08-11T06:42:27Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.45523524,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Update alert notification channels ",
+ "sections": "Update alert notification channels ",
+ "info": "Read about how to update alerts notification channels . ",
+ "category_2": "Alert notifications ",
+ "body": " to a notification channel : Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. Choose a channel , and then click Alert policies. From the selected policy, use the windows to select, remove, or clear all notification channels. Assign a channel to policies To add"
+ },
+ "id": "5f2dbad928ccbcb8ca88dfed"
+ },
+ {
+ "body": "You must save a new notification channel or any changes to an existing notification channel before testing it. Alerts will then send a test message to your chosen destination. Request the test To test a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Follow standard procedures to add a new notification channel or to update an existing notification channel, and save it. Select a notification channel, and then click Envelope Message Icon Send a test notification. Review the test confirmation message, and then click Got it. Troubleshoot the test results A confirmation message will automatically show up in the user interface that indicates where the test was sent (for example, email) and whether it was successful. Also, the test notification message itself includes detailed information, including: The person who requested the test Links to policies for the channel Links to all notification channels and policies for the account When troubleshooting problems, review the test notification message, and verify the setup requirements for the type of notification channel you selected. If necessary, make additional changes to your notification channel, and test it again as needed. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert notifications",
+ "info": "Be sure to save your alerts notification channels before testing them to make sure they're working properly.",
+ "nodeid": 6491,
+ "sections": [
+ "New Relic Alerts",
+ "Get started",
+ "Alert policies",
+ "Alert conditions",
+ "Alert violations",
+ "Alert Incidents",
+ "Alert notifications",
+ "Troubleshooting",
+ "Rules, limits, and glossary",
+ "Alerts and Nerdgraph",
+ "REST API alerts",
+ "Test alert notification channels",
+ "Request the test",
+ "Troubleshoot the test results",
+ "For more help"
+ ],
+ "title": "Test alert notification channels",
+ "popularity": 1,
+ "external_id": "fcea4cf920f099fa1fcf7fab3760d57bdf2e02b7",
+ "category_1": "New Relic Alerts",
+ "category_2": "Alert notifications",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/test-alert-notification-channels",
+ "published_at": "2020-08-18T18:08:07Z",
+ "updated_at": "2020-08-11T04:16:54Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.45365188,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Test alert notification channels ",
+ "sections": "Test alert notification channels ",
+ "info": "Be sure to save your alerts notification channels before testing them to make sure they're working properly.",
+ "category_2": "Alert notifications ",
+ "body": "You must save a new notification channel or any changes to an existing notification channel before testing it. Alerts will then send a test message to your chosen destination. Request the test To test a notification channel : Go to one.newrelic.com, in the top nav click Alerts & AI, then click"
+ },
+ "id": "5f2dbb3664441fd3a556a97c"
+ },
+ {
+ "body": "You can use alerts to set up notification channels, and attach those channels to policies. Your selected channels provide fast and consistent ways for the right personnel to be notified about incidents. For example, notifications allow you to include charts about the incident to provide context and share them with your team. Alerts offers several notification channels, including webhooks, Slack rooms, email, and more. You'll be notified by your notification channels when incidents are opened, acknowledged, or closed. This document explains the available notification channels and how to set them up. This document is about alerts notifications. For general information about unsubscribing from other New Relic emails, including marketing emails, weekly reports, and announcements, see Unsubscribe from New Relic emails. View notification channels To see all notification channels in your account: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Add or remove notification channels To set up a new notification channel: On the Notification channels, click New notification channel. Select the type of channel and complete other required steps for it. To add or remove a notification policy or channel: Select a specific notification channel, select Alert policies, and add or remove a policy. OR Select a specific policy, select Notification channels, and add or remove a channel. Instructions for specific notification channels These are the available notification channel types. User For your convenience, we automatically load all users and their email addresses for the selected account. If your account has one or more sub-accounts, the notification channel includes only users for the currently selected master or sub-account. Use the User notification channel to select existing account team members and admins. To view the Users list or to add users to alert policies: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. A user channel also sends push notifications to any of the user's registered mobile devices. A device is registered if the user has logged into New Relic using the mobile app on the device. Email We automatically add every individual and their email address on the selected account to the User notification channel and you can select them there. You don't need to add existing New Relic accounts to the Email channel. To add an email channel for other users, follow these guidelines: Field Description Email (required) In general, use the Email notification channel to identify user emails or email aliases that are not already on the selected account. For example, if you have a dev-ops@company.com email alias for your DevOps team, add the email alias to the Email channel. Otherwise, use the User notification channel to select specific users on your DevOps team. For easier maintenance, add a single non-user email address or alias to a single alert notification channel. If you want to use the email channel for more than one email, create an email group or alias outside your account. These email addresses can be the same as or different from email addresses already on your account. Users can unsubscribe from general (non-alerts-related) emails, but they cannot unsubscribe from alerts email notifications. Instead, the account Owner, Admin, or add-on manager must remove users from the policy's email notification channel. Include JSON attachment (optional) To include a JSON attachment with the email notification, select this checkbox. OpsGenie You must have an existing OpsGenie account integrated with New Relic in order to provide the following information: Field Description Channel name (required) A meaningful name for the OpsGenie notification channel (maximum 64 characters). API key (required) The API key generated from your OpsGenie integration used to authenticate API requests. Teams (optional) List of team names that are responsible for the alert. OpsGenie runs team escalation policies to calculate which users will receive notifications. Tags (optional) A comma-separated list of labels attached to the alert. To overwrite the OpsGenie Quiet Hours setting for urgent alerts, add an OverwriteQuietHours tag. Recipients (optional) One or more names of users, groups, on-call schedules, escalation policies, etc., that OpsGenie uses to calculate where to send notifications. PagerDuty You must have an existing PagerDuty account in order to provide the following information: Field Description Service name (required) The name of your service integrating with PagerDuty for notifications. Integration key (required) The unique service identifier used by PagerDuty's Integration API to trigger, acknowledge, and resolve incidents for the service. Slack Before adding Slack notifications, you must create a unique webhook integration using Slack's New Relic integration. If you want web, transaction, server, and mobile alerts to be posted in separate channels, you must set up separate integrations for each one. Field Description Channel name (required) A meaningful name for the Slack notification channel (maximum 64 characters); for example, Network Ops Center. URL (required) Copy and paste the New Relic webhook integration URL that you've set up with Slack. For example: https://hooks.slack.com/services/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 Be sure to include https:// in the URL. Do not use http://. Team channel (optional) If used, include # before the name of the Slack channel where alert notifications are sent; for example, #NOC. VictorOps You must have an existing VictorOps account in order to provide the following required information: Field Description Channel name (required) A meaningful name for this notification channel (maximum 64 characters). For example, if the VictorOps Route key is for your Technical Support team, you could name this channel Tech Support - VictorOps. Key (required) VictorOps generates a unique key for each account. It maps the VictorOps account to its associated integrations. Route key (optional) This key maps the alert or incident to a specific team. Webhook Webhooks are HTTP POST messages containing JSON documents delivered to a destination URL. When an incident is opened, acknowledged, or closed, our webhook feature sends a message to your URL with any relevant information, such as a description of the event and a link back to New Relic. You also have the option to customize the payload in the POST message for further integration into your system. If your endpoint does not acknowledge the POST request within 10 seconds, the Alerts UI may indicate a failed notification event for the related incident. Before adding webhook notifications, you must have an endpoint set up to respond with a status code between 200 and 206 after receiving the following required information: Field Description Channel name (required) A meaningful name for the webhook (maximum 64 characters). Base url (required) The endpoint that will receive the POST message and trigger customized behaviors in your system. If you want to include a port number in the webhook URL, make sure the port is available for requests. Otherwise the webhook will not work. Basic auth (optional) To require basic authentication for the webhook, select Add basic auth, and provide the user name and password to authenticate the webhook. Custom headers (optional) To include headers with webhooks, select Add custom headers, and provide the name and value for each header. Use custom payload (optional) To use the default values, leave blank. To view and edit the default values, select Add custom payload. Payload (for custom payloads only) Your customized POST message code. This field includes: A list of variables you can use Syntax highlighting, based on payload type Payload type (for custom payloads only) Specify the message format: JSON (default) or Form. xMatters You must have an existing xMatters account in order to provide the following information: Field Description Channel name (required) Name your channel so you can identify it easily when associating it with a policy. Integration url (required) The unique integration url provided by xMatters pointing to your xMatters account. Receive mobile push notifications In order to receive mobile push notifications, your device must be registered and listed in (account) > User preferences. If the device is not listed in User preferences, log out of the app, log back in, and check again to see if it is listed. To receive mobile push notifications: Log in to your New Relic account via the mobile app at least once to ensure the device is registered. Add the user channel to the alert policy. Switch push notifications On for the device. Acknowledge alert notifications Anyone in your account can acknowledge notifications through the user interface or email notification. Acknowledging an incident in New Relic also acknowledges any associated incident in PagerDuty. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert notifications",
+ "info": "Read about how to set up alerts notification channels so you can be notified when incidents are opened, acknowledged, or closed.",
+ "nodeid": 6281,
+ "sections": [
+ "New Relic Alerts",
+ "Get started",
+ "Alert policies",
+ "Alert conditions",
+ "Alert violations",
+ "Alert Incidents",
+ "Alert notifications",
+ "Troubleshooting",
+ "Rules, limits, and glossary",
+ "Alerts and Nerdgraph",
+ "REST API alerts",
+ "Notification channels: Control where to send alerts",
+ "View notification channels",
+ "Add or remove notification channels",
+ "Instructions for specific notification channels",
+ "Receive mobile push notifications",
+ "Acknowledge alert notifications",
+ "For more help"
+ ],
+ "title": "Notification channels: Control where to send alerts",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/notification-channels-control-where-send-alerts",
+ "popularity": 1,
+ "external_id": "65878aca7993877ee748776c87e9225c90687e3f",
+ "category_1": "New Relic Alerts",
+ "category_2": "Alert notifications",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/notification-channels-control-where-send-alerts",
+ "published_at": "2020-08-18T18:51:22Z",
+ "updated_at": "2020-08-15T11:49:29Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.41058606,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Notification channels : Control where to send alerts",
+ "sections": "Notification channels : Control where to send alerts",
+ "info": "Read about how to set up alerts notification channels so you can be notified when incidents are opened, acknowledged, or closed.",
+ "category_2": "Alert notifications ",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications /notification -channels -control-where-send-alerts",
+ "body": " account: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Add or remove notification channels To set up a new notification channel : On the Notification channels, click New notification channel . Select the type of channel and complete other required steps"
+ },
+ "id": "5f2dbad864441fb7d256a9db"
+ }
+ ],
+ "/build-apps/add-query-mutate-data-nerdstorage": [
+ {
+ "body": "Build apps You know better than anyone what information is crucial to your business, and how best to visualize it. Sometimes, this means going beyond dashboards to creating your own app. With React and GraphQL, you can create custom views tailored to your business. These guides are designed to help you start building apps, and dive into our library of components. We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a \"Hello, World!\" application Build a \"Hello, World!\" app and publish it to New Relic One 20 min Publish and deploy apps Start sharing the apps you build 20 min Set up your development environment Prepare to build apps and contribute to this site 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 30 min Add a table to your app Add a table to your New Relic One app 30 min Create a custom map view Build an app to show page view data on a map",
+ "type": "developer",
+ "document_type": "page",
+ "info": "",
+ "sections": [
+ "Build apps",
+ "Guides to build apps",
+ "Create a \"Hello, World!\" application",
+ "Publish and deploy apps",
+ "Set up your development environment",
+ "Add the NerdGraphQuery component to an application",
+ "Add a time picker to your app",
+ "Add, query, and mutate data using NerdStorage",
+ "Add a table to your app",
+ "Create a custom map view"
+ ],
+ "title": "Build apps",
+ "popularity": 1,
+ "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d",
+ "image": "",
+ "url": "https://developer.newrelic.com/build-apps/",
+ "published_at": "2020-08-18T02:08:12Z",
+ "updated_at": "2020-08-18T01:45:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.6154529,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Add , query , and mutate data using NerdStorage ",
+ "body": " it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 45 min Add , query , and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one"
+ },
+ "id": "5efa999d64441fc0f75f7e21"
+ },
+ {
+ "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,000 documents, plus storage type. Each document can have a maximum length of 64 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Intro to NerdStorage on New Relic One",
+ "sections": [
+ "Intro to NerdStorage",
+ "Use NerdStorage in your apps",
+ "Data model",
+ "Limits",
+ "Data access",
+ "Permissions for working with NerdStorage"
+ ],
+ "title": "Intro to NerdStorage",
+ "popularity": 1,
+ "external_id": "709e06c25376d98b2191ca369b4d139e5084bd62",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nerdstorage/",
+ "published_at": "2020-08-18T02:11:48Z",
+ "updated_at": "2020-08-14T01:50:34Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.15920696,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Intro to NerdStorage ",
+ "sections": "Intro to NerdStorage ",
+ "info": "Intro to NerdStorage on New Relic One",
+ "body": " document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing"
+ },
+ "id": "5efa989ee7b9d2048e7bab92"
+ },
+ {
+ "body": "Query and store data 10 min To help you build a New Relic One application, we provide you with the New Relic One SDK. Here you can learn how to use the SDK query components, which allow you to make queries and mutations via NerdGraph, our GraphQL endpoint. Query-related React components can be identified by the Query suffix. Mutation-related components can be identified by the Mutation prefix. Components overview Our data components are based on React Apollo. The most basic component is NerdGraphQuery, which accepts any GraphQL (or GraphQL AST generated by the graphql-tag library as the query parameter, and a set of query variables passed as variables. Over this query, we have created an additional set of queries, which can be divided into four groups: User queries: These allow you to query the current user and its associated accounts. Components in this category: UserStorageQuery and AccountsQuery. Entities queries: Because New Relic One is entity-centric, we use queries to make access to your entities easier. You can count, search, list, query, and favorite them. Components in this category: EntityCountQuery, EntitySearchQuery, EntitiesByDomainTypeQuery, EntitiesByGuidsQuery, EntityByGuidQuery, EntityByNameQuery. Storage queries: New Relic One provides a simple storage mechanism that we call NerdStorage. This can be used by Nerdpack creators to store application configuration setting data, user-specific data, and other small pieces of data. Components in this category: UserStorageQuery, AccountStorageQuery, EntityStorageQuery, UserStorageMutation, AccountStorageMutation, and EntityStorageMutation. For details, see NerdStorage. NRQL queries: To be able to query your New Relic data via NRQL (New Relic Query Language), we provide a NrqlQuery component. This component can return data in different formats, so that you can use it for charting and not only for querying. Query components All query components accept a function as a children prop where the different statuses can be passed. This callback receives an object with the following properties: loading: Boolean that is set to true when data fetching is happening. Our components use the cache-and-network strategy, meaning that after the data has loaded, subsequent data reloads might be triggered first with stale data, then refreshed when the most recent data has arrived. data: Root property where the data requested is retrieved. The structure matches a root structure based on the NerdGraph schema. This is true even for highly nested data structures, which means you’ll have to traverse down to find the desired data. error: Contains an Error instance when the query fails. Set to undefined when data is loading or the fetch was successful. fetchMore: Callback function that can be called when the query is being loaded in chunks. The function will only be present when it’s feasible to do so, more data is available, and no fetchMore has already been triggered. Data is loaded in batches of 200 by default. Other components provided by the platform (like the Dropdown or the List) are capable of accepting fetchMore, meaning you can combine them easily. Mutation components Mutation components also accept a children as a function, like the query ones. The mutation can be preconfigured at the component level, and a function is passed back that you can use in your component. This is the standard React Apollo approach for performing mutations, but you might find it easier to use our static mutation method added to the component. More on this topic below. Static methods All of the described components also expose a static method so that they can be used imperatively rather than declaratively. All Query components have a static Query method, and all Mutation components have a mutation method. These static methods accept the same props as their query component, but passed as an object. For example: // Declarative way (using components). function renderAccountList() { return ( ({data, error}) => { if (error) { return Failed to retrieve list: {error.message} ; } return data.map((account) => { {account.name} }); }} ); } // Imperative way (using promises). async function getAccountList() { let data = {}; try { data = await AccountsQuery.query(); } catch (error) { console.log('Failed to retrieve list: ' + error.message); return; } return data.actor.accounts.map((account) => { return account.name; }); } Copy Similarly, a mutation can happen either way; either declaratively or imperatively. NrqlQuery NrqlQuery deserves additional explanation, because there are multiple formats in which you can return data from it. To provide maximum functionality, all three are exposed through a formatType property. You can find its different values under NrqlQuery.formatType: NERD_GRAPH: Returns the format in which it arrives from NerdGraph. RAW: The format exposed by default in Insights and dashboards when being plotted as JSON. This format is useful if you have a pre-existing script in this format that you're willing to migrate to or incorporate with. CHART: The format used by the charting engine that we also expose. You can find a more detailed explanation of how to manipulate this format in the guide to chart components, and some examples. If you are willing to push data, we currently do not expose NrqlMutation. To do that, see the Event API for how to add custom events.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Reference guide for SDK query components using NerdGraph",
+ "sections": [
+ "Query and store data",
+ "Components overview",
+ "Query components",
+ "Mutation components",
+ "Static methods",
+ "NrqlQuery"
+ ],
+ "title": "Query and store data",
+ "popularity": 1,
+ "external_id": "cbbf363393edeefbc4c08f9754b43d38fd911026",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/query-and-store-data/",
+ "published_at": "2020-08-18T02:08:12Z",
+ "updated_at": "2020-08-01T01:42:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.13865894,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Query and store data ",
+ "sections": "Query and store data ",
+ "info": "Reference guide for SDK query components using NerdGraph",
+ "body": ", EntityByGuidQuery , EntityByNameQuery . Storage queries: New Relic One provides a simple storage mechanism that we call NerdStorage . This can be used by Nerdpack creators to store application configuration setting data , user-specific data , and other small pieces of data . Components in this category"
+ },
+ "id": "5efa989e28ccbc2f15307deb"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
+ "type": "developer",
+ "document_type": "page",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "sections": [
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
+ ],
+ "title": "New Relic CLI Reference",
+ "popularity": 1,
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-08-18T02:11:50Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.09380336,
+ "_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"
+ },
+ "id": "5efa989ee7b9d2024b7bab97"
+ },
+ {
+ "body": "Query data with NRQL 10 min With NRQL, you can query any of the default event data being reported by New Relic, plus any custom events and attributes you’ve added. Step 1 of 4 NRQL syntax is comparable to ANSI SQL. Learn more about NRQL syntax SELECT function(attribute) [AS 'label'][, ...] FROM event [WHERE attribute [comparison] [AND|OR ...]][AS 'label'][, ...] [FACET attribute | function(attribute)] [LIMIT number] [SINCE time] [UNTIL time] [WITH TIMEZONE timezone] [COMPARE WITH time] [TIMESERIES time] Copy Step 2 of 4 NRQL queries can be as simple as fetching rows of data in a raw tabular form to inspect individual events. Learn what events open source agents provide out of the box -- Fetch a list of Browser PageView events SELECT * FROM PageView Copy Step 3 of 4 NRQL queries can also do extremely powerful calculations before the data is presented to you, such as crafting funnels based on the way people actually use your website. Learn more about NRQL funnels -- See how many users visit, signup, browse and purchase from your site as a funnel SELECT funnel(session, WHERE pageUrl='http://www.demotron.com/' AS 'Visited Homepage', WHERE pageUrl='http://www.demotron.com/signup' AS 'Signed Up', WHERE pageUrl='http://www.demotron.com/browse' AS 'Browsed Items', WHERE pageUrl='http://www.demotron.com/checkout' AS 'Made Purchase') FROM PageView SINCE 12 hours ago Copy Step 4 of 4 Using NRQL, you can customize your New Relic experience by crafting diverse dashboards that show your data from multiple angles. You can share these dashboards with technical and non-technical stakeholders alike. Learn more and start building Documentation For an overview of NRQL syntax, see Introduction to NRQL. For a detailed description of all available functions, see NRQL syntax, components, and functions. NRU Tutorials To learn how to query and narrow a large data store by a specific parameter, watch the tutorial on Filtering queries with NRQL. Community forum Connect with other developers in the our Explorers Hub. GitHub For examples of integrations and other technologies, check us out on GitHub.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Query default event data as well as custom events and attributes with our powerful, SQL-like query language. Start querying now.",
+ "sections": [
+ "Query data with NRQL",
+ "Learn more and start building",
+ "Documentation",
+ "NRU Tutorials",
+ "Community forum",
+ "GitHub"
+ ],
+ "title": "Query data with NRQL",
+ "popularity": 1,
+ "external_id": "7bb23b086badd7a572964357aad776116f5bfbbe",
+ "image": "https://developer.newrelic.com/static/eb2adf50e7680e8ba5b7daaf06c203d1/757a2/nr1-dashboard.png",
+ "url": "https://developer.newrelic.com/collect-data/query-data-nrql/",
+ "published_at": "2020-08-18T02:08:12Z",
+ "updated_at": "2020-08-14T01:46:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.08179283,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Query data with NRQL",
+ "sections": "Query data with NRQL",
+ "info": "Query default event data as well as custom events and attributes with our powerful, SQL-like query language. Start querying now.",
+ "body": "Query data with NRQL 10 min With NRQL, you can query any of the default event data being reported by New Relic, plus any custom events and attributes you’ve added. Step 1 of 4 NRQL syntax is comparable to ANSI SQL. Learn more about NRQL syntax SELECT function(attribute) [AS 'label'][, ...] FROM"
+ },
+ "id": "5efa999ce7b9d29f377bab69"
+ }
+ ],
+ "/build-apps/add-nerdgraphquery-guide": [
+ {
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "Tip",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "popularity": 1,
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-18T01:50:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 1.6000241,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Set up your Nerdpacks ",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps .",
+ "tags": "New Relic One app ",
+ "body": " your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first "Hello World" app , and serve it locally. Tip Use the NR1 VS Code"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "Build apps You know better than anyone what information is crucial to your business, and how best to visualize it. Sometimes, this means going beyond dashboards to creating your own app. With React and GraphQL, you can create custom views tailored to your business. These guides are designed to help you start building apps, and dive into our library of components. We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a \"Hello, World!\" application Build a \"Hello, World!\" app and publish it to New Relic One 20 min Publish and deploy apps Start sharing the apps you build 20 min Set up your development environment Prepare to build apps and contribute to this site 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 30 min Add a table to your app Add a table to your New Relic One app 30 min Create a custom map view Build an app to show page view data on a map",
+ "type": "developer",
+ "document_type": "page",
+ "info": "",
+ "sections": [
+ "Build apps",
+ "Guides to build apps",
+ "Create a \"Hello, World!\" application",
+ "Publish and deploy apps",
+ "Set up your development environment",
+ "Add the NerdGraphQuery component to an application",
+ "Add a time picker to your app",
+ "Add, query, and mutate data using NerdStorage",
+ "Add a table to your app",
+ "Create a custom map view"
+ ],
+ "title": "Build apps",
+ "popularity": 1,
+ "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d",
+ "image": "",
+ "url": "https://developer.newrelic.com/build-apps/",
+ "published_at": "2020-08-18T02:08:12Z",
+ "updated_at": "2020-08-18T01:45:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.79272,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Build apps ",
+ "sections": "Add the NerdGraphQuery component to an application ",
+ "body": " min Publish and deploy apps Start sharing the apps you build 20 min Set up your development environment Prepare to build apps and contribute to this site 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add"
+ },
+ "id": "5efa999d64441fc0f75f7e21"
+ },
+ {
+ "body": "Map page views by region in a custom app 30 min New Relic has powerful and flexible tools for building custom apps and populating them with data. This guide shows you how to build a custom app and populate it with page view data using New Relic's Query Language (NRQL - pronounced 'nurkle'). Then you make your data interactive. And last, if you have a little more time and want to install a third-party React library, you can display the page view data you collect on a map of the world. In this guide, you build an app to display page view data in two ways: In a table On a map Please review the Before you begin section to make sure you have everything you need and don't get stuck halfway through. Before you begin In order to get the most out of this guide, you must have: A New Relic developer account, API key, and the command-line tool. If you don't have these yet, see the steps in Setting up your development environment New Relic Browser page view data to populate the app. Without this data, you won't be able to complete this guide. To add your data to a world map in the second half of the guide: npm, which you'll use during this section of the guide to install Leaflet, a third-party JavaScript React library used to build interactive maps. If you're new to React and npm, you can go here to install Node.js and npm. New Relic terminology The following are some terms used in this guide: New Relic application: The finished product where data is rendered in New Relic One. This might look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One that launches your application. Nerdlets: New Relic React components used to build your application. The three default files are index.js, nr1.json, and styles.scss, but you can customize and add your own. Build a custom app with a table chart Step 1 of 8 Query your browser data Use Query builder to write a NRQL query to see your page view data, as follows. On New Relic One, select Query your data (in the top right corner). That puts you in NRQL mode. You'll use NRQL to test your query before dropping the data into your table. Copy and paste this query into a clear query field, and then select Run. FROM PageView SELECT count(*), average(duration) WHERE appName = 'WebPortal' FACET countryCode, regionCode SINCE 1 week ago LIMIT 1000 Copy If you have PageView data, this query shows a week of average page views broken down by country and limited to a thousand items. The table will be full width and use the \"chart\" class defined in the CSS. If you don't have any results at this point, ensure your query doesn't have any errors. If your query is correct, you might not have the Browser agent installed. Step 2 of 8 Create and serve a new Nerdpack To get started, create a new Nerdpack, and serve it up to New Relic from your local development environment: Create a new Nerdpack for this app: nr1 create --type nerdpack --name pageviews-app Copy Serve the project up to New Relic: cd pageviews-app && nr1 nerdpack:serve Copy Step 3 of 8 Review your app files and view your app locally Navigate to your pageviews-app to see how it's structured. It contains a launcher folder, where you can customize the description and icon that will be displayed on the app's launcher in New Relic One. It also contains nerdlets, which each contain three default files: index.js, nr1.json, and styles.scss. You'll edit some of these files as part of this guide. For more information, see Nerdpack file structure. Now in your browser, open https://one.newrelic.com/?nerdpacks=local, and then click Apps to see the pageview-apps Nerdpack that you served up. When you select the launcher, you see a Hello message. Step 4 of 8 Hard code your account ID For the purposes of this exercise and for your convenience, hard code your account ID. In the pageview-app-nerdlet directory, in the index.js file, add this code between the import and export lines. (Read about finding your account ID here). const accountId = [Replace with your account ID]; Copy Step 5 of 8 Import the TableChart component To show your data in a table chart, import the TableChart component from New Relic One. To do so, in index.js, add this code under import React. import { TableChart } from `nr1`; Copy Step 6 of 8 Add a table with a single row To add a table with a single row, in the index.js file, replace this line: return Hello, pageview-app-nerdlet Nerdlet! ; Copy with this export code: export default class PageViewApp extends React.Component { render() { return ( ); } } Copy Step 7 of 8 Customize the look of your table (optional) You can use standard CSS to customize the look of your components. In the styles.scss file, add this CSS. Feel free to customize this CSS to your taste. .container { width: 100%; height: 99vh; display: flex; flex-direction: column; .row { margin: 10px; display: flex; flex-direction: row; } .chart { height: 250px; } } Copy Step 8 of 8 Get your data into that table Now that you've got a table, you can drop a TableChart populated with data from the NRQL query you wrote at the very beginning of this guide. Put this code into the row div. ; Copy Go to New Relic One and click your app to see your data in the table. (You might need to serve your app to New Relic again.) Congratulations! You made your app! Continue on to make it interactive and show your data on a map. Make your app interactive with a text field Once you confirm that data is getting to New Relic from your app, you can start customizing it and making it interactive. To do this, you add a text field to filter your data. Later, you use a third-party library called Leaflet to show that data on a world map. Step 1 of 3 Import the TextField component Like you did with the TableChart component, you need to import a TextField component from New Relic One. import { TextField } from 'nr1'; Copy Step 2 of 3 Add a row for your text field To add a text field filter above the table, put this code above the TableChart div. The text field will have a default value of \"US\". { this.setState({ countryCode: event.target.value }); }} />
; Copy Step 3 of 3 Build the text field object Above the render() function, add a constructor to build the text field object. constructor(props) { super(props); this.state = { countryCode: null } } Copy Then, add a constructor to your render() function. Above return, add: const { countryCode } = this.state; Copy Now add countryCode to your table chart query. ; Copy Reload your app to try out the text field. Get your data on a map To create the map, you use npm to install Leaflet. Step 1 of 9 Install Leaflet In your terminal, type: npm install --save leaflet react-leaflet Copy In your nerdlets styles.scss file, import the Leaflet CSS: @import `~leaflet/dist/leaflet.css`; Copy While you're in styles.scss, fix the width and height of your map: .containerMap { width: 100%; z-index: 0; height: 70vh; } Copy Step 2 of 9 Add a webpack config file for Leaflet Add a webpack configuration file .extended-webpackrc.js to the top-level folder in your nerdpack. This supports your use of map tiling information data from Leaflet. module.exports = { module: { rules: [ { test: /\\.(png|jpe?g|gif)$/, use: [ { loader: 'file-loader', options: {}, }, { loader: 'url-loader', options: { limit: 25000 }, }, ], }, ], }, }; Copy Step 3 of 9 Import modules from Leaflet In index.js, import modules from Leaflet. import { Map, CircleMarker, TileLayer } from 'react-leaflet'; Copy Step 4 of 9 Import additional modules from New Relic One You need several more modules from New Relic One to make the Leaflet map work well. Import them with this code: import { NerdGraphQuery, Spinner, Button, BlockText } from 'nr1'; Copy NerdGraphQuery lets you make multiple NRQL queries at once and is what will populate the map with data. Spinner adds a loading spinner. Button gives you button components. BlockText give you block text components. Step 5 of 9 Get data for the map Using latitude and longitude with country codes, you can put New Relic data on a map. mapData() { const { countryCode } = this.state; const query = `{ actor { account(id: 1606862) { mapData: nrql(query: \"SELECT count(*) as x, average(duration) as y, sum(asnLatitude)/count(*) as lat, sum(asnLongitude)/count(*) as lng FROM PageView FACET regionCode, countryCode WHERE appName = 'WebPortal' ${countryCode ? ` WHERE countryCode like '%${countryCode}%' ` : ''} LIMIT 1000 \") { results nrql } } } }`; return query; }; Copy Step 6 of 9 Customize the map marker colors Above the mapData function, add this code to customize the map marker colors. getMarkerColor(measure, apdexTarget = 1.7) { if (measure <= apdexTarget) { return '#11A600'; } else if (measure >= apdexTarget && measure <= apdexTarget * 4) { return '#FFD966'; } else { return '#BF0016'; } }; Copy Feel free to change the HTML color code values to your taste. In this example, #11A600 is green, #FFD966 is sort of yellow, and #BF0016 is red. Step 7 of 9 Set your map's default center point Set a default center point for your map using latitude and longitude. const defaultMapCenter = [10.5731, -7.5898]; Copy Step 8 of 9 Add a row for your map Between the text field row and the table chart row, insert a new row for the map content using NerdGraphQuery. {({ loading, error, data }) => { if (loading) { return ; } if (error) { return 'Error'; } const { results } = data.actor.account.mapData; console.debug(results); return 'Hello'; }}
; Copy Reload your application in New Relic One to test that it works. Step 9 of 9 Replace \"Hello\" with the Leaflet code Replace return \"Hello\"; with: return ( {results.map((pt, i) => { const center = [pt.lat, pt.lng]; return ( { alert(JSON.stringify(pt)); }} /> ); })} ); Copy This code creates a world map centered on the latitude and longitude you chose using OpenStreetMap data and your marker colors. Reload your app to see the pageview data on the map!",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Build a New Relic app showing page view data on a world map.",
+ "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",
+ "popularity": 1,
+ "external_id": "6ff5d696556512bb8d8b33fb31732f22bab455cb",
+ "image": "https://developer.newrelic.com/static/d87a72e8ee14c52fdfcb91895567d268/0086b/pageview.png",
+ "url": "https://developer.newrelic.com/build-apps/map-pageviews-by-region/",
+ "published_at": "2020-08-18T02:11:48Z",
+ "updated_at": "2020-08-14T01:45:09Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.39790472,
+ "_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.",
+ "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"
+ },
+ {
+ "body": "Query and store data 10 min To help you build a New Relic One application, we provide you with the New Relic One SDK. Here you can learn how to use the SDK query components, which allow you to make queries and mutations via NerdGraph, our GraphQL endpoint. Query-related React components can be identified by the Query suffix. Mutation-related components can be identified by the Mutation prefix. Components overview Our data components are based on React Apollo. The most basic component is NerdGraphQuery, which accepts any GraphQL (or GraphQL AST generated by the graphql-tag library as the query parameter, and a set of query variables passed as variables. Over this query, we have created an additional set of queries, which can be divided into four groups: User queries: These allow you to query the current user and its associated accounts. Components in this category: UserStorageQuery and AccountsQuery. Entities queries: Because New Relic One is entity-centric, we use queries to make access to your entities easier. You can count, search, list, query, and favorite them. Components in this category: EntityCountQuery, EntitySearchQuery, EntitiesByDomainTypeQuery, EntitiesByGuidsQuery, EntityByGuidQuery, EntityByNameQuery. Storage queries: New Relic One provides a simple storage mechanism that we call NerdStorage. This can be used by Nerdpack creators to store application configuration setting data, user-specific data, and other small pieces of data. Components in this category: UserStorageQuery, AccountStorageQuery, EntityStorageQuery, UserStorageMutation, AccountStorageMutation, and EntityStorageMutation. For details, see NerdStorage. NRQL queries: To be able to query your New Relic data via NRQL (New Relic Query Language), we provide a NrqlQuery component. This component can return data in different formats, so that you can use it for charting and not only for querying. Query components All query components accept a function as a children prop where the different statuses can be passed. This callback receives an object with the following properties: loading: Boolean that is set to true when data fetching is happening. Our components use the cache-and-network strategy, meaning that after the data has loaded, subsequent data reloads might be triggered first with stale data, then refreshed when the most recent data has arrived. data: Root property where the data requested is retrieved. The structure matches a root structure based on the NerdGraph schema. This is true even for highly nested data structures, which means you’ll have to traverse down to find the desired data. error: Contains an Error instance when the query fails. Set to undefined when data is loading or the fetch was successful. fetchMore: Callback function that can be called when the query is being loaded in chunks. The function will only be present when it’s feasible to do so, more data is available, and no fetchMore has already been triggered. Data is loaded in batches of 200 by default. Other components provided by the platform (like the Dropdown or the List) are capable of accepting fetchMore, meaning you can combine them easily. Mutation components Mutation components also accept a children as a function, like the query ones. The mutation can be preconfigured at the component level, and a function is passed back that you can use in your component. This is the standard React Apollo approach for performing mutations, but you might find it easier to use our static mutation method added to the component. More on this topic below. Static methods All of the described components also expose a static method so that they can be used imperatively rather than declaratively. All Query components have a static Query method, and all Mutation components have a mutation method. These static methods accept the same props as their query component, but passed as an object. For example: // Declarative way (using components). function renderAccountList() { return ( ({data, error}) => { if (error) { return Failed to retrieve list: {error.message} ; } return data.map((account) => { {account.name} }); }} ); } // Imperative way (using promises). async function getAccountList() { let data = {}; try { data = await AccountsQuery.query(); } catch (error) { console.log('Failed to retrieve list: ' + error.message); return; } return data.actor.accounts.map((account) => { return account.name; }); } Copy Similarly, a mutation can happen either way; either declaratively or imperatively. NrqlQuery NrqlQuery deserves additional explanation, because there are multiple formats in which you can return data from it. To provide maximum functionality, all three are exposed through a formatType property. You can find its different values under NrqlQuery.formatType: NERD_GRAPH: Returns the format in which it arrives from NerdGraph. RAW: The format exposed by default in Insights and dashboards when being plotted as JSON. This format is useful if you have a pre-existing script in this format that you're willing to migrate to or incorporate with. CHART: The format used by the charting engine that we also expose. You can find a more detailed explanation of how to manipulate this format in the guide to chart components, and some examples. If you are willing to push data, we currently do not expose NrqlMutation. To do that, see the Event API for how to add custom events.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Reference guide for SDK query components using NerdGraph",
+ "sections": [
+ "Query and store data",
+ "Components overview",
+ "Query components",
+ "Mutation components",
+ "Static methods",
+ "NrqlQuery"
+ ],
+ "title": "Query and store data",
+ "popularity": 1,
+ "external_id": "cbbf363393edeefbc4c08f9754b43d38fd911026",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/query-and-store-data/",
+ "published_at": "2020-08-18T02:08:12Z",
+ "updated_at": "2020-08-01T01:42:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.29999372,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Query and store data ",
+ "sections": "Components overview ",
+ "info": "Reference guide for SDK query components using NerdGraph ",
+ "body": " be identified by the Query suffix. Mutation-related components can be identified by the Mutation prefix. Components overview Our data components are based on React Apollo. The most basic component is NerdGraphQuery , which accepts any Graph QL (or Graph QL AST generated by the graphql-tag library as the query "
+ },
+ "id": "5efa989e28ccbc2f15307deb"
+ },
+ {
+ "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Intro to New Relic One API components",
+ "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",
+ "popularity": 1,
+ "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.2660732,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Intro to New Relic One API components ",
+ "sections": "Query and storage components ",
+ "info": "Intro to New Relic One API components ",
+ "body": " is with NerdGraph , our Graph QL endpoint. This can be queried using NerdGraphQuery . To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph , see Queries and mutations. We also provide storage for storing small data sets, such as configuration"
+ },
+ "id": "5efa989e28ccbc4071307de5"
+ }
+ ],
+ "/explore-docs/query-and-store-data": [
+ {
+ "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,000 documents, plus storage type. Each document can have a maximum length of 64 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Intro to NerdStorage on New Relic One",
+ "sections": [
+ "Intro to NerdStorage",
+ "Use NerdStorage in your apps",
+ "Data model",
+ "Limits",
+ "Data access",
+ "Permissions for working with NerdStorage"
+ ],
+ "title": "Intro to NerdStorage",
+ "popularity": 1,
+ "external_id": "709e06c25376d98b2191ca369b4d139e5084bd62",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nerdstorage/",
+ "published_at": "2020-08-18T02:11:48Z",
+ "updated_at": "2020-08-14T01:50:34Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.25488237,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "body": " and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods ) or imperatively (by using the static methods for query and mutation ). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order"
+ },
+ "id": "5efa989ee7b9d2048e7bab92"
+ },
+ {
+ "body": "The New Relic Java agent API lets you control, customize, and extend the functionality of the APM Java agent. This API consists of: Static methods on the com.newrelic.api.agent.NewRelic class A @Trace annotation for implementing custom instrumentation A hierarchy of API objects providing additional functionality Use this API to set up custom instrumentation of your Java app and collect more in-depth data. For detailed information about this API, see the complete Javadoc on GitHub. Another way to set up custom instrumentation is to use XML instrumentation. The XML option is simpler and does not require modification of your app code, but it lacks the complete functionality of the Java agent API. For best results when using the API, ensure that you have the latest Java agent release. Several APIs used in the examples require Java agent 3.36.0 or higher. For all available New Relic APIs, see Intro to APIs. Use the API To access the API class, add newrelic-api.jar to your application class path. The jar is in the New Relic Java agent's installation zip file. You can call the API when the Java agent is not running. The API methods are just stubs; the implementation is added when the Java agent loads the class. Transactions To instrument Transactions in your application, use the following APIs. If you want to... Use this Create a Transaction when New Relic does not create one automatically @Trace(dispatcher = true) on the method that encompasses the work to be reported. When this annotation is used on a method within the context of an existing transaction, this will not start a new transaction, but rather include the method in the existing transaction. Capture the duration of a method that New Relic does not automatically trace @Trace() on the method you want to time. Set the name of the current Transaction NewRelic.setTransactionName(...) Start the timer for the response time of the current Transaction and to cause a Transaction you create to be reported as a Web transaction, rather than as an Other transaction NewRelic.setRequestAndReponse(...) Add custom attributes to Transactions and TransactionEvents NewRelic.addCustomParameter(...) Prevent a Transaction from being reported to New Relic NewRelic.ignoreTransaction() Exclude a Transaction when calculating your app's Apdex score NewRelic.ignoreApdex() Instrument asynchronous work For detailed information, see Java agent API for asynchronous applications. If you want to... Use this Trace an asynchronous method if it is linked to an existing Transaction... @Trace(async = true) Link the Transaction associated with the Token on the current thread... Token.link() or Token.linkAndExpire() Expire a Token associated with the current Transaction... Token.expire() Stop timing a Segment and have it report as part of its parent Transaction Segment.end() Stop timing a Segment and not have it report as part of its parent Transaction Segment.ignore() Implement distributed tracing These APIs require distributed tracing to be enabled. Distributed tracing lets you see the path that a request takes as it travels through a distributed system. For general instructions on how to use the calls below to implement distributed tracing, see Use distributed tracing APIs. If you want to... Use this Create a payload to be sent to a called service. Transaction.createDistributedTracePayload() For more on obtaining references to the current transaction and other entities, see Obtain references. Accept a payload sent from the first service; this will link these services together in a trace. Transaction.acceptDistributedTracePayload(...) For more on obtaining references to the current transaction and other entities, see Obtain references. Payload used to connect services. The text() call returns a JSON string representation of the payload. DistributedTracePayload.text() Payload used to connect services. The httpSafe() call returns a base64 encoded JSON string representation of the payload. DistributedTracePayload.httpSafe() Add custom attributes to SpanEvents in distributed traces NewRelic.getAgent().getTracedMethod().addCustomAttribute(...) Implement cross application tracing To track external calls and add cross application tracing, use the following APIs: If you want to... Use this Trace across a custom transport channel that New Relic does not support by default, such as a proprietary RPC transport Transaction.getRequestMetadata(), .processRequestMetadata(...), .getResponseMetadata(), .processResponseMetadata(...) Also refer to the information in this document about using Transaction to obtain references to New Relic entities. View or change the metric name or a rollup metric name of a TracedMethod (A rollup metric name, such as OtherTransaction/all, is not scoped to a specific transaction. It represents all background transactions.) TracedMethod.getMetricName(), .setMetricName(...), .setRollupMetricName(...) Also refer to the information in this document about using TracedMethod to obtain references to New Relic entities. Report a call to an external HTTP service, database server, message queue, or other external resource that is being traced using the Java agent API's @Trace annotation TracedMethod.reportAsExternal(...) passing arguments constructed using ExternalParameters builder. Also refer to the information in this document about using TracedMethod to obtain references to New Relic entities. Enable and add cross application tracing when communicating with an external HTTP or JMS service that is instrumented by New Relic TracedMethod.addOutboundRequestHeaders(...) along with TracedMethod.reportAsExternal(...) Also refer to the information in this document about using TracedMethod to obtain references to New Relic entities. Add timing for an application server or dispatcher that is not supported automatically Transaction.setRequest(...), Transaction.setResponse(...), or NewRelic.setRequestAndResponse(...), and Transaction.markResponseSent() Also refer to the information in this document about using Transaction to obtain references to New Relic entities. Obtain references to New Relic entities Other tasks require the New Relic Agent object. The Agent object exposes multiple objects that give you the following functionality: If you want to... Use this Get a reference to the current Transaction NewRelic.getAgent().getTransaction() Get a Token to link asynchronous work NewRelic.getAgent().getTransaction().getToken() Start and get a reference to a Segment NewRelic.getAgent().getTransaction().startSegment() Get a reference to the method currently being traced NewRelic.getAgent().getTracedMethod() Get a reference to the Agent logger NewRelic.getAgent().getLogger() Get a reference to the Agent configuration NewRelic.getAgent().getConfig() Get a reference to an aggregator for custom metrics NewRelic.getAgent().getAggregator() Get a reference to Insights in order to record custom events NewRelic.getAgent().getInsights() Additional API functionality The following APIs provide additional functionality, such as setting app server info, reporting errors, adding page load timing information, recording custom metrics, and sending custom events to Insights. If you want to... Use this Explicitly set port, name, and version information for an application server or dispatcher and the instance name for a JVM NewRelic.setAppServerPort(...), .setServerInfo(...), and .setInstanceName(...) Report an error that New Relic does not report automatically NewRelic.noticeError(...) When inside a transaction, the first call to noticeError wins. Only 1 error will be reported per transaction. Add browser page load timing for Transactions that New Relic does not add to the header automatically NewRelic.getBrowserTimingHeader(), .getBrowserTimingFooter(), .setUserName(String name), .setAccountName(String name), and .setProductName(String name) Create and accumulate custom metrics NewRelic.recordMetric(...), .recordResponseTimeMetric(...), or .incrementCounter(...) Record Insights custom events Insights.recordCustomEvent(...) Or, use NewRelic.addCustomParameter(...) to add custom attributes to the New Relic-defined TransactionEvent type. Also refer to the information in this document about using Insights to obtain references to New Relic entities. Additional API usage examples For detailed code examples about using the APIs, see New Relic's documentation about custom instrumentation for: External calls, cross application traces, messaging, datastores, and web frameworks Cross application tracing and external datastore calls Apps using custom instrumentation with annotation Custom framework instrumentation API Preventing unwanted instrumentation Inserting custom attributes Inserting custom events Collecting custom metrics For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / APM agents / Java agent / API guides",
+ "info": "A goal-focused guide to New Relic's Java agent API, with links to relevant sections of the complete API documentation on GitHub.",
+ "nodeid": 11521,
+ "sections": [
+ "Java agent",
+ "Getting started",
+ "Installation",
+ "Additional installation",
+ "Heroku",
+ "Configuration",
+ "Attributes",
+ "Features",
+ "Instrumentation",
+ "Custom instrumentation",
+ "API guides",
+ "Async instrumentation",
+ "Troubleshooting",
+ "Guide to using the Java agent API",
+ "Use the API",
+ "Transactions",
+ "Instrument asynchronous work",
+ "Implement distributed tracing",
+ "Implement cross application tracing",
+ "Obtain references to New Relic entities",
+ "Additional API functionality",
+ "Additional API usage examples",
+ "For more help"
+ ],
+ "title": "Guide to using the Java agent API ",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/agents/java-agent/api-guides/guide-using-java-agent-api",
+ "popularity": 1,
+ "external_id": "a31c751c7c29dd46effac2e568f7c0a92b033b18",
+ "category_1": "Java agent",
+ "category_2": "API guides",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/agents/java-agent/api-guides/guide-using-java-agent-api",
+ "published_at": "2020-08-18T10:50:48Z",
+ "updated_at": "2020-08-15T02:29:16Z",
+ "category_0": "APM agents",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.028378151,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "body": "The New Relic Java agent API lets you control, customize, and extend the functionality of the APM Java agent. This API consists of: Static methods on the com.newrelic.api.agent.NewRelic class A @Trace annotation for implementing custom instrumentation A hierarchy of API objects providing additional"
+ },
+ "id": "5a3137f4e621f4576cf1e35f"
+ },
+ {
+ "body": "[RSS] Released on: Wednesday, February 15, 2017 - 09:55 Download Improvements APIs This release adds a number of APIs that will allow you to instrument and get expanded visibility into frameworks, libraries, and any custom code that New Relic does not automatically instrument. In addition to instrumenting your web frameworks, you can also instrument calls to and from messaging systems, database calls, and external calls! By passing context about your code to the APIs, you will get the same reporting, including cross application tracing, that you get with New Relic’s built-in instrumentation. Solr This release adds support for Solr versions 5 and 6 (up to and including version 6.3.0). Fixes Fixes a bug that prevents an application from starting up when a JAX-RS annotated method contains more than 8 parameters. Fixes an issue that affected Spring and JAX-RS applications compiled with the Java 8 flag javac -parameters. The issue would cause the application to throw a java.lang.reflect.MalformedParametersException exception. Fixes bug that affected applications implementing JAX-RS endpoints using static methods. The agent now reports WildFly dispatcher name and version. Fixes a bug in which Queue Time could be misreported on the Overview page for customers injecting the X-Queue-Start or X-Request-Start HTTP headers. This fix brings the Java Agent into compliance with the behavior of other New Relic Agents. Fixes an issue in which custom Hystrix Commands that are subclassed multiple times in Groovy cause an application to throw an exception on startup.",
+ "type": "docs",
+ "document_type": "release_notes",
+ "breadcrumb": "Contents / Release notes / APM agent release notes / Java agent release notes",
+ "info": "",
+ "nodeid": 11976,
+ "sections": [
+ "APM agent release notes",
+ "Go agent release notes",
+ "Java agent release notes",
+ ".NET agent release notes",
+ "Node.js agent release notes",
+ "PHP agent release notes",
+ "Python agent release notes",
+ "Ruby agent release notes",
+ "C SDK release notes",
+ "Java Agent 3.36.0",
+ "Improvements",
+ "Fixes"
+ ],
+ "title": "Java Agent 3.36.0",
+ "popularity": -2,
+ "external_id": "f94f5c53e522a9835ea42514e90d9a39e81fd050",
+ "category_1": "APM agent release notes",
+ "category_2": "Java agent release notes",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/release-notes/agent-release-notes/java-release-notes/java-agent-3360",
+ "published_at": "2020-08-18T03:10:52Z",
+ "updated_at": "2018-04-14T23:39:35Z",
+ "category_0": "Release notes",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.026818182,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "body": " with the Java 8 flag javac -parameters. The issue would cause the application to throw a java.lang.reflect.MalformedParametersException exception. Fixes bug that affected applications implementing JAX-RS endpoints using static methods . The agent now reports WildFly dispatcher name and version. Fixes a bug"
+ },
+ "id": "58a53cf38e9c0f755a81db4e"
+ },
+ {
+ "body": "For your New Relic-monitored Java application, one custom instrumentation method is to use an XML file that lists the methods and classes you want to instrument. This documentation shows an example XML instrumentation file. For more information, see Java instrumentation by XML. Edit XML file in UI To edit your XML file directly from the New Relic UI: Go to one.newrelic.com > APM > (select an app) > Settings > Instrumentation. From here you can: Download a sample XML file. Select an edit existing XML file. Search the instrumentation history. XML file format The XML file format includes root and child nodes. Do not instrument all of your methods, as this can lead to a metric grouping issue. Root node: extension The root node of an XML file is extension. It can have three different attributes: Value Definition name A unique but descriptive name identifying your XML extension. enabled Identifies whether the extension will be read by the Java agent. Default is true. If false, New Relic will ignore the extension. version The version of the extension. If two extensions have the same name, only the extension with the highest version will be used. Instrumentation (child of extension) The instrumentation node is a child of extension. It can have one attribute: metricPrefix. This is the prefix used for the metric names when the nameTransaction node is not specified. Default is CUSTOM. Pointcut (child of instrumentation) The pointcut is a child node of instrumentation and can have several attributes. Also, a pointcut can have several different child nodes. Value Definition transactionStartPoint If a transaction is not already in progress when this pointcut is reached, then a transaction will be started. If a transaction is already in progress, then that transaction will continue. A new transaction will not be created. metricNameFormat The name format to use for a metric. If not present, then this will default to the class name followed by the method name. You can only set the metricNameFormat on pointcuts where transactionStartPoint is set to false. excludeFromTransactionTrace When true the transaction trace will not be provided if this pointcut initiates the transaction. If the pointcut is reached in the middle of a transaction, then the transaction trace will still be present, but this method will be excluded from the call graph. ignoreTransaction When true the entire transaction will be ignored. transactionType Sets the type of the transaction. Possible values are background (default, reported as a non-web transaction) and web (reported as a web transaction). Child nodes for pointcut A pointcut can have several different child nodes: Value Definition nameTransaction If this element is present, the agent will name the transaction using the class name and method(s) instrumented by this pointcut. methodAnnotation The case sensitive full name of an annotation class including the package name. All methods that are marked with this annotation will be matched. className The case sensitive name of the class to match, including the package name. Pair this node with the method node. If this node is present on a pointcut, then the interfaceName node cannot be present on the same pointcut node. The className node has the attribute includeSubclasses. If true the methods on the class with the matching name will be instrumented along with the matching methods on any child class of this class. If false (default), only methods on the exact class specified will be instrumented. The className must follow these rules: Inner classes can be instrumented. The full package structure with dots between packages must be used. To match subclasses of the specified class, set the attribute includeSubclasses to true. interfaceName The case sensitive name of an interface, including the package name, whose implementation classes will be matched. Pair this node with the method node. If this node is present on a pointcut, then the className node cannot be present on the same pointcut node. The interfaceName must follow this rule: The full package structure with dots between packages must be used. method A method on the class to instrument. Pair this node with a className node. Also, the method node can have children. Child nodes for method The method node can have several children. For more information and examples, see Troubleshooting Java custom instrumentation. Value Definition name The exact case sensitive name of the method to match. A method name node must follow these rules: Public, protected, private, and package methods can all be instrumented. Static and instance methods can be instrumented. Constructors cannot be instrumented. parameters The parameter types of the method specified in order. If the parameters element is not present, then all methods matching the name will be matched. This includes private and protected declarations. A method parameters node contains a list of the method's parameters, specified by type elements. Here are the major rules for the type elements: Primitives are specified using their normal name: int, float, double, long, byte, short, boolean, char. Objects require a full package structure. For example, do not use String in the XML; instead, use java.lang.String. Do not use generics with collection objects. For example, write java.util.List instead of java.util.List. Include brackets for arrays. For example, an array of integers will be int[ ] and an array of strings will be java.lang.String[ ]. Include two sets of brackets for an array of arrays. For example, an array of arrays of longs would be long[ ][ ]. To send the parameter as an analytic event to New Relic One, add an XML attribute to the type element called attributeName. To use a method with no parameters, the parameters node needs to be present to match a \"no arguments\" method. returnType The case sensitive name of a class indicating a return type to match. All methods that return this class type will be matched. Example Here is a sample class and an XML file that could be used to instrument that class. Sample class package test; import java.util.HashMap; import java.util.Map; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; public class SampleTester { private String configName; private Map maxSampleTimes; public SampleTester(String pConfigName) { configName = pConfigName; maxSampleTimes = new HashMap<>(); } public void checkSample(String name, long[] times) { if (times != null) { maxSampleTimes.put(name, getFirst(times)); } else { maxSampleTimes.put(name, (long) getFirst()); } } private Long getFirst(long[] times) { return times[0]; } private int getFirst() { return 0; } public void printMaxRepeat(final long max) throws Exception { Runnable myRunnable = new Runnable() { public void run() { try { printMax(max); } catch (Exception e) { e.printStackTrace(); } } }; ScheduledExecutorService scheduledExecutor = Executors.newScheduledThreadPool(1); scheduledExecutor.scheduleWithFixedDelay(myRunnable, 0, 10000, TimeUnit.MILLISECONDS); } private void printMax(long max) { System.out.println(\"max is \" + max); } } Sample XML instrumentation file and explanation test.SampleTester checkSample java.lang.String long[] getFirst run test.SampleTester printMaxRepeat printMax The first block of the XML file specifies the name and version of the extension. As the XML extension is default enabled, that attribute is not specified. The second block specifies the methods in SampleClass that should be instrumented. A transaction is started at the beginning of the block. It is worth noting that in the example class, there are two methods that share a name (getFirst) but have different signatures. These are instrumented with a single method node. By removing the parameters node, all methods with the same name can be matched under one method node. In the third block, the specified methods do not have a transaction started on them. This is because the transaction has already been started in run. The transaction will not be ignored, and will be included in the transaction trace. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / APM agents / Java agent / Custom instrumentation",
+ "info": "With New Relic monitoring for Java, you can use XML files to set up custom instrumentation of your Java application.",
+ "nodeid": 2341,
+ "sections": [
+ "Java agent",
+ "Getting started",
+ "Installation",
+ "Additional installation",
+ "Heroku",
+ "Configuration",
+ "Attributes",
+ "Features",
+ "Instrumentation",
+ "Custom instrumentation",
+ "API guides",
+ "Async instrumentation",
+ "Troubleshooting",
+ "Java XML instrumentation examples",
+ "Edit XML file in UI",
+ "XML file format",
+ "Example",
+ "For more help"
+ ],
+ "title": "Java XML instrumentation examples",
+ "popularity": 1,
+ "external_id": "d14a2215072dd950be5807e5cbd2acf0b793c573",
+ "category_1": "Java agent",
+ "category_2": "Custom instrumentation",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/agents/java-agent/custom-instrumentation/java-xml-instrumentation-examples",
+ "published_at": "2020-08-18T11:53:43Z",
+ "updated_at": "2020-08-18T11:53:43Z",
+ "category_0": "APM agents",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.02058597,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "body": " must follow these rules: Public, protected, private, and package methods can all be instrumented. Static and instance methods can be instrumented. Constructors cannot be instrumented. parameters The parameter types of the method specified in order. If the parameters element is not present, then all"
+ },
+ "id": "5ab28d72827a66324f05caa3"
+ },
+ {
+ "body": "newrelic_add_custom_tracer(string $function_name) Specify functions or methods for the agent to instrument with custom instrumentation. Requirements Compatible with all agent versions. Description Specify functions or methods for the agent to target for custom instrumentation. This is the API equivalent of the newrelic.transaction_tracer.custom setting. You cannot apply custom tracing to internal PHP functions. Parameters Parameter Description $function_name string Required. The name can be formatted either as function_name for procedural functions, or as \"ClassName::method\" for methods. Both static and instance methods will be instrumented if the method syntax is used, and the class name must be fully qualified: it must include the full namespace if the class was defined within a namespace. Return value(s) Returns true if the tracer was added successfully. Example(s) Instrument a function function example_function() { if (extension_loaded('newrelic')) { // Ensure PHP agent is available newrelic_add_custom_tracer(\"example_function\"); } } Instrument a method within a class class ExampleClass { function example_method() { if (extension_loaded('newrelic')) { // Ensure PHP agent is available newrelic_add_custom_tracer(\"ExampleClass::example_method\"); } } } Instrument a method within a namespaced class namespace Foo\\Bar; class ExampleClass { function example_method() { if (extension_loaded('newrelic')) { // Ensure PHP agent is available newrelic_add_custom_tracer(\"Foo\\\\Bar\\\\ExampleClass::example_method\"); } } } Alternatively, on PHP 5.5 or later, the ::class syntax can be used instead: namespace Foo\\Bar { class ExampleClass { function example_method() { // ... } } } namespace { use Foo\\Bar; if (extension_loaded('newrelic')) { // Ensure PHP agent is available newrelic_add_custom_tracer(Bar::class . \"::example_method\"); } } }",
+ "type": "docs",
+ "document_type": "api_doc",
+ "breadcrumb": "Contents » APM agents / PHP agent / PHP agent API",
+ "info": "New Relic PHP agent API call to add custom instrumentation to particular methods in your app code. ",
+ "nodeid": 11821,
+ "sections": [
+ "PHP agent",
+ "Getting started",
+ "Installation",
+ "Advanced installation",
+ "Configuration",
+ "API guides",
+ "PHP agent API",
+ "Attributes",
+ "Features",
+ "Frameworks and libraries",
+ "Troubleshooting",
+ "newrelic_add_custom_tracer",
+ "Requirements",
+ "Description",
+ "Parameters",
+ "Return value(s)",
+ "Example(s)",
+ "Instrument a function",
+ "Instrument a method within a class",
+ "Instrument a method within a namespaced class",
+ "For more help"
+ ],
+ "title": "newrelic_add_custom_tracer (PHP agent API)",
+ "popularity": 1,
+ "external_id": "12242c1e6fe8cb70e2d42ff670cad04c01e9317e",
+ "category_1": "PHP agent",
+ "category_2": "PHP agent API",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/agents/php-agent/php-agent-api/newrelic_add_custom_tracer",
+ "published_at": "2020-08-18T03:05:13Z",
+ "updated_at": "2019-09-30T22:55:59Z",
+ "category_0": "APM agents",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.01595171,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Instrument a method within a class",
+ "info": "New Relic PHP agent API call to add custom instrumentation to particular methods in your app code. ",
+ "body": " static and instance methods will be instrumented if the method syntax is used, and the class name must be fully qualified: it must include the full namespace if the class was defined within a namespace. Return value(s) Returns true if the tracer was added successfully. Example(s) Instrument"
+ },
+ "id": "58ca4191e621f45edd466e7a"
+ }
+ ],
+ "/build-apps/publish-deploy": [
+ {
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "Tip",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "popularity": 1,
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-18T01:50:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.29266515,
+ "_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"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
+ "type": "developer",
+ "document_type": "page",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "sections": [
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
+ ],
+ "title": "New Relic CLI Reference",
+ "popularity": 1,
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-08-18T02:11:50Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.047144882,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic CLI Reference",
+ "sections": "New Relic CLI Reference",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "tags": "new relic cli",
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs"
+ },
+ "id": "5efa989ee7b9d2024b7bab97"
+ },
+ {
+ "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.",
+ "sections": [
+ "Get started with the New Relic CLI",
+ "Before you begin",
+ "Install the New Relic CLI",
+ "Linux",
+ "macOS",
+ "Windows",
+ "Create your New Relic CLI profile",
+ "Get your application details",
+ "Add a simple tag to your application",
+ "Bonus step: Create a deployment marker",
+ "Next steps"
+ ],
+ "title": "Get started with the New Relic CLI",
+ "popularity": 1,
+ "tags": [
+ "api key",
+ "New Relic CLI",
+ "Tags",
+ "Entity",
+ "Deployment markers"
+ ],
+ "external_id": "531f2f3985bf64bb0dc92a642445887095048882",
+ "image": "",
+ "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/",
+ "published_at": "2020-08-18T02:06:05Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.030464739,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the New Relic CLI",
+ "sections": "Create your New Relic CLI profile",
+ "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.",
+ "tags": "New Relic CLI",
+ "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow"
+ },
+ "id": "5efa999c196a67c4e1766461"
+ },
+ {
+ "body": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application. In this guide, you are going to build a sample table using various New Relic One components. Before you begin If you haven't already installed the New Relic One CLI, step through the quick start in New Relic One. This process also gets you an API key. In addition, to complete the steps in this guide, you need a GitHub account, and to have Node.js installed on your machine. See [Setting up your development environment](/build-apps/set-up-dev-env) for more info. Clone and set up the example application Step 1 of 4 Clone the nr1-how-to example application from GitHub to your local machine. Then, navigate to the app directory. The example app lets you experiment with tables. git clone https://github.com/newrelic/nr1-how-to.git` cd nr1-how-to/create-a-table/nerdlets/create-a-table-nerdlet` Copy Step 2 of 4 Edit the index.json file and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install dependencies nr1 nerdpack:serve # Serve the demo app locally Copy Step 4 of 4 Open one.newrelic.com/?nerdpacks=local in your browser. Click Apps*, and then in the Other apps section, you should see a Create a table** launcher. That's the demo application you're going to work on. Go ahead and select it. Have a good look at the demo app. There's a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You'll use Table components to add a new table in the second row. Work with table components Step 1 of 10 Navigate to the `nerdlets/create-a-table-nerdlet` subdirectory and open the `index.js` file. Add the following components to the import statement at the top of the file so that it looks like the example: Table TableHeader TableHeaderCell TableRow TableRowCell import { Table, TableHeader, TableHeaderCell, TableRow, TableRowCell, PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart, } from 'nr1'; Copy Step 2 of 10 Add a basic Table component Locate the empty GridItem in index.js: This is where you start building the table. Add the initial component. The items property collects the data by calling _getItems(), which contains sample values. ; Copy Step 3 of 10 Add the header and rows As the Table component renders a fixed number of header cells and rows, your next step is adding header components, as well as a function that returns the required table rows. Inside of the Table component, add the TableHeader and then a TableHeaderCell child for each heading. Since you don't know how many rows you'll need, your best bet is to call a function to build as many TableRows as items returned by _getItems(). Application Size Company Team Commit ; { ({ item }) => ( {item.name} {item.value} {item.company} {item.team} {item.commit} ); } Copy Step 4 of 10 Take a look at the application running in New Relic One: you should see something similar to the screenshot below. Step 5 of 10 Replace standard table cells with smart cells The New Relic One library includes cell components that can automatically format certain data types, like users, metrics, and entity names. The table you've just created contains columns that can benefit from those components: Application (an entity name) and Size (a metric). Before you can use EntityTitleTableRowCell and MetricTableRowCell, you have to add them to the import statement first. import { EntityTitleTableRowCell, MetricTableRowCell, ... /* All previous components */ } from 'nr1'; Copy Step 6 of 10 Update your table rows by replacing the first and second TableRowCells with entity and metric cells. Notice that EntityTitleTableRowCell and MetricTableRowCell are self-closing tags. { ({ item }) => ( {item.company} {item.team} {item.commit} ); } Copy Step 7 of 10 Time to give your table a second look: The cell components you've added take care of properly formatting the data. Step 8 of 10 Add some action to your table! Tables are great, but interactive tables can be better: As a last update, you are going to allow users to act on each data row. Add the _getActions() method to your index.js file, right before _getItems(). As you may have guessed from the code, _getActions() spawns an alert box when you click Team or Commit cells. _getActions() { return [ { label: 'Alert Team', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__ALERT, onClick: (evt, { item, index }) => { alert(`Alert Team: ${item.team}`); }, }, { label: 'Rollback Version', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__UNDO, onClick: (evt, { item, index }) => { alert(`Rollback from: ${item.commit}`); }, }, ]; } Copy Step 9 of 10 Find the TableRow component in your return statement and point the actions property to _getActions(). The TableRow actions property defines a set of actions that appear when the user hovers over a table row. Actions have a mandatory text and an onClick callback, but can also display an icon or be disabled if needed. Copy Step 10 of 10 Go back to your application and try hovering over any of the rows: Notice how the two available actions appear. When you click them, a function triggers with the selected row data as an argument, and an alert displays in your browser. Next steps You've built a table into a New Relic One application, using components to format data automatically and provide contextual actions. Well done! Keep exploring the Table components, their properties, and how to use them, in our SDK documentation.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Add a table to your New Relic One app.",
+ "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",
+ "popularity": 1,
+ "external_id": "7ff7a8426eb1758a08ec360835d9085fae829936",
+ "image": "https://developer.newrelic.com/static/e637c7eb75a9dc01740db8fecc4d85bf/1d6ec/table-new-cells.png",
+ "url": "https://developer.newrelic.com/build-apps/howto-use-nrone-table-components/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-14T01:46:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.0036841223,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Add tables to your New Relic One application ",
+ "sections": "Add tables to your New Relic One application ",
+ "info": "Add a table to your New Relic One app .",
+ "body": "-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app , install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update"
+ },
+ "id": "5efa989ee7b9d2ad567bab51"
+ },
+ {
+ "body": "For accounts on our New Relic One pricing plan, this document explains: How to add and manage users User types and user groups This doc is for accounts on our New Relic One pricing plan. If you're on our original product-based pricing plan, see Original user roles. Not sure which you're on? See Overview of pricing and account/user structure. Manage users Here are some important user management tips to remember and share with your team members: Basic users, who are free users, can self-serve to become billable full users. A New Relic user can have a maximum of either three concurrent active sessions, or three unique IP addresses in use at any given time. To manage users: from one.newrelic.com, select Apps from the top navigation, and then select User management. User type For accounts on the New Relic One pricing plan, the user type determines the monitoring and analysis features a user has access to. (Note that this does not control account admin-related permissions; that's determined by the user group.) User types include: Basic user: These users are free and have access to basic features like setting up reporting of data to New Relic, running queries of your data, making custom charts and dashboards, and setting up alert notifications. These users do not have access to Full-Stack Observability features. For details, see the capability table below. Full user: These users have access to Full-Stack Observability features, including our curated UI experiences for APM, infrastructure monitoring, browser monitoring, mobile monitoring, and synthetic monitors. The Standard pricing tier includes one full user. For details, see the capability table below. The number of full users is not the only pricing factor: Learn more about pricing. For details about full user and basic user capabilities, expand this collapser: Capabilities for full users vs. basic users Below are some important differences between basic user and full user capabilities. In short, basic users have access to our Telemetry Data Platform and Applied Intelligence (read-only) features, while full users have access to that plus Full-Stack Observability features. Features Full user Basic user Full-Stack Observability (New Relic-built UI experiences) Application performance monitoring (APM) UI fa-check Infrastructure monitoring UI fa-check Digital Experience Monitoring (Browser, Mobile, Synthetics) UI fa-check Serverless monitoring UI fa-check Logs in context with other UI experiences fa-check Synthetics checks fa-check New Relic Edge with Infinite Tracing (tail-based sampling) fa-check (Pro and Enterprise) Subscribe to New Relic One catalog apps fa-check Applied Intelligence (AI) Proactive Detection fa-check fa-check (read-only) Incident Intelligence fa-check fa-check (read-only) Telemetry Data Platform Data ingest from any source (Metrics, Events, Logs, Traces) fa-check fa-check Alerts and notifications fa-check fa-check Interactive query interface fa-check fa-check Custom charts and dashboards (not New Relic-built) fa-check fa-check Encryption at rest fa-check fa-check Standard data retention fa-check fa-check NerdGraph (GraphQL) API fa-check fa-check Security and compliance fa-check fa-check Integrations fa-check fa-check Data management fa-check fa-check Logs UI fa-check fa-check Build custom New Relic One apps fa-check fa-check User group When full users (not basic users) are added, there are additional choices related to account administration. For the Standard pricing tier, the two user groups available are: Admin: Adding someone to the Admin group gives them configuration and administrative abilities like adding/editing users, editing account and billing settings, and configuring some settings. User: Adding someone to the User group allows them to use and configure features but not manage users or billing. Coming soon: Pro and Enterprise tiers include additional admin functionalities and group-related features. Capability limitations There are some temporary limitations for users on the newer model, mainly around API access. For details, see Limitations. Query usage data See Query usage data. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / New Relic accounts / Accounts and billing / New Relic One pricing and users",
+ "info": "For New Relic accounts on our New Relic One pricing plan, an explanation of user roles. ",
+ "nodeid": 39356,
+ "sections": [
+ "Accounts and billing",
+ "Account setup",
+ "Account structure",
+ "New Relic One pricing and users",
+ "General account settings",
+ "Automated user management",
+ "SAML single sign on",
+ "Partner install",
+ "New Relic One users and roles",
+ "Manage users",
+ "User type",
+ "User group",
+ "Capability limitations",
+ "Query usage data",
+ "For more help"
+ ],
+ "title": "New Relic One users and roles ",
+ "popularity": 1,
+ "external_id": "6b424e8f440119aa9d9529ef1cf91fac524e2991",
+ "category_1": "Accounts and billing",
+ "category_2": "New Relic One pricing and users",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/accounts/accounts-billing/new-relic-one-pricing-users/users-roles",
+ "published_at": "2020-08-18T17:39:18Z",
+ "updated_at": "2020-08-15T05:13:24Z",
+ "category_0": "New Relic accounts",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.0031960718,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One users and roles ",
+ "sections": "New Relic One pricing and users",
+ "info": "For New Relic accounts on our New Relic One pricing plan, an explanation of user roles. ",
+ "category_0": "New Relic accounts",
+ "category_1": "Accounts and billing",
+ "category_2": "New Relic One pricing and users",
+ "body": " Overview of pricing and account/user structure. Manage users Here are some important user management tips to remember and share with your team members: Basic users, who are free users, can self-serve to become billable full users. A New Relic user can have a maximum of either three concurrent active",
+ "breadcrumb": "Contents / New Relic accounts / Accounts and billing / New Relic One pricing and users"
+ },
+ "id": "5f22d159196a67f322b53d0a"
+ }
+ ],
+ "/build-apps/build-hello-world-app": [
+ {
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "Tip",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "popularity": 1,
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-18T01:50:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 1.0103776,
+ "_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"
+ },
+ {
+ "body": "Nerdpack file structure A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. Here we explain: The file structure for a Nerdpack, a Nerdlet, and a launcher How to link a launcher file to a Nerdlet How to link your application with a monitored entity For basic component definitions, see our component reference. Generate Nerdpack components There are two ways to generate a Nerdpack template: Generate a Nerdpack: Use the New Relic One CLI command nr1 create and select Nerdpack to create a Nerdpack template that includes a Nerdlet and a launcher. Generate Nerdlet or launcher individually: Use the New Relic One CLI command nr1 create and choose either Nerdlet or launcher. This can be useful when adding Nerdlets to an existing Nerdpack. For documentation on generating and connecting Nerdpack components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │ └── my-nerdlet-launcher │ ├── icon.png │ └── nr1.json ├── nerdlets │ └── my-nerdlet-nerdlet │ ├── index.js │ ├── nr1.json │ └── styles.scss ├── node_modules │ ├── js-tokens │ ├── loose-envify │ ├── object-assign │ ├── prop-types │ ├── react │ ├── react-dom │ ├── react-is │ └── scheduler ├── nr1.json ├── package-lock.json └── package.json Copy Nerdlet file structure A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files, index.js, nr1.json, and styles.scss. Here is what the default files look like after being generated using the nr1 create command: index.js The JavaScript code of the Nerdlet. import React from 'react'; export default class MyAwesomeNerdpack extends React.Component { render() { return Hello, my-awesome-nerdpack Nerdlet! ; } } Copy nr1.json The Nerdlet configuration file. { \"schemaType\": \"NERDLET\", \"id\": \"my-awesome-nerdpack-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\" } Copy Besides using the launcher as the access point for your application, you can also associate the application with a monitored entity to get it to appear in the entity explorer. To do this, add two additional fields to the config file of the first-launched Nerdlet: entities and actionCategory. In the following example, the Nerdlet has been associated with all Browser-monitored applications and will appear under the Monitor UI category : { \"schemaType\": \"NERDLET\", \"id\": \"my-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"Custom Data\", \"entities\": [{ \"domain\": \"BROWSER\", \"type\": \"APPLICATION\" }], \"actionCategory\": \"monitor\" } Copy To see this application in the UI, you would go to the entity explorer, select Browser applications, and select a monitored application. styles.scss An empty SCSS file for styling your application. icon.png The launcher icon that appears on the Apps page in New Relic One when an application is deployed. Launcher file structure Launchers have their own file structure. Note that: A launcher is not required; as an alternative to using a launcher, you can associate your application with a monitored entity. An application can have more than one launcher, which might be desired for an application with multiple Nerdlets. After generating a launcher using the nr1 create command, its folder contains two files: nr1.json The configuration file. { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy To connect a launcher to a Nerdlet, the rootNerdletId must match the id in the launched Nerdlet's nr1.json config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet. icon.png The icon displayed on the launcher for the app on the Apps page.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the Nerdpack File Structure",
+ "sections": [
+ "Nerdpack file structure",
+ "Generate Nerdpack components",
+ "Nerdlet file structure",
+ "index.js",
+ "nr1.json",
+ "styles.scss",
+ "icon.png",
+ "Launcher file structure"
+ ],
+ "title": "Nerdpack file structure",
+ "popularity": 1,
+ "external_id": "c97bcbb0a2b3d32ac93b5b379a1933e7b4e00161",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nerdpack-file-structure/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-14T01:49:25Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.7917644,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Nerdpack file structure ",
+ "sections": "Nerdpack file structure ",
+ "info": "An overview of the Nerdpack File Structure ",
+ "body": " components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure : my-nerdlet ├── README.md ├── launchers │ └── my-nerdlet-launcher │ ├── icon.png"
+ },
+ "id": "5efa989e196a671300766404"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
+ "type": "developer",
+ "document_type": "page",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "sections": [
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
+ ],
+ "title": "New Relic CLI Reference",
+ "popularity": 1,
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-08-18T02:11:50Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.510402,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic CLI Reference",
+ "sections": "New Relic CLI Reference",
+ "tags": "new relic cli ",
+ "body": " - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads"
+ },
+ "id": "5efa989ee7b9d2024b7bab97"
+ },
+ {
+ "body": "A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. This document explains: The file structure for a Nerdpack, a Nerdlet and a launcher How to link a launcher file to a Nerdlet How to link your application with a monitored entity For basic component definitions, see our developer site. Generate Nerdpack components There are two ways to generate a Nerdpack template: Generate Nerdpack. Use the CLI command nr1 create and select Nerdpack to create a Nerdpack template that includes a Nerdlet and a launcher. Generate Nerdlet or launcher individually. You can use the CLI command nr1 create and choose to select either a Nerdlet or launcher. This may be useful when adding Nerdlets to an existing Nerdpack. For a lesson on generating and connecting Nerdpack components, see the workshop. Nerdpack file structure When you generate a Nerdpack template using the CLI nr1 create command, it has this file structure: my-nerdlet ├── README.md ├── launchers │ └── my-nerdlet-launcher │ ├── icon.png │ └── nr1.json ├── nerdlets │ └── my-nerdlet-nerdlet │ ├── index.js │ ├── nr1.json │ └── styles.scss ├── node_modules │ ├── js-tokens │ ├── loose-envify │ ├── object-assign │ ├── prop-types │ ├── react │ ├── react-dom │ ├── react-is │ └── scheduler ├── nr1.json ├── package-lock.json └── package.json Nerdlet file structure A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files: index.js The JavaScript code. Here's what the default file looks like when a Nerdlet is generated with the CLI nr1 create: import React from 'react'; export default class MyAwesomeNerdpack extends React.Component { render() { return Hello, my-awesome-nerdpack Nerdlet! } } nr1.json Configuration file. Here is the default file generated by the CLI nr1 create command: { \"schemaType\": \"NERDLET\", \"id\": \"my-awesome-nerdpack-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\" } Besides using the launcher as the access point for your application, you can also associate the application with a monitored entity to get it to appear in the New Relic One entity explorer. To do this, add two additional fields to the config file of the first-launched Nerdlet: entities and actionCategory. In the following example, the Nerdlet has been associated with all New Relic Browser-monitored applications and will appear under the Monitor UI category : { \"schemaType\": \"NERDLET\", \"id\": \"my-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"Custom Data\", \"entities\": [{\"domain\": \"BROWSER\", \"type\": \"APPLICATION\"}], \"actionCategory\": \"monitor\" } To see this application in the UI, you would go to the New Relic One entity explorer, select Browser applications, and select a monitored application. styles.scss The file for CSS styles (Sass SCSS syntax). Launcher file structure When an application with a launcher file has been deployed, its launcher is located on the New Relic One home page (one.newrelic.com). A launcher is not required; as an alternative to using a launcher, you can associate your application with a monitored entity. An application can have more than one launcher; this may be desired for an application with multiple Nerdlets. A launcher folder contains two files: nr1.json The configuration file. Here is the default file template created by the nr1 create command: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } To connect a launcher to a Nerdlet, the rootNerdletId must match the id in the launched Nerdlet's nr1.json config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet. icon.png The launcher icon that appears on the one.newrelic.com home page when an application is deployed. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / New Relic One / Use New Relic One / Build on New Relic One",
+ "info": "For building a New Relic One application: an explanation of the Nerdpack/Nerdlet file structure. ",
+ "nodeid": 36006,
+ "sections": [
+ "Use New Relic One",
+ "Get started",
+ "Core concepts",
+ "UI and data",
+ "Workloads",
+ "Build on New Relic One",
+ "Nerdpack file structure",
+ "Generate Nerdpack components",
+ "Nerdlet file structure",
+ "Launcher file structure",
+ "For more help"
+ ],
+ "title": "Nerdpack file structure",
+ "popularity": 1,
+ "external_id": "6e3788bee17cb65b6dc210862e2a10399f78ff67",
+ "category_1": "Use New Relic One",
+ "category_2": "Build on New Relic One",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/new-relic-one-application-nerdpack-file-structure",
+ "published_at": "2020-08-18T15:32:31Z",
+ "updated_at": "2020-07-25T00:32:16Z",
+ "category_0": "New Relic One",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.44179532,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Nerdpack file structure ",
+ "sections": "Nerdpack file structure ",
+ "info": "For building a New Relic One application : an explanation of the Nerdpack /Nerdlet file structure . ",
+ "category_0": "New Relic One ",
+ "category_1": "Use New Relic One ",
+ "category_2": "Build on New Relic One ",
+ "body": " file structure When you generate a Nerdpack template using the CLI nr1 create command, it has this file structure : my-nerdlet ├── README.md ├── launchers │ └── my-nerdlet-launcher │ ├── icon.png │ └── nr1 .json ├── nerdlets │ └── my-nerdlet-nerdlet │ ├── index.js │ ├── nr1 .json │ └── styles.scss",
+ "breadcrumb": "Contents / New Relic One / Use New Relic One / Build on New Relic One "
+ },
+ "id": "5da0e07a64441f1328edf241"
+ },
+ {
+ "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Intro to New Relic One API components",
+ "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",
+ "popularity": 1,
+ "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.36209166,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Intro to New Relic One API components",
+ "sections": "Intro to New Relic One API components",
+ "info": "Intro to New Relic One API components",
+ "body": ", and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1 , which you get when you install the NR1 CLI . The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform"
+ },
+ "id": "5efa989e28ccbc4071307de5"
+ }
+ ],
+ "/build-apps/set-up-dev-env": [
+ {
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "Tip",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "popularity": 1,
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-18T01:50:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 14.765135,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI reference",
+ "sections": "New Relic One CLI reference",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "tags": "New Relic One app",
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI . The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.",
+ "sections": [
+ "Get started with the New Relic CLI",
+ "Before you begin",
+ "Install the New Relic CLI",
+ "Linux",
+ "macOS",
+ "Windows",
+ "Create your New Relic CLI profile",
+ "Get your application details",
+ "Add a simple tag to your application",
+ "Bonus step: Create a deployment marker",
+ "Next steps"
+ ],
+ "title": "Get started with the New Relic CLI",
+ "popularity": 1,
+ "tags": [
+ "api key",
+ "New Relic CLI",
+ "Tags",
+ "Entity",
+ "Deployment markers"
+ ],
+ "external_id": "531f2f3985bf64bb0dc92a642445887095048882",
+ "image": "",
+ "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/",
+ "published_at": "2020-08-18T02:06:05Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 6.516817,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the New Relic CLI ",
+ "sections": "Get started with the New Relic CLI ",
+ "info": "Learn the essentials of the New Relic CLI , from install and configuration to basic usage.",
+ "tags": "New Relic CLI ",
+ "body": ". This guide walks you through the essentials of New Relic CLI , from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key , which you can create from the Account settings of your New Relic account An instrumented application in your"
+ },
+ "id": "5efa999c196a67c4e1766461"
+ },
+ {
+ "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return \"Hello, World!\" ; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Build a \"Hello, World!\" app and publish it to New Relic One",
+ "sections": [
+ "Create a \"Hello, World!\" application",
+ "Before you begin",
+ "Tip",
+ "Create a local version of the \"Hello, World!\" application",
+ "Publish your application to New Relic",
+ "Add details to describe your project",
+ "Subscribe accounts to your application",
+ "Summary",
+ "Related information"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "popularity": 1,
+ "tags": [
+ "nr1 cli",
+ "Nerdpack file structure",
+ "NR One Catalog",
+ "Subscribe applications"
+ ],
+ "external_id": "aa427030169067481fb69a3560798265b6b52b7c",
+ "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png",
+ "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/",
+ "published_at": "2020-08-18T02:09:27Z",
+ "updated_at": "2020-08-18T01:45:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 1.6688437,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Publish your application to New Relic ",
+ "info": "Build a "Hello, World!" app and publish it to New Relic One ",
+ "tags": "nr1 cli ",
+ "body": ", you can publish it to New Relic One . See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic . To develop projects, you need the New Relic One CLI (command line interface). If you haven't already"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
+ "type": "developer",
+ "document_type": "page",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "sections": [
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
+ ],
+ "title": "New Relic CLI Reference",
+ "popularity": 1,
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-08-18T02:11:50Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 1.5284107,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic CLI Reference",
+ "sections": "New Relic CLI Reference",
+ "info": "The command line tools for performing tasks against New Relic APIs ",
+ "tags": "new relic cli ",
+ "body": " the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql"
+ },
+ "id": "5efa989ee7b9d2024b7bab97"
+ },
+ {
+ "body": "New Relic One CLI subscription commands To manage your Nerdpack subscriptions, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Command details nr1 subscription:set Subscribe to a Nerdpack Subscribes your account to a specific Nerdpack and channel. This command can be run with a Nerdpack UUID or within a specific Nerdpack folder. By default, the command uses the Nerdpack ID in package.json and subscribes to the STABLE channel. An account can only be subscribed to one Nerdpack and channel at a time. Usage $ nr1 subscription:set Options -i, --nerdpack-id=NERDPACK_ID Specifies the Nerdpack to subscribe to. By default, the command will use the one in package.json. -c, --channel=DEV/BETA/STABLE Specifies the channel to subscribe to. [default: STABLE] --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. Aliases $ nr1 nerdpack:subscribe nr1 subscription:list See your subscription Lists all the Nerdpacks your account is subscribed to. Your account is linked to your API key. Usage $ nr1 subscription:list Options --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 subscription:unset Unsubscribe from a Nerdpack Unsubscribes your account from a specific Nerdpack. When this command is executed within a Nerdpack folder, the Nerdpack ID from package.json is used by default. Usage $ nr1 subscription:unset Options -i, --nerdpack-id=NERDPACK_ID Specifies the Nerdpack to subscribe to. By default, the command will use the one in package.json. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. Aliases $ nr1 nerdpack:unsubscribe $ nr1 subscription:delete $ nr1 subscription:remove $ nr1 subscription:rm",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI commands you can use to manage your Nerdpack subscriptions.",
+ "sections": [
+ "New Relic One CLI subscription commands",
+ "Command details",
+ "nr1 subscription:set",
+ "Subscribe to a Nerdpack",
+ "Usage",
+ "Options",
+ "Aliases",
+ "nr1 subscription:list",
+ "See your subscription",
+ "nr1 subscription:unset",
+ "Unsubscribe from a Nerdpack"
+ ],
+ "title": "New Relic One CLI subscription commands",
+ "popularity": 1,
+ "external_id": "12d2e1b06dede5b1272527f95a14518010aecc58",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-subscription/",
+ "published_at": "2020-08-18T02:11:48Z",
+ "updated_at": "2020-08-06T01:44:54Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.4754124,
+ "_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"
+ },
+ "id": "5f2b6096e7b9d225ebc9de6f"
+ }
+ ],
+ "/explore-docs/nerdpack-file-structure": [
+ {
+ "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return \"Hello, World!\" ; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Build a \"Hello, World!\" app and publish it to New Relic One",
+ "sections": [
+ "Create a \"Hello, World!\" application",
+ "Before you begin",
+ "Tip",
+ "Create a local version of the \"Hello, World!\" application",
+ "Publish your application to New Relic",
+ "Add details to describe your project",
+ "Subscribe accounts to your application",
+ "Summary",
+ "Related information"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "popularity": 1,
+ "tags": [
+ "nr1 cli",
+ "Nerdpack file structure",
+ "NR One Catalog",
+ "Subscribe applications"
+ ],
+ "external_id": "aa427030169067481fb69a3560798265b6b52b7c",
+ "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png",
+ "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/",
+ "published_at": "2020-08-18T02:09:27Z",
+ "updated_at": "2020-08-18T01:45:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 17.529211,
+ "_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"
+ },
+ {
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "Tip",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "popularity": 1,
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-18T01:50:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 13.546968,
+ "_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"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
+ "type": "developer",
+ "document_type": "page",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "sections": [
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
+ ],
+ "title": "New Relic CLI Reference",
+ "popularity": 1,
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-08-18T02:11:50Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 1.2413275,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic CLI Reference",
+ "sections": "New Relic CLI Reference",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "tags": "new relic cli ",
+ "body": " - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads"
+ },
+ "id": "5efa989ee7b9d2024b7bab97"
+ },
+ {
+ "body": "A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. This document explains: The file structure for a Nerdpack, a Nerdlet and a launcher How to link a launcher file to a Nerdlet How to link your application with a monitored entity For basic component definitions, see our developer site. Generate Nerdpack components There are two ways to generate a Nerdpack template: Generate Nerdpack. Use the CLI command nr1 create and select Nerdpack to create a Nerdpack template that includes a Nerdlet and a launcher. Generate Nerdlet or launcher individually. You can use the CLI command nr1 create and choose to select either a Nerdlet or launcher. This may be useful when adding Nerdlets to an existing Nerdpack. For a lesson on generating and connecting Nerdpack components, see the workshop. Nerdpack file structure When you generate a Nerdpack template using the CLI nr1 create command, it has this file structure: my-nerdlet ├── README.md ├── launchers │ └── my-nerdlet-launcher │ ├── icon.png │ └── nr1.json ├── nerdlets │ └── my-nerdlet-nerdlet │ ├── index.js │ ├── nr1.json │ └── styles.scss ├── node_modules │ ├── js-tokens │ ├── loose-envify │ ├── object-assign │ ├── prop-types │ ├── react │ ├── react-dom │ ├── react-is │ └── scheduler ├── nr1.json ├── package-lock.json └── package.json Nerdlet file structure A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files: index.js The JavaScript code. Here's what the default file looks like when a Nerdlet is generated with the CLI nr1 create: import React from 'react'; export default class MyAwesomeNerdpack extends React.Component { render() { return Hello, my-awesome-nerdpack Nerdlet! } } nr1.json Configuration file. Here is the default file generated by the CLI nr1 create command: { \"schemaType\": \"NERDLET\", \"id\": \"my-awesome-nerdpack-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\" } Besides using the launcher as the access point for your application, you can also associate the application with a monitored entity to get it to appear in the New Relic One entity explorer. To do this, add two additional fields to the config file of the first-launched Nerdlet: entities and actionCategory. In the following example, the Nerdlet has been associated with all New Relic Browser-monitored applications and will appear under the Monitor UI category : { \"schemaType\": \"NERDLET\", \"id\": \"my-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"Custom Data\", \"entities\": [{\"domain\": \"BROWSER\", \"type\": \"APPLICATION\"}], \"actionCategory\": \"monitor\" } To see this application in the UI, you would go to the New Relic One entity explorer, select Browser applications, and select a monitored application. styles.scss The file for CSS styles (Sass SCSS syntax). Launcher file structure When an application with a launcher file has been deployed, its launcher is located on the New Relic One home page (one.newrelic.com). A launcher is not required; as an alternative to using a launcher, you can associate your application with a monitored entity. An application can have more than one launcher; this may be desired for an application with multiple Nerdlets. A launcher folder contains two files: nr1.json The configuration file. Here is the default file template created by the nr1 create command: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } To connect a launcher to a Nerdlet, the rootNerdletId must match the id in the launched Nerdlet's nr1.json config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet. icon.png The launcher icon that appears on the one.newrelic.com home page when an application is deployed. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / New Relic One / Use New Relic One / Build on New Relic One",
+ "info": "For building a New Relic One application: an explanation of the Nerdpack/Nerdlet file structure. ",
+ "nodeid": 36006,
+ "sections": [
+ "Use New Relic One",
+ "Get started",
+ "Core concepts",
+ "UI and data",
+ "Workloads",
+ "Build on New Relic One",
+ "Nerdpack file structure",
+ "Generate Nerdpack components",
+ "Nerdlet file structure",
+ "Launcher file structure",
+ "For more help"
+ ],
+ "title": "Nerdpack file structure",
+ "popularity": 1,
+ "external_id": "6e3788bee17cb65b6dc210862e2a10399f78ff67",
+ "category_1": "Use New Relic One",
+ "category_2": "Build on New Relic One",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/new-relic-one-application-nerdpack-file-structure",
+ "published_at": "2020-08-18T15:32:31Z",
+ "updated_at": "2020-07-25T00:32:16Z",
+ "category_0": "New Relic One",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.94898546,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Nerdpack file structure ",
+ "sections": "Nerdpack file structure ",
+ "info": "For building a New Relic One application: an explanation of the Nerdpack /Nerdlet file structure . ",
+ "category_0": "New Relic One ",
+ "category_1": "Use New Relic One ",
+ "category_2": "Build on New Relic One ",
+ "body": "A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. This document explains: The file structure for a Nerdpack , a Nerdlet and a launcher How to link a launcher file to a Nerdlet How to link your",
+ "breadcrumb": "Contents / New Relic One / Use New Relic One / Build on New Relic One "
+ },
+ "id": "5da0e07a64441f1328edf241"
+ },
+ {
+ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of common commands you can use with the New Relic One CLI.",
+ "sections": [
+ "New Relic One CLI common commands",
+ "Command details",
+ "nr1 help",
+ "See commands and get details",
+ "Usage",
+ "Arguments",
+ "Examples",
+ "nr1 update",
+ "Update your CLI",
+ "nr1 create",
+ "Create a new component",
+ "Options",
+ "nr1 profiles",
+ "Manage your profiles keychain",
+ "Commands",
+ "nr1 autocomplete",
+ "See autocomplete installation instructions",
+ "nr1 nrql",
+ "Query using NRQL"
+ ],
+ "title": "New Relic One CLI common commands",
+ "popularity": 1,
+ "external_id": "503e515e1095418f8d19329517344ab209d143a4",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-common/",
+ "published_at": "2020-08-18T02:06:04Z",
+ "updated_at": "2020-08-14T01:48:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.80596286,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI common commands",
+ "sections": "New Relic One CLI common commands",
+ "info": "An overview of common commands you can use with the New Relic One CLI .",
+ "body": " update Updates to the latest version of the CLI . nr1 create Creates a new component from a template (Nerdpack , Nerdlet , launcher , or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL"
+ },
+ "id": "5f28bd6ae7b9d267996ade94"
+ }
+ ],
+ "/explore-docs/nr1-catalog": [
+ {
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "Tip",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "popularity": 1,
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-18T01:50:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.746022,
+ "_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": " 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"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
+ "type": "developer",
+ "document_type": "page",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "sections": [
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
+ ],
+ "title": "New Relic CLI Reference",
+ "popularity": 1,
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-08-18T02:11:50Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.30402333,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic CLI Reference",
+ "sections": "New Relic CLI commands ",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "tags": "new relic cli ",
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs"
+ },
+ "id": "5efa989ee7b9d2024b7bab97"
+ },
+ {
+ "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.",
+ "sections": [
+ "Get started with the New Relic CLI",
+ "Before you begin",
+ "Install the New Relic CLI",
+ "Linux",
+ "macOS",
+ "Windows",
+ "Create your New Relic CLI profile",
+ "Get your application details",
+ "Add a simple tag to your application",
+ "Bonus step: Create a deployment marker",
+ "Next steps"
+ ],
+ "title": "Get started with the New Relic CLI",
+ "popularity": 1,
+ "tags": [
+ "api key",
+ "New Relic CLI",
+ "Tags",
+ "Entity",
+ "Deployment markers"
+ ],
+ "external_id": "531f2f3985bf64bb0dc92a642445887095048882",
+ "image": "",
+ "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/",
+ "published_at": "2020-08-18T02:06:05Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.15999478,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the New Relic CLI ",
+ "sections": "Get started with the New Relic CLI ",
+ "info": "Learn the essentials of the New Relic CLI , from install and configuration to basic usage.",
+ "tags": "New Relic CLI ",
+ "body": " that you've installed the New Relic CLI , it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command , which is useful when switching between accounts. To create your first CLI profile, run the profiles add command . Note that you need"
+ },
+ "id": "5efa999c196a67c4e1766461"
+ },
+ {
+ "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return \"Hello, World!\" ; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Build a \"Hello, World!\" app and publish it to New Relic One",
+ "sections": [
+ "Create a \"Hello, World!\" application",
+ "Before you begin",
+ "Tip",
+ "Create a local version of the \"Hello, World!\" application",
+ "Publish your application to New Relic",
+ "Add details to describe your project",
+ "Subscribe accounts to your application",
+ "Summary",
+ "Related information"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "popularity": 1,
+ "tags": [
+ "nr1 cli",
+ "Nerdpack file structure",
+ "NR One Catalog",
+ "Subscribe applications"
+ ],
+ "external_id": "aa427030169067481fb69a3560798265b6b52b7c",
+ "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png",
+ "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/",
+ "published_at": "2020-08-18T02:09:27Z",
+ "updated_at": "2020-08-18T01:45:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.12382183,
+ "_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": "NR One Catalog ",
+ "body": ", you can publish it to New Relic One . See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic . To develop projects, you need the New Relic One CLI (command line interface). If you haven't already"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
+ {
+ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of common commands you can use with the New Relic One CLI.",
+ "sections": [
+ "New Relic One CLI common commands",
+ "Command details",
+ "nr1 help",
+ "See commands and get details",
+ "Usage",
+ "Arguments",
+ "Examples",
+ "nr1 update",
+ "Update your CLI",
+ "nr1 create",
+ "Create a new component",
+ "Options",
+ "nr1 profiles",
+ "Manage your profiles keychain",
+ "Commands",
+ "nr1 autocomplete",
+ "See autocomplete installation instructions",
+ "nr1 nrql",
+ "Query using NRQL"
+ ],
+ "title": "New Relic One CLI common commands",
+ "popularity": 1,
+ "external_id": "503e515e1095418f8d19329517344ab209d143a4",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-common/",
+ "published_at": "2020-08-18T02:06:04Z",
+ "updated_at": "2020-08-14T01:48:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.019941866,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI common commands ",
+ "sections": "New Relic One CLI common commands ",
+ "info": "An overview of common commands you can use with the New Relic One CLI .",
+ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI . You can click any command to see its usage options and additional details about the command . Command Description nr1 help Shows all nr1 commands or details about each command . nr1"
+ },
+ "id": "5f28bd6ae7b9d267996ade94"
+ }
+ ],
+ "/explore-docs/nr1-nerdpack": [
+ {
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "Tip",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "popularity": 1,
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-18T01:50:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.9420942,
+ "_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": ". For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command . nr1 update Updates to the latest version of the CLI . nr1 create Creates a new component from a template (Nerdpack , Nerdlet"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
+ "type": "developer",
+ "document_type": "page",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "sections": [
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
+ ],
+ "title": "New Relic CLI Reference",
+ "popularity": 1,
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-08-18T02:11:50Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.30665752,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic CLI Reference",
+ "sections": "New Relic CLI commands ",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "tags": "new relic cli ",
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs"
+ },
+ "id": "5efa989ee7b9d2024b7bab97"
+ },
+ {
+ "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.",
+ "sections": [
+ "Get started with the New Relic CLI",
+ "Before you begin",
+ "Install the New Relic CLI",
+ "Linux",
+ "macOS",
+ "Windows",
+ "Create your New Relic CLI profile",
+ "Get your application details",
+ "Add a simple tag to your application",
+ "Bonus step: Create a deployment marker",
+ "Next steps"
+ ],
+ "title": "Get started with the New Relic CLI",
+ "popularity": 1,
+ "tags": [
+ "api key",
+ "New Relic CLI",
+ "Tags",
+ "Entity",
+ "Deployment markers"
+ ],
+ "external_id": "531f2f3985bf64bb0dc92a642445887095048882",
+ "image": "",
+ "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/",
+ "published_at": "2020-08-18T02:06:05Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.16153151,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the New Relic CLI ",
+ "sections": "Get started with the New Relic CLI ",
+ "info": "Learn the essentials of the New Relic CLI , from install and configuration to basic usage.",
+ "tags": "New Relic CLI ",
+ "body": " that you've installed the New Relic CLI , it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command , which is useful when switching between accounts. To create your first CLI profile, run the profiles add command . Note that you need"
+ },
+ "id": "5efa999c196a67c4e1766461"
+ },
+ {
+ "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return \"Hello, World!\" ; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Build a \"Hello, World!\" app and publish it to New Relic One",
+ "sections": [
+ "Create a \"Hello, World!\" application",
+ "Before you begin",
+ "Tip",
+ "Create a local version of the \"Hello, World!\" application",
+ "Publish your application to New Relic",
+ "Add details to describe your project",
+ "Subscribe accounts to your application",
+ "Summary",
+ "Related information"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "popularity": 1,
+ "tags": [
+ "nr1 cli",
+ "Nerdpack file structure",
+ "NR One Catalog",
+ "Subscribe applications"
+ ],
+ "external_id": "aa427030169067481fb69a3560798265b6b52b7c",
+ "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png",
+ "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/",
+ "published_at": "2020-08-18T02:09:27Z",
+ "updated_at": "2020-08-18T01:45:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.121671684,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Publish your application to New Relic ",
+ "info": "Build a "Hello, World!" app and publish it to New Relic One ",
+ "tags": "nr1 cli ",
+ "body": ", you can publish it to New Relic One . See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic . To develop projects, you need the New Relic One CLI (command line interface). If you haven't already"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
+ {
+ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of common commands you can use with the New Relic One CLI.",
+ "sections": [
+ "New Relic One CLI common commands",
+ "Command details",
+ "nr1 help",
+ "See commands and get details",
+ "Usage",
+ "Arguments",
+ "Examples",
+ "nr1 update",
+ "Update your CLI",
+ "nr1 create",
+ "Create a new component",
+ "Options",
+ "nr1 profiles",
+ "Manage your profiles keychain",
+ "Commands",
+ "nr1 autocomplete",
+ "See autocomplete installation instructions",
+ "nr1 nrql",
+ "Query using NRQL"
+ ],
+ "title": "New Relic One CLI common commands",
+ "popularity": 1,
+ "external_id": "503e515e1095418f8d19329517344ab209d143a4",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-common/",
+ "published_at": "2020-08-18T02:06:04Z",
+ "updated_at": "2020-08-14T01:48:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.092428446,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI common commands ",
+ "sections": "New Relic One CLI common commands ",
+ "info": "An overview of common commands you can use with the New Relic One CLI .",
+ "body": " (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command "
+ },
+ "id": "5f28bd6ae7b9d267996ade94"
+ }
+ ],
+ "/explore-docs/nr1-plugins": [
+ {
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "Tip",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "popularity": 1,
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-18T01:50:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.7391757,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI reference",
+ "sections": "New Relic One CLI Commands ",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "tags": "New Relic One app",
+ "body": " extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands . For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
+ "type": "developer",
+ "document_type": "page",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "sections": [
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
+ ],
+ "title": "New Relic CLI Reference",
+ "popularity": 1,
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-08-18T02:11:50Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.30295157,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic CLI Reference",
+ "sections": "New Relic CLI commands ",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "tags": "new relic cli ",
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs"
+ },
+ "id": "5efa989ee7b9d2024b7bab97"
+ },
+ {
+ "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.",
+ "sections": [
+ "Get started with the New Relic CLI",
+ "Before you begin",
+ "Install the New Relic CLI",
+ "Linux",
+ "macOS",
+ "Windows",
+ "Create your New Relic CLI profile",
+ "Get your application details",
+ "Add a simple tag to your application",
+ "Bonus step: Create a deployment marker",
+ "Next steps"
+ ],
+ "title": "Get started with the New Relic CLI",
+ "popularity": 1,
+ "tags": [
+ "api key",
+ "New Relic CLI",
+ "Tags",
+ "Entity",
+ "Deployment markers"
+ ],
+ "external_id": "531f2f3985bf64bb0dc92a642445887095048882",
+ "image": "",
+ "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/",
+ "published_at": "2020-08-18T02:06:05Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.16104315,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the New Relic CLI ",
+ "sections": "Get started with the New Relic CLI ",
+ "info": "Learn the essentials of the New Relic CLI , from install and configuration to basic usage.",
+ "tags": "New Relic CLI ",
+ "body": " that you've installed the New Relic CLI , it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command , which is useful when switching between accounts. To create your first CLI profile, run the profiles add command . Note that you need"
+ },
+ "id": "5efa999c196a67c4e1766461"
+ },
+ {
+ "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return \"Hello, World!\" ; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Build a \"Hello, World!\" app and publish it to New Relic One",
+ "sections": [
+ "Create a \"Hello, World!\" application",
+ "Before you begin",
+ "Tip",
+ "Create a local version of the \"Hello, World!\" application",
+ "Publish your application to New Relic",
+ "Add details to describe your project",
+ "Subscribe accounts to your application",
+ "Summary",
+ "Related information"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "popularity": 1,
+ "tags": [
+ "nr1 cli",
+ "Nerdpack file structure",
+ "NR One Catalog",
+ "Subscribe applications"
+ ],
+ "external_id": "aa427030169067481fb69a3560798265b6b52b7c",
+ "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png",
+ "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/",
+ "published_at": "2020-08-18T02:09:27Z",
+ "updated_at": "2020-08-18T01:45:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.075089455,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Publish your application to New Relic ",
+ "info": "Build a "Hello, World!" app and publish it to New Relic One ",
+ "tags": "nr1 cli ",
+ "body": ", you can publish it to New Relic One . See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic . To develop projects, you need the New Relic One CLI (command line interface). If you haven't already"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
+ {
+ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of common commands you can use with the New Relic One CLI.",
+ "sections": [
+ "New Relic One CLI common commands",
+ "Command details",
+ "nr1 help",
+ "See commands and get details",
+ "Usage",
+ "Arguments",
+ "Examples",
+ "nr1 update",
+ "Update your CLI",
+ "nr1 create",
+ "Create a new component",
+ "Options",
+ "nr1 profiles",
+ "Manage your profiles keychain",
+ "Commands",
+ "nr1 autocomplete",
+ "See autocomplete installation instructions",
+ "nr1 nrql",
+ "Query using NRQL"
+ ],
+ "title": "New Relic One CLI common commands",
+ "popularity": 1,
+ "external_id": "503e515e1095418f8d19329517344ab209d143a4",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-common/",
+ "published_at": "2020-08-18T02:06:04Z",
+ "updated_at": "2020-08-14T01:48:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.018434381,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI common commands ",
+ "sections": "New Relic One CLI common commands ",
+ "info": "An overview of common commands you can use with the New Relic One CLI .",
+ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI . You can click any command to see its usage options and additional details about the command . Command Description nr1 help Shows all nr1 commands or details about each command . nr1"
+ },
+ "id": "5f28bd6ae7b9d267996ade94"
+ }
+ ],
+ "/explore-docs/nr1-common": [
+ {
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "Tip",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "popularity": 1,
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-18T01:50:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.73570365,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI reference",
+ "sections": "New Relic One CLI Commands ",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "tags": "New Relic One app",
+ "body": " extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands . For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
+ "type": "developer",
+ "document_type": "page",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "sections": [
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
+ ],
+ "title": "New Relic CLI Reference",
+ "popularity": 1,
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-08-18T02:11:50Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.3024054,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic CLI Reference",
+ "sections": "New Relic CLI commands ",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "tags": "new relic cli ",
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs"
+ },
+ "id": "5efa989ee7b9d2024b7bab97"
+ },
+ {
+ "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.",
+ "sections": [
+ "Get started with the New Relic CLI",
+ "Before you begin",
+ "Install the New Relic CLI",
+ "Linux",
+ "macOS",
+ "Windows",
+ "Create your New Relic CLI profile",
+ "Get your application details",
+ "Add a simple tag to your application",
+ "Bonus step: Create a deployment marker",
+ "Next steps"
+ ],
+ "title": "Get started with the New Relic CLI",
+ "popularity": 1,
+ "tags": [
+ "api key",
+ "New Relic CLI",
+ "Tags",
+ "Entity",
+ "Deployment markers"
+ ],
+ "external_id": "531f2f3985bf64bb0dc92a642445887095048882",
+ "image": "",
+ "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/",
+ "published_at": "2020-08-18T02:06:05Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.16154054,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the New Relic CLI ",
+ "sections": "Get started with the New Relic CLI ",
+ "info": "Learn the essentials of the New Relic CLI , from install and configuration to basic usage.",
+ "tags": "New Relic CLI ",
+ "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow"
+ },
+ "id": "5efa999c196a67c4e1766461"
+ },
+ {
+ "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return \"Hello, World!\" ; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Build a \"Hello, World!\" app and publish it to New Relic One",
+ "sections": [
+ "Create a \"Hello, World!\" application",
+ "Before you begin",
+ "Tip",
+ "Create a local version of the \"Hello, World!\" application",
+ "Publish your application to New Relic",
+ "Add details to describe your project",
+ "Subscribe accounts to your application",
+ "Summary",
+ "Related information"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "popularity": 1,
+ "tags": [
+ "nr1 cli",
+ "Nerdpack file structure",
+ "NR One Catalog",
+ "Subscribe applications"
+ ],
+ "external_id": "aa427030169067481fb69a3560798265b6b52b7c",
+ "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png",
+ "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/",
+ "published_at": "2020-08-18T02:09:27Z",
+ "updated_at": "2020-08-18T01:45:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.074954085,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Publish your application to New Relic ",
+ "info": "Build a "Hello, World!" app and publish it to New Relic One ",
+ "tags": "nr1 cli ",
+ "body": ", you can publish it to New Relic One . See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic . To develop projects, you need the New Relic One CLI (command line interface). If you haven't already"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
+ {
+ "body": "New Relic One CLI plugin commands To install and manage your plugins, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Command details nr1 plugins:install Install a plugin Installs a plugin into the CLI. You can install plugins from npm or a Git URL. Please note that installing a plugin will override the core plugin. For example, if you have a core plugin that has a 'hello' command, then installing a plugin with a 'hello' command will override the core plugin implementation. This is useful if you want to update the core plugin functionality without patching and updating the whole CLI. Usage $ nr1 plugins:install PLUGIN Arguments PLUGIN: the name, path, or URL of the plugin you want to install. required Options -f, --force Runs yarn install --force. This forces a re-download of all the plugin's packages. -h, --help Shows CLI help. --verbose Adds extra information to the output. Examples $ nr1 plugins:install myplugin $ nr1 plugins:install https://github.com/someuser/someplugin $ nr1 plugins:install someuser/someplugin Aliases $ nr1 plugins:add nr1 plugins:link Link your plugin Links a local plugin into the CLI for development. Please note that linking a plugin will override your user-installed plugin or core plugin. For example, if you have a user-installed or core plugin that has a 'hello' command, linking a plugin with a 'hello' command will override the user-installed or core plugin implementation. This is useful for development work. Usage $ nr1 plugins:link PLUGIN Arguments PLUGIN: the name, path, or URL of the plugin you want to link. required Options -h, --help Shows CLI help. --verbose Adds extra information to the output. Examples $ nr1 plugins:link myplugin $ nr1 plugins:link someuser/someplugin nr1 plugins:update Update your plugins Updates all of your installed plugins. Usage $ nr1 plugins:update Options -h, --help Shows CLI help. --verbose Adds extra information to the output. nr1 plugins:uninstall Uninstall your plugin Removes a plugin from the CLI. Usage $ nr1 plugins:uninstall PLUGIN Arguments PLUGIN: the name of the plugin you want to uninstall. required Options -h, --help Shows CLI help. --verbose Adds extra information to the output. Aliases $ nr1 plugins:unlink $ nr1 plugins:remove",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI commands you can use to install and manage your plugins.",
+ "sections": [
+ "New Relic One CLI plugin commands",
+ "Command details",
+ "nr1 plugins:install",
+ "Install a plugin",
+ "Usage",
+ "Arguments",
+ "Options",
+ "Examples",
+ "Aliases",
+ "nr1 plugins:link",
+ "Link your plugin",
+ "nr1 plugins:update",
+ "Update your plugins",
+ "nr1 plugins:uninstall",
+ "Uninstall your plugin"
+ ],
+ "title": "New Relic One CLI plugin commands",
+ "popularity": 1,
+ "external_id": "6e94c2de165c2b01c2b15c9297a7314f1895112e",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-plugins/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-14T01:50:34Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.016611477,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI plugin commands ",
+ "sections": "New Relic One CLI plugin commands ",
+ "info": "An overview of the CLI commands you can use to install and manage your plugins.",
+ "body": "New Relic One CLI plugin commands To install and manage your plugins, use the commands below. You can click any command to see its usage options and additional details about the command . Command Description nr1 plugins:install Installs a plugin into the CLI . nr1 plugins:link Links a plugin"
+ },
+ "id": "5f28bd6a196a670ddd19d000"
+ }
+ ],
+ "/explore-docs/nr1-config": [
+ {
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "Tip",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "popularity": 1,
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-18T01:50:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.7390982,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI reference",
+ "sections": "New Relic One CLI Commands ",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "tags": "New Relic One app",
+ "body": " extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands . For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
+ "type": "developer",
+ "document_type": "page",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "sections": [
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
+ ],
+ "title": "New Relic CLI Reference",
+ "popularity": 1,
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-08-18T02:11:50Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.30471438,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic CLI Reference",
+ "sections": "New Relic CLI commands ",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "tags": "new relic cli ",
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs"
+ },
+ "id": "5efa989ee7b9d2024b7bab97"
+ },
+ {
+ "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.",
+ "sections": [
+ "Get started with the New Relic CLI",
+ "Before you begin",
+ "Install the New Relic CLI",
+ "Linux",
+ "macOS",
+ "Windows",
+ "Create your New Relic CLI profile",
+ "Get your application details",
+ "Add a simple tag to your application",
+ "Bonus step: Create a deployment marker",
+ "Next steps"
+ ],
+ "title": "Get started with the New Relic CLI",
+ "popularity": 1,
+ "tags": [
+ "api key",
+ "New Relic CLI",
+ "Tags",
+ "Entity",
+ "Deployment markers"
+ ],
+ "external_id": "531f2f3985bf64bb0dc92a642445887095048882",
+ "image": "",
+ "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/",
+ "published_at": "2020-08-18T02:06:05Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.16224013,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the New Relic CLI ",
+ "sections": "Get started with the New Relic CLI ",
+ "info": "Learn the essentials of the New Relic CLI , from install and configuration to basic usage.",
+ "tags": "New Relic CLI ",
+ "body": " that you've installed the New Relic CLI , it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command , which is useful when switching between accounts. To create your first CLI profile, run the profiles add command . Note that you need"
+ },
+ "id": "5efa999c196a67c4e1766461"
+ },
+ {
+ "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return \"Hello, World!\" ; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Build a \"Hello, World!\" app and publish it to New Relic One",
+ "sections": [
+ "Create a \"Hello, World!\" application",
+ "Before you begin",
+ "Tip",
+ "Create a local version of the \"Hello, World!\" application",
+ "Publish your application to New Relic",
+ "Add details to describe your project",
+ "Subscribe accounts to your application",
+ "Summary",
+ "Related information"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "popularity": 1,
+ "tags": [
+ "nr1 cli",
+ "Nerdpack file structure",
+ "NR One Catalog",
+ "Subscribe applications"
+ ],
+ "external_id": "aa427030169067481fb69a3560798265b6b52b7c",
+ "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png",
+ "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/",
+ "published_at": "2020-08-18T02:09:27Z",
+ "updated_at": "2020-08-18T01:45:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.07506929,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Publish your application to New Relic ",
+ "info": "Build a "Hello, World!" app and publish it to New Relic One ",
+ "tags": "nr1 cli ",
+ "body": ", you can publish it to New Relic One . See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic . To develop projects, you need the New Relic One CLI (command line interface). If you haven't already"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
+ {
+ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of common commands you can use with the New Relic One CLI.",
+ "sections": [
+ "New Relic One CLI common commands",
+ "Command details",
+ "nr1 help",
+ "See commands and get details",
+ "Usage",
+ "Arguments",
+ "Examples",
+ "nr1 update",
+ "Update your CLI",
+ "nr1 create",
+ "Create a new component",
+ "Options",
+ "nr1 profiles",
+ "Manage your profiles keychain",
+ "Commands",
+ "nr1 autocomplete",
+ "See autocomplete installation instructions",
+ "nr1 nrql",
+ "Query using NRQL"
+ ],
+ "title": "New Relic One CLI common commands",
+ "popularity": 1,
+ "external_id": "503e515e1095418f8d19329517344ab209d143a4",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-common/",
+ "published_at": "2020-08-18T02:06:04Z",
+ "updated_at": "2020-08-14T01:48:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.018429406,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI common commands ",
+ "sections": "New Relic One CLI common commands ",
+ "info": "An overview of common commands you can use with the New Relic One CLI .",
+ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI . You can click any command to see its usage options and additional details about the command . Command Description nr1 help Shows all nr1 commands or details about each command . nr1"
+ },
+ "id": "5f28bd6ae7b9d267996ade94"
+ }
+ ],
+ "/explore-docs/nerdstorage": [
+ {
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "Tip",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "popularity": 1,
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-18T01:50:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 18.007029,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI reference",
+ "sections": "New Relic One CLI reference",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps .",
+ "tags": "New Relic One app ",
+ "body": "New Relic One CLI reference To build a New Relic One app , you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app . We provide a variety of tools for building apps , including the New Relic One CLI (command line interface). This page explains how to use"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
+ "type": "developer",
+ "document_type": "page",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "sections": [
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
+ ],
+ "title": "New Relic CLI Reference",
+ "popularity": 1,
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-08-18T02:11:50Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 1.9044049,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic CLI Reference",
+ "sections": "New Relic CLI Reference",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "tags": "new relic cli",
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs"
+ },
+ "id": "5efa989ee7b9d2024b7bab97"
+ },
+ {
+ "body": "Add, query, and mutate data using NerdStorage 45 min NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. Using NerdStorage, you can create individual documents of up to 64kb in size, create different collections of documents, and store data by entity, account, or user level. This guide explains how to add data and documents to NerdStorage. For an introduction to what NerdStorage is and how it works, see Intro to NerdStorage. Before you begin This guide requires that you have an API key and the New Relic One CLI as described in Set up your development environment. Get started First, get the NerdStorage app running successfully inside New Relic One. Step 1 of 3 Clone the example applications from the GitHub repo. Step 2 of 3 Use the New Relic One CLI to update the application UUID and run the application locally. In the terminal, switch to the /nr1-how-to/use-nerdstorage directory: cd / nr1 - how - to / use - nerdstorage; Copy Update the UUID and serve the application: nr1 nerdpack:uuid -gf nr1 nerdpack:serve Copy Step 3 of 3 Once the app is successfully served, your terminal will return the URL to view your running application on New Relic One. Load the URL. Click Apps and under Other apps you'll see the Use Nerdstorage app listed. Click to launch the app. Add data to NerdStorage Once the app is up and running on New Relic One, you can prepare the app and start adding data. On the How To Use NerdStorage app screen, there's a Saved to NerdStorage pane with a field for adding data. However, if you type something you'll get an error message. This is because you need to be set up to store data at the User level. You can do this with the help of the UserStorageMutation component. Step 1 of 3 Open the application’s ./nerdlets/use-nerdstorage-nerdlet/index.js file in the text editor of your choice and find the code for the TextField and Button used to enter data. The Button onClick prop makes a call to a helper method called _addToNerdStorage, and you need to update it to add UserStorageMutation The UserStorage NerdStorage components require a collection and documentId. In the constructor method in the application’s index.js file, you can see the variables being provided. In the .js file, it will look something like this: constructor(props) { super(props) this.collectionId = 'mycollection'; this.documentId = 'learning-nerdstorage'; this.state = { isOpen: true, storage: [], text: '', }; this._addToNerdStorage = this._addToNerdStorage.bind(this); this._removeFromNerdStorage = this._removeFromNerdStorage.bind(this); this._deleteDocument = this._deleteDocument.bind(this); } Copy Step 2 of 3 Import the UserStorageMutation by adding it to your import statement at the top of the index.js file: import { UserStorageMutation } from 'nr1'; Copy Then update the helper with this code beginning with _addToNerdStorage: _addToNerdStorage(){ const { text, storage } = this.state; storage.push(text); this.setState({storage}, () => { UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.WRITE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, document: { storage }, }) .then((res) => { this.setState({text: ''}); Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.NORMAL }); }) .catch((err) => console.log(err)); }); } Copy Step 3 of 3 Return to your running How To Use NerdStorage app screen on New Relic One and reload the page. Add some text in the text entry field and click the check button. This will update NerdStorage and trigger a Toast notification inside the app. You should then see the text you typed displayed as a table row below the text entry field. Query data from NerdStorage Once you get data storage working as described in the section above, you also need to get the app properly reading data from NerdStorage, or the app will reload with an empty state every time you navigate away from the app page and back. To do this, add the UserStorageQuery component and update the componentDidMount method. Step 1 of 3 Import the UserStorageQuery by adding it to the import statement in the application’s ./nerdlets/use-nerdstorage-nerdlet/index.js file. import { UserStorageMutation, UserStorageQuery } from 'nr1'; Copy Step 2 of 3 Then, add the following componentDidMount method to your application: componentDidMount(){ UserStorageQuery.query({ collection: this.collectionId, documentId: this.documentId, }) .then(({ data }) => { if(data !== null) { this.setState({storage: data.storage}); } }) .catch(err => console.log(err)); } Copy Step 3 of 3 Back inside the NerdStorage app, test your changes by adding a few more rows using the text entry field. Then exit and relaunch the application. The application should load and show all the data you entered before you navigated away. Mutate data in NerdStorage Each NerdStorage entry displayed in the table inside the app has a trash button that can be used to update a specific entry. The trash button works by making a call to the _removeFromNerdStorage helper method. Step 1 of 1 To get this process working, update the code in _removeFromNerdStorage: _removeFromNerdStorage(index, data){ const { storage } = this.state; storage.pop(data); this.setState({storage}, () => { UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.WRITE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, document: { storage }, }) .then((res) => { Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.NORMAL }); }) .catch((err) => console.log(err)); }); } Copy Once you do this, clicking the trash button removes the item it's associated with, and the app updates to show the change. Delete collection from NerdStorage While the trash button is a good method for removing specific entries one at a time, you may also want the ability to delete a whole NerdStorage document at once. You can do this by adding the Delete Document button to your app. Step 1 of 2 Add a new GridItem to the application immediately before the closing Grid tag. In the new GridItem add the following code to display your new button: this._deleteDocument()} type={Button.TYPE.DESTRUCTIVE} sizeType={Button.SIZE_TYPE.SMALL} iconType={Button.ICON_TYPE.INTERFACE__OPERATIONS__TRASH} > Delete Document ; Copy Step 2 of 2 Because the new Delete Document button will be calling the _deleteDocument helper method, you'll need to update that using this code: _deleteDocument(){ this.setState({storage: []}); UserStorageMutation.mutate({ actionType: UserStorageMutation.ACTION_TYPE.DELETE_DOCUMENT, collection: this.collectionId, documentId: this.documentId, }); Toast.showToast({ title: \"NerdStorage Update.\", type: Toast.TYPE.CRITICAL }); } Copy Back inside the application, you should now see both the individual trash buttons and the newly added Delete Document button. Next steps Now that you’ve successfully implemented NerdStorage into a New Relic One application, you can store and mutate data connected to your User. For more information on the various NerdStorage components, please visit the New Relic developer website API documentation.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next.",
+ "sections": [
+ "Add, query, and mutate data using NerdStorage",
+ "Before you begin",
+ "Get started",
+ "Add data to NerdStorage",
+ "Query data from NerdStorage",
+ "Mutate data in NerdStorage",
+ "Delete collection from NerdStorage",
+ "Next steps"
+ ],
+ "title": "Add, query, and mutate data using NerdStorage",
+ "popularity": 1,
+ "external_id": "97cc9637edea35ecd68683f1010f67a5f8c79038",
+ "image": "https://developer.newrelic.com/static/e03456a7ed8556f83bd3329ea38b261d/8f217/add-data-NerdStorage.png",
+ "url": "https://developer.newrelic.com/build-apps/add-query-mutate-data-nerdstorage/",
+ "published_at": "2020-08-18T02:11:50Z",
+ "updated_at": "2020-08-14T01:50:34Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.78831506,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Add, query, and mutate data using NerdStorage ",
+ "sections": "Add, query, and mutate data using NerdStorage ",
+ "info": "NerdStorage is a document database accessible within New Relic One . It allows you to modify, save, and retrieve documents from one session to the next.",
+ "body": " will return the URL to view your running application on New Relic One . Load the URL. Click Apps and under Other apps you'll see the Use Nerdstorage app listed. Click to launch the app . Add data to NerdStorage Once the app is up and running on New Relic One , you can prepare the app and start adding data "
+ },
+ "id": "5efa98d4e7b9d26d6b7bab74"
+ },
+ {
+ "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return \"Hello, World!\" ; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Build a \"Hello, World!\" app and publish it to New Relic One",
+ "sections": [
+ "Create a \"Hello, World!\" application",
+ "Before you begin",
+ "Tip",
+ "Create a local version of the \"Hello, World!\" application",
+ "Publish your application to New Relic",
+ "Add details to describe your project",
+ "Subscribe accounts to your application",
+ "Summary",
+ "Related information"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "popularity": 1,
+ "tags": [
+ "nr1 cli",
+ "Nerdpack file structure",
+ "NR One Catalog",
+ "Subscribe applications"
+ ],
+ "external_id": "aa427030169067481fb69a3560798265b6b52b7c",
+ "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png",
+ "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/",
+ "published_at": "2020-08-18T02:09:27Z",
+ "updated_at": "2020-08-18T01:45:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.3596391,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Create a "Hello, World!" application ",
+ "sections": "Publish your application to New Relic ",
+ "info": "Build a "Hello, World!" app and publish it to New Relic One ",
+ "tags": "NR One Catalog",
+ "body": " the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One . Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
+ {
+ "body": "Build apps You know better than anyone what information is crucial to your business, and how best to visualize it. Sometimes, this means going beyond dashboards to creating your own app. With React and GraphQL, you can create custom views tailored to your business. These guides are designed to help you start building apps, and dive into our library of components. We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a \"Hello, World!\" application Build a \"Hello, World!\" app and publish it to New Relic One 20 min Publish and deploy apps Start sharing the apps you build 20 min Set up your development environment Prepare to build apps and contribute to this site 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 30 min Add a table to your app Add a table to your New Relic One app 30 min Create a custom map view Build an app to show page view data on a map",
+ "type": "developer",
+ "document_type": "page",
+ "info": "",
+ "sections": [
+ "Build apps",
+ "Guides to build apps",
+ "Create a \"Hello, World!\" application",
+ "Publish and deploy apps",
+ "Set up your development environment",
+ "Add the NerdGraphQuery component to an application",
+ "Add a time picker to your app",
+ "Add, query, and mutate data using NerdStorage",
+ "Add a table to your app",
+ "Create a custom map view"
+ ],
+ "title": "Build apps",
+ "popularity": 1,
+ "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d",
+ "image": "",
+ "url": "https://developer.newrelic.com/build-apps/",
+ "published_at": "2020-08-18T02:08:12Z",
+ "updated_at": "2020-08-18T01:45:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.30304605,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Build apps ",
+ "sections": "Add, query, and mutate data using NerdStorage ",
+ "body": " you start building apps , and dive into our library of components . We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a "Hello, World!" application Build a "Hello, World!" app and publish it to New Relic One 20"
+ },
+ "id": "5efa999d64441fc0f75f7e21"
+ }
+ ],
+ "/explore-docs/intro-to-sdk": [
+ {
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "Tip",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "popularity": 1,
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-18T01:50:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 3.5731812,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI reference",
+ "sections": "New Relic One CLI reference",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps .",
+ "tags": "New Relic One app ",
+ "body": "New Relic One CLI reference To build a New Relic One app , you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app . We provide a variety of tools for building apps , including the New Relic One CLI (command line interface). This page explains how to use"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "Add the NerdGraphQuery component to an application 20 minutes This guide steps you through the process of adding the NerdGraphQuery component to a sample transaction overview application. This allows you to query data from your New Relic account and add it to a dropdown menu. NerdGraph is our GraphQL implementation. GraphQL has some key differences when compared to REST: The client, not the server, determines what data is returned. You can easily collect data from multiple sources. For example, in a single query, you can get account information, infrastructure data, and issue a NRQL request. Note Before completing this exercise, you can experiment with GraphQL queries in our NerdGraph API explorer. We also have a 14-minute video that covers the steps below. Before you begin To develop projects, you need our New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete steps 1–4 of our CLI quick start, and be sure to make a copy of your account ID from step 1 because you’ll need it later. Note If you've already installed the New Relic One CLI, but you can't remember your account ID, start the CLI quick start again, and then click the Get your API key down arrow. The account ID is the number preceding your account name. For additional details, see Set up your development environment. Prepare the sample code To get started, complete these steps to update the application UUID (unique ID) and run the sample application locally: Step 1 of 7 If you haven't already done so, clone the example applications from our how-to GitHub repo. Here's an example using HTTPS: git clone https://github.com/newrelic/nr1-how-to.git Copy Step 2 of 7 Change to the directory use-nerdgraph-nerdlet: cd nr1-how-to/use-nerdgraph/nerdlets/use-nerdgraph-nerdlet Copy Step 3 of 7 In your preferred text editor, open index.js. Step 4 of 7 Replace with your account id: Note Your account ID is available in the CLI quick start (see Before you begin). this.accountId = ; Copy Step 5 of 7 Change to the /nr1-howto/use-nerdgraph directory: cd ../.. Copy Step 6 of 7 Execute these commands to update the UUID and serve the sample application: nr1 nerdpack:uuid -gf nr1 nerdpack:serve Copy Step 7 of 7 Once the sample application is successfully served, go to the local New Relic One homepage (https://one.newrelic.com/?nerdpacks=local), click Apps, and then click Use NerdGraph. After launching the Use NerdGraph application, you see a dashboard that gives an overview of the transactions in your account: Add the NerdGraphQuery component Now you can create a dropdown menu for changing the account the application is viewing. The first step is to import the NerdGraphQuery component into the application's index.js file. Note If you need more details about our example below, see the APIs and components page on https://developer.newrelic.com Step 1 of 3 Add the NerdGraphQuery component into the first StackItem inside of the return in the index.js file: {({ loading, error, data }) => { console.log({ loading, error, data }); if (loading) { return ; } if (error) { return 'Error!'; } return null; }} ; Copy Step 2 of 3 The NerdGraphQuery component takes a query object that states the source you want to access and the data you want returned. Add the following code to your index.js file in the render method: Note In the browser console, you can see the data from your query returned in an object that follows the same structure of the object in the initial query. const query = ` query($id: Int!) { actor { account(id: $id) { name } } } `; Copy Step 3 of 3 To take the data returned by the NerdGraph query and display it in the application, replace the return null in the current NerdGraphQuery component with this return statement: return {data.actor.account.name} Apps: ; Copy When you go back to the browser and view your application, you see a new headline showing the name of your account returned from NerdGraph: How to use NerdGraphQuery.query At this point, you have implemented the NerdGraphQuery component with the application's render method and displayed the return data within the transaction overview application. Here's what you need to do next: Query NerdGraph inside of the componentDidMount lifecycle method. Save the returned data for later use in the application. Step 1 of 2 This code takes the response from NerdGraph and makes sure the results are processed, stored into the application state, and logged to the browser console for viewing. Add this code into the index.js file just under the constructor: componentDidMount() { const accountId = this.state; const gql = `{ actor { accounts { id name } } }`; const accounts = NerdGraphQuery.query({query: gql}) //The NerdGraphQuery.query method called with the query object to get your account data is stored in the accounts variable. accounts.then(results => { console.log('Nerdgraph Response:', results); const accounts = results.data.actor.accounts.map(account => { return account; }); const account = accounts.length > 0 && accounts[0]; this.setState({ selectedAccount: account, accounts }); }).catch((error) => { console.log('Nerdgraph Error:', error); }) } Copy Step 2 of 2 After the data is stored into state, display a selection so users can change accounts and update the application. To do this, add this code to index.js for the second StackItem in the return statement: { accounts && ( this.selectAccount(value)} > {accounts.map((a) => { return ( {a.name} ); })} ); } Copy Review the results of the NerdGraph query After you complete these steps, look at the application in your browser, and note the following: The dropdown menu now displays the data returned from the NerdGraphQuery.query and allows you to select an account. After you select a new account, the application shows data from the new selection. The final index.js file should have code similar to the code below. This completed sample is in your nerdlet final.js. import React from 'react'; import { PlatformStateContext, NerdGraphQuery, Spinner, HeadingText, Grid, GridItem, Stack, StackItem, Select, SelectItem, AreaChart, TableChart, PieChart } from 'nr1' import { timeRangeToNrql } from '@newrelic/nr1-community'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class UseNerdgraphNerdletNerdlet extends React.Component { constructor(props){ super(props) this.state = { accountId: , accounts: null, selectedAccount: null, } } componentDidMount() { const accountId = this.state; const gql = `{ actor { accounts { id name } } }`; const accounts = NerdGraphQuery.query({ query: gql }) accounts.then(results => { console.log('Nerdgraph Response:', results); const accounts = results.data.actor.accounts.map(account => { return account; }); const account = accounts.length > 0 && accounts[0]; this.setState({ selectedAccount: account, accounts }); }).catch((error) => { console.log('Nerdgraph Error:', error); }) } selectAccount(option) { this.setState({ accountId: option.id, selectedAccount: option }); } render() { const { accountId, accounts, selectedAccount } = this.state; console.log({ accountId, accounts, selectedAccount }); const query = ` query($id: Int!) { actor { account(id: $id) { name } } } `; const variables = { id: accountId, }; const avgResTime = `SELECT average(duration) FROM Transaction FACET appName TIMESERIES AUTO `; const trxOverview = `FROM Transaction SELECT count(*) as 'Transactions', apdex(duration) as 'apdex', percentile(duration, 99, 95) FACET appName `; const errCount = `FROM TransactionError SELECT count(*) as 'Transaction Errors' FACET error.message `; const responseCodes = `SELECT count(*) as 'Response Code' FROM Transaction FACET httpResponseCode `; return ( {({loading, error, data}) => { if (loading) { return ; } if (error) { return 'Error!'; } return {data.actor.account.name} Apps: ; }} {accounts && this.selectAccount(value)}> {accounts.map(a => { return ( {a.name} ) })} } {(PlatformState) => { /* Taking a peek at the PlatformState */ const since = timeRangeToNrql(PlatformState); return ( <> Transaction Overview Average Response Time Response Code Transaction Errors > ); }} ) } } Copy Summary Now that you've completed all the steps in this example, you've successfully queried data from your account using the NerdGraphQuery component in two methods: Using the NerdGraphQuery component inside the application's render method and then passing the returned data into the children's components. Using the NerdGraphQuery.query method to query data before the application renders.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application",
+ "sections": [
+ "Add the NerdGraphQuery component to an application",
+ "Note",
+ "Before you begin",
+ "Prepare the sample code",
+ "Add the NerdGraphQuery component",
+ "How to use NerdGraphQuery.query",
+ "Review the results of the NerdGraph query",
+ "Summary"
+ ],
+ "title": "Add the NerdGraphQuery component to an application",
+ "popularity": 1,
+ "external_id": "6bd6c8a72eab352a3e8f4332570e286c7831ba84",
+ "image": "https://developer.newrelic.com/static/5dcf6e45874c1fa40bb6f21151af0c24/b01d9/no-name.png",
+ "url": "https://developer.newrelic.com/build-apps/add-nerdgraphquery-guide/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-14T01:49:25Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 1.1957614,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Add the NerdGraphQuery component to an application ",
+ "sections": "Add the NerdGraphQuery component to an application ",
+ "info": "The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application ",
+ "body": " { Platform StateContext, NerdGraphQuery , Spinner, HeadingText, Grid, GridItem, Stack, StackItem, Select, SelectItem, AreaChart , TableChart , PieChart } from 'nr1' import { timeRangeToNrql } from '@newrelic/nr1-community'; // https://docs.newrelic.com/docs/new -relic -programmable-platform -introduction"
+ },
+ "id": "5efa993c64441ff4865f7e32"
+ },
+ {
+ "body": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application. In this guide, you are going to build a sample table using various New Relic One components. Before you begin If you haven't already installed the New Relic One CLI, step through the quick start in New Relic One. This process also gets you an API key. In addition, to complete the steps in this guide, you need a GitHub account, and to have Node.js installed on your machine. See [Setting up your development environment](/build-apps/set-up-dev-env) for more info. Clone and set up the example application Step 1 of 4 Clone the nr1-how-to example application from GitHub to your local machine. Then, navigate to the app directory. The example app lets you experiment with tables. git clone https://github.com/newrelic/nr1-how-to.git` cd nr1-how-to/create-a-table/nerdlets/create-a-table-nerdlet` Copy Step 2 of 4 Edit the index.json file and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install dependencies nr1 nerdpack:serve # Serve the demo app locally Copy Step 4 of 4 Open one.newrelic.com/?nerdpacks=local in your browser. Click Apps*, and then in the Other apps section, you should see a Create a table** launcher. That's the demo application you're going to work on. Go ahead and select it. Have a good look at the demo app. There's a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You'll use Table components to add a new table in the second row. Work with table components Step 1 of 10 Navigate to the `nerdlets/create-a-table-nerdlet` subdirectory and open the `index.js` file. Add the following components to the import statement at the top of the file so that it looks like the example: Table TableHeader TableHeaderCell TableRow TableRowCell import { Table, TableHeader, TableHeaderCell, TableRow, TableRowCell, PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart, } from 'nr1'; Copy Step 2 of 10 Add a basic Table component Locate the empty GridItem in index.js: This is where you start building the table. Add the initial component. The items property collects the data by calling _getItems(), which contains sample values. ; Copy Step 3 of 10 Add the header and rows As the Table component renders a fixed number of header cells and rows, your next step is adding header components, as well as a function that returns the required table rows. Inside of the Table component, add the TableHeader and then a TableHeaderCell child for each heading. Since you don't know how many rows you'll need, your best bet is to call a function to build as many TableRows as items returned by _getItems(). Application Size Company Team Commit ; { ({ item }) => ( {item.name} {item.value} {item.company} {item.team} {item.commit} ); } Copy Step 4 of 10 Take a look at the application running in New Relic One: you should see something similar to the screenshot below. Step 5 of 10 Replace standard table cells with smart cells The New Relic One library includes cell components that can automatically format certain data types, like users, metrics, and entity names. The table you've just created contains columns that can benefit from those components: Application (an entity name) and Size (a metric). Before you can use EntityTitleTableRowCell and MetricTableRowCell, you have to add them to the import statement first. import { EntityTitleTableRowCell, MetricTableRowCell, ... /* All previous components */ } from 'nr1'; Copy Step 6 of 10 Update your table rows by replacing the first and second TableRowCells with entity and metric cells. Notice that EntityTitleTableRowCell and MetricTableRowCell are self-closing tags. { ({ item }) => ( {item.company} {item.team} {item.commit} ); } Copy Step 7 of 10 Time to give your table a second look: The cell components you've added take care of properly formatting the data. Step 8 of 10 Add some action to your table! Tables are great, but interactive tables can be better: As a last update, you are going to allow users to act on each data row. Add the _getActions() method to your index.js file, right before _getItems(). As you may have guessed from the code, _getActions() spawns an alert box when you click Team or Commit cells. _getActions() { return [ { label: 'Alert Team', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__ALERT, onClick: (evt, { item, index }) => { alert(`Alert Team: ${item.team}`); }, }, { label: 'Rollback Version', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__UNDO, onClick: (evt, { item, index }) => { alert(`Rollback from: ${item.commit}`); }, }, ]; } Copy Step 9 of 10 Find the TableRow component in your return statement and point the actions property to _getActions(). The TableRow actions property defines a set of actions that appear when the user hovers over a table row. Actions have a mandatory text and an onClick callback, but can also display an icon or be disabled if needed. Copy Step 10 of 10 Go back to your application and try hovering over any of the rows: Notice how the two available actions appear. When you click them, a function triggers with the selected row data as an argument, and an alert displays in your browser. Next steps You've built a table into a New Relic One application, using components to format data automatically and provide contextual actions. Well done! Keep exploring the Table components, their properties, and how to use them, in our SDK documentation.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Add a table to your New Relic One app.",
+ "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",
+ "popularity": 1,
+ "external_id": "7ff7a8426eb1758a08ec360835d9085fae829936",
+ "image": "https://developer.newrelic.com/static/e637c7eb75a9dc01740db8fecc4d85bf/1d6ec/table-new-cells.png",
+ "url": "https://developer.newrelic.com/build-apps/howto-use-nrone-table-components/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-14T01:46:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.7044865,
+ "_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": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can"
+ },
+ "id": "5efa989ee7b9d2ad567bab51"
+ },
+ {
+ "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,000 documents, plus storage type. Each document can have a maximum length of 64 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Intro to NerdStorage on New Relic One",
+ "sections": [
+ "Intro to NerdStorage",
+ "Use NerdStorage in your apps",
+ "Data model",
+ "Limits",
+ "Data access",
+ "Permissions for working with NerdStorage"
+ ],
+ "title": "Intro to NerdStorage",
+ "popularity": 1,
+ "external_id": "709e06c25376d98b2191ca369b4d139e5084bd62",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nerdstorage/",
+ "published_at": "2020-08-18T02:11:48Z",
+ "updated_at": "2020-08-14T01:50:34Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.6584254,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Use NerdStorage in your apps ",
+ "info": "Intro to NerdStorage on New Relic One ",
+ "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK . On this page, you’ll learn how to use NerdStorage SDK components . Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's"
+ },
+ "id": "5efa989ee7b9d2048e7bab92"
+ },
+ {
+ "body": "For an even better experience than plugins, go to: newrelic.com/integrations: Integrate the on-host and cloud systems you already use with New Relic, so you can filter and analyze data, create dashboards, and set alerts within a single platform. developer.newrelic.com: Use developer tools to collect data from any source, automate workflows, build apps, and use our APIs. Each plugin in Plugin Central includes procedures for how to install, use, troubleshoot, and uninstall it. After you install a plugin, it starts to receive data, usually within five minutes. The plugin automatically appears with a short name and icon on your Plugins menu in New Relic One. You do not need to select it from Plugin Central. Plugins in Plugin Central are not supported with accounts that host data in the EU region data center. View plugin dashboard details The amount and types of information on the plugin's summary page and dashboards depend on the specific plugin. For example, a plugin may have one or more components (instances) and one or more dashboards. To view summary and dashboard details about the plugin: Go to one.newrelic.com > More > Plugins, and select your plugin. From the plugin's summary page, review the list of components or instances, summary metrics, and list of Recent Events. To view dashboard details about any component or instance, select its name. Plugin summary Depending on the plugin, the summary includes: One or more components or instances (what the plugin agent is monitoring, typically a host/port pair) Zero to five summary metrics for the past three minutes (values such as average, total, minimum, maximum, standard deviation, rate, or count) with optional alerts Recent events list, including deployments, notifications, and alerts Other information about alert violations, events, and activity If your plugin has 100 or more components or instances, you can search for a specific component instance. Here is a summary of additional standard features. If you want to... Do this... View version information for a component's or instance's agent Mouse over the component's name. Change the sort order On the title row of the plugin's summary page, select the up or down arrow for a component (instance) or a summary metric's label. Show or hide items on the events and activity list Select an event icon, or select All. View details about an event On the events and activity list, select the link. View page details for a component or instance Select the name or a summary metric for the component (instance). Plugin dashboards Depending on the plugin, it may have one or more dashboards, and each dashboard may present data as a chart or a table. You can use any of New Relic's standard dashboard features to drill down into detailed information. The customized dashboards that show plugin data are part of the plugin. Users cannot add or remove these dashboards. This must be done by the author or publisher as part of a plugin update. Plugin alerts If the plugin publisher set Critical (red) or Caution (yellow) alert conditions for your plugin's components or instances, you can view details direct in the user interface. For example, you can: Select and view alert details. Change the existing thresholds. Set your alert notification options; for example, to receive email notifications for Critical events. Delete a plugin Each plugin in Plugin Central includes procedures for how to uninstall it. When you select the plugin's Download or Continue button, the plugin should include a README file or refer to other documentation resources. Remove plugin components (instances) At a minimum, your plugin must stop reporting data before you start uninstalling it. Make sure the health status for your plugin's components (instances) are gray. Depending on the plugin, there may be other dependencies before disabling or uninstalling it. For example, plugins from SaaS providers may have different requirements. Be sure to review the instructions that the plugin's publisher provides. Then, to remove individual components from your plugin, click the settings settings icon for each component (instance). Delete the plugin After you remove each component (instance) for the plugin, the plugin icon will automatically disappear from your Plugins menu in the New Relic UI. You do not need to do anything else to delete the plugin. If you are the plugin's publisher and need to delete the plugin from Plugin Central, go to support.newrelic.com. For more help If you need more help, check out these support and learning resources: Review the documentation provided by the plugin publisher, or contact the publisher's support resources (identified in the plugin's Get support link). Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Plugins / Plugins for New Relic / Install plugins",
+ "info": "How to navigate the user interface for plugins you install from Plugin Central in New Relic One.",
+ "nodeid": 3276,
+ "sections": [
+ "Plugins for New Relic",
+ "Get started",
+ "Install plugins",
+ "Custom dashboards and custom views",
+ "Use a Plugin Central plugin",
+ "View plugin dashboard details",
+ "Delete a plugin",
+ "For more help"
+ ],
+ "title": "Use a Plugin Central plugin",
+ "popularity": 1,
+ "external_id": "2d4076c0d593e21391ca034868b87042328d8a61",
+ "category_1": "Plugins for New Relic",
+ "category_2": "Install plugins",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/plugins/plugins-new-relic/installing-plugins/use-plugin-central-plugin",
+ "published_at": "2020-08-18T14:35:58Z",
+ "updated_at": "2020-08-18T14:35:58Z",
+ "category_0": "Plugins",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.59509915,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Plugins for New Relic ",
+ "info": "How to navigate the user interface for plugins you install from Plugin Central in New Relic One .",
+ "category_1": "Plugins for New Relic ",
+ "body": "For an even better experience than plugins, go to: newrelic.com/integrations: Integrate the on-host and cloud systems you already use with New Relic , so you can filter and analyze data, create dashboards, and set alerts within a single platform . developer.newrelic.com: Use developer tools",
+ "breadcrumb": "Contents / Plugins / Plugins for New Relic / Install plugins"
+ },
+ "id": "5f2ef9b3196a67c2a0fbd721"
+ }
+ ],
+ "/explore-docs/nr1-subscription": [
+ {
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "Tip",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "popularity": 1,
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-08-18T02:07:10Z",
+ "updated_at": "2020-08-18T01:50:36Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.7381426,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI reference",
+ "sections": "New Relic One CLI Commands ",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "tags": "New Relic One app",
+ "body": " extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands . For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
+ "type": "developer",
+ "document_type": "page",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "sections": [
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
+ ],
+ "title": "New Relic CLI Reference",
+ "popularity": 1,
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-08-18T02:11:50Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.30232108,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic CLI Reference",
+ "sections": "New Relic CLI commands ",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "tags": "new relic cli ",
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs"
+ },
+ "id": "5efa989ee7b9d2024b7bab97"
+ },
+ {
+ "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.",
+ "sections": [
+ "Get started with the New Relic CLI",
+ "Before you begin",
+ "Install the New Relic CLI",
+ "Linux",
+ "macOS",
+ "Windows",
+ "Create your New Relic CLI profile",
+ "Get your application details",
+ "Add a simple tag to your application",
+ "Bonus step: Create a deployment marker",
+ "Next steps"
+ ],
+ "title": "Get started with the New Relic CLI",
+ "popularity": 1,
+ "tags": [
+ "api key",
+ "New Relic CLI",
+ "Tags",
+ "Entity",
+ "Deployment markers"
+ ],
+ "external_id": "531f2f3985bf64bb0dc92a642445887095048882",
+ "image": "",
+ "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/",
+ "published_at": "2020-08-18T02:06:05Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.16199563,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the New Relic CLI ",
+ "sections": "Get started with the New Relic CLI ",
+ "info": "Learn the essentials of the New Relic CLI , from install and configuration to basic usage.",
+ "tags": "New Relic CLI ",
+ "body": " that you've installed the New Relic CLI , it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command , which is useful when switching between accounts. To create your first CLI profile, run the profiles add command . Note that you need"
+ },
+ "id": "5efa999c196a67c4e1766461"
+ },
+ {
+ "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return \"Hello, World!\" ; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Build a \"Hello, World!\" app and publish it to New Relic One",
+ "sections": [
+ "Create a \"Hello, World!\" application",
+ "Before you begin",
+ "Tip",
+ "Create a local version of the \"Hello, World!\" application",
+ "Publish your application to New Relic",
+ "Add details to describe your project",
+ "Subscribe accounts to your application",
+ "Summary",
+ "Related information"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "popularity": 1,
+ "tags": [
+ "nr1 cli",
+ "Nerdpack file structure",
+ "NR One Catalog",
+ "Subscribe applications"
+ ],
+ "external_id": "aa427030169067481fb69a3560798265b6b52b7c",
+ "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png",
+ "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/",
+ "published_at": "2020-08-18T02:09:27Z",
+ "updated_at": "2020-08-18T01:45:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.07493319,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Publish your application to New Relic ",
+ "info": "Build a "Hello, World!" app and publish it to New Relic One ",
+ "tags": "nr1 cli ",
+ "body": ", you can publish it to New Relic One . See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic . To develop projects, you need the New Relic One CLI (command line interface). If you haven't already"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
+ {
+ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of common commands you can use with the New Relic One CLI.",
+ "sections": [
+ "New Relic One CLI common commands",
+ "Command details",
+ "nr1 help",
+ "See commands and get details",
+ "Usage",
+ "Arguments",
+ "Examples",
+ "nr1 update",
+ "Update your CLI",
+ "nr1 create",
+ "Create a new component",
+ "Options",
+ "nr1 profiles",
+ "Manage your profiles keychain",
+ "Commands",
+ "nr1 autocomplete",
+ "See autocomplete installation instructions",
+ "nr1 nrql",
+ "Query using NRQL"
+ ],
+ "title": "New Relic One CLI common commands",
+ "popularity": 1,
+ "external_id": "503e515e1095418f8d19329517344ab209d143a4",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-common/",
+ "published_at": "2020-08-18T02:06:04Z",
+ "updated_at": "2020-08-14T01:48:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.018395994,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI common commands ",
+ "sections": "New Relic One CLI common commands ",
+ "info": "An overview of common commands you can use with the New Relic One CLI .",
+ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI . You can click any command to see its usage options and additional details about the command . Command Description nr1 help Shows all nr1 commands or details about each command . nr1"
+ },
+ "id": "5f28bd6ae7b9d267996ade94"
+ }
+ ],
+ "/explore-docs/nr1-cli": [
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
+ "type": "developer",
+ "document_type": "page",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "sections": [
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
+ ],
+ "title": "New Relic CLI Reference",
+ "popularity": 1,
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-08-18T02:11:50Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 1.0787585,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic CLI Reference",
+ "sections": "New Relic CLI commands ",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "tags": "new relic cli",
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs"
+ },
+ "id": "5efa989ee7b9d2024b7bab97"
+ },
+ {
+ "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.",
+ "sections": [
+ "Get started with the New Relic CLI",
+ "Before you begin",
+ "Install the New Relic CLI",
+ "Linux",
+ "macOS",
+ "Windows",
+ "Create your New Relic CLI profile",
+ "Get your application details",
+ "Add a simple tag to your application",
+ "Bonus step: Create a deployment marker",
+ "Next steps"
+ ],
+ "title": "Get started with the New Relic CLI",
+ "popularity": 1,
+ "tags": [
+ "api key",
+ "New Relic CLI",
+ "Tags",
+ "Entity",
+ "Deployment markers"
+ ],
+ "external_id": "531f2f3985bf64bb0dc92a642445887095048882",
+ "image": "",
+ "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/",
+ "published_at": "2020-08-18T02:06:05Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.5655756,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the New Relic CLI",
+ "sections": "Get started with the New Relic CLI",
+ "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.",
+ "tags": "New Relic CLI",
+ "body": " that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command , which is useful when switching between accounts. To create your first CLI profile, run the profiles add command . Note that you need"
+ },
+ "id": "5efa999c196a67c4e1766461"
+ },
+ {
+ "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return \"Hello, World!\" ; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Build a \"Hello, World!\" app and publish it to New Relic One",
+ "sections": [
+ "Create a \"Hello, World!\" application",
+ "Before you begin",
+ "Tip",
+ "Create a local version of the \"Hello, World!\" application",
+ "Publish your application to New Relic",
+ "Add details to describe your project",
+ "Subscribe accounts to your application",
+ "Summary",
+ "Related information"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "popularity": 1,
+ "tags": [
+ "nr1 cli",
+ "Nerdpack file structure",
+ "NR One Catalog",
+ "Subscribe applications"
+ ],
+ "external_id": "aa427030169067481fb69a3560798265b6b52b7c",
+ "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png",
+ "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/",
+ "published_at": "2020-08-18T02:09:27Z",
+ "updated_at": "2020-08-18T01:45:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.55214196,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Create a "Hello, World!" application ",
+ "sections": "Publish your application to New Relic ",
+ "info": "Build a "Hello, World!" app and publish it to New Relic One ",
+ "tags": "Nerdpack file structure",
+ "body": ", you can publish it to New Relic One . See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic . To develop projects, you need the New Relic One CLI (command line interface). If you haven't already"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
+ {
+ "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:clone Clones a Nerdpack from a git repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Command details nr1 nerdpack:clone Clone an existing Nerdpack Duplicates an existing Nerdpack onto your local computer. You can clone an open source Nerdpack from our Open Source GitHub repositories. After choosing a git repository, this command performs the following actions so that you can start using the Nerdpack: Clones the repository. Sets the repository as remote upstream. Installs all of its dependencies (using npm). Generates a new UUID using your profile, and commits it. Usage $ nr1 nerdpack:clone OPTION Options -r, --repo=REPO Repository location (either an HTTPS or SSH path). (Required) -p, --path=PATH Determines the directory to clone to (defaults to the repository name). -f, --force Replaces destination folder if it exists. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 nerdpack:serve Serve your Nerdpack locally Launches a server with your Nerdpack locally on the New Relic One platform, where it can be tested live. To learn more about working with apps locally, see our guide on how to serve, publish, and deploy documentation. Usage $ nr1 nerdpack:serve Options --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 nerdpack:uuid Get your Nerdpack's UUID Prints the UUID (Universal Unique ID) of your Nerdpack, by default. The UUID determines what data the Nerdpack can access and who can subscribe to the Nerdpack. To deploy a Nerdpack you didn't make, you'll have to assign it a new UUID by using the -g or --generate option. For more details, see our GitHub workshop on GitHub. Usage $ nr1 nerdpack:uuid Options --profile=PROFILE The authentication profile you want to use. -f, --force If present, it will override the existing UUID without asking. -g, --generate Generates a new UUID if not available. --verbose Adds extra information to the output. nr1 nerdpack:publish Publish your Nerdpack Publishes your Nerdpack to New Relic. Please note: If no additional parameters are passed in, this command will automatically deploy the Nerdpack onto the DEV channel. If you want to specify your own list of deploy channels, add the --channel option. For example, $ nr1 nerdpack:publish --channel BETA --channel STABLE. If you want to disable this behavior, add -D or --skip-deploy to the command. Then, you can use nr1 nerdpack:deploy to perform a deploy manually. For more on publishing and deploying, see Deploy to New Relic One. Usage $ nr1 nerdpack:publish Options -B, --skip-build Skips the previous build process. -D, --skip-deploy Skips the following deploy process. -c, --channel=DEV/BETA/STABLE Specifies the channel to deploys to. [default: STABLE] -f, --force Forces the publish, overriding any existing version in the registry. --dry-run Undergoes publishing process without actually publishing anything. --extra-metadata-path=extra-metadata-path Specifies a json file .path with extra metadata. [default: extra-metadata.json] --prerelease=STRING The value you enter will be appended to the current version of generated files. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 nerdpack:deploy Deploy your Nerdpack to a channel Deploys a Nerdpack version to a specific channel (DEV, BETA, or STABLE). A channel can only have one Nerdpack version deployed to it at one time. If a channel has an existing Nerdpack associated with it, deploying a new Nerdpack version to that channel will undeploy the previous one. For more on publishing and deploying, see Deploy to New Relic One. Usage $ nr1 nerdpack:deploy OPTION Options -c, --channel=DEV/BETA/STABLE Specifies the channel to deploy to. (required) -i, --nerdpack-id=NERDPACK_ID Specifies the Nerdpack to deploy. By default, the command will use the one in package.json. --from-version=VERSION Specifies which version to deploy. By default, the command will use the one in package.json. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 nerdpack:undeploy Undeploy your Nerdpack Undeploys a Nerdpack version from a specific channel (for example, DEV, BETA, or STABLE). Usage $ nr1 nerdpack:undeploy OPTION Options -c, --channel=DEV/BETA/STABLE Specifies the channel to undeploy from. (required) -i, --nerdpack-id=NERDPACK_ID Specifies the Nerdpack to deploy. By default, the command will use the one in package.json. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.",
+ "sections": [
+ "New Relic One CLI Nerdpack commands",
+ "Command details",
+ "nr1 nerdpack:clone",
+ "Clone an existing Nerdpack",
+ "Usage",
+ "Options",
+ "nr1 nerdpack:serve",
+ "Serve your Nerdpack locally",
+ "nr1 nerdpack:uuid",
+ "Get your Nerdpack's UUID",
+ "nr1 nerdpack:publish",
+ "Publish your Nerdpack",
+ "nr1 nerdpack:deploy",
+ "Deploy your Nerdpack to a channel",
+ "nr1 nerdpack:undeploy",
+ "Undeploy your Nerdpack"
+ ],
+ "title": "New Relic One CLI Nerdpack commands",
+ "popularity": 1,
+ "external_id": "7c1050a6a8624664b90c15111f7c72e96b2fbe17",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-nerdpack/",
+ "published_at": "2020-08-18T02:11:48Z",
+ "updated_at": "2020-08-04T01:44:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.47135732,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI Nerdpack commands ",
+ "sections": "New Relic One CLI Nerdpack commands ",
+ "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks .",
+ "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command . Command Description nr1 nerdpack :clone Clones a Nerdpack from a git repository. nr1 nerdpack :serve Serves your Nerdpack "
+ },
+ "id": "5f28bd6a64441f9817b11a38"
+ },
+ {
+ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of common commands you can use with the New Relic One CLI.",
+ "sections": [
+ "New Relic One CLI common commands",
+ "Command details",
+ "nr1 help",
+ "See commands and get details",
+ "Usage",
+ "Arguments",
+ "Examples",
+ "nr1 update",
+ "Update your CLI",
+ "nr1 create",
+ "Create a new component",
+ "Options",
+ "nr1 profiles",
+ "Manage your profiles keychain",
+ "Commands",
+ "nr1 autocomplete",
+ "See autocomplete installation instructions",
+ "nr1 nrql",
+ "Query using NRQL"
+ ],
+ "title": "New Relic One CLI common commands",
+ "popularity": 1,
+ "external_id": "503e515e1095418f8d19329517344ab209d143a4",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-common/",
+ "published_at": "2020-08-18T02:06:04Z",
+ "updated_at": "2020-08-14T01:48:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.16341951,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI common commands ",
+ "sections": "New Relic One CLI common commands ",
+ "info": "An overview of common commands you can use with the New Relic One CLI.",
+ "body": " (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command "
+ },
+ "id": "5f28bd6ae7b9d267996ade94"
+ }
+ ],
+ "/collect-data/query-data-nrql": [
+ {
+ "body": "Add custom attributes to your New Relic data There are countless filters and pivots you might want to apply to your data. By adding custom attributes to your data, you can see beyond your code and analyze your business in-depth. A common pattern when using custom attributes is to capture user information, e.g. name, id, email, etc. This allows you to 'link' your operational data with your business data. For example, if you have the user information, you tie together your service desk and CRM data with the operational data in New Relic. Step 1 of 2 You can add a userid custom attribute to your APM-reported data (Transaction and TransactionError events) with the opensource Java APM agent's API. NewRelic.addCustomParameter('userid', userId); Copy Step 2 of 2 Once added, you can run a NRQL query that uses the 'userid' custom attribute. Once you have added a custom attribute like 'userid', you can use it to filter and facet your NRQL queries. -- Get a count of errors experienced by a single filtered userid faceted by date and error message SELECT count(*) FROM TransactionError WHERE userid = '1401961100' FACET dateOf(timestamp), `error.message` SINCE 1 week ago Copy",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Add metadata for more detailed analysis",
+ "sections": [
+ "Add custom attributes to your New Relic data"
+ ],
+ "title": "Add custom attributes to your New Relic data",
+ "popularity": 1,
+ "tags": [
+ "Custom Attributes",
+ "NRQL"
+ ],
+ "external_id": "b7c3eb72c1c275d97df9c6232d50bd675ac2e39a",
+ "image": "https://developer.newrelic.com/static/2dd8a32b57677b2e8d2497147d8ebc26/2663f/custom-attribute-query.png",
+ "url": "https://developer.newrelic.com/collect-data/custom-attributes/",
+ "published_at": "2020-08-18T02:08:12Z",
+ "updated_at": "2020-08-04T01:39:41Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.7941898,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Add custom attributes to your New Relic data ",
+ "sections": "Add custom attributes to your New Relic data ",
+ "tags": "NRQL ",
+ "body": " APM-reported data (Transaction and TransactionError events) with the opensource Java APM agent's API. NewRelic.addCustomParameter('userid', userId); Copy Step 2 of 2 Once added, you can run a NRQL query that uses the 'userid' custom attribute. Once you have added a custom attribute like 'userid"
+ },
+ "id": "5efa999de7b9d2985d7bab67"
+ },
+ {
+ "body": "NRQL is a query language you can use to query the New Relic database. This document explains NRQL syntax, clauses, components, and functions. Syntax This document is a reference for the functions and clauses used in a NRQL query. Other resources for understanding NRQL: Intro to NRQL: explains what NRQL is used for, what data you can query with it, and basic NRQL syntax Examine NRQL queries used to build New Relic charts Simulate SQL JOIN functions Use funnels to evaluate a series of related data Format NRQL for querying with the Event API Query components Every NRQL query will begin with a SELECT statement or a FROM clause. All other clauses are optional. The clause definitions below also contain example NRQL queries. Required: SELECT statement SELECT attribute ... SELECT function(attribute) ... The SELECT specifies what portion of a data type you want to query by specifying an attribute or a function. It's followed by one or more arguments separated by commas. In each argument you can: Get the values of all available attributes by using * as a wildcard. For example: SELECT * from Transaction. Get values associated with a specified attribute or multiple attributes specified in a comma separated list. Get aggregated values from specified attributes by selecting an aggregator function. Label the results returned in each argument with the AS clause. You can also use SELECT with basic math functions. Avg response time since last week This query returns the average response time since last week. SELECT average(duration) FROM PageView SINCE 1 week ago Required: FROM clause SELECT ... FROM data type ... Use the FROM clause to specify the data type you wish to query. You can start your query with FROM or with SELECT. You can merge values for the same attributes across multiple data types in a comma separated list. Query one data type This query returns the count of all APM transactions over the last three days: SELECT count(*) FROM Transaction SINCE 3 days ago Query multiple data types This query returns the count of all APM transactions and Browser events over the last three days: SELECT count(*) FROM Transaction, PageView SINCE 3 days ago SHOW EVENT TYPES clause SHOW EVENT TYPES... SHOW EVENT TYPES will return a list of all the data types present in your account for a specific time range. It is used as the first clause in a query instead of SELECT. In this context, \"event types\" refers to the data types you can access with a NRQL query. Data types in the last day This query will return all the data types present over the past day: SHOW EVENT TYPES SINCE 1 day ago WHERE clause Use the WHERE clause to filter results. NRQL returns the results that fulfill the condition(s) you specify in the clause. SELECT function(attribute) ... WHERE attribute [operator 'value' | IN ('value' [, 'value]) | IS [NOT] NULL ] [AND|OR ...] ... If you specify more than one condition, separate the conditions by the operators AND or OR. If you want to simulate a SQL join, use custom attributes in a WHERE or FACET clause. Operators that the WHERE clause accepts Description =, !=, <, <=, >, >= NRQL accepts standard comparison operators. Example: state = 'WA' AND Used to define an intersection of two conditions. OR Used to define a union of two conditions. IS NULL Determines if an attribute has a null value. IS NOT NULL Determines if an attribute does not have a null value. IN Determines if the string value of an attribute is in a specified set. Using this method yields better performance than stringing together multiple WHERE clauses. Example: animalType IN ('cat', 'dog', 'fish') NOT IN Determines if the string value of an attribute is not in a specified set. Using this method yields better performance than stringing together multiple WHERE clauses. Values must be in parentheses, separated by commas. For example: SELECT * FROM PageView WHERE countryCode NOT IN ('CA', 'WA') LIKE Determines if an attribute contains a specified sub-string. The string argument for the LIKE operator accepts the percent sign (%) as a wildcard anywhere in the string. If the substring does not begin or end the string you are matching against, the wildcard must begin or end the string. Examples: userAgentName LIKE 'IE%' IE IE Mobile userAgentName LIKE 'o%a%' Opera Opera Mini userAgentName LIKE 'o%a' Opera userAgentName LIKE '%o%a%' Opera Opera Mini Mozilla Gecko NOT LIKE Determines if an attribute does not contain a specified sub-string. RLIKE Determines if an attribute contains a specified Regex sub-string. Uses RE2 syntax. Examples: appName RLIKE 'z.*|q.*'' z-app q-app hostname RLIKE 'ip-10-351-[0-2]?[0-9]-.*' ip-10-351-19-237 ip-10-351-2-41 ip-10-351-24-238 ip-10-351-14-15 Note: Slashes must be escaped in the Regex pattern. For example, \\d must be \\\\d. Regex defaults to full-string matching, therefore ^ and $ are implicit and you do not need to add them. If the Regex pattern contains a capture group, the group will be ignored. That is, the group will not be captured for use later in the query. NOT RLIKE Determines if an attribute does not contain a specified Regex sub-string. Uses RE2 syntax. Example query with three conditions This query returns the browser response time for pages with checkout in the URL for Safari users in the United States and Canada over the past 24 hours. SELECT histogram(duration, 50, 20) FROM PageView WHERE countryCode IN ('CA', 'US') AND userAgentName='Safari' AND pageUrl LIKE '%checkout%' SINCE 1 day ago AS clause SELECT ... AS 'label' ... Use the AS clause to label an attribute, aggregator, step in a funnel, or the result of a math function with a string delimited by single quotes. The label is used in the resulting chart. Query using math function and AS This query returns the number of page views per session: SELECT count(*)/uniqueCount(session) AS 'Pageviews per Session' FROM PageView Query using funnel and AS This query returns a count of people who have visited both the main page and the careers page of a site over the past week: SELECT funnel(SESSION, WHERE name='Controller/about/main' AS 'Step 1', WHERE name = 'Controller/about/careers' AS 'Step 2') FROM PageView SINCE 1 week ago FACET clause SELECT ... FACET attribute ... Use FACET to separate and group your results by attribute values. For example, you could FACET your PageView data by deviceType to figure out what percentage of your traffic comes from mobile, tablet, and desktop devices. Use the LIMIT clause to specify how many facets appear (default is 10). For more complex grouping, use FACET CASES. FACET clauses support up to five attributes, separated by commas. The facets are sorted in descending order by the first field you provide in the SELECT clause. If you are faceting on attributes with more than 1,000 unique values, a subset of facet values is selected and sorted according to the query type. When selecting min(), max(), or count(), FACET uses those functions to determine how facets are picked and sorted. When selecting any other function, FACET uses the frequency of the attribute you are faceting on to determine how facets are picked and sorted. For more on faceting on multiple attributes, with some real-world examples, see this New Relic blog post. Faceted query using count() This query shows cities with the highest pageview counts. This query uses the total number of pageviews per city to determine how facets are picked and ordered. SELECT count(*) FROM PageView FACET city Faceted query using uniqueCount() This query shows the cities that access the highest number of unique URLs. This query uses the total number of times a particular city appears in the results to determine how facets are picked and ordered. SELECT uniqueCount(pageUrl) FROM PageView FACET city Grouping results across time Advanced segmentation and cohort analysis allow you to facet on bucket functions to more effectively break out your data. Cohort analysis is a way to group results together based on timestamps. You can separate them into buckets that cover a specified range of dates and times. FACET CASES clause SELECT ... FACET CASES ( WHERE attribute operator value, WHERE attribute operator value, ... ) ... Use FACET CASES to break out your data by more complex conditions than possible with FACET. Separate multiple conditions with a comma ,. For example, you could query your PageView data and FACET CASES into categories like less than 1 second, from 1 to 10 seconds, and greater than 10 seconds. You can combine multiple attributes within your cases, and label the cases with the AS selector. Data points will be added to at most one facet case, the first facet case that they match. You may also use a time function with your attribute. Basic usage with WHERE SELECT count(*) FROM PageView FACET CASES (WHERE duration < 1, WHERE duration > 1 and duration < 10, WHERE duration > 10) Group based on multiple attributes This example groups results into one bucket where the transaction name contains login, and another where the URL contains login and a custom attribute indicates that the user was a paid user: SELECT count(*) FROM Transaction FACET CASES (WHERE name LIKE '%login%', WHERE name LIKE '%feature%' AND customer_type='Paid') Label groups with AS This example uses the AS selector to give your results a human-readable name: SELECT count(*) FROM Transaction FACET CASES (WHERE name LIKE '%login%' AS 'Total Logins', WHERE name LIKE '%feature%' AND customer_type='Paid' AS 'Feature Visits from Paid Users') LIMIT clause SELECT ... LIMIT count ... Use the LIMIT clause to control the maximum number of facet values returned by FACET queries or the maximum number of items returned by SELECT * queries. This clause takes a single integer value as an argument. If the LIMIT clause is not specified, or no value is provided, the limit defaults to 10 for FACET queries and 100 in the case of SELECT * queries. The maximum allowed value for the LIMIT clause is 2,000. Query using LIMIT This query shows the top 20 countries by session count and provides 95th percentile of response time for each country for Windows users only. SELECT uniqueCount(session), percentile(duration, 95) FROM PageView WHERE userAgentOS = 'Windows' FACET countryCode LIMIT 20 SINCE YESTERDAY OFFSET clause SELECT ... LIMIT count OFFSET count ... Use the OFFSET clause with LIMIT to control the portion of rows returned by SELECT * or SELECT column queries. Like the LIMIT clause, OFFSET takes a single integer value as an argument. OFFSET sets the number of rows to be skipped before the selected rows of your query are returned. This is constrained by LIMIT. OFFSET rows are skipped starting from the most recent record. For example, the query SELECT interestingValue FROM Minute_Report LIMIT 5 OFFSET 1 returns the last 5 values from Minute_Report except for the most recent one. SINCE clause SELECT ... SINCE [numerical units AGO | phrase] ... The default value is 1 hour ago. Use the SINCE clause to define the beginning of a time range for the returned data. When using NRQL, you can set a UTC timestamp or relative time range. You can specify a timezone for the query but not for the results. NRQL results are based on your system time. See Set time range on dashboards and charts for detailed information and examples. UNTIL clause SELECT ... UNTIL integer units AGO ... The default value is NOW. Only use UNTIL to specify an end point other than the default. Use the UNTIL clause to define the end of a time range across which to return data. Once a time range has been specified, the data will be preserved and can be reviewed after the time range has ended. You can specify a UTC timestamp or relative time range. You can specify a time zone for the query but not for the results. The returned results are based on your system time. See Set time range on dashboards and charts for detailed information and examples. WITH TIMEZONE clause SELECT ... WITH TIMEZONE (selected zone) ... By default, query results are displayed in the timezone of the browser you're using. Use the WITH TIMEZONE clause to select a time zone for a date or time in the query that hasn't already had a time zone specified for it. For example, the query clause SINCE Monday UNTIL Tuesday WITH TIMEZONE 'America/New_York' will return data recorded from Monday at midnight, Eastern Standard Time, until midnight Tuesday, Eastern Standard Time. Available Time Zone Selections Africa/Abidjan Africa/Addis_Ababa Africa/Algiers Africa/Blantyre Africa/Cairo Africa/Windhoek America/Adak America/Anchorage America/Araguaina America/Argentina/Buenos_Aires America/Belize America/Bogota America/Campo_Grande America/Cancun America/Caracas America/Chicago America/Chihuahua America/Dawson_Creek America/Denver America/Ensenada America/Glace_Bay America/Godthab America/Goose_Bay America/Havana America/La_Paz America/Los_Angeles America/Miquelon America/Montevideo America/New_York America/Noronha America/Santiago America/Sao_Paulo America/St_Johns Asia/Anadyr Asia/Bangkok Asia/Beirut Asia/Damascus Asia/Dhaka Asia/Dubai Asia/Gaza Asia/Hong_Kong Asia/Irkutsk Asia/Jerusalem Asia/Kabul Asia/Katmandu Asia/Kolkata Asia/Krasnoyarsk Asia/Magadan Asia/Novosibirsk Asia/Rangoon Asia/Seoul Asia/Tashkent Asia/Tehran Asia/Tokyo Asia/Vladivostok Asia/Yakutsk Asia/Yekaterinburg Asia/Yerevan Atlantic/Azores Atlantic/Cape_Verde Atlantic/Stanley Australia/Adelaide Australia/Brisbane Australia/Darwin Australia/Eucla Australia/Hobart Australia/Lord_Howe Australia/Perth Chile/EasterIsland Etc/GMT+10 Etc/GMT+8 Etc/GMT-11 Etc/GMT-12 Europe/Amsterdam Europe/Belfast Europe/Belgrade Europe/Brussels Europe/Dublin Europe/Lisbon Europe/London Europe/Minsk Europe/Moscow Pacific/Auckland Pacific/Chatham Pacific/Gambier Pacific/Kiritimati Pacific/Marquesas Pacific/Midway Pacific/Norfolk Pacific/Tongatapu UTC See Set time range on dashboards and charts for detailed information and examples. WITH METRIC_FORMAT clause For information on querying metric data, see Query metrics. COMPARE WITH clause SELECT ... (SINCE or UNTIL) (integer units) AGO COMPARE WITH (integer units) AGO ... Use the COMPARE WITH clause to compare the values for two different time ranges. COMPARE WITH requires a SINCE or UNTIL statement. The time specified by COMPARE WITH is relative to the time specified by SINCE or UNTIL. For example, SINCE 1 day ago COMPARE WITH 1 day ago compares yesterday with the day before. The time range for theCOMPARE WITH value is always the same as that specified by SINCE or UNTIL. For example, SINCE 2 hours ago COMPARE WITH 4 hours ago might compare 3:00pm through 5:00pm against 1:00 through 3:00pm. COMPARE WITH can be formatted as either a line chart or a billboard: With TIMESERIES, COMPARE WITH creates a line chart with the comparison mapped over time. Without TIMESERIES, COMPARE WITH generates a billboard with the current value and the percent change from the COMPARE WITH value. Example: This query returns data as a line chart showing the 95th percentile for the past hour compared to the same range one week ago. First as a single value, then as a line chart. SELECT percentile(duration) FROM PageView SINCE 1 week ago COMPARE WITH 1 week AGO SELECT percentile(duration) FROM PageView SINCE 1 week ago COMPARE WITH 1 week AGO TIMESERIES AUTO TIMESERIES clause SELECT ... TIMESERIES integer units ... Use the TIMESERIES clause to return data as a time series broken out by a specified period of time. Since TIMESERIES is used to trigger certain charts, there is no default value. To indicate the time range, use integer units. For example: TIMESERIES 1 minute TIMESERIES 30 minutes TIMESERIES 1 hour TIMESERIES 30 seconds Use a set interval The value provided indicates the units used to break out the graph. For example, to present a one-day graph showing 30 minute increments: SELECT ... SINCE 1 day AGO TIMESERIES 30 minutes Use automatically set interval TIMESERIES can also be set to AUTO, which will divide your graph into a reasonable number of divisions. For example, a daily chart will be divided into 30 minute intervals and a weekly chart will be divided into 6 hour intervals. This query returns data as a line chart showing the 50th and 90th percentile of client-side transaction time for one week with a data point every 6 hours. SELECT average(duration), percentile(duration, 50, 90) FROM PageView SINCE 1 week AGO TIMESERIES AUTO Use max interval You can set TIMESERIES to MAX, which will automatically adjust your time window to the maximum number of intervals allowed for a given time period. This allows you to update your time windows without having to manually update your TIMESERIES buckets and ensures your time window is being split into the peak number of intervals allowed. The maximum number of TIMESERIES buckets that will be returned is 366. For example, the following query creates 4-minute intervals, which is the ceiling for a daily chart. SELECT average(duration) FROM Transaction since 1 day ago TIMESERIES MAX For functions such as average( ) or percentile( ), a large interval can have a significant smoothing effect on outliers. EXTRAPOLATE clause You can use this clause with these data types: Transaction TransactionError Custom events reported via APM agent APIs The purpose of EXTRAPOLATE is to mathematically compensate for the effects of APM agent sampling of event data so that query results more closely represent the total activity in your system. This clause will be useful when a New Relic APM agent reports so many events that it often passes its harvest cycle reporting limits. When that occurs, the agent begins to sample events. When EXTRAPOLATE is used in a NRQL query that supports its use, the ratio between the reported events and the total events is used to extrapolate a close approximation of the total unsampled data. When it is used in a NRQL query that doesn’t support its use or that hasn’t used sampled data, it has no effect. Note that EXTRAPOLATE is most useful for homogenous data (like throughput or error rate). It's not effective when attempting to extrapolate a count of distinct things (like uniqueCount() or uniques()). This clause works only with NRQL queries that use one of the following aggregator functions: apdex average count histogram sum percentage (if function it takes as an argument supports EXTRAPOLATE) rate (if function it takes as an argument supports EXTRAPOLATE) stddev Example of extrapolating throughput A query that will show the extrapolated throughput of a service named interestingApplication. SELECT count(*) FROM Transaction WHERE appName='interestingApplication' SINCE 60 minutes ago EXTRAPOLATE Example of extrapolating throughput as a time series A query that will show the extrapolated throughput of a service named interestingApplication by transaction name, displayed as a time series. SELECT count(*) FROM Transaction WHERE appName='interestingApplication' SINCE 60 minutes ago FACET name TIMESERIES 1 minute EXTRAPOLATE Query metric data There are several ways to query metric data using NRQL: Query metric timeslice data, which is reported by New Relic APM, Mobile, Browser Query the Metric data type, which is reported by some of our integrations and Telemetry SDKs For more on understanding metrics in New Relic, see Metric data types. Aggregator functions Use aggregator functions to filter and aggregate data in a NRQL query. Some helpful information about using aggregator functions: See the New Relic University tutorials for Filter queries, Apdex queries, and Percentile queries. Or, go to the full online course Writing NRQL queries. Data type \"coercion\" is not supported. Read about available type conversion functions. Cohort analysis functions appear on the New Relic Insights Cohort analysis page. The cohort functions aggregate transactions into time segments. Here are the available aggregator functions. The definitions below contain example NRQL queries. Examples: SELECT histogram(duration, 10, 20) FROM PageView SINCE 1 week ago apdex(attribute, t: ) Use the apdex function to return an Apdex score for a single transaction or for all your transactions. The attribute can be any attribute based on response time, such as duration or backendDuration. The t: argument defines an Apdex T threshold in seconds. The Apdex score returned by the apdex( ) function is based only on execution time. It does not account for APM errors. If a transaction includes an error but completes in Apdex T or less, that transaction will be rated satisfying by the apdex ( ) function. Get Apdex for specific customers If you have defined custom attributes, you can filter based on those attributes. For example, you could monitor the Apdex for a particularly important customer: SELECT apdex(duration, t: 0.4) FROM Transaction WHERE customerName='ReallyImportantCustomer' SINCE 1 day ago Get Apdex for specific transaction Use the name attribute to return a score for a specific transaction, or return an overall Apdex by omitting name. This query returns an Apdex score for the Controller/notes/index transaction over the last hour: SELECT apdex(duration, t: 0.5) from Transaction WHERE name='Controller/notes/index' SINCE 1 hour ago The apdex function returns an Apdex score that measures user satisfaction with your site. Arguments are a response time attribute and an Apdex T threshold in seconds. Get overall Apdex for your app This example query returns an overall Apdex for the application over the last three weeks: SELECT apdex(duration, t: 0.08) FROM Transaction SINCE 3 week ago average(attribute) Use the average( ) function to return the average value for an attribute. It takes a single attribute name as an argument. If a value of the attribute is not numeric, it will be ignored when aggregating. If data matching the query's conditions is not found, or there are no numeric values returned by the query, it will return a value of null. buckets(attribute, ceiling [,number of buckets]) Use the buckets() function to aggregate data split up by a FACET clause into buckets based on ranges. You can bucket by any attribute that is stored as a numerical value in the New Relic database. It takes three arguments: Attribute name Maximum value of the sample range. Any outliers will appear in the final bucket. Total number of buckets For more information and examples, see Split your data into buckets. bucketPercentile(attribute) The bucketPercentile( ) function is the NRQL equivalent of the histogram_quantile function in Prometheus. It is intended to be used with dimensional metric data. Instead of the quantile, New Relic returns the percentile, which is the quantile * 100. Use the bucketPercentile( ) function to calculate the quantile from the histogram data in a Prometheus format. It takes the bucket name as an argument and reports percentiles along the bucket's boundaries: SELECT bucketPercentile(duration_bucket) FROM Metric SINCE 1 day ago Optionally, you can add percentile specifications as an argument: SELECT bucketPercentile(duration_bucket, 50, 75, 90) FROM Metric SINCE 1 day ago Because multiple metrics are used to make up Prometheus histogram data, you must query for specific Prometheus metrics in terms of the associated . For example, to compute percentiles from a Prometheus histogram, with the prometheus_http_request_duration_seconds using NRQL, use bucketPercentile(prometheus_http_request_duration_seconds_bucket, 50). Note how _bucket is added to the end of the as a suffix. See the Prometheus.io documentation for more information. cardinality(attribute) Use the cardinality( ) function to obtain the number of combinations of all the dimensions (attributes) on a metric. It takes three arguments, all optional: Metric name: if present, cardinality( ) only computes the metric specified. Include: if present, the include list restricts the cardinality computation to those attributes. Exclude: if present, the exclude list causes those attributes to be ignored in the cardinality computation. SELECT cardinality(metric_name, include:{attribute_list}, exclude:{attribute_list}) count(*) Use the count( ) function to return a count of available records. It takes a single argument; either *, an attribute, or a constant value. Currently, it follows typical SQL behavior and counts all records that have values for its argument. Since count(*) does not name a specific attribute, the results will be formatted in the default \"humanize\" format. derivative(attribute [,time interval]) derivative() finds the rate of change for a given dataset. The rate of change is calculated using a least-squares regression to approximate the derivative. The time interval is the period for which the rate of change is calculated. For example, derivative(attributeName, 1 minute) will return the rate of change per minute. dimensions(include: {attributes}, exclude: {attributes}) Use the dimensions( ) function to return all the dimensional values on a data type. You can explicitly include or exclude specific attributes using the optional arguments: Include: if present, the include list limits dimensions( ) to those attributes. Exclude: if present, the dimensions( ) calculation ignores those attributes. FROM Metric SELECT count(node_filesystem_size) TIMESERIES FACET dimensions() When used with a FACET clause, dimensions( ) produces a unique timeseries for all facets available on the event type, similar to how Prometheus behaves with non-aggregated queries. earliest(attribute) Use the earliest( ) function to return the earliest value for an attribute over the specified time range. It takes a single argument. Arguments after the first will be ignored. If used in conjunction with a FACET it will return the most recent value for an attribute for each of the resulting facets. Get earliest country per user agent from PageView This query returns the earliest country code per each user agent from the PageView event. SELECT earliest(countryCode) FROM PageView FACET userAgentName eventType() ...WHERE eventType() = 'EventNameHere'... ...FACET eventType()... Use the eventType() function in a FACET clause to break out results by the selected data type or in a WHERE clause to filter results to a specific data type. This is particularly useful for targeting specific data types with the filter() and percentage() functions. In this context, \"event type\" refers to the types of data you can access with a NRQL query. Use eventType() in filter() function This query returns the percentage of total TransactionError results out of the total Transaction results. You can use the eventType() function to target specific types of data with the filter() function. SELECT 100 * filter(count(*), where eventType() = 'TransactionError') / filter(count(*), where eventType() = 'Transaction') FROM Transaction, TransactionError WHERE appName = 'App.Prod' TIMESERIES 2 Minutes SINCE 6 hours ago Use eventType() with FACET This query displays a count of how many records each data type (Transaction and TransactionError) returns. SELECT count(*) FROM Transaction, TransactionError FACET eventType() TIMESERIES filter(function(attribute), WHERE condition) Use the filter( ) function to limit the results for one of the aggregator functions in your SELECT statement. You can use filter() in conjunction with FACET or TIMESERIES. Analyze purchases that used offer codes You could use filter() to compare the items bought in a set of transactions for those using an offer code versus those who aren't: Use the filter( ) function to limit the results for one of the aggregator functions in your SELECT statement. funnel(attribute, steps) Use the funnel() function to generate a funnel chart. It takes an attribute as its first argument. You then specify steps as WHERE clauses (with optional AS clauses for labels) separated by commas. For details and examples, see the funnels documentation. getField(attribute, field) Use the getField() function to extract a field from complex metrics. It takes the following arguments: Metric type Supported fields summary count, total, max, min gauge count, total, max, min, latest distribution count, total, max, min counter count Examples: SELECT max(getField(mySummary, count)) from Metric SELECT sum(mySummary) from Metric where getField(mySummary, count) > 10 histogram(attribute, ceiling [,number of buckets]) Use the histogram( ) function to generate histograms. It takes three arguments: Attribute name Maximum value of the sample range Total number of buckets Histogram of response times from PageView events This query results in a histogram of response times ranging up to 10 seconds over 20 buckets. SELECT histogram(duration, 10, 20) FROM PageView SINCE 1 week ago Prometheus histogram buckets histogram( ) accepts Prometheus histogram buckets: SELECT histogram(duration_bucket, 10, 20) FROM Metric SINCE 1 week ago New Relic distribution metric histogram( ) accepts Distribution metric as an input: SELECT histogram(myDistributionMetric, 10, 20) FROM Metric SINCE 1 week ago keyset() Using keyset() will allow you to see all of the attributes for a given data type over a given time range. It takes no arguments. It returns a JSON structure containing groups of string-typed keys, numeric-typed keys, boolean-typed keys, and all keys. See all attributes for a data type This query returns the attributes found for PageView events from the last day: SELECT keyset() FROM PageView SINCE 1 day ago latest(attribute) Use the latest( ) function to return the most recent value for an attribute over a specified time range. It takes a single argument. Arguments after the first will be ignored. If used in conjunction with a FACET it will return the most recent value for an attribute for each of the resulting facets. Get most recent country per user agent from PageView This query returns the most recent country code per each user agent from the PageView event. SELECT latest(countryCode) FROM PageView FACET userAgentName max(attribute) Use the max( ) function to return the maximum recorded value of a numeric attribute over the time range specified. It takes a single attribute name as an argument. If a value of the attribute is not numeric, it will be ignored when aggregating. If data matching the query's conditions is not found, or there are no numeric values returned by the query, it will return a value of null. median(attribute) Use the median( ) function to return an attribute's median, or 50th percentile. For more information about percentile queries, see percentile(). The median( ) query is only available when using the query builder. Median query This query will generate a line chart for the median value. SELECT median(duration) FROM PageView TIMESERIES AUTO min(attribute) Use the min( ) function to return the minimum recorded value of a numeric attribute over the time range specified. It takes a single attribute name as an argument. If a value of the attribute is not numeric, it will be ignored when aggregating. If data matching the query's conditions is not found, or there are no numeric values returned by the query, it will return a value of null. percentage(function(attribute), WHERE condition) Use the percentage( ) function to return the percentage of a target data set that matches some condition. The first argument requires an aggregator function against the desired attribute. Use exactly two arguments (arguments after the first two will be ignored). If the attribute is not numeric, this function returns a value of 100%. percentile(attribute [, percentile [, ...]]) Use the percentile( ) function to return an attribute's approximate value at a given percentile. It requires an attribute and can take any number of arguments representing percentile points. The percentile() function enables percentiles to displays with up to three digits after the decimal point, providing greater precision. Percentile thresholds may be specified as decimal values, but be aware that for most data sets, percentiles closer than 0.1 from each other will not be resolved. Percentile display examples Use TIMESERIES to generate a line chart with percentiles mapped over time. Omit TIMESERIES to generate a billboard and attribute sheet showing aggregate values for the percentiles. If no percentiles are listed, the default is the 95th percentile. To return only the 50th percentile value, the median, you can also use median(). Basic percentile query This query will generate a line chart with lines for the 5th, 50th, and 95th percentile. SELECT percentile(duration, 5, 50, 95) FROM PageView TIMESERIES AUTO predictLinear(attribute, [,time interval]) predictLinear() is an extension of the derivative() function. It uses a similar method of least-squares linear regression to predict the future values for a dataset. The time interval is how far the query will look into the future. For example, predictLinear(attributeName, 1 hour) is a linear prediction 1 hour into the future of the query time window. Generally, predictLinear() is helpful for continuously growing values like disk space, or predictions on large trends. Since predictLinear() is a linear regression, familiarity with the dataset being queried helps to ensure accurate long-term predictions. Any dataset which grows exponentially, logarithmically, or by other nonlinear means will likely only be successful in very short-term predictions. New Relic recommends against using predictLinear in TIMESERIES queries. This is because each bucket will be making an individual prediction based on its relative timeframe within the query, meaning that such queries will not show predictions from the end of the timeseries forward. rate(function(attribute) [,time interval]) Use the rate( ) function to visualize the frequency or rate of a given query per time interval. For example, you might want to know the number of pageviews per minute over an hour-long period or the count of unique sessions on your site per hour over a day-long period. Use TIMESERIES to generate a line chart with rates mapped over time. Omit TIMESERIES to generate a billboard showing a single rate value averaged over time. Basic rate query This query will generate a line chart showing the rate of throughput for APM transactions per 10 minutes over the past 6 hours. SELECT rate(count(*), 10 minute) FROM Transaction SINCE 6 hours ago TIMESERIES round(attribute) Use the round( ) function to return the rounded value of an attribute. Optionally round( ) can take a second argument, to_nearest, to round the first argument to the closest multiple of the second one. to_nearest can be fractional. SELECT round(n [, to_nearest]) stddev(attribute) Use the stddev( ) function to return one standard deviation for a numeric attribute over the time range specified. It takes a single argument. If the attribute is not numeric, it will return a value of zero. stdvar(attribute) Use the stdvar( ) function to return the standard variance for a numeric attribute over the time range specified. It takes a single argument. If the attribute is not numeric, it will return a value of zero. sum(attribute) Use the sum( ) function to return the sum recorded values of a numeric attribute over the time range specified. It takes a single argument. Arguments after the first will be ignored. If the attribute is not numeric, it will return a value of zero. uniqueCount(attribute) Use the uniqueCount( ) function to return the number of unique values recorded for an attribute over the time range specified. To optimize query performance, this function returns approximate results for queries that inspect more than 256 unique values. uniques(attribute [,limit]) Use the uniques( ) function to return a list of unique values recorded for an attribute over the time range specified. When used along with the facet clause, a list of unique attribute values will be returned per each facet value. The limit parameter is optional. When it is not provided, the default limit of 1,000 unique attribute values per facet is applied. You may specify a different limit value, up to a maximum of 10,000. The uniques( ) function will return the first set of unique attribute values discovered, until the limit is reached. Therefore, if you have 5,000 unique attribute values in your data set, and the limit is set to 1,000, the operator will return the first 1,000 unique values that it discovers, regardless of their frequency. The maximum number of values that can be returned in a query result is the product of the uniques( ) limit times the facet limit. In the following query, the theoretical maximum number of values that can be returned is 5 million (5,000 x 1,000). From Transaction SELECT uniques(host,5000) FACET appName LIMIT 1000 However, depending on the data set being queried, and the complexity of the query, memory protection limits may prevent a very large query from being executed. Type conversion NRQL does not support \"coercion.\" This means that a float stored as a string is treated as a string and cannot be operated on by functions expecting float values. You can convert a string with a numeric value or a boolean with a string value to their numeric and boolean types with these functions: Use the numeric() function to convert a number with a string format to a numeric function. The function can be built into a query that uses math functions on query results or NRQL aggregator functions, such as average(). Use the boolean() function to convert a string value of \"true\" or \"false\" to the corresponding boolean value. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started",
+ "info": "New Relic Query Language (NRQL) dictionary of clauses and aggregator functions. ",
+ "nodeid": 1136,
+ "sections": [
+ "NRQL: New Relic Query Language",
+ "Get started",
+ "NRQL query tools",
+ "NRQL query tutorials",
+ "NRQL syntax, clauses, and functions",
+ "Syntax",
+ "Query components",
+ "Query metric data",
+ "Aggregator functions",
+ "Type conversion",
+ "For more help"
+ ],
+ "title": "NRQL syntax, clauses, and functions",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/nrql-syntax-clauses-functions",
+ "popularity": 1,
+ "external_id": "a748f594f32d72e0cbd0bca97e4cedc4e398dbab",
+ "category_1": "NRQL: New Relic Query Language",
+ "category_2": "Get started",
+ "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/percentile_0.png",
+ "url": "https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/nrql-syntax-clauses-functions",
+ "published_at": "2020-08-18T06:37:42Z",
+ "updated_at": "2020-08-15T03:21:31Z",
+ "category_0": "Query your data",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.6758109,
+ "_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"
+ },
+ "id": "5f2abcef28ccbcb0ee0c3aed"
+ },
+ {
+ "body": "You can create alert conditions using NRQL queries. Create NRQL alert condition To create a NRQL condition: When you start to create a condition, where it prompts you to Select a product, click NRQL. Tips on creating a NRQL condition: NRQL conditions Tips Condition types NRQL condition types include static, baseline, and outlier. Create a description For some condition types, you can create a Description. Query results Queries must return a number. The condition works by evaluating that returned number against the thresholds you set. Time period As with all alert conditions, NRQL conditions evaluate one single minute at a time. The implicit SINCE ... UNTIL clause specifying which minute to evaluate is controlled by your Evaluation offset setting. Since very recent data may be incomplete, you may want to query data from 3 minutes ago or longer, especially for: Applications that run on multiple hosts. SyntheticCheck data: Timeouts can take 3 minutes, so 5 minutes or more is recommended. Also, if a query will generate intermittent data, consider using the sum of query results option. Condition settings Use the Condition settings to: Configure whether and how open violations are force-closed. Adjust the evaluation offset. Create a concise and descriptive condition name. (NerdGraph API Only) Provide a text description for the condition that will be included in violations and notifications. Troubleshooting procedures Optional: To include your organization's procedures for handling the incident, add the runbook URL to the condition. Limits on conditions See the maximum values. Examples For more information, see: Expected NRQL syntax Examples of NRQL condition queries Alert threshold types When you create a NRQL alert, you can choose from different types of thresholds: NRQL alert threshold types Description Static This is the simplest type of NRQL threshold. It allows you to create a condition based on a NRQL query that returns a numeric value. Optional: Include a FACET clause. Baseline Uses a self-adjusting condition based on the past behavior of the monitored values. Uses the same NRQL query form as the static type, except you cannot use a FACET clause. Outlier Looks for group behavior and values that are outliers from those groups. Uses the same NRQL query form as the static type, but requires a FACET clause. NRQL alert syntax Here is the basic syntax for creating all NRQL alert conditions. Depending on the threshold type, also include a FACET clause as applicable. SELECT function(attribute) FROM Event WHERE attribute [comparison] [AND|OR ...] Clause Notes SELECT function(attribute) Required Supported functions that return numbers include: apdex average count latest max min percentage percentile sum uniqueCount If you use the percentile aggregator in a faceted alert condition with many facets, this may cause the following error to appear: An error occurred while fetching chart data. If you see this error, use average instead. FROM data type Required Only one data type can be targeted. Supported data types: Event Metric (RAW data points will be returned) WHERE attribute [comparison] [AND|OR ...] Optional Use the WHERE clause to specify a series of one or more conditions. All the operators are supported. FACET attribute Static: Optional Baseline: Not allowed Outlier: Required Including a FACET clause in your NRQL syntax depends on the threshold type: static, baseline, or outlier. Use the FACET clause to separate your results by attribute and alert on each attribute independently. Faceted queries can return a maximum of 5000 values for static conditions and a maximum of 500 values for outlier conditions. If the query returns more than this number of values, the alert condition cannot be created. If you create the condition and the query returns more than this number later, the alert will fail. Sum of query results (limited or intermittent data) Available only for static (basic) threshold types. If a query returns intermittent or limited data, it may be difficult to set a meaningful threshold. Missing or limited data will sometimes generate false positives or false negatives. To avoid this problem when using the static threshold type, you can set the selector to sum of query results. This lets you set the alert on an aggregated sum instead of a value from a single harvest cycle. Up to two hours of the one-minute data checks can be aggregated. The duration you select determines the width of the rolling sum, and the preview chart will update accordingly. Offset the query time window Every minute, we evaluate the NRQL query in one-minute time windows. The start time depends on the value you select in the NRQL condition's Advanced settings > Evaluation offset. Example: Using the default time window to evaluate violations With the Evaluation offset at the default setting of three minutes, the NRQL time window applied to your query will be: SINCE 3 minutes ago UNTIL 2 minutes ago If the event type is sourced from an APM language agent and aggregated from many app instances (for example, Transactions, TransactionErrors, etc.), we recommend evaluating data from three minutes ago or longer. An offset of less than 3 minutes will trigger violations sooner, but you might see more false positives and negatives due to data latency. For cloud data, such as AWS integrations, you may need an offset longer than 3 minutes. Check our AWS polling intervals documentation to determine your best setting. NRQL alert threshold examples Here are some common use cases for NRQL alert conditions. These queries will work for static and baseline threshold types. The outlier threshold type will require additional FACET clauses. Alert on specific segments of your data Create constrained alerts that target a specific segment of your data, such as a few key customers or a range of data. Use the WHERE clause to define those conditions. SELECT average(duration) FROM Transaction WHERE account_id in (91290, 102021, 20230) SELECT percentile(duration, 95) FROM Transaction WHERE name LIKE 'Controller/checkout/%' Alert on Nth percentile of your data Create alerts when an Nth percentile of your data hits a specified threshold; for example, maintaining SLA service levels. Since we evaluate the NRQL query in one-minute time windows, percentiles will be calculated for each minute separately. SELECT percentile(duration, 95) FROM Transaction SELECT percentile(databaseDuration, 75) FROM Transaction Alert on max, min, avg of your data Create alerts when your data hits a certain maximum, minimum, or average; for example, ensuring that a duration or response time does not pass a certain threshold. SELECT max(duration) FROM Transaction SELECT average(duration) FROM Transaction Alert on a percentage of your data Create alerts when a proportion of your data goes above or below a certain threshold. SELECT percentage(count(*), WHERE duration > 2) FROM Transaction SELECT percentage(count(*), WHERE httpResponseCode = '500') FROM Transaction Alert on Apdex with any T-value Create alerts on Apdex, applying your own T-value for certain transactions. For example, get an alert notification when your Apdex for a T-value of 500ms on transactions for production apps goes below 0.8. SELECT apdex(duration, t:0.5) FROM Transaction WHERE appName like '%prod%' Create a description You can define a description that passes useful information downstream for better violation responses or for use by downstream systems. For details, see Description. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert conditions",
+ "info": "How to define thresholds that trigger alert notifications based on your NRQL queries.",
+ "nodeid": 9231,
+ "sections": [
+ "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": "Create NRQL alert conditions",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions",
+ "popularity": 1,
+ "external_id": "956a7a0b84d2afac5e6236df3143085ebc4f7459",
+ "category_1": "New Relic Alerts",
+ "category_2": "Alert conditions",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions",
+ "published_at": "2020-08-18T21:58:59Z",
+ "updated_at": "2020-08-15T23:05:02Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.170984,
+ "_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": " the incident, add the runbook URL to the condition. Limits on conditions See the maximum values. Examples For more information, see: Expected NRQL syntax Examples of NRQL condition queries Alert threshold types When you create a NRQL alert, you can choose from different types of thresholds: NRQL "
+ },
+ "id": "5f2d992528ccbc489d88dfc1"
+ },
+ {
+ "body": "APM reports metric data in the form of metric timeslice data, and you can use NRQL to query and facet this type of data. Why query metric timeslice data? We report metrics in several ways. One variety of metric data we call metric timeslice data; this is the type of data used to generate many of the charts in APM, Mobile, and Browser (for more details, see metric timeslice data). Historically, this type of data couldn't be queried via our query language, NRQL. But now we are converting popular APM metrics from metric timeslice data to more-detailed dimensional metric data, which opens them up for querying via NRQL and via our NerdGraph API. This capability allows you to create powerful, in-depth custom visualizations of these important APM metrics. And this includes being able to query your custom metrics. Where to query? We recommend querying APM metric timeslice data using New Relic One query builder in advanced mode. This experience offers full NRQL functionality, and also gives helpful auto-complete suggestions and feedback on query errors. You can also incorporate NRQL queries in our NerdGraph (GraphQL) API. How to construct a query In APM, some charts have the option to view the NRQL query that generated that chart. This can be a good option for understanding how to query metrics. The NRQL query examined below is slightly modified from the error rate chart on the APM summary page. FROM Metric SELECT count(apm.service.error.count) / count(apm.service.transaction.duration) WHERE (entity.guid = 'AN_ENTITY_GUID') AND (transactionType = 'Web') SINCE 1 day ago TIMESERIES Here is a breakdown of how the parts of this query work: Query segment What does it do? FROM Metric Metric is one of our core data types, and metric timeslice data is stored as this data type. For general tips on querying Metric data, see Metric query examples. SELECT count(apm.service.error.count) / count(apm.service.transaction.duration) This math generates a count of errors out of a total count of transaction metrics. This query uses the converted metric names. Note that you can use other aggregator functions. WHERE (entity.guid = 'AN_ENTITY_GUID') You must specify at least one data source. You can select a single entity's GUID, as shown here, or you can select multiple sources. This query uses entity.guid, but you can also use appId or appName. AND (transactionType = 'Web') Sets the transaction type to web, meaning that background/non-web transactions won't be counted. SINCE 1 day ago Selecting a time range. TIMESERIES This optional clause displays the results in a time-based chart. For general information on NRQL syntax, including FROM, FACET, and TIMESERIES, see Intro to NRQL. For more queries, see Query examples. How metric timeslice data is converted The conversion of original APM metric timeslice metrics into dimensional metrics that are available for querying is an ongoing process and isn't complete. If you don't see a metric you're looking for in this section, see Generic queries. Here are how the original APM metric timeslice metrics are converted into dimensional metrics: Metric timeslice structure Dimensional metric structure APM metric names are represented as single strings of segments separated by forward slashes. For example, the “Datastore/statement/MySQL/users/select” metric represents the time spent in a select database operation on the users table. A single dimensional metric named apm.service.datastore.operation.duration represents the entire group of datastore metrics. This metric has three attributes representing the data values encoded into the metric name, datastoreType, table and operation: datastoreType = ‘MySQL’ table = ‘users’ operation = ‘select’ Some of the APM metrics made available as dimensional metrics: Metric name Description Attributes apm.service.cpu.usertime.utilization Time spent in user-mode code percentage apm.service.datastore.operation.duration Response time for database calls broken out by table operations datastoreType, table, operation apm.service.error.count Summary error count metrics transactionType apm.service.external.host.duration Response time for external calls broken out by external host name external.host apm.service.instance.count Count of the number of agent instances apm.service.memory.physical Process memory in MB apm.service.transaction.apdex Apdex scores per transaction transactionName, transactionType apm.service.transaction.duration Response time per transaction keyTransactionName, transactionName, transactionType apm.service.transaction.error.count Error counts per transaction keyTransactionName, transactionName, transactionType apm.service.transaction.external.duration External call response time by transaction type transactionType To understand more about the general structure of metric timeslice data, including some common examples, see Metric timeslice data. Attributes These attributes are available in addition to the metric-specific attributes listed in the APM dimensional metrics table above. Name Description appName The name of the application. appId The ID of the application. entity.guid The GUID of the application. host The host of the monitored process. host.bootId The ID of the boot of the host, if available. host.displayName The display_name of the host, if it was set in the agent. instanceName For Java APM agents, host : port metricName The name of the dimensional metric. metricTimesliceName The timeslice name of the legacy metric. Generic queries with the newrelic.timeslice.value metric For metrics that haven't been converted to dimensional metrics, or for your own custom metrics, we have a dimensional metric named newrelic.timeslice.value. We recommend using the dimensional metrics from the table above when possible. When to use newrelic.timeslice.value? Given a metric timeslice name, you can query to see if it has a converted dimensional metric equivalent with this syntax: from Metric SELECT uniques(metricName) where metricTimesliceName = 'Datastore/statement/MySQL/test/select' If the only metric name returned is newrelic.timeslice.value, you'll need to query your data using this general approach. Facet on a wildcarded metric name segment Some metric timeslice names include attribute values as segments of the metric name. For example, our APM agents report metrics by tracking the duration of external calls using this format: External/{externalHost}/all Here, {externalHost} represents the host name for the outbound network call. Here's an example of a generic newrelic.timeslice.value query of a custom metric that facets on a wildcarded metric segment: FROM Metric SELECT count(newrelic.timeslice.value) WHERE appName = 'MY APP' WITH METRIC_FORMAT 'Custom/Labels/{action}' TIMESERIES FACET action In this query, {action} creates a temporary attribute, action, which is then used by FACET action. You can use any name you want, because it's only an attribute that exists for the duration of the query. You should choose a name that does not conflict with an existing attribute name. Here's another example of a faceted wildcard query: This shows a NRQL query of metric timeslice data that facets the rate of Flask functions by the wildcarded process name. Recommended aggregator functions Recommended NRQL aggregator functions include: apdex average sum count rate uniques Query examples Some examples of querying metric timeslice data: Facet by multiple app names This query uses WHERE… IN to specify two applications and then facet by them: FROM Metric SELECT rate(count(apm.service.transaction.duration), 1 minute) as 'Web throughput' WHERE appName IN ('MY_APPLICATION', 'MY_OTHER_APPLICATION') AND (transactionType = 'Web') FACET appName TIMESERIES Throughput-per-minute rate This query displays requests-per-minute chart using the rate function: FROM Metric SELECT rate(count(apm.service.transaction.duration), 1 minute) as 'HttpDispatcher requests_per_minute' WHERE appName = 'MY_APPLICATION' AND (transactionType = 'Web') TIMESERIES SINCE 3 days ago Facet by host-related attributes This query displays a requests-per-minute chart faceted by host name: FROM Metric SELECT count(apm.service.transaction.duration) as 'HttpDispatcher requests_per_minute' WHERE appName = 'MY_APPLICATION' AND (transactionType = 'Web') TIMESERIES SINCE 3 hours ago FACET host LIMIT 20 Instead of using host, you can facet by other host-related attributes, like host.bootId. Query of average duration of a metric This queries the average duration for a metric using average: FROM Metric SELECT average(apm.service.transaction.duration) as 'HttpDispatcher average duration' WHERE appName = 'MY_APPLICATION' AND (transactionType = 'Web') TIMESERIES SINCE 3 days ago For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / NRQL query tutorials",
+ "info": "In New Relic, you can query metric timeslice data from APM using NRQL. ",
+ "nodeid": 36916,
+ "sections": [
+ "NRQL: New Relic Query Language",
+ "Get started",
+ "NRQL query tools",
+ "NRQL query tutorials",
+ "Query APM metric timeslice data with NRQL",
+ "Why query metric timeslice data?",
+ "Where to query?",
+ "How to construct a query",
+ "How metric timeslice data is converted",
+ "Attributes",
+ "Generic queries with the newrelic.timeslice.value metric",
+ "When to use newrelic.timeslice.value?",
+ "Facet on a wildcarded metric name segment",
+ "Recommended aggregator functions",
+ "Query examples",
+ "For more help"
+ ],
+ "title": "Query APM metric timeslice data with NRQL",
+ "popularity": 1,
+ "external_id": "f536406572d7d2aafd2df6acd5da36a035ef82c3",
+ "category_1": "NRQL: New Relic Query Language",
+ "category_2": "NRQL query tutorials",
+ "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-one-nrql-query-metric-timeslice-data.png",
+ "url": "https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/nrql-query-tutorials/query-apm-metric-timeslice-data-nrql",
+ "published_at": "2020-08-18T08:51:56Z",
+ "updated_at": "2020-08-15T03:15:39Z",
+ "category_0": "Query your data",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.10769665,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Query APM metric timeslice data with NRQL ",
+ "sections": "Query APM metric timeslice data with NRQL ",
+ "info": "In New Relic, you can query metric timeslice data from APM using NRQL . ",
+ "category_0": "Query your data ",
+ "category_1": "NRQL : New Relic Query Language",
+ "category_2": "NRQL query tutorials",
+ "body": "APM reports metric data in the form of metric timeslice data , and you can use NRQL to query and facet this type of data . Why query metric timeslice data ? We report metrics in several ways. One variety of metric data we call metric timeslice data ; this is the type of data used to generate many",
+ "breadcrumb": "Contents / Query your data / NRQL : New Relic Query Language / NRQL query tutorials"
+ },
+ "id": "5f2b1349196a67379343fbcf"
+ },
+ {
+ "body": "New Relic Insights' Query page is one place you can run NRQL queries of your data. To get started: Go to insights.newrelic.com > Query, then use any of the available NRQL syntax and functions. Use the Query page to: Create and run queries of your data. View your query history. View favorite queries. Use the NRQL query to create, view, organize, and share Insights dashboards. For a library of educational videos about how to use New Relic Insights, visit learn.newrelic.com. Use NRQL query history To view up to twenty of your most recent queries, select the History tab directly below the query command line interface. Use the query history to adjust and improve recent queries. If you want to... Do this... Run recent queries Select a recent query from the history list. The query will appear on the command line, where it can be edited. Delete queries Mouse over a query in the history list so the delete [trash] icon appears. The query history only retains the twenty most recent queries, so it can be useful to delete unwanted queries to make room for queries you like. Favorite queries Mouse over a query in the history list and the favorite star icon appears. Then, to view and use your favorite queries, select the Favorites tab. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Insights / Use Insights UI / Explore data",
+ "info": "Use the New Relic Insights Query page to create and edit NRQL queries, favorite them for later use, and add query results to dashboards. ",
+ "nodeid": 1131,
+ "sections": [
+ "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"
+ ],
+ "title": "Query page: Create and edit NRQL queries",
+ "popularity": 1,
+ "external_id": "e00d2b865680d15c361b4058e22270fe5103aa8e",
+ "category_1": "Use Insights UI",
+ "category_2": "Explore data",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/insights/use-insights-ui/manage-account-data/query-page-create-edit-nrql-queries",
+ "published_at": "2020-08-18T10:41:24Z",
+ "updated_at": "2020-07-26T08:08:39Z",
+ "category_0": "Insights",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.09991312,
+ "_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 "
+ },
+ "id": "59425a3c8e9c0f6937f1cda9"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/data/sidenav.json b/src/data/sidenav.json
index 28b90f668..76a81c6d7 100644
--- a/src/data/sidenav.json
+++ b/src/data/sidenav.json
@@ -37,6 +37,10 @@
"displayName": "Set up New Relic using Terraform",
"url": "/automate-workflows/get-started-terraform"
},
+ {
+ "displayName": "Set up New Relic using the Kubernetes operator",
+ "url": "/automate-workflows/get-started-kubernetes"
+ },
{
"displayName": "Tag a set of resources efficiently",
"url": "/automate-workflows/5-mins-tag-resources"
@@ -78,6 +82,10 @@
{
"displayName": "Add, query, and mutate data using NerdStorage",
"url": "/build-apps/add-query-mutate-data-nerdstorage"
+ },
+ {
+ "displayName": "See all open source apps",
+ "url": "https://opensource.newrelic.com/nerdpacks/"
}
]
},
@@ -99,7 +107,33 @@
"children": [
{
"displayName": "New Relic One CLI",
- "url": "/explore-docs/nr1-cli"
+ "url": "/explore-docs/nr1-cli",
+ "children": [
+ {
+ "displayName": "Common commands",
+ "url": "/explore-docs/nr1-common"
+ },
+ {
+ "displayName": "Config commands",
+ "url": "/explore-docs/nr1-config"
+ },
+ {
+ "displayName": "Nerdpack commands",
+ "url": "/explore-docs/nr1-nerdpack"
+ },
+ {
+ "displayName": "Subscription commands",
+ "url": "/explore-docs/nr1-subscription"
+ },
+ {
+ "displayName": "Plugin commands",
+ "url": "/explore-docs/nr1-plugins"
+ },
+ {
+ "displayName": "Catalog commands",
+ "url": "/explore-docs/nr1-catalog"
+ }
+ ]
},
{
"displayName": "New Relic CLI",
@@ -122,391 +156,374 @@
"url": "/explore-docs/intro-to-sdk",
"children": [
{
- "displayName": "AccountPicker",
- "url": "/components/account-picker",
- "group": "Controls"
- },
- {
- "displayName": "Button",
- "url": "/components/button",
- "group": "Controls"
- },
- {
- "displayName": "Checkbox",
- "url": "/components/checkbox",
- "group": "Controls"
- },
- {
- "displayName": "Dropdown",
- "url": "/components/dropdown",
- "group": "Controls"
- },
- {
- "displayName": "DropdownItem",
- "url": "/components/dropdown-item",
- "group": "Controls"
- },
- {
- "displayName": "Radio",
- "url": "/components/radio",
- "group": "Controls"
- },
- {
- "displayName": "RadioGroup",
- "url": "/components/radio-group",
- "group": "Controls"
- },
- {
- "displayName": "Select",
- "url": "/components/select",
- "group": "Controls"
- },
- {
- "displayName": "SelectItem",
- "url": "/components/select-item",
- "group": "Controls"
- },
- {
- "displayName": "TextField",
- "url": "/components/text-field",
- "group": "Controls"
- },
- {
- "displayName": "Table",
- "url": "/components/table",
- "group": "Tables"
- },
- {
- "displayName": "TableHeader",
- "url": "/components/table-header",
- "group": "Tables"
- },
- {
- "displayName": "TableHeaderCell",
- "url": "/components/table-header-cell",
- "group": "Tables"
- },
- {
- "displayName": "TableRow",
- "url": "/components/table-row",
- "group": "Tables"
- },
- {
- "displayName": "TableRowCell",
- "url": "/components/table-row-cell",
- "group": "Tables"
- },
- {
- "displayName": "EntityTitleTableRowCell",
- "url": "/components/entity-title-table-row-cell",
- "group": "Tables"
- },
- {
- "displayName": "MetricTableRowCell",
- "url": "/components/metric-table-row-cell",
- "group": "Tables"
- },
- {
- "displayName": "SparklineTableRowCell",
- "url": "/components/sparkline-table-row-cell",
- "group": "Tables"
- },
- {
- "displayName": "UserTableRowCell",
- "url": "/components/user-table-row-cell",
- "group": "Tables"
- },
- {
- "displayName": "Icon",
- "url": "/components/icon",
- "group": "Feedback"
- },
- {
- "displayName": "Spinner",
- "url": "/components/spinner",
- "group": "Feedback"
- },
- {
- "displayName": "Toast",
- "url": "/components/toast",
- "group": "Feedback"
- },
- {
- "displayName": "Modal",
- "url": "/components/modal",
- "group": "Overlays"
- },
- {
- "displayName": "Tooltip",
- "url": "/components/tooltip",
- "group": "Overlays"
- },
- {
- "displayName": "AutoSizer",
- "url": "/components/auto-sizer",
- "group": "Structure"
- },
- {
- "displayName": "Card",
- "url": "/components/card",
- "group": "Structure"
- },
- {
- "displayName": "CardBody",
- "url": "/components/card-body",
- "group": "Structure"
- },
- {
- "displayName": "CardHeader",
- "url": "/components/card-header",
- "group": "Structure"
- },
- {
- "displayName": "Grid",
- "url": "/components/grid",
- "group": "Structure"
- },
- {
- "displayName": "GridItem",
- "url": "/components/grid-item",
- "group": "Structure"
- },
- {
- "displayName": "List",
- "url": "/components/list",
- "group": "Structure"
- },
- {
- "displayName": "ListItem",
- "url": "/components/list-item",
- "group": "Structure"
- },
- {
- "displayName": "Spacing",
- "url": "/components/spacing",
- "group": "Structure"
- },
- {
- "displayName": "Stack",
- "url": "/components/stack",
- "group": "Structure"
- },
- {
- "displayName": "StackItem",
- "url": "/components/stack-item",
- "group": "Structure"
- },
- {
- "displayName": "Tabs",
- "url": "/components/tabs",
- "group": "Structure"
- },
- {
- "displayName": "TabsItem",
- "url": "/components/tabs-item",
- "group": "Structure"
- },
- {
- "displayName": "BlockText",
- "url": "/components/block-text",
- "group": "Text"
- },
- {
- "displayName": "HeadingText",
- "url": "/components/heading-text",
- "group": "Text"
- },
- {
- "displayName": "Link",
- "url": "/components/link",
- "group": "Text"
- },
- {
- "displayName": "AreaChart",
- "url": "/components/area-chart",
- "group": "Data visualization"
- },
- {
- "displayName": "BarChart",
- "url": "/components/bar-chart",
- "group": "Data visualization"
- },
- {
- "displayName": "BillboardChart",
- "url": "/components/billboard-chart",
- "group": "Data visualization"
- },
- {
- "displayName": "ChartGroup",
- "url": "/components/chart-group",
- "group": "Data visualization"
- },
- {
- "displayName": "FunnelChart",
- "url": "/components/funnel-chart",
- "group": "Data visualization"
- },
- {
- "displayName": "HeatmapChart",
- "url": "/components/heatmap-chart",
- "group": "Data visualization"
- },
- {
- "displayName": "HistogramChart",
- "url": "/components/histogram-chart",
- "group": "Data visualization"
- },
- {
- "displayName": "JsonChart",
- "url": "/components/json-chart",
- "group": "Data visualization"
- },
- {
- "displayName": "LineChart",
- "url": "/components/line-chart",
- "group": "Data visualization"
- },
- {
- "displayName": "PieChart",
- "url": "/components/pie-chart",
- "group": "Data visualization"
- },
- {
- "displayName": "ScatterChart",
- "url": "/components/scatter-chart",
- "group": "Data visualization"
- },
- {
- "displayName": "SparklineChart",
- "url": "/components/sparkline-chart",
- "group": "Data visualization"
- },
- {
- "displayName": "StackedBarChart",
- "url": "/components/stacked-bar-chart",
- "group": "Data visualization"
- },
- {
- "displayName": "TableChart",
- "url": "/components/table-chart",
- "group": "Data visualization"
- },
- {
- "displayName": "AccountStorageMutation",
- "url": "/components/account-storage-mutation",
- "group": "Query and storage"
- },
- {
- "displayName": "AccountStorageQuery",
- "url": "/components/account-storage-query",
- "group": "Query and storage"
- },
- {
- "displayName": "AccountsQuery",
- "url": "/components/accounts-query",
- "group": "Query and storage"
- },
- {
- "displayName": "EntitiesByDomainTypeQuery",
- "url": "/components/entities-by-domain-type-query",
- "group": "Query and storage"
- },
- {
- "displayName": "EntitiesByGuidsQuery",
- "url": "/components/entities-by-guids-query",
- "group": "Query and storage"
- },
- {
- "displayName": "EntitiesByNameQuery",
- "url": "/components/entities-by-name-query",
- "group": "Query and storage"
- },
- {
- "displayName": "EntityByGuidQuery",
- "url": "/components/entity-by-guid-query",
- "group": "Query and storage"
- },
- {
- "displayName": "EntityCountQuery",
- "url": "/components/entity-count-query",
- "group": "Query and storage"
- },
- {
- "displayName": "EntitySearchQuery",
- "url": "/components/entity-search-query",
- "group": "Query and storage"
- },
- {
- "displayName": "EntityStorageMutation",
- "url": "/components/entity-storage-mutation",
- "group": "Query and storage"
- },
- {
- "displayName": "EntityStorageQuery",
- "url": "/components/entity-storage-query",
- "group": "Query and storage"
- },
- {
- "displayName": "NerdGraphMutation",
- "url": "/components/nerd-graph-mutation",
- "group": "Query and storage"
- },
- {
- "displayName": "NerdGraphQuery",
- "url": "/components/nerd-graph-query",
- "group": "Query and storage"
- },
- {
- "displayName": "NrqlQuery",
- "url": "/components/nrql-query",
- "group": "Query and storage"
- },
- {
- "displayName": "UserQuery",
- "url": "/components/user-query",
- "group": "Query and storage"
- },
- {
- "displayName": "UserStorageMutation",
- "url": "/components/user-storage-mutation",
- "group": "Query and storage"
- },
- {
- "displayName": "UserStorageQuery",
- "url": "/components/user-storage-query",
- "group": "Query and storage"
- },
- {
- "displayName": "NerdletStateContext",
- "url": "/components/nerdlet-state-context",
- "group": "Platform APIs"
- },
- {
- "displayName": "PlatformStateContext",
- "url": "/components/platform-state-context",
- "group": "Platform APIs"
- },
- {
- "displayName": "logger",
- "url": "/apis/logger",
- "group": "Platform APIs"
- },
- {
- "displayName": "navigation",
- "url": "/apis/navigation",
- "group": "Platform APIs"
- },
- {
- "displayName": "nerdlet",
- "url": "/apis/nerdlet",
- "group": "Platform APIs"
+ "displayName": "Controls",
+ "children": [
+ {
+ "displayName": "AccountPicker",
+ "url": "/components/account-picker"
+ },
+ {
+ "displayName": "Button",
+ "url": "/components/button"
+ },
+ {
+ "displayName": "Checkbox",
+ "url": "/components/checkbox"
+ },
+ {
+ "displayName": "Dropdown",
+ "url": "/components/dropdown"
+ },
+ {
+ "displayName": "DropdownItem",
+ "url": "/components/dropdown-item"
+ },
+ {
+ "displayName": "Radio",
+ "url": "/components/radio"
+ },
+ {
+ "displayName": "RadioGroup",
+ "url": "/components/radio-group"
+ },
+ {
+ "displayName": "Select",
+ "url": "/components/select"
+ },
+ {
+ "displayName": "SelectItem",
+ "url": "/components/select-item"
+ },
+ {
+ "displayName": "TextField",
+ "url": "/components/text-field"
+ }
+ ]
+ },
+ {
+ "displayName": "Tables",
+ "children": [
+ {
+ "displayName": "Table",
+ "url": "/components/table"
+ },
+ {
+ "displayName": "TableHeader",
+ "url": "/components/table-header"
+ },
+ {
+ "displayName": "TableHeaderCell",
+ "url": "/components/table-header-cell"
+ },
+ {
+ "displayName": "TableRow",
+ "url": "/components/table-row"
+ },
+ {
+ "displayName": "TableRowCell",
+ "url": "/components/table-row-cell"
+ },
+ {
+ "displayName": "EntityTitleTableRowCell",
+ "url": "/components/entity-title-table-row-cell"
+ },
+ {
+ "displayName": "MetricTableRowCell",
+ "url": "/components/metric-table-row-cell"
+ },
+ {
+ "displayName": "SparklineTableRowCell",
+ "url": "/components/sparkline-table-row-cell"
+ },
+ {
+ "displayName": "UserTableRowCell",
+ "url": "/components/user-table-row-cell"
+ }
+ ]
+ },
+ {
+ "displayName": "Feedback",
+ "children": [
+ {
+ "displayName": "Icon",
+ "url": "/components/icon"
+ },
+ {
+ "displayName": "Spinner",
+ "url": "/components/spinner"
+ },
+ {
+ "displayName": "Toast",
+ "url": "/components/toast"
+ }
+ ]
+ },
+ {
+ "displayName": "Overlays",
+ "children": [
+ {
+ "displayName": "Modal",
+ "url": "/components/modal"
+ },
+ {
+ "displayName": "Tooltip",
+ "url": "/components/tooltip"
+ }
+ ]
+ },
+ {
+ "displayName": "Structure",
+ "children": [
+ {
+ "displayName": "AutoSizer",
+ "url": "/components/auto-sizer"
+ },
+ {
+ "displayName": "Card",
+ "url": "/components/card"
+ },
+ {
+ "displayName": "CardBody",
+ "url": "/components/card-body"
+ },
+ {
+ "displayName": "CardHeader",
+ "url": "/components/card-header"
+ },
+ {
+ "displayName": "Grid",
+ "url": "/components/grid"
+ },
+ {
+ "displayName": "GridItem",
+ "url": "/components/grid-item"
+ },
+ {
+ "displayName": "List",
+ "url": "/components/list"
+ },
+ {
+ "displayName": "ListItem",
+ "url": "/components/list-item"
+ },
+ {
+ "displayName": "Spacing",
+ "url": "/components/spacing"
+ },
+ {
+ "displayName": "Stack",
+ "url": "/components/stack"
+ },
+ {
+ "displayName": "StackItem",
+ "url": "/components/stack-item"
+ },
+ {
+ "displayName": "Tabs",
+ "url": "/components/tabs"
+ },
+ {
+ "displayName": "TabsItem",
+ "url": "/components/tabs-item"
+ }
+ ]
+ },
+ {
+ "displayName": "Text",
+ "children": [
+ {
+ "displayName": "BlockText",
+ "url": "/components/block-text"
+ },
+ {
+ "displayName": "HeadingText",
+ "url": "/components/heading-text"
+ },
+ {
+ "displayName": "Link",
+ "url": "/components/link"
+ }
+ ]
+ },
+ {
+ "displayName": "Data visualization",
+ "children": [
+ {
+ "displayName": "AreaChart",
+ "url": "/components/area-chart"
+ },
+ {
+ "displayName": "BarChart",
+ "url": "/components/bar-chart"
+ },
+ {
+ "displayName": "BillboardChart",
+ "url": "/components/billboard-chart"
+ },
+ {
+ "displayName": "ChartGroup",
+ "url": "/components/chart-group"
+ },
+ {
+ "displayName": "FunnelChart",
+ "url": "/components/funnel-chart"
+ },
+ {
+ "displayName": "HeatmapChart",
+ "url": "/components/heatmap-chart"
+ },
+ {
+ "displayName": "HistogramChart",
+ "url": "/components/histogram-chart"
+ },
+ {
+ "displayName": "JsonChart",
+ "url": "/components/json-chart"
+ },
+ {
+ "displayName": "LineChart",
+ "url": "/components/line-chart"
+ },
+ {
+ "displayName": "PieChart",
+ "url": "/components/pie-chart"
+ },
+ {
+ "displayName": "ScatterChart",
+ "url": "/components/scatter-chart"
+ },
+ {
+ "displayName": "SparklineChart",
+ "url": "/components/sparkline-chart"
+ },
+ {
+ "displayName": "StackedBarChart",
+ "url": "/components/stacked-bar-chart"
+ },
+ {
+ "displayName": "TableChart",
+ "url": "/components/table-chart"
+ }
+ ]
+ },
+ {
+ "displayName": "Query and storage",
+ "children": [
+ {
+ "displayName": "AccountStorageMutation",
+ "url": "/components/account-storage-mutation"
+ },
+ {
+ "displayName": "AccountStorageQuery",
+ "url": "/components/account-storage-query"
+ },
+ {
+ "displayName": "AccountsQuery",
+ "url": "/components/accounts-query"
+ },
+ {
+ "displayName": "EntitiesByDomainTypeQuery",
+ "url": "/components/entities-by-domain-type-query"
+ },
+ {
+ "displayName": "EntitiesByGuidsQuery",
+ "url": "/components/entities-by-guids-query"
+ },
+ {
+ "displayName": "EntitiesByNameQuery",
+ "url": "/components/entities-by-name-query"
+ },
+ {
+ "displayName": "EntityByGuidQuery",
+ "url": "/components/entity-by-guid-query"
+ },
+ {
+ "displayName": "EntityCountQuery",
+ "url": "/components/entity-count-query"
+ },
+ {
+ "displayName": "EntitySearchQuery",
+ "url": "/components/entity-search-query"
+ },
+ {
+ "displayName": "EntityStorageMutation",
+ "url": "/components/entity-storage-mutation"
+ },
+ {
+ "displayName": "EntityStorageQuery",
+ "url": "/components/entity-storage-query"
+ },
+ {
+ "displayName": "NerdGraphMutation",
+ "url": "/components/nerd-graph-mutation"
+ },
+ {
+ "displayName": "NerdGraphQuery",
+ "url": "/components/nerd-graph-query"
+ },
+ {
+ "displayName": "NrqlQuery",
+ "url": "/components/nrql-query"
+ },
+ {
+ "displayName": "UserQuery",
+ "url": "/components/user-query"
+ },
+ {
+ "displayName": "UserStorageMutation",
+ "url": "/components/user-storage-mutation"
+ },
+ {
+ "displayName": "UserStorageQuery",
+ "url": "/components/user-storage-query"
+ }
+ ]
+ },
+ {
+ "displayName": "Platform APIs",
+ "children": [
+ {
+ "displayName": "NerdletStateContext",
+ "url": "/components/nerdlet-state-context"
+ },
+ {
+ "displayName": "PlatformStateContext",
+ "url": "/components/platform-state-context"
+ },
+ {
+ "displayName": "logger",
+ "url": "/apis/logger"
+ },
+ {
+ "displayName": "navigation",
+ "url": "/apis/navigation"
+ },
+ {
+ "displayName": "nerdlet",
+ "url": "/apis/nerdlet"
+ }
+ ]
}
]
}
]
},
+ {
+ "displayName": "Attend events",
+ "children": [
+ {
+ "displayName": "Kubecon & CloudNativeCon",
+ "url": "/kubecon-europe-2020"
+ }
+ ]
+ },
{
"displayName": "Developer champions",
"url": "/developer-champion"
+ },
+
+ {
+ "displayName": "Podcasts",
+ "url": "/podcasts"
}
]
diff --git a/src/hooks/useApiDoc.js b/src/hooks/useApiDoc.js
index 078517f76..c34c9b390 100644
--- a/src/hooks/useApiDoc.js
+++ b/src/hooks/useApiDoc.js
@@ -1,6 +1,7 @@
import { useMemo } from 'react';
import { getTypeDefs } from '../utils/typeDefs';
import navigationApi from '../data/navigationApi';
+import additionalDocs from '../data/additionalDocs';
const IGNORED_METHODS = [
'prototype',
@@ -34,6 +35,15 @@ const useApiDoc = (name) => {
return navigationApi;
}
+ // The SDK may be missing method documentation. If so, we need to add in
+ // some additional hardcoded values.
+ const clientDocs = {
+ typeDefs: [],
+ constants: [],
+ methods: [],
+ ...additionalDocs[name],
+ };
+
if (!api) {
const err = new Error('NR1_SDK API not found');
window.NREUM && window.NREUM.noticeError(err, { apiName: name });
@@ -65,30 +75,35 @@ const useApiDoc = (name) => {
return {
description: apiDocs?.text,
usage: `import { ${name} } from 'nr1'`,
- typeDefs: getTypeDefs(properties),
- constants: getConstants(api),
- methods: Object.getOwnPropertyNames(api)
- .filter(
- (member) =>
- !IGNORED_METHODS.includes(member) &&
- typeof api[member] === 'function'
- )
- .filter(
- (member) =>
- !IGNORED_METHODS_BY_LIB[name] ||
- !IGNORED_METHODS_BY_LIB[name].includes(member)
- )
- .map((member) => {
- const methodDocs = api[member].__docs__;
+ typeDefs: [...clientDocs.typeDefs, ...getTypeDefs(properties)],
+ constants: [...clientDocs.constants, ...getConstants(api)],
+ methods: [
+ ...clientDocs.methods,
+ ...Object.getOwnPropertyNames(api)
+ .filter(
+ (member) =>
+ !IGNORED_METHODS.includes(member) &&
+ typeof api[member] === 'function'
+ )
+ .filter(
+ (member) =>
+ !IGNORED_METHODS_BY_LIB[name] ||
+ !IGNORED_METHODS_BY_LIB[name].includes(member)
+ )
+ .map((member) => {
+ const methodDocs = api[member].__docs__;
- return {
- name: `${name}.${member}`,
- description: methodDocs?.text,
- returnValue: methodDocs?.tags.return?.[0] ?? { type: 'undefined' },
- params: methodDocs?.tags.param ?? [],
- examples: methodDocs?.tags.examples ?? [],
- };
- }),
+ return {
+ name: `${name}.${member}`,
+ description: methodDocs?.text,
+ returnValue: methodDocs?.tags.return?.[0] ?? {
+ type: 'undefined',
+ },
+ params: methodDocs?.tags.param ?? [],
+ examples: methodDocs?.tags.examples ?? [],
+ };
+ }),
+ ],
};
}, [name]);
};
diff --git a/src/hooks/usePageContext.js b/src/hooks/usePageContext.js
new file mode 100644
index 000000000..fc02f9b87
--- /dev/null
+++ b/src/hooks/usePageContext.js
@@ -0,0 +1,6 @@
+import { useContext } from 'react';
+import { PageContext } from '../components/PageContext';
+
+const usePageContext = () => useContext(PageContext);
+
+export default usePageContext;
diff --git a/src/hooks/usePageLayout.js b/src/hooks/usePageLayout.js
new file mode 100644
index 000000000..6143f068a
--- /dev/null
+++ b/src/hooks/usePageLayout.js
@@ -0,0 +1,6 @@
+import { useContext } from 'react';
+import PageLayout from '../components/PageLayout';
+
+const usePageLayout = () => useContext(PageLayout.Context);
+
+export default usePageLayout;
diff --git a/src/hooks/usePrevious.js b/src/hooks/usePrevious.js
new file mode 100644
index 000000000..8f4662014
--- /dev/null
+++ b/src/hooks/usePrevious.js
@@ -0,0 +1,11 @@
+import { useEffect, useRef } from 'react';
+
+const usePrevious = (value) => {
+ const ref = useRef();
+ useEffect(() => {
+ ref.current = value;
+ }, [value]);
+ return ref.current;
+};
+
+export default usePrevious;
diff --git a/src/images/custom-attributes/custom-attribute-query.png b/src/images/custom-attributes/custom-attribute-query.png
new file mode 100644
index 000000000..15fe1f23a
Binary files /dev/null and b/src/images/custom-attributes/custom-attribute-query.png differ
diff --git a/src/images/kubecon-europe-2020/kubecon-europe-2020.jpg b/src/images/kubecon-europe-2020/kubecon-europe-2020.jpg
new file mode 100644
index 000000000..b6e477709
Binary files /dev/null and b/src/images/kubecon-europe-2020/kubecon-europe-2020.jpg differ
diff --git a/src/images/podcasts/podcasts-badge.png b/src/images/podcasts/podcasts-badge.png
new file mode 100644
index 000000000..d0fee6d2a
Binary files /dev/null and b/src/images/podcasts/podcasts-badge.png differ
diff --git a/src/images/podcasts/podcasts.jpg b/src/images/podcasts/podcasts.jpg
new file mode 100644
index 000000000..2710fa4cc
Binary files /dev/null and b/src/images/podcasts/podcasts.jpg differ
diff --git a/src/layouts/MainLayout.js b/src/layouts/MainLayout.js
new file mode 100644
index 000000000..24aa6034a
--- /dev/null
+++ b/src/layouts/MainLayout.js
@@ -0,0 +1,147 @@
+import React, { useState, useEffect } from 'react';
+import PropTypes from 'prop-types';
+import { css } from '@emotion/core';
+
+import { Helmet } from 'react-helmet';
+import { GlobalHeader } from '@newrelic/gatsby-theme-newrelic';
+import { graphql, useStaticQuery } from 'gatsby';
+import Cookies from 'js-cookie';
+import Footer from '../components/Footer';
+import MobileHeader from '../components/MobileHeader';
+import Sidebar from '../components/Sidebar';
+import CookieApprovalDialog from '../components/CookieApprovalDialog';
+import '../components/styles.scss';
+import { useLocation } from '@reach/router';
+
+const gaTrackingId = 'UA-3047412-33';
+const gdprConsentCookieName = 'newrelic-gdpr-consent';
+
+const MainLayout = ({ children }) => {
+ const {
+ site: { layout },
+ } = useStaticQuery(graphql`
+ query {
+ site {
+ layout {
+ contentPadding
+ maxWidth
+ }
+ }
+ }
+ `);
+
+ const location = useLocation();
+ const [cookieConsent, setCookieConsent] = useState(false);
+ const [isMobileNavOpen, setIsMobileNavOpen] = useState(false);
+
+ useEffect(() => {
+ const consentValue = Cookies.get(gdprConsentCookieName) === 'true';
+ consentValue && setCookieConsent(true);
+ }, []);
+
+ useEffect(() => {
+ setIsMobileNavOpen(false);
+ }, [location.pathname]);
+
+ return (
+
+
+ {cookieConsent ? (
+
+ ) : null}
+
+
+
setIsMobileNavOpen(!isMobileNavOpen)}
+ />
+
+
+
+ );
+};
+
+MainLayout.propTypes = {
+ children: PropTypes.node.isRequired,
+};
+
+export default MainLayout;
diff --git a/src/layouts/index.js b/src/layouts/index.js
new file mode 100644
index 000000000..d002b0d68
--- /dev/null
+++ b/src/layouts/index.js
@@ -0,0 +1,17 @@
+import React from 'react';
+import MainLayout from './MainLayout';
+import PropTypes from 'prop-types';
+
+const Layout = ({ children, pageContext }) => {
+ if (pageContext.fileRelativePath.match(/404/)) {
+ return children;
+ }
+ return {children} ;
+};
+
+Layout.propTypes = {
+ children: PropTypes.node,
+ pageContext: PropTypes.object,
+};
+
+export default Layout;
diff --git a/src/markdown-pages/automate-workflows/5-mins-tag-resources.mdx b/src/markdown-pages/automate-workflows/5-mins-tag-resources.mdx
index 8c52ec4be..0dd28fb4f 100644
--- a/src/markdown-pages/automate-workflows/5-mins-tag-resources.mdx
+++ b/src/markdown-pages/automate-workflows/5-mins-tag-resources.mdx
@@ -7,19 +7,29 @@ description: 'Add tags to applications you instrument for easier filtering and o
tileShorthand:
title: 'Quickly tag resources'
description: 'Add tags to apps for easy filtering'
+resources:
+ - title: 'Understand the Entity Explorer'
+ url: https://youtube.com/watch?v=IGZQup8ZEmE
+ - title: 'Use tags to organize and group what you monitor'
+ url: https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/tagging-use-tags-organize-group-what-you-monitor
+ - title: 'New Relic CLI Repo'
+ url: https://github.com/newrelic/newrelic-cli
+tags:
+ - tags
+ - new relic CLI
---
[Tags](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/tagging-use-tags-organize-group-what-you-monitor) help you group, search, filter, and focus the data about your [entities](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/what-entity-new-relic), 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 are going to use the New Relic CLI to add multiple tags to one of your entities.
+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](https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#personal-api-key): Create it at the **Account settings** screen of your New Relic account.
+For this guide you need your New Relic [personal API Key](https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#personal-api-key): Create it at the **Account settings** screen for your account.
@@ -28,28 +38,28 @@ For this guide you need your New Relic [personal API Key](https://docs.newrelic.
You can download the New Relic CLI via [Homebrew](https://brew.sh/) (macOS), [Scoop](https://scoop.sh/) (Windows), and [Snapcraft](https://snapcraft.io/) (Linux). You can also download [pre-built binaries](https://github.com/newrelic/newrelic-cli/releases) for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer.
-* #### Linux
+- #### Linux
- With [Snapcraft](https://snapcraft.io/) installed, run:
+ With [Snapcraft](https://snapcraft.io/) installed, run:
- `sudo snap install newrelic-cli`
+ `sudo snap install newrelic-cli`
-* #### macOS
+- #### macOS
- With [Homebrew](https://brew.sh/) installed, run:
+ With [Homebrew](https://brew.sh/) installed, run:
- `brew install newrelic-cli`
+ `brew install newrelic-cli`
-* #### Windows
+- #### Windows
- With [Scoop](https://scoop.sh/) installed, run:
+ With [Scoop](https://scoop.sh/) installed, run:
- `scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git`
- `scoop install newrelic-cli`
+ `scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git`
+ `scoop install newrelic-cli`
-## Create your New Relic CLI profile
+## Create your New Relic CLI profile
New Relic CLI profiles contain credentials and settings that you can apply to any CLI command.
@@ -66,13 +76,13 @@ newrelic profiles default -n tutorial
## Search for an entity
-Your New Relic account may have hundreds of entities: Have a quick look by opening the [Entity explorer](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/ui-data/new-relic-one-entity-explorer-view-performance-across-apps-services-hosts).
+Your New Relic account might have hundreds of entities: Have a quick look by opening the [Entity explorer](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/ui-data/new-relic-one-entity-explorer-view-performance-across-apps-services-hosts).
In the terminal, run [`entity search`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_entity_search.md) 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.
```bash lineNumbers=false
# Change the `name` to match any of your existing entities
-newrelic entity search --name "test"
+newrelic entity search --name "test"
```
@@ -92,17 +102,21 @@ Select an entity from the results and look for its `guid` value; the `guid` is t
"type": "WORKLOAD"
},
```
+
## 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`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_entity_tags_create.md) command.
+With your entity `guid`, you can add tags right away. You can do so by invoking the [`entities tags create`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_entity_tags_create.md) 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`
-Adding tags is an asynchronous operation: it could take a little while for the tags to get created.
+
+ Adding tags is an asynchronous operation: it could take a little while for the
+ tags to get created.
+
```bash lineNumbers=false
# Adding a single tag
@@ -110,6 +124,7 @@ newrelic entity tags create --guid GUID --tag key:value
# Adding multiple tags
newrelic entity tags create --guid GUID --tag tag1:test,tag2:test
```
+
## Check that the tags are there
@@ -124,30 +139,24 @@ Tags can be deleted at any time by invoking the [`entity tags delete`](https://g
-
```json lineNumbers=false
[
{
"Key": "tag1",
- "Values": [
- "true"
- ]
+ "Values": ["true"]
},
{
"Key": "tag2",
- "Values": [
- "test"
- ]
+ "Values": ["test"]
},
{
"Key": "tag3",
- "Values": [
- "testing"
- ]
+ "Values": ["testing"]
}
// ...
]
```
+
## Next steps
@@ -155,11 +164,3 @@ Tags can be deleted at any time by invoking the [`entity tags delete`](https://g
Have a look at [all the New Relic CLI commands](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic.md). For example, you could create a [New Relic workflow](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/new-relic-one-workloads-isolate-resolve-incidents-faster) using [`workload create`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_workload_create.md).
If you'd like to engage with other community members, visit our [New Relic Explorers Hub](https://discuss.newrelic.com/c/build-on-new-relic/developer-toolkit) page. We welcome feature requests or bug reports on [GitHub](https://github.com/newrelic/newrelic-cli).
-
-## Related info
-
-- [Understanding Entity Explorer (Video)](https://www.youtube.com/watch?v=IGZQup8ZEmE)
-- [Tagging: Use tags to organize and group what you monitor](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/tagging-use-tags-organize-group-what-you-monitor)
-- [New Relic CLI commands reference](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic.md)
-- [New Relic CLI repository on GitHub](https://github.com/newrelic/newrelic-cli)
-
diff --git a/src/markdown-pages/automate-workflows/get-started-kubernetes.mdx b/src/markdown-pages/automate-workflows/get-started-kubernetes.mdx
new file mode 100644
index 000000000..70c0992e9
--- /dev/null
+++ b/src/markdown-pages/automate-workflows/get-started-kubernetes.mdx
@@ -0,0 +1,247 @@
+---
+path: '/automate-workflows/get-started-kubernetes'
+duration: '20 min'
+title: 'Set up New Relic using the Kubernetes operator'
+template: 'GuideTemplate'
+description: 'Learn how to provision New Relic resources using the [Kubernetes operator](https://github.com/newrelic/newrelic-kubernetes-operator).'
+tileShorthand:
+ title: 'Set up New Relic using the Kubernetes operator'
+ description: 'Learn how to provision New Relic resources using the Kubernetes operator'
+resources:
+ - title: 'New Relic Kubernetes operator'
+ url: https://github.com/newrelic/newrelic-kubernetes-operator
+ - title: 'New Relic documentation'
+ url: https://docs.newrelic.com
+ - title: 'Kubernetes documentation'
+ url: https://kubernetes.io/docs/home/
+tags:
+ - kubernetes
+ - kubernetes operator
+ - nrql alert conditions
+---
+
+
+
+[Kubernetes](https://kubernetes.io/) is an open-source system for automating deployment, scaling, and management of containerized applications. You can use it to provision all kinds of infrastructure and services, including New Relic entities.
+
+In this guide you'll learn how to set up New Relic for the first time with the official [New Relic Kubernetes operator](https://github.com/newrelic/newrelic-kubernetes-operator). More specifically, you'll provision an alert policy with NRQL conditions in your New Relic account using Kubernetes.
+
+
+
+## Before you begin
+
+This walkthrough assumes you’ve already deployed a Kubernetes cluster. You could even create a local cluster on your machine with [`kind`](https://kind.sigs.k8s.io/).
+To use this guide, you should have some basic knowledge of both New Relic and Kubernetes. To complete the full exercise, you’ll need to:
+
+- Deploy a New Relic agent if you haven't done so yet. [Install New Relic](https://docs.newrelic.com/docs/agents/manage-apm-agents/installation/install-agent) for your application.
+- [Install `kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/) and point it at the correct cluster; this determines the cluster where you’ll install the New Relic operator.
+- [Install `kustomize`](https://kubernetes-sigs.github.io/kustomize/installation/).
+
+
+
+
+## Installing the operator on your Kubernetes cluster
+
+First, install [cert-manager](https://cert-manager.io/), which automatically provisions and manages TLS certificates in Kubernetes.
+
+```bash lineNumbers=false
+kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.15.0/cert-manager.yaml
+```
+
+Next, install the Kubernetes operator.
+
+```bash lineNumbers=false
+kustomize build https://github.com/newrelic/newrelic-kubernetes-operator/config/default | kubectl apply -f -
+```
+
+To confirm the installation was successful, run a few `kubectl` commands to check the status of the Kubernetes operator.
+Ensure the Kubernetes operator's namespace, `newrelic-kubernetes-operator-system`, has been applied:
+
+```bash lineNumbers=false
+kubectl get namespaces
+```
+
+The output should be similar to the following, which includes the Kubernetes operator's namespace, `newrelic-kubernetes-operator-system`:
+
+```no-highlighting lineNumbers=false
+NAME STATUS AGE
+cert-manager Active 4m35s
+default Active 20m
+kube-node-lease Active 20m
+kube-public Active 20m
+kube-system Active 20m
+newrelic-kubernetes-operator-system Active 3m48s
+```
+
+Now, make sure the Kubernetes operator's controller manager is running:
+
+
+
+ Note : Don't forget to include the{' '}
+ --namespace (shorthand -n) option when running kubectl get pods to
+ ensure you're inspecting resources within the correct namespace.
+
+
+
+```bash lineNumbers=false
+kubectl get pods --namespace newrelic-kubernetes-operator-system
+```
+
+You should see output similar to the following:
+
+```no-highlighting lineNumbers=false
+NAME READY STATUS RESTARTS AGE
+newrelic-kubernetes-operator-controller-manager-7b9c64f58crwg9j 2/2 Running 0 157m
+```
+
+If your output is similar to the example shown, you’re ready for the next step. If you don’t see a pod named `newrelic-kubernetes-operator-controller-manager-`, double check your Kubernetes configuration to ensure you’re within the correct context and pointing to the correct cluster.
+
+
+
+
+## Creating your first alert policy
+
+To kick things off, start small. First, create an alert policy with the minimum required configuration, then add a NRQL alert condition to the policy, which will add the condition to the policy in New Relic.
+A minimal alert policy configuration is represented in the code below. For the sake of this walkthrough, name this file `new_relic_alert_policy.yaml`.
+
+
+
+ Note : For help locating your personal API key, check out
+ New Relic's{' '}
+
+ personal API key documentation
+
+ .
+
+
+
+```yaml lineNumbers=false
+apiVersion: nr.k8s.newrelic.com/v1
+kind: AlertsPolicy
+metadata:
+ name: my-policy
+spec:
+ account_id:
+ api_key:
+ name: 'Alert Policy Created With k8s' # Feel free to rename
+ region: 'us'
+```
+
+Now run the `kubectl apply` command to create your alert policy.
+
+```bash lineNumbers=false
+kubectl apply -f ./new_relic_alert_policy.yaml
+```
+
+You'll see output that reads similar to the following:
+
+```bash lineNumbers=false
+alertspolicy.nr.k8s.newrelic.com/my-policy created
+```
+
+Confirm that your alert policy was created by viewing your policies at `alerts.newrelic.com/accounts/{your account ID}/policies`. You can search for your new policy by its name. In this case, search for "Alert Policy Created With k8s."
+
+You should see your new alert policy. Next it’s time to add a NRQL alert condition to the policy using the same configuration file.
+
+
+
+
+## Add NRQL alert conditions to your alert policy
+
+In the previous section you created an alert policy; now, you’ll add some alert conditions to the policy so you can trigger alerts when certain metrics are out of line.
+In your `new_relic_alert_policy.yaml` file, add a NRQL alert condition to the policy that will alert you when an application's average overall response time is above five seconds for a three minute period.
+
+
+
+ Note : To receive notifications when an alert is triggered,
+ add{' '}
+
+ notification channels
+ {' '}
+ to your alert policy, with this code.
+
+
+
+```yaml lineNumbers=false
+# The policy from the previous steps
+apiVersion: nr.k8s.newrelic.com/v1
+kind: AlertsPolicy
+metadata:
+ name: my-policy
+spec:
+ account_id:
+ api_key:
+ name: 'Alert Policy Created With k8s' # Feel free to rename
+ region: 'us'
+
+ # Add a NRQL alert condition to the policy
+ conditions:
+ - spec:
+ type: 'NRQL'
+ name: 'NRQL Alert Condition Created With k8s'
+ nrql:
+ query: "SELECT average(duration) FROM Transaction WHERE appName = 'YOUR APP NAME'"
+ evaluationOffset: 3
+ enabled: true
+ terms:
+ - threshold: '5'
+ threshold_occurrences: 'ALL'
+ threshold_duration: 180
+ priority: 'CRITICAL'
+ operator: 'ABOVE'
+ violationTimeLimit: 'ONE_HOUR'
+ valueFunction: 'SINGLE_VALUE'
+```
+
+With the alert condition added to the configuration, you can apply the update, which will create a NRQL alert condition and add it to your policy.
+
+```bash lineNumbers=false
+kubectl apply -f ./new_relic_alert_policy.yaml
+```
+
+To confirm that the NRQL alert condition was created successfully, refresh your alert policy. If you see a new alert condition added to the alert policy, it was a success.
+
+To finish things off, you'll create and add an alert channel to your alert policy. For example, maybe you want to send an email out to your team when your alert condition is triggered.
+
+
+
+
+## Try it out now
+
+We have a Kubernetes test cluster ready for you in 2 minutes. By following this on-line tutorial, you will learn how to:
+
+- Deploy the New Relic agent in a Kubernetes environment
+- Use the New Relic Kubernetes operator
+
+**Some tips to use the on-line tutorial window:**
+
+- Accept the cookies, so you can see the menu bar.
+- Click anywhere in the tutorial window to start. It will take about 2 minutes for your environment to be ready.
+- Press CTRL-l or type `clear` to clear the terminal window
+- Click on the finish flag icon in the bottom menu to hide or show the instructions
+
+Good luck!
+
+
+
+Some browsers automatically disable the use of iframes. If the module isn't loading
+please check your browser settings.
+
+
+
+
+
+## What’s next?
+
+Nice work — now you can manage your New Relic alert policies and NRQL alert conditions with code that integrates seamlessly within your Kubernetes workflow. This provides the ability to configure and manage your alerts with a domain-specific pattern, providing consistency and maintainability. You also gain the benefits of code reviews for any potential changes moving forward.
+As you and your team move forward, you might need to adjust some of the configuration values to better fit your needs.
+The New Relic Kubernetes Operator is just one of several tools in the New Relic Developer Toolkit aimed at facilitating observability as code.
diff --git a/src/markdown-pages/automate-workflows/get-started-new-relic-cli.mdx b/src/markdown-pages/automate-workflows/get-started-new-relic-cli.mdx
index e135f7a64..4e9c375b5 100644
--- a/src/markdown-pages/automate-workflows/get-started-new-relic-cli.mdx
+++ b/src/markdown-pages/automate-workflows/get-started-new-relic-cli.mdx
@@ -8,6 +8,17 @@ promote: true
tileShorthand:
title: 'Automate common tasks'
description: 'Use the New Relic CLI to tag apps and create deployment markers'
+resources:
+ - title: 'New Relic CLI commands reference'
+ url: https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic.md
+ - title: 'New Relic CLI Github repository'
+ url: https://github.com/newrelic/newrelic-cli
+tags:
+ - api key
+ - New Relic CLI
+ - Tags
+ - Entity
+ - Deployment markers
---
@@ -19,10 +30,10 @@ Access the New Relic platform from the comfort of your terminal: you can use the
## Before you begin
-For this guide you just need:
+For this guide you just need:
1. Your New Relic [personal API Key](https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#personal-api-key), which you can create from the **Account settings** of your New Relic account
-2. An [instrumented application](https://docs.newrelic.com/docs/agents/manage-apm-agents/installation/install-agent) in your New Relic account
+2. An [instrumented application](https://docs.newrelic.com/docs/agents/manage-apm-agents/installation/install-agent) in your New Relic account
@@ -52,7 +63,7 @@ With [Scoop](https://scoop.sh/) installed, run:
-## Create your New Relic CLI profile
+## 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.
@@ -75,7 +86,7 @@ Before searching for your application using the New Relic CLI, write down or cop
-The New Relic CLI can retrieve your application details as a JSON object.
+The New Relic CLI can retrieve your application details as a JSON object.
To search for your APM application use the [`apm application search`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_apm_application_search.md) command. If you get an error, check that the account ID and application name you provided are correct.
@@ -104,6 +115,7 @@ When you've successfully searched for your application, look for the `guid` valu
}
]
```
+
## Add a simple tag to your application
@@ -115,6 +127,7 @@ Let's suppose that you want to add an environment tag to your application. Go ah
```sh lineNumbers=false
newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing
```
+
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:
@@ -126,6 +139,7 @@ To add multiple tags at once to your application, modify and run the following s
```sh lineNumbers=false
newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test
```
+
> Adding tags is an asynchronous operation: this means it could take a while for the tags to get created.
@@ -142,25 +156,20 @@ All tags associated with your application are retrieved as a JSON array.
[
{
"Key": "tag1",
- "Values": [
- "true"
- ]
+ "Values": ["true"]
},
{
"Key": "tag2",
- "Values": [
- "test"
- ]
+ "Values": ["test"]
},
{
"Key": "tag3",
- "Values": [
- "testing"
- ]
+ "Values": ["testing"]
}
// ...
]
```
+
## Bonus step: Create a deployment marker
@@ -190,6 +199,7 @@ Here is an example.
"user": "Developer Toolkit Test Account"
}
```
+
## Next steps
@@ -197,9 +207,3 @@ Here is an example.
Have a look at [all the available commands](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic.md). For example, you could create a [New Relic workflow](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/new-relic-one-workloads-isolate-resolve-incidents-faster) using [`workload create`](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_workload_create.md)
If you'd like to engage with other community members, visit our [New Relic Explorers Hub](https://discuss.newrelic.com/c/build-on-new-relic/developer-toolkit) page. We welcome feature requests or bug reports on [GitHub](https://github.com/newrelic/newrelic-cli).
-
-## Related info
-
-- [New Relic CLI commands reference](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic.md)
-- [New Relic CLI repository on GitHub](https://github.com/newrelic/newrelic-cli)
-- [New Relic documentation](https://docs.newrelic.com)
diff --git a/src/markdown-pages/automate-workflows/get-started-terraform.mdx b/src/markdown-pages/automate-workflows/get-started-terraform.mdx
index 666efa87d..76faeb824 100644
--- a/src/markdown-pages/automate-workflows/get-started-terraform.mdx
+++ b/src/markdown-pages/automate-workflows/get-started-terraform.mdx
@@ -3,44 +3,54 @@ path: '/automate-workflows/get-started-terraform'
duration: '20 min'
title: 'Set up New Relic using Terraform'
template: 'GuideTemplate'
-description: "Learn how to provision New Relic resources using [Terraform](https://www.terraform.io/)."
+description: 'Learn how to provision New Relic resources using [Terraform](https://www.terraform.io/).'
tileShorthand:
title: 'Set up New Relic using Terraform'
description: 'Learn how to provision New Relic resources using Terraform'
+resources:
+ - title: 'Terraform New Relic Provider'
+ url: 'https://github.com/newrelic/terraform-provider-newrelic'
+ - title: 'New Relic documentation'
+ url: https://docs.newrelic.com
+ - title: 'Terraform documentation'
+ url: https://terraform.io/docs/index.html
+tags:
+ - notification channel
+ - Synthetics monitors
---
+
[Terraform](https://www.terraform.io/) is a popular infrastructure as code software tool by HashiCorp. You can use it to provision all kind of infrastructure and services, including New Relic entities.
In this guide you'll learn how to set up New Relic for the first time with [Terraform](https://www.terraform.io/). More specifically, you are going to provision an alert policy with notifications in your New Relic account using Terraform.
-
+
-
## Before you begin
To use this guide, you should have some basic knowledge of both New Relic and Terraform.
-* If you haven't deployed a New Relic agent yet, [install New Relic](https://docs.newrelic.com/docs/agents/manage-apm-agents/installation/install-agent) for your application.
-* [Install Terraform CLI](https://www.terraform.io/intro/getting-started/install.html).
+- If you haven't deployed a New Relic open source agent yet, [install New Relic](https://docs.newrelic.com/docs/agents/manage-apm-agents/installation/install-agent) for your application.
+- [Install Terraform CLI](https://www.terraform.io/intro/getting-started/install.html).
## Bootstrap your provider configuration
-New Relic's Terraform Provider detects the environment variables above when running Terraform commands.
+Our Terraform Provider detects the environment variables above when running Terraform commands.
You can set the environment variables in your `.bash_profile` or `.bashrc` file.
Set the following environment variables:
-* Set your [New Relic Personal API key](https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#personal-api-key) with the `NEW_RELIC_API_KEY` environment variable. Most Personal API keys begin with the prefix `NRAK-`.
-* Set your [New Relic Admin API key](https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#admin) with the `NEW_RELIC_ADMIN_API_KEY` environment variable. Most Admin API keys begin with the prefix `NRAA-`.
-* Set your [New Relic Account ID](https://docs.newrelic.com/docs/accounts/install-new-relic/account-setup/account-id) with the `NEW_RELIC_ACCOUNT_ID` environment variable.
-* Set your New Relic [region](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/get-started/our-eu-us-region-data-centers#verifying-account) with the `NEW_RELIC_REGION` environment variable. Your region is `US` if your account settings page is located at `rpm.newrelic.com`, and `EU` if your account is located at `rpm.eu.newrelic.com`.
+- Set your [New Relic Personal API key](https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#personal-api-key) with the `NEW_RELIC_API_KEY` environment variable. Most Personal API keys begin with the prefix `NRAK-`.
+- Set your [New Relic Admin API key](https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#admin) with the `NEW_RELIC_ADMIN_API_KEY` environment variable. Most Admin API keys begin with the prefix `NRAA-`.
+- Set your [New Relic Account ID](https://docs.newrelic.com/docs/accounts/install-new-relic/account-setup/account-id) with the `NEW_RELIC_ACCOUNT_ID` environment variable.
+- Set your New Relic [region](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/get-started/our-eu-us-region-data-centers#verifying-account) with the `NEW_RELIC_REGION` environment variable. Your region is `US` if your account settings page is located at `rpm.newrelic.com`, and `EU` if your account is located at `rpm.eu.newrelic.com`.
```bash lineNumbers=false
# Add this to your .bash_profile
@@ -51,6 +61,7 @@ export NEW_RELIC_REGION=US
# Or set it inline when running `terraform plan` or `terraform apply`:
$ NEW_RELIC_API_KEY=NRAK-... terraform apply
```
+
@@ -85,11 +96,12 @@ $ terraform init
$ terraform plan
```
-`plan` performs a [dry run](https://en.wikipedia.org/wiki/Dry_run_(testing)) of your Terraform configuration, so nothing is actually provisioned. Always run `plan` to test your configuration before applying it.
+`plan` performs a [dry run]() of your Terraform configuration, so nothing is actually provisioned. Always run `plan` to test your configuration before applying it.
+
-## Add a data source
+## Add a data source
The alert policy you defined in `main.tf` does not contain any alert condition. You are going to add an alert condition linked to your application.
@@ -109,6 +121,7 @@ resource "newrelic_alert_policy" "alert_policy_name" {
name = "My Alert Policy Name"
}
```
+
@@ -149,12 +162,13 @@ resource "newrelic_alert_condition" "alert_condition_name" {
}
}
```
+
## Add a notification channel
-Alert policies use [notification channels](https://docs.newrelic.com/docs/alerts/new-relic-alerts/managing-notification-channels/notification-channels-control-where-send-alerts) to inform you about incidents and active alerts. To add a notification channel to your alert policy, add the following snippet to your configuration file.
+Alert policies use [notification channels](https://docs.newrelic.com/docs/alerts/new-relic-alerts/managing-notification-channels/notification-channels-control-where-send-alerts) to inform you about incidents and active alerts. To add a notification channel to your alert policy, add the following snippet to your configuration file.
When the alert condition is triggered, the notification channel sends an email to the specified `recipients`. You can send notifications using different tools and channels, such as Slack, by changing the `type` of your [alert channel](https://www.terraform.io/docs/providers/newrelic/r/alert_channel.html).
@@ -191,6 +205,7 @@ To [apply](https://www.terraform.io/docs/commands/apply.html) the Terraform conf
Answer `yes` when prompted to apply the changes. Once the `apply` process is complete, you should see the new alert policy you've provisioned using Terraform, and its alert conditions, in your New Relic account.
You can run `terraform apply` every time you need to make changes to your configuration. To eliminate the resources you've provisioned, run [`terraform destroy`](https://www.terraform.io/docs/commands/destroy.html).
+
@@ -207,7 +222,7 @@ To use our `apm` module with Terraform:
Here is a configuration example with overridden default values. Initialize the working directory using `terraform init`to download and enable the module.
-
+
The `apm` module doesn't create a notification channel, so you would still have to define one.
@@ -232,7 +247,7 @@ module "dummy-app-monitor" {
error_rate_warning_threshold = 5
error_rate_critical_threshold = 10
- # Specifying an application URL will provision a Synthetics monitor and associated alert condition.
+ # Specifying an application URL will provision a Synthetic monitor and associated alert condition.
application_url = "https://www.dummyapp.com"
synthetics_monitor_verify_ssl = true
@@ -260,6 +275,7 @@ resource "newrelic_alert_channel" "slack" {
}
}
```
+
Running `terraform plan` yields the following:
@@ -273,6 +289,7 @@ Running `terraform plan` yields the following:
name: "slack" => "slack"
type: "slack" => "slack"
```
+
To prevent Terraform from wrongly marking a resource as changed, add an [`ignore_changes`](https://www.terraform.io/docs/configuration/resources.html#ignore_changes) directive:
@@ -286,12 +303,7 @@ resource "newrelic_alert_channel" "slack" {
}
...
```
+
This avoids changes to resources caused by obfuscated items.
-
-## Related info
-
-- [Terraform New Relic Provider](https://www.terraform.io/docs/providers/newrelic/index.html)
-- [New Relic documentation](https://docs.newrelic.com)
-- [Terraform documentation](https://www.terraform.io/docs/index.html)
\ No newline at end of file
diff --git a/src/markdown-pages/build-apps/add-nerdgraphquery-guide.mdx b/src/markdown-pages/build-apps/add-nerdgraphquery-guide.mdx
index 127036858..58eaca8e1 100644
--- a/src/markdown-pages/build-apps/add-nerdgraphquery-guide.mdx
+++ b/src/markdown-pages/build-apps/add-nerdgraphquery-guide.mdx
@@ -4,15 +4,26 @@ duration: '20 minutes'
title: 'Add the NerdGraphQuery component to an application'
template: 'GuideTemplate'
description: 'The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application'
+resources:
+ - title: 'New Relic documentation'
+ url: https://docs.newrelic.com
+ - title: 'New Relic Explorer Hub'
+ url: https://discuss.newrelic.com
+tags:
+ - nerdgraphquery component
+ - transaction overview app
+ - query account data
+ - drop-down menu
+ - NerdGraphQuery.query method
---
-This guide steps you through the process of adding the NerdGraphQuery component to a sample transaction overview application. This allows you to query data from your New Relic account and add it to a dropdown menu.
+This guide steps you through the process of adding the `NerdGraphQuery` component to a sample transaction overview application. This allows you to query data from your New Relic account and add it to a dropdown menu.
-NerdGraph is New Relic's GraphQL implementation. GraphQL has some key differences when compared to REST:
+NerdGraph is our GraphQL implementation. GraphQL has some key differences when compared to REST:
-* The client, not the server, determines what data is returned.
-* You can easily collect data from multiple sources. For example, in a single New Relic query, you can get account information, infrastructure data, and issue a NRQL request.
+- The client, not the server, determines what data is returned.
+- You can easily collect data from multiple sources. For example, in a single query, you can get account information, infrastructure data, and issue a NRQL request.
@@ -20,28 +31,27 @@ Before completing this exercise, you can experiment with GraphQL queries in our
-
We also have a 14-minute video that covers the steps below.
-
+
## Before you begin
-To develop projects, you need our New Relic One CLI (command line interface).
-
-If you haven't already installed it, do the following:
+To develop projects, you need our New Relic One CLI (command line interface). If you haven't already installed it, do the following:
-* Go to our [installation wizard](https://one.newrelic.com/launcher/developer-center.launcher?pane=eyJuZXJkbGV0SWQiOiJkZXZlbG9wZXItY2VudGVyLmRldmVsb3Blci1jZW50ZXIifQ==) and complete steps 1–4.
-* Make a copy of your account ID in Step 1 because you’ll need it later (it's the number before the account name).
+* Install [Node.js](https://nodejs.org/en/download/).
+* Complete steps 1–4 of our [CLI quick start](https://one.newrelic.com/launcher/developer-center.launcher?pane=eyJuZXJkbGV0SWQiOiJkZXZlbG9wZXItY2VudGVyLmRldmVsb3Blci1jZW50ZXIifQ==), and be sure to make a copy of your account ID from step 1 because you’ll need it later.
- If you already installed the New Relic One CLI, but you can't remember your account ID, you can re-run the wizard just to get your account ID.
+If you've already installed the New Relic One CLI, but you can't remember your account ID, start the [CLI quick start](https://one.newrelic.com/launcher/developer-center.launcher?pane=eyJuZXJkbGV0SWQiOiJkZXZlbG9wZXItY2VudGVyLmRldmVsb3Blci1jZW50ZXIifQ==) again, and then click the **Get your API key** down arrow. The account ID is the number preceding your account name.
+For additional details, see [Set up your development environment](set-up-dev-env).
+
## Prepare the sample code
To get started, complete these steps to update the [application UUID (unique ID)](https://developer.newrelic.com/build-tools/new-relic-one-applications/guide-to-authentication--data-access--and-permissions) and run the sample application locally:
@@ -52,19 +62,19 @@ To get started, complete these steps to update the [application UUID (unique ID)
If you haven't already done so, clone the example applications from our [how-to GitHub repo](https://github.com/newrelic/nr1-how-to). Here's an example using HTTPS:
- ```bash
- git clone https://github.com/newrelic/nr1-how-to.git
- ```
+```bash
+git clone https://github.com/newrelic/nr1-how-to.git
+```
- Change to the directory `use-nerdgraph-nerdlet`:
+Change to the directory `use-nerdgraph-nerdlet`:
- ```bash
- cd nr1-how-to/use-nerdgraph/nerdlets/use-nerdgraph-nerdlet
- ```
+```bash
+cd nr1-how-to/use-nerdgraph/nerdlets/use-nerdgraph-nerdlet
+```
@@ -80,13 +90,13 @@ Replace `` with your account id:
-Your account ID is available in the CLI wizard (see **Before you begin**).
+Your account ID is available in the CLI quick start (see **Before you begin**).
- ```jsx
- this.accountId = ;
- ```
+```jsx
+this.accountId = ;
+```
@@ -94,40 +104,34 @@ Your account ID is available in the CLI wizard (see **Before you begin**).
Change to the `/nr1-howto/use-nerdgraph` directory:
- ```bash
- cd ../..
- ```
+```bash
+cd ../..
+```
+
Execute these commands to update the UUID and serve the sample application:
- ```bash
- nr1 nerdpack:uuid -gf
- nr1 nerdpack:serve
- ```
+```bash
+nr1 nerdpack:uuid -gf
+nr1 nerdpack:serve
+```
-Once the sample application is successfully served, go to the local New Relic One homepage (https://one.newrelic.com/?nerdpacks=local) and click **Use NerdGraph**.
+Once the sample application is successfully served, go to the local New Relic One homepage (https://one.newrelic.com/?nerdpacks=local), click **Apps**, and then click **Use NerdGraph**.
![Use Nerdgraph launcher](../../images/nerdgraphquery-guide/use-nerdgraph-launcher.png)
-
-
-If you don't see any launchers, click **Your applications**.
-
-
-
-
-After launching the **Use NerdGraph** application, you see a dashboard that gives an overview of the transactions in your New Relic account.
+After launching the **Use NerdGraph** application, you see a dashboard that gives an overview of the transactions in your account:
![Screenshot showing the sample transaction application](../../images/nerdgraphquery-guide/no-name.png)
@@ -147,20 +151,20 @@ If you need more details about our example below, see the APIs and components pa
Add the `NerdGraphQuery` component into the first `StackItem` inside of the `return` in the `index.js` file:
- ```jsx
-
- {({loading, error, data}) => {
- console.log({loading, error, data})
- if (loading) {
- return ;
- }
- if (error) {
- return 'Error!';
- }
- return null;
- }}
-
- ```
+```jsx
+
+ {({ loading, error, data }) => {
+ console.log({ loading, error, data });
+ if (loading) {
+ return ;
+ }
+ if (error) {
+ return 'Error!';
+ }
+ return null;
+ }}
+
+```
@@ -176,17 +180,17 @@ In the browser console, you can see the data from your query returned in an obje
- ```jsx
- const query = `
- query($id: Int!) {
- actor {
- account(id: $id) {
- name
- }
- }
- }
- `;
- ```
+```jsx
+const query = `
+ query($id: Int!) {
+ actor {
+ account(id: $id) {
+ name
+ }
+ }
+ }
+`;
+```
@@ -194,53 +198,49 @@ In the browser console, you can see the data from your query returned in an obje
To take the data returned by the NerdGraph query and display it in the application, replace the `return null` in the current `NerdGraphQuery` component with this `return` statement:
- ```jsx
- return {data.actor.account.name} Apps: ;
- ```
+```jsx
+return {data.actor.account.name} Apps: ;
+```
+When you go back to the browser and view your application, you see a new headline showing the name of your account returned from NerdGraph:
-
+![App Image](../../images/nerdgraphquery-guide/with-name.png)
+
-When you go back to the browser and view your application, you see a new headline showing the name of your account returned from NerdGraph.
-
-![App Image](../../images/nerdgraphquery-guide/with-name.png)
-
## How to use `NerdGraphQuery.query`
-At this point, you implemented the `NerdGraphQuery` component with the application's `render` method and displayed the return data within the transaction overview application.
+At this point, you have implemented the `NerdGraphQuery` component with the application's `render` method and displayed the return data within the transaction overview application.
Here's what you need to do next:
* Query NerdGraph inside of the `componentDidMount` lifecycle method.
-* Save the returned data for later usage throughout the New Relic One application.
-
-Complete the following:
+* Save the returned data for later use in the application.
-The following code takes the response from NerdGraph and makes sure the results are processed, stored into the application state, and logged to the browser console for viewing.
+This code takes the response from NerdGraph and makes sure the results are processed, stored into the application state, and logged to the browser console for viewing.
-Add the following code into the `index.js` just under the `constructor`:
+Add this code into the `index.js` file just under the `constructor`:
- ```jsx
- componentDidMount() {
- const accountId = this.state;
- const gql = `{ actor { accounts { id name } } }`;
+```jsx
+componentDidMount() {
+ const accountId = this.state;
+ const gql = `{ actor { accounts { id name } } }`;
- const accounts = NerdGraphQuery.query({query: gql}) //The NerdGraphQuery.query method called with the query object to get your account data is stored in the accounts variable.
- accounts.then(results => {
- console.log('Nerdgraph Response:', results);
- const accounts = results.data.actor.accounts.map(account => {
- return account;
- });
- const account = accounts.length > 0 && accounts[0];
- this.setState({ selectedAccount: account, accounts });
- }).catch((error) => { console.log('Nerdgraph Error:', error); })
- }
- ```
+ const accounts = NerdGraphQuery.query({query: gql}) //The NerdGraphQuery.query method called with the query object to get your account data is stored in the accounts variable.
+ accounts.then(results => {
+ console.log('Nerdgraph Response:', results);
+ const accounts = results.data.actor.accounts.map(account => {
+ return account;
+ });
+ const account = accounts.length > 0 && accounts[0];
+ this.setState({ selectedAccount: account, accounts });
+ }).catch((error) => { console.log('Nerdgraph Error:', error); })
+}
+```
@@ -248,196 +248,199 @@ Add the following code into the `index.js` just under the `constructor`:
After the data is stored into state, display a selection so users can change accounts and update the application.
-To do this, add the following code to `index.js` for the second `StackItem` in the `return` statement:
-
- ```jsx
- {accounts &&
-
- this.selectAccount(value)}>
- {accounts.map(a => {
- return
+To do this, add this code to `index.js` for the second `StackItem` in the `return` statement:
+
+```jsx
+{
+ accounts && (
+
+ this.selectAccount(value)}
+ >
+ {accounts.map((a) => {
+ return (
+
{a.name}
-
- })}
-
-
- }
- ```
+
+ );
+ })}
+
+
+ );
+}
+```
+
+### Review the results of the NerdGraph query
+
After you complete these steps, look at the application in your browser, and note the following:
-* The dropdown menu displays the data returned from the `NerdGraphQuery.query` and allows you to select an account.
+* The dropdown menu now displays the data returned from the `NerdGraphQuery.query` and allows you to select an account.
* After you select a new account, the application shows data from the new selection.
![App Complete](../../images/nerdgraphquery-guide/complete.png)
-The final `index.js` file should have code similar to the code below. This completed sample code is in your nerdlet `final.js`.
-
- ```jsx
- import React from 'react';
- import { PlatformStateContext, NerdGraphQuery, Spinner, HeadingText, Grid, GridItem, Stack, StackItem, Select, SelectItem, AreaChart, TableChart, PieChart } from 'nr1'
- import { timeRangeToNrql } from '@newrelic/nr1-community';
-
- // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction
-
- export default class UseNerdgraphNerdletNerdlet extends React.Component {
- constructor(props){
- super(props)
- this.state = {
- accountId: ,
- accounts: null,
- selectedAccount: null,
- }
- }
-
- componentDidMount() {
- const accountId = this.state;
- const gql = `{ actor { accounts { id name } } }`;
-
- const accounts = NerdGraphQuery.query({ query: gql })
- accounts.then(results => {
- console.log('Nerdgraph Response:', results);
- const accounts = results.data.actor.accounts.map(account => {
- return account;
- });
- const account = accounts.length > 0 && accounts[0];
- this.setState({ selectedAccount: account, accounts });
- }).catch((error) => { console.log('Nerdgraph Error:', error); })
- }
-
- selectAccount(option) {
- this.setState({ accountId: option.id, selectedAccount: option });
- }
-
-
- render() {
- const { accountId, accounts, selectedAccount } = this.state;
- console.log({ accountId, accounts, selectedAccount });
-
- const query = `
- query($id: Int!) {
- actor {
- account(id: $id) {
- name
- }
- }
- }
- `;
-
- const variables = {
- id: accountId,
- };
-
- const avgResTime = `SELECT average(duration) FROM Transaction FACET appName TIMESERIES AUTO `;
- const trxOverview = `FROM Transaction SELECT count(*) as 'Transactions', apdex(duration) as 'apdex', percentile(duration, 99, 95) FACET appName `;
- const errCount = `FROM TransactionError SELECT count(*) as 'Transaction Errors' FACET error.message `;
- const responseCodes = `SELECT count(*) as 'Response Code' FROM Transaction FACET httpResponseCode `;
-
- return (
-
-
-
- {({loading, error, data}) => {
- if (loading) {
- return ;
- }
-
- if (error) {
- return 'Error!';
- }
-
- return {data.actor.account.name} Apps: ;
- }}
-
-
- {accounts &&
-
- this.selectAccount(value)}>
- {accounts.map(a => {
- return (
-
- {a.name}
-
- )
- })}
-
-
- }
-
-
-
- {(PlatformState) => {
- /* Taking a peek at the PlatformState */
- const since = timeRangeToNrql(PlatformState);
- return (
- <>
-
-
-
-
- Transaction Overview
-
-
-
-
-
-
-
- Average Response Time
-
-
-
-
-
-
-
- Response Code
-
-
-
-
-
-
-
- Transaction Errors
-
-
-
-
-
- >
- );
- }}
-
-
-
- )
- }
- }
-
- ```
+The final `index.js` file should have code similar to the code below. This completed sample is in your nerdlet `final.js`.
+
+```jsx
+import React from 'react';
+import { PlatformStateContext, NerdGraphQuery, Spinner, HeadingText, Grid, GridItem, Stack, StackItem, Select, SelectItem, AreaChart, TableChart, PieChart } from 'nr1'
+import { timeRangeToNrql } from '@newrelic/nr1-community';
+
+// https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction
+
+export default class UseNerdgraphNerdletNerdlet extends React.Component {
+ constructor(props){
+ super(props)
+ this.state = {
+ accountId: ,
+ accounts: null,
+ selectedAccount: null,
+ }
+ }
+
+ componentDidMount() {
+ const accountId = this.state;
+ const gql = `{ actor { accounts { id name } } }`;
+
+ const accounts = NerdGraphQuery.query({ query: gql })
+ accounts.then(results => {
+ console.log('Nerdgraph Response:', results);
+ const accounts = results.data.actor.accounts.map(account => {
+ return account;
+ });
+ const account = accounts.length > 0 && accounts[0];
+ this.setState({ selectedAccount: account, accounts });
+ }).catch((error) => { console.log('Nerdgraph Error:', error); })
+ }
+
+ selectAccount(option) {
+ this.setState({ accountId: option.id, selectedAccount: option });
+ }
+
+
+ render() {
+ const { accountId, accounts, selectedAccount } = this.state;
+ console.log({ accountId, accounts, selectedAccount });
+
+ const query = `
+ query($id: Int!) {
+ actor {
+ account(id: $id) {
+ name
+ }
+ }
+ }
+ `;
+
+ const variables = {
+ id: accountId,
+ };
+
+ const avgResTime = `SELECT average(duration) FROM Transaction FACET appName TIMESERIES AUTO `;
+ const trxOverview = `FROM Transaction SELECT count(*) as 'Transactions', apdex(duration) as 'apdex', percentile(duration, 99, 95) FACET appName `;
+ const errCount = `FROM TransactionError SELECT count(*) as 'Transaction Errors' FACET error.message `;
+ const responseCodes = `SELECT count(*) as 'Response Code' FROM Transaction FACET httpResponseCode `;
+
+ return (
+
+
+
+ {({loading, error, data}) => {
+ if (loading) {
+ return ;
+ }
+
+ if (error) {
+ return 'Error!';
+ }
+
+ return {data.actor.account.name} Apps: ;
+ }}
+
+
+ {accounts &&
+
+ this.selectAccount(value)}>
+ {accounts.map(a => {
+ return (
+
+ {a.name}
+
+ )
+ })}
+
+
+ }
+
+
+
+ {(PlatformState) => {
+ /* Taking a peek at the PlatformState */
+ const since = timeRangeToNrql(PlatformState);
+ return (
+ <>
+
+
+
+
+ Transaction Overview
+
+
+
+
+
+
+
+ Average Response Time
+
+
+
+
+
+
+
+ Response Code
+
+
+
+
+
+
+
+ Transaction Errors
+
+
+
+
+
+ >
+ );
+ }}
+
+
+
+ )
+ }
+}
+
+```
## Summary
-Now that you completed all the steps in this example, you successfully queried data from your account using the `NerdGraphQuery` component in two methods:
-
-1. Using the `NerdGraphQuery` component inside the application's render method and then passing the returned data into the children's components.
-2. Using the `NerdGraphQuery.query` method to query data before the application renders.
-
-## Related information
-
-- [New Relic documentation](https://docs.newrelic.com)
-- [New Relic's Explorer Hub](https://discuss.newrelic.com/)
-
+Now that you've completed all the steps in this example, you've successfully queried data from your account using the `NerdGraphQuery` component in two methods:
+- Using the `NerdGraphQuery` component inside the application's render method and then passing the returned data into the children's components.
+- Using the `NerdGraphQuery.query` method to query data before the application renders.
diff --git a/src/markdown-pages/build-apps/add-query-mutate-data-NerdStorage.mdx b/src/markdown-pages/build-apps/add-query-mutate-data-NerdStorage.mdx
index 443a12264..7c66ef134 100644
--- a/src/markdown-pages/build-apps/add-query-mutate-data-NerdStorage.mdx
+++ b/src/markdown-pages/build-apps/add-query-mutate-data-NerdStorage.mdx
@@ -4,15 +4,23 @@ duration: '45 min'
title: 'Add, query, and mutate data using NerdStorage'
template: 'GuideTemplate'
description: '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.'
+resources:
+ - title: 'New Relic SDK documentation'
+ url: /explore-docs/intro-to-sdk
+tags:
+ - add data
+ - query data
+ - mutate data
+ - 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.
+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.
+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](/explore-docs/nerdstorage).
+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](/explore-docs/nerdstorage).
@@ -28,19 +36,20 @@ First, get the NerdStorage app running successfully inside New Relic One.
-Clone the example applications from the [GitHub repo](https://github.com/newrelic/nr1-how-to/tree/master/use-nerdstorage).
+Clone the example applications from the [GitHub repo](https://github.com/newrelic/nr1-how-to/tree/master/use-nerdstorage).
-Use the New Relic One CLI to update the application UUID and run the application locally.
+Use the New Relic One CLI to update the application UUID and run the application locally.
-1. In the terminal, switch to the `/nr1-howto/use-nerdstorage` directory:
+1. In the terminal, switch to the `/nr1-how-to/use-nerdstorage` directory:
```
-cd /nr1-howto/use-nerdstorage
+cd /nr1-how-to/use-nerdstorage
```
+
2. Update the UUID and serve the application:
```
@@ -52,9 +61,9 @@ nr1 nerdpack:serve
-Once the app is successfully served, your terminal will return the URL to view your running application on [New Relic One](https://one.newrelic.com/?nerdpacks=local).
+Once the app is successfully served, your terminal will return the URL to view your running application on [New Relic One](https://one.newrelic.com/?nerdpacks=local).
-Load the URL. Under **Your applications** you'll see the **Use Nerdstorage** app listed. Click to launch the app.
+Load the URL. Click **Apps** and under **Other apps** you'll see the **Use Nerdstorage** app listed. Click to launch the app.
![Your applications view updated](../../images/build-an-app/NerdStorage-applications-view.png)
@@ -62,12 +71,11 @@ Load the URL. Under **Your applications** you'll see the **Use Nerdstorage** 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.
+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](https://developer.newrelic.com/client-side-sdk/index.html#data-fetching/UserStorageMutation).
+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](https://developer.newrelic.com/client-side-sdk/index.html#data-fetching/UserStorageMutation).
![add data view 1](../../images/build-an-app/add-data-NerdStorage.png)
@@ -94,6 +102,7 @@ constructor(props) {
this._deleteDocument = this._deleteDocument.bind(this);
}
```
+
@@ -125,34 +134,35 @@ _addToNerdStorage(){
});
}
```
+
-1. Return to your running **How To Use NerdStorage** app screen on New Relic One and reload the page.
+1. Return to your running **How To Use NerdStorage** app screen on New Relic One and reload the page.
-2. 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.
+2. 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.
![add data view 2](../../images/build-an-app/add-data-NerdStorage-2.png)
-
## 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.
+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.
-Import the `UserStorageQuery` by adding it to the import statement in the application’s `./nerdlets/use-nerdstorage-nerdlet/index.js` file.
+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';
```
+
@@ -173,6 +183,7 @@ componentDidMount(){
.catch(err => console.log(err));
}
```
+
@@ -182,17 +193,16 @@ Back inside the NerdStorage app, test your changes by adding a few more rows usi
-
## 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.
+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.
-To get this process working, update the code in `_removeFromNerdStorage`:
+To get this process working, update the code in `_removeFromNerdStorage`:
```
_removeFromNerdStorage(index, data){
@@ -214,7 +224,7 @@ _removeFromNerdStorage(index, data){
}
```
-Once this is done, clicking the trash button will remove the item it's associated with, and the app will update to show the change.
+Once you do this, clicking the trash button removes the item it's associated with, and the app updates to show the change.
![mutate data](../../images/build-an-app/mutate-data-NerdStorage.png)
@@ -224,7 +234,7 @@ Once this is done, clicking the trash button will remove the item it's associate
## 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.
+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.
@@ -242,11 +252,12 @@ iconType={Button.ICON_TYPE.INTERFACE__OPERATIONS__TRASH}
Delete Document
```
+
-
+
-As the new **Delete Document** button will be calling the `_deleteDocument` helper method, you'll need to update that using the code below:
+Because the new **Delete Document** button will be calling the `_deleteDocument` helper method, you'll need to update that using this code:
```
_deleteDocument(){
@@ -259,19 +270,15 @@ _deleteDocument(){
Toast.showToast({ title: "NerdStorage Update.", type: Toast.TYPE.CRITICAL });
}
```
+
-Back inside the application, you should now see both the individual trash buttons and the newly added **Delete Document** button.
+Back inside the application, you should now see both the individual trash buttons and the newly added **Delete Document** button.
![delete collection button view](../../images/build-an-app/delete-collection-NerdStorage.png)
-
## 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](/components/user-storage-mutation).
-
-## Related info
-
-- [New Relic SDK documentation](/explore-docs/intro-to-sdk)
+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](/components/user-storage-mutation).
diff --git a/src/markdown-pages/build-apps/add-time-picker-guide.mdx b/src/markdown-pages/build-apps/add-time-picker-guide.mdx
index 1c62b4d4f..308d1e704 100644
--- a/src/markdown-pages/build-apps/add-time-picker-guide.mdx
+++ b/src/markdown-pages/build-apps/add-time-picker-guide.mdx
@@ -7,42 +7,73 @@ description: 'Add a time picker to a sample application'
tileShorthand:
title: 'Add a time picker to your app'
description: 'Add a time picker to a sample application'
+resources:
+ - title: 'New Relic documentation'
+ url: https://docs.newrelic.com
+ - title: 'New Relic Explorer Hub'
+ url: https://discuss.newrelic.com
+tags:
+ - time picker
+ - app
+ - helper method
+ - platformstatecontext
---
+
-This guide steps you through the process of adding access to the New Relic time picker in the sample transaction overview application.
+This guide steps you through the process of adding access to our time picker in the sample transaction overview application.
The sample application provides an overview of the telemetry data showing your account's transactions by application, average response time, HTTP response codes, and transaction errors. When you enable the time picker, users can specify the time range of data to view.
We also have a 12 minute video that covers the steps below.
-
+
## Before you begin
-These steps require that you have the following:
+To develop projects, you need our New Relic One CLI (command line interface). If you haven't already installed it, do the following:
+
+* Install [Node.js](https://nodejs.org/en/download/).
+* Complete steps 1–4 of the [CLI quick start](https://one.newrelic.com/launcher/developer-center.launcher?pane=eyJuZXJkbGV0SWQiOiJkZXZlbG9wZXItY2VudGVyLmRldmVsb3Blci1jZW50ZXIifQ==). In step 1, be sure to make a copy of the number preceding your account name. This is your accound ID, and you’ll need it later.
-- A GitHub account
-- New Relic developer account
-- API Key (the same key you set up in [Quick start](https://one.newrelic.com/launcher/developer-center.launcher?pane=eyJuZXJkbGV0SWQiOiJkZXZlbG9wZXItY2VudGVyLmRldmVsb3Blci1jZW50ZXIifQ==))
-- The New Relic One [CLI](https://cli.nr-ext.net/installer.pkg)
+
+
+ If you've already installed the New Relic One CLI, but you can't remember your account ID, start the [CLI quick start](https://one.newrelic.com/launcher/developer-center.launcher?pane=eyJuZXJkbGV0SWQiOiJkZXZlbG9wZXItY2VudGVyLmRldmVsb3Blci1jZW50ZXIifQ==) again, and then click the **Get your API key** down arrow. The account ID is the number preceding your account name.
+
+
+
+For additional details, see [Set up your development environment](set-up-dev-env).
## Prepare the time picker sample code
-To get started, complete these steps to update the application UUID and run the sample application locally:
+To get started, complete these steps to update the [application UUID (unique ID)](/explore-docs/nr1-cli) and run the sample application locally:
-Clone the example applications from our [how-to GitHub repo](https://github.com/newrelic/nr1-how-to).
+If you haven't already done so, clone the example applications from our [how-to GitHub repo](https://github.com/newrelic/nr1-how-to).
+
+```bash
+git clone https://github.com/newrelic/nr1-how-to.git
+```
+
+
+
+
+
+Change to the directory `nr1-howto-add-time-picker-nerdlet`:
+
+```bash
+cd nr1-how-to/add-time-picker/nerdlets/nr1-howto-add-time-picker-nerdlet
+```
-In your preferred text editor, open `/add-time-picker/nerdlets/nr1-howto-add-time-picker-nerdlet/index.js`.
+In your preferred text editor, open `index.js`.
@@ -51,23 +82,23 @@ In your preferred text editor, open `/add-time-picker/nerdlets/nr1-howto-add-tim
Replace `` with your account id:
-
- Your account ID is viewable in the profile selection menu of the developer center (where you downloaded the New Relic One CLI).
+
+ Your account ID is available in the CLI quick start (see **Before you begin**).
- ```js
- this.accountId = ;
- ```
+```jsx
+this.accountId = ;
+```
-
- In your terminal, change to the `add-time-picker` directory:
+
+Change to the `add-time-picker` directory:
```
- cd /nr1-howto/add-time-picker
+ cd /nr1-how-to/add-time-picker
```
@@ -76,30 +107,16 @@ Replace `` with your account id:
Execute these commands to update the UUID and serve the sample application:
- ```
- nr1 nerdpack:uuid -gf
- nr1 nerdpack:serve
- ```
-
-
-
-
-
-Once the sample application is successfully served, go to the local New Relic One homepage: https://one.newrelic.com/?nerdpacks=local
+```
+nr1 nerdpack:uuid -gf
+nr1 nerdpack:serve
+```
-Click **Add Time Picker**:
-
-
-
-If you don't see any launchers, click **Your applications**.
-
-
-
-![New Relic One launcher image](../../images/time-picker-guide/homepage-launcher.png)
+Once the sample application is successfully served, go to the local version of New Relic One (https://one.newrelic.com/?nerdpacks=local) click **Apps**, and click **Add Time Picker**.
@@ -109,25 +126,25 @@ After launching the **Add Time Picker** application, you see a dashboard that gi
![Transaction overview application](../../images/time-picker-guide/add-timepicker.png)
-By default, the application shows your data within the last 60 minutes. If you toggle the time picker, it doesn't update the charts because the transaction overview application isn't connected to the New Relic One platform. It has no access to the data from the time picker.
+By default, the application shows your data within the last 60 minutes. If you toggle the time picker, it doesn't update the charts because the transaction overview application isn't connected to the New Relic One platform. It has no access to the data from the time picker.
In the following sections, you'll add the time picker to the example application and add the time to the queries.
## Import the `PlatformStateContext` component
-The first step in adding the time picker is to import the `PlatformStateContext` component.
+The first step in adding the time picker is to import the `PlatformStateContext` component.
-
- If you need more details about our example below, see the APIs and components page on [https://developer.newrelic.com](https://developer.newrelic.com/client-side-sdk/index.html#apis/PlatformStateContext)
-
-
+
+If you need more details about the `PlatformStateContext` example that follows, see the [APIs and components page](/components/platform-state-context)
+
+
Here's what the `PlatformStateContext` component does:
-* Wraps all of the code within the return statement of the render method
-* Makes a function call passing in the New Relic platform state
-* Returns all of the code within our current return statement
+- Wraps all of the code within the return statement of the render method
+- Makes a function call passing in the New Relic platform state
+- Returns all of the code within our current return statement
Complete these steps:
@@ -143,17 +160,17 @@ In a text editor, open `/add-time-picker/nerdlets/nr1-howto-add-time-picker-nerd
Add the `PlatformStateContext` component to the end of the import statement so it looks like this:
- ```js
- import {
- Grid,
- GridItem,
- HeadingText,
- AreaChart,
- TableChart,
- PieChart,
- PlatformStateContext
- } from 'nr1';
- ```
+```jsx
+import {
+ Grid,
+ GridItem,
+ HeadingText,
+ AreaChart,
+ TableChart,
+ PieChart,
+ PlatformStateContext,
+} from 'nr1';
+```
@@ -161,13 +178,13 @@ Add the `PlatformStateContext` component to the end of the import statement so i
Just below the current `return` insert this code for the `PlatformStateContext` component:
-```js
+```jsx
- {(platformState) => {
- return (
- // ADD THE CURRENT RETURN CODE HERE
- )
- }}
+ {(platformState) => {
+return (
+// ADD THE CURRENT RETURN CODE HERE
+)
+}}
```
@@ -177,55 +194,83 @@ Just below the current `return` insert this code for the `PlatformStateContext`
Move the current application code so it is under the `return` of the `PlatformState` function call. The `return` statement should now look like this:
- ```js
- return (
-
- {(PlatformState) => {
- return (
- <>
-
-
-
-
- Transaction Overview
-
-
-
-
-
-
-
- Average Response Time
-
-
-
-
-
-
-
- Response Code
-
-
-
-
-
-
-
- Transaction Errors
-
-
-
-
-
- >
- );
- }}
-
- );
- ```
+```jsx
+return (
+
+ {(PlatformState) => {
+ return (
+ <>
+
+
+
+
+ Transaction Overview
+
+
+
+
+
+
+
+ Average Response Time
+
+
+
+
+
+
+
+ Response Code
+
+
+
+
+
+
+
+ Transaction Errors
+
+
+
+
+
+ >
+ );
+ }}
+
+);
+```
@@ -233,10 +278,10 @@ Move the current application code so it is under the `return` of the `PlatformSt
Add a `console.log` statement to make sure you are seeing appropriate data. Insert the following code inside the `PlatformState` return statement just before the opening tag for the `` component:
- ```js
- /* Taking a peek at the PlatformState */
- console.log(PlatformState);
- ```
+```jsx
+/* Taking a peek at the PlatformState */
+console.log(PlatformState);
+```
@@ -248,17 +293,17 @@ After you complete these steps, your browser console displays something like thi
## Add the time to the queries
-In your console, you should see some data from the New Relic platform state. Now you are ready to add `timeRange` data to update the charts in the transaction overview application.
+In your console, you should see some data from the New Relic platform state. Now you're ready to add `timeRange` data to update the charts in the transaction overview application.
-This step requires you to import the `timeRangeToNrql` utility method from the New Relic One community library.
+This step requires you to import the `timeRangeToNrql` utility method from the New Relic One community library.
-
+
You can get more details on the New Relic One community library from our [GitHub repo](https://github.com/newrelic/nr1-community).
-
+
-This helper method takes your `PlatformState.timeRange` duration data, formats it from milliseconds, and returns a formatted `SINCE` statement to add to your `NRQL`.
+This helper method takes your `PlatformState.timeRange` duration data, formats it from milliseconds, and returns a formatted `SINCE` statement to add to your `NRQL`.
@@ -267,14 +312,14 @@ This helper method takes your `PlatformState.timeRange` duration data, formats i
Import the `timeRangeToNrql` method by inserting this line of code below the other `import` sections:
-
+
You don't need to include the `AccountDropdown` from the community import example.
-
+
- ```js
- import { timeRangeToNrql } from '@newrelic/nr1-community';
- ```
+```jsx
+import { timeRangeToNrql } from '@newrelic/nr1-community';
+```
@@ -282,9 +327,9 @@ You don't need to include the `AccountDropdown` from the community import exampl
Pass the `PlatformState` to the `timeRangeToNrql` helper, and save its output as a `since` statement for later use:
- ```js
- const since = timeRangeToNrql(PlatformState);
- ```
+```jsx
+const since = timeRangeToNrql(PlatformState);
+```
@@ -292,9 +337,9 @@ Pass the `PlatformState` to the `timeRangeToNrql` helper, and save its output as
After creating the `since` variable, go through the code in the `PlatformStateContext` return statement and concatenate the `since` variable in each of the existing chart component queries. Here's a `TableChart` example:
- ```js
-
- ```
+```jsx
+
+```
@@ -303,92 +348,119 @@ After creating the `since` variable, go through the code in the `PlatformStateCo
After you update all of the chart components, confirm that the final `index.js` file looks similar to this:
-
+
This completed sample code is in your `nerdlet final.js`.
+```jsx
+import React from 'react';
+import {
+ PlatformStateContext,
+ Grid,
+ GridItem,
+ HeadingText,
+ AreaChart,
+ TableChart,
+ PieChart,
+} from 'nr1';
+import { timeRangeToNrql } from '@newrelic/nr1-community';
+
+export default class Nr1HowtoAddTimePicker extends React.Component {
+ constructor(props) {
+ super(props);
+ this.accountId = 1;
+ }
+ render() {
+ const avgResTime = `SELECT average(duration) FROM Transaction FACET appName TIMESERIES AUTO `;
+ const trxOverview = `FROM Transaction SELECT count(*) as 'Transactions', apdex(duration) as 'apdex', percentile(duration, 99, 95) FACET appName `;
+ const errCount = `FROM TransactionError SELECT count(*) as 'Transaction Errors' FACET error.message `;
+ const responseCodes = `SELECT count(*) as 'Response Code' FROM Transaction FACET httpResponseCode `;
- ```js
- import React from 'react';
- import {
- PlatformStateContext,
- Grid,
- GridItem,
- HeadingText,
- AreaChart,
- TableChart,
- PieChart
- } from 'nr1';
- import { timeRangeToNrql } from '@newrelic/nr1-community';
-
- export default class Nr1HowtoAddTimePicker extends React.Component {
- constructor(props){
- super(props)
- this.accountId = 1;
- }
- render() {
- const avgResTime = `SELECT average(duration) FROM Transaction FACET appName TIMESERIES AUTO `;
- const trxOverview = `FROM Transaction SELECT count(*) as 'Transactions', apdex(duration) as 'apdex', percentile(duration, 99, 95) FACET appName `;
- const errCount = `FROM TransactionError SELECT count(*) as 'Transaction Errors' FACET error.message `;
- const responseCodes = `SELECT count(*) as 'Response Code' FROM Transaction FACET httpResponseCode `;
+ return (
+
+ {(PlatformState) => {
+ /* Taking a peek at the PlatformState */
+ console.log(PlatformState);
+
+ const since = timeRangeToNrql(PlatformState);
+ console.log(since);
return (
-
- {(PlatformState) => {
- /* Taking a peek at the PlatformState */
- console.log(PlatformState)
-
- const since = timeRangeToNrql(PlatformState);
- console.log(since);
-
- return (
- <>
-
-
-
-
- Transaction Overview
-
-
-
-
-
-
-
- Average Response Time
-
-
-
-
-
-
-
- Response Code
-
-
-
-
-
-
-
- Transaction Errors
-
-
-
-
-
- >
- );
- }}
-
+ <>
+
+
+
+
+ Transaction Overview
+
+
+
+
+
+
+
+ Average Response Time
+
+
+
+
+
+
+
+ Response Code
+
+
+
+
+
+
+
+ Transaction Errors
+
+
+
+
+
+ >
);
- }
+ }}
+
+ );
}
- ```
+}
+```
@@ -396,9 +468,4 @@ This completed sample code is in your `nerdlet final.js`.
## Summary
-When you completed all the steps in this example, you successfully implemented the time picker in your application by importing the `PlatformStateContext` component and accessing its `timePicker` data object.
-
-## Related information
-
-- [New Relic documentation](https://docs.newrelic.com)
-- [New Relic's Explorer Hub](https://discuss.newrelic.com/)
+When you completed all the steps in this example, you successfully implemented the time picker in your application by importing the `PlatformStateContext` component and accessing its `timePicker` data object.
diff --git a/src/markdown-pages/build-apps/build-hello-world-app.mdx b/src/markdown-pages/build-apps/build-hello-world-app.mdx
index d04a6bd7f..02ac10739 100644
--- a/src/markdown-pages/build-apps/build-hello-world-app.mdx
+++ b/src/markdown-pages/build-apps/build-hello-world-app.mdx
@@ -4,15 +4,27 @@ duration: '15 min'
title: 'Create a "Hello, World!" application'
template: 'GuideTemplate'
description: 'Build a "Hello, World!" app and publish it to New Relic One'
+redirects:
+ - /build-new-relic-one-applications
+resources:
+ - title: NR1 VS Code extension
+ url: https://marketplace.visualstudio.com/items?itemName=new-relic.nr1
+ - title: 'Build on New Relic One'
+ url: https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/new-relic-one-build-your-own-custom-new-relic-one-application
+tags:
+ - nr1 cli
+ - Nerdpack file structure
+ - NR One Catalog
+ - Subscribe applications
---
-
-Here's how you can quickly build a "Hello, World!" application in New Relic One. In these steps, we'll show you how to create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One.
+
-We also have a 5-minute video that covers the steps below.
+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.
+
@@ -20,83 +32,89 @@ We also have a 5-minute video that covers the steps below.
To get started, make sure you have accounts in GitHub and [New Relic](https://newrelic.com/signup/).
-Use your New Relic account credentials to log into our [CLI wizard](https://one.newrelic.com/launcher/developer-center.launcher?pane=eyJuZXJkbGV0SWQiOiJkZXZlbG9wZXItY2VudGVyLmRldmVsb3Blci1jZW50ZXIifQ==). It sets you up with the following:
+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](https://nodejs.org/en/download/).
+- Complete all the steps in the [CLI quick start](https://one.newrelic.com/launcher/developer-center.launcher?pane=eyJuZXJkbGV0SWQiOiJkZXZlbG9wZXItY2VudGVyLmRldmVsb3Blci1jZW50ZXIifQ==).
-* New Relic API key
-* Download options for the New Relic CLI (command line interface)
-* Customized CLI commands to configure your environment
+For additional details about setting up your environment, see [Set up your development environment](set-up-dev-env).
-After you install the CLI and configure your environment, continue with the steps below. If you want to build your app and see it locally, you need to install [Node.js](https://nodejs.org/en/download/) and run `npm install`.
+
+
+Use the [NR1 VS Code extension](https://marketplace.visualstudio.com/items?itemName=new-relic.nr1) 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.
+The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One.
-If you followed all the steps in the CLI wizard, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a "Hello, World!" project:
+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:
-
+
- Open a code editor and point it to the new directory named after your nerdpack project (for example, `my-awesome-nerdpack`).
+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
-
-
+Your code editor displays two artifacts:
-
+- `launchers` containing the homepage tile
+- `nerdlets` containing your application code
+
+
- Expand `nerdlets` in your code editor, and open `index.js`.
+Expand `nerdlets` in your code editor, and open `index.js`.
- Change the default `return` message to `"Hello, World!"`:
+Change the default `return` message to `"Hello, World!"`:
+
+```js
+import React from 'react';
- ```js
- import React from 'react';
-
- // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction
+// https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction
- export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component {
- render() {
- return "Hello, World!" ;
- }
+export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component {
+ render() {
+ return "Hello, World!" ;
}
- ```
+}
+```
- 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:
+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:
- ![Launcher artifact with icon.png](../../images/create-hello-world/custom-tile.png)
+![Launcher artifact with icon.png](../../images/create-hello-world/custom-tile.png)
- To change the name of the launcher to something meaningful, in your code editor under `launchers`, open `nr1.json`.
+To change the name of the launcher to something meaningful, in your code editor under `launchers`, open `nr1.json`.
+
+
-
-
- Change the value for `displayName` to anything you want as the launcher label, and save the file:
+Change the value for `displayName` to anything you want as the launcher label, and save the file:
- ```json
- {
- "schemaType": "LAUNCHER",
- "id": "my-awesome-nerdpack-launcher",
- "description": "Describe me",
- "displayName": "INSERT_YOUR_TILE_LABEL_HERE",
- "rootNerdletId": "my-awesome-nerdpack-nerdlet"
+```json
+{
+ "schemaType": "LAUNCHER",
+ "id": "my-awesome-nerdpack-launcher",
+ "description": "Describe me",
+ "displayName": "INSERT_YOUR_TILE_LABEL_HERE",
+ "rootNerdletId": "my-awesome-nerdpack-nerdlet"
}
```
@@ -104,74 +122,73 @@ If you followed all the steps in the CLI wizard, you now have files under a new
- To see your new changes locally, start the Node server with this command in your terminal:
+To see your new changes locally, start the Node server with this command in your terminal:
+
+```
+npm start
+```
- ```
- npm start
- ```
- Open a browser and go to [https://one.newrelic.com/?nerdpacks=local](https://one.newrelic.com/?nerdpacks=local) (this url is also shown in the terminal).
+Open a browser and go to [https://one.newrelic.com/?nerdpacks=local](https://one.newrelic.com/?nerdpacks=local) (this url is also shown in the terminal).
- When the browser opens, click the new launcher for your application. Here's an example where we inserted a leaf icon:
+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:
- ![The customized nerdlet launcher](../../images/create-hello-world/hello-world-launcher.png)
+![The customized nerdlet launcher](../../images/create-hello-world/hello-world-launcher.png)
-
- After you click the new launcher, your "Hello, World!" appears:
+After you click the new launcher, your "Hello, World!" appears:
- ![Hello, World in the browser](../../images/create-hello-world/hello-world-output-local.png)
+![Hello, World in the browser](../../images/create-hello-world/hello-world-output-local.png)
-
+## Publish your application to New Relic
-## Publish you 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.
+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.
- Execute the following in your terminal:
+Execute the following in your terminal:
+
+```
+nr1 nerdpack:publish
+```
- ```
- nr1 nerdpack:publish
- ```
-
+
- Close your local New Relic One development tab, and open [New Relic One](https://one.newrelic.com).
-
+Close your local New Relic One development tab, and open [New Relic One](https://one.newrelic.com).
+
- Click the **New Relic One Catalog** launcher.
+Click the **Apps** launcher.
- Under **Your company applications**, click the launcher for your new application.
+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.
+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.
- ![An empty application description in the catalog](../../images/create-hello-world/catalog-description-empty.png)
+![An empty application description in the catalog](../../images/create-hello-world/catalog-description-empty.png)
## Add details to describe your project
@@ -181,85 +198,86 @@ Now that your new application is in the New Relic One catalog, you can add detai
- Go to your project in the terminal and execute the following:
+Go to your project in the terminal and execute the following:
- ```
- nr1 create
- ```
+```
+nr1 create
+```
- Select **catalog**, which creates a stub in your project under the `catalog` directory. Here's how the results might look in your code editor:
+Select **catalog**, which creates a stub in your project under the `catalog` directory. Here's how the results might look in your code editor:
- ![Catalog stub](../../images/create-hello-world/new-catalog-stub.png)
+![Catalog stub](../../images/create-hello-world/new-catalog-stub.png)
- 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](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/discover-manage-applications-new-relic-one-catalog#clamshell-2).
+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](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/discover-manage-applications-new-relic-one-catalog#clamshell-2).
- After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog:
+After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog:
- ```
- nr1 catalog:submit
- ```
+```
+nr1 catalog:submit
+```
- Return to the catalog and refresh the page to see your new screenshots and metadata describing your project.
+Return to the catalog and refresh the page to see your new screenshots and metadata describing your project.
-
## Subscribe accounts to your application
-To make sure other users see your application on the New Relic One homepage, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application.
+To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application.
-
+
- 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**.
+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**.
- On your application's description page, click **Add this app**.
+On your application's description page, click **Add this app**.
- Select the accounts you want to subscribe to the application, and then click **Update access** to save your selections.
+Select the accounts you want to subscribe to the application, and then click **Update accounts** to save your selections.
-When you return to the New Relic One homepage, you'll see the launcher for your new application.
+When you return to the Apps page, you'll see the launcher for your new application.
## Summary
-Now that you completed the steps in this example, you learned the basic steps to create a custom application:
+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 see it directly on their homepage.
+- 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
-- [New Relic documentation](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/new-relic-one-build-your-own-custom-new-relic-one-application)
-- [New Relic's Explorer Hub](https://discuss.newrelic.com/)
+- 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.
diff --git a/src/markdown-pages/build-apps/howto-use-nrone-table-components.mdx b/src/markdown-pages/build-apps/howto-use-nrone-table-components.mdx
index a0ebd3377..c3f2489da 100644
--- a/src/markdown-pages/build-apps/howto-use-nrone-table-components.mdx
+++ b/src/markdown-pages/build-apps/howto-use-nrone-table-components.mdx
@@ -8,36 +8,48 @@ promote: true
tileShorthand:
title: 'Add a table to your app'
description: 'Add a table to your New Relic One app'
+resources:
+ - title: 'How to use New Relic One table components'
+ url: https://discuss.newrelic.com/t/how-to-use-nr1-table-components/98934
+ - title: 'New Relic SDK documentation'
+ url: https://developer.newrelic.com/client-side-sdk/index.html
+tags:
+ - table in app
+ - Table component
+ - TableHeaderc omponent
+ - TableHeaderCell component
+ - TableRow component
+ - TableRowCell component
+
---
-Tables are a popular way of displaying data in New Relic applications. For example, with the [chart builder](https://docs.newrelic.com/docs/chart-builder/use-chart-builder/get-started/introduction-chart-builder) you can create tables from [NRQL queries](https://docs.newrelic.com/docs/query-data/nrql-new-relic-query-language/getting-started/introduction-nrql).
+Tables are a popular way of displaying data in New Relic applications. For example, with the [query builder](https://docs.newrelic.com/docs/chart-builder/use-chart-builder/get-started/introduction-chart-builder) you can create tables from [NRQL queries](https://docs.newrelic.com/docs/query-data/nrql-new-relic-query-language/getting-started/introduction-nrql).
-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.
+Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application.
-In this guide, you are going to build a sample table using various components of the _NR1_ library.
+In this guide, you are going to build a sample table using various New Relic One components.
-
+
## Before you begin
-Follow the [instructions in New Relic One](https://one.newrelic.com/launcher/developer-center.launcher) to create an API key and download and configure your NR1 CLI profile.
+If you haven't already installed the New Relic One CLI, step through the [quick start in New Relic One](https://one.newrelic.com/launcher/developer-center.launcher). This process also gets you an API key.
-This guide requires that you have Git and node.js installed on your machine.
+In addition, to complete the steps in this guide, you need a GitHub account, and to have Node.js installed on your machine. See [Setting up your development environment](/build-apps/set-up-dev-env) for more info.
-
+
+## Clone and set up the example application
-## Clone the example application
-
-In this guide you are going to experiment with tables. To do that, you need a New Relic One application you can modify and test on your computer.
+Clone the [nr1-how-to](https://github.com/newrelic/nr1-how-to) example application from GitHub to your local machine. Then, navigate to the app directory.
-There's a demo application for you in the [nr1-how-to](https://github.com/newrelic/nr1-how-to) repository. Start by cloning the repository from GitHub to your local machine. Then, navigate to the app directory.
+The example app lets you experiment with tables.
```sh lineNumbers=false copy=false
git clone https://github.com/newrelic/nr1-how-to.git`
@@ -54,16 +66,16 @@ export default class Nr1HowtoAddTimePicker extends React.Component {
super(props)
this.accountId = YOUR_ACCOUNT_ID;
}
- ...
+ ...
}
```
-## Run the demo application
+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](https://developer.newrelic.com/build-tools/new-relic-one-applications/guide-to-authentication--data-access--and-permissions) by invoking the NR1 CLI.
+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](https://developer.newrelic.com/build-tools/new-relic-one-applications/guide-to-authentication--data-access--and-permissions) 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.
@@ -76,55 +88,65 @@ nr1 nerdpack:serve # Serve the demo app locally
-Open [one.newrelic.com/?nerdpacks=local](https://one.newrelic.com/?nerdpacks=local) in your browser. You should see a **Create a table** button in your launcher: That's the demo application you are going to work on. Go ahead and select it.
+Open [one.newrelic.com/?nerdpacks=local](https://one.newrelic.com/?nerdpacks=local) in your browser. Click **Apps*, and then in the **Other apps** section, you should see a **Create a table** launcher. That's the demo application you're going to work on. Go ahead and select it.
![app-launcher](../../images/nrone-table-guide/demo-app-button.png)
-Have a good look at the demo app: There is a `TableChart` on the left side named **Transaction Overview**, with an `AreaChart` next to it. You are going to use `Table` components to add a new table in the second row.
+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.
![app-launcher](../../images/nrone-table-guide/app-overview.png)
-
+
-## Import the Table components
+## Work with table components
+
+
Navigate to the `nerdlets/create-a-table-nerdlet` subdirectory and open the `index.js` file.
Add the following components to the import statement at the top of the file so that it looks like the example:
-* `Table`
-* `TableHeader`
-* `TableHeaderCell`
-* `TableRow`
-* `TableRowCell`
-
+- `Table`
+- `TableHeader`
+- `TableHeaderCell`
+- `TableRow`
+- `TableRowCell`
```jsx lineNumbers=false
import {
- Table, TableHeader, TableHeaderCell, TableRow, TableRowCell, PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart,
+ Table,
+ TableHeader,
+ TableHeaderCell,
+ TableRow,
+ TableRowCell,
+ PlatformStateContext,
+ Grid,
+ GridItem,
+ HeadingText,
+ AreaChart,
+ TableChart,
} from 'nr1';
```
-## Add a basic Table component
+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.
```jsx lineNumbers=false
-
+
```
-## Add the header and rows
+Add the header and rows
As the [`Table`](https://developer.newrelic.com/client-side-sdk/index.html#components/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.
@@ -132,25 +154,25 @@ Inside of the `Table` component, add the `TableHeader` and then a `TableHeaderCe
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()`.
-
```jsx lineNumbers=false
- Application
- Size
- Company
- Team
- Commit
-
-{({ item }) => (
+ Application
+ Size
+ Company
+ Team
+ Commit
+;
+{
+ ({ item }) => (
- {item.name}
- {item.value}
- {item.company}
- {item.team}
- {item.commit}
+ {item.name}
+ {item.value}
+ {item.company}
+ {item.team}
+ {item.commit}
-)}
-
+ );
+}
```
@@ -163,13 +185,13 @@ Take a look at the application running in New Relic One: you should see somethin
-## Replace standard table cells with smart cells
+Replace standard table cells with smart cells
-The NR1 library includes cell components that can automatically format certain data types, like users, metrics, and entity names.
+The 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.
+Before you can use `EntityTitleTableRowCell` and `MetricTableRowCell`, you have to add them to the import statement first.
```jsx lineNumbers=false copy=false
import {
@@ -183,21 +205,25 @@ import {
-Update your table rows by replacing the first and second `TableRowCell`s with entity and metric cells.
+Update your table rows by replacing the first and second `TableRowCell`s with entity and metric cells.
Notice that [`EntityTitleTableRowCell`](https://developer.newrelic.com/client-side-sdk/index.html#components/EntityTitleTableRowCell) and [`MetricTableRowCell`](https://developer.newrelic.com/client-side-sdk/index.html#components/MetricTableRowCell) are self-closing tags.
```jsx lineNumbers=false
-{({ item }) => (
+{
+ ({ item }) => (
-
-
- {item.company}
- {item.team}
- {item.commit}
+
+
+ {item.company}
+ {item.team}
+ {item.commit}
-)}
-
+ );
+}
```
@@ -210,15 +236,15 @@ Time to give your table a second look: The cell components you've added take car
-## Add some action to your table!
+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()`.
+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.
-```jsx lineNumbers=false
+```jsx lineNumbers=false
_getActions() {
return [
{
@@ -243,7 +269,7 @@ _getActions() {
-Find the `TableRow` component in your `return` statement and point the `actions` property to `_getActions()`.
+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.
@@ -266,9 +292,3 @@ Go back to your application and try hovering over any of the rows: Notice how th
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](https://developer.newrelic.com/client-side-sdk/index.html#components/Table).
-
-### Related info
-
-- [Community page for how to use NR1 table components ](https://discuss.newrelic.com/t/how-to-use-nr1-table-components/98934)
-- [New Relic SDK documentation](https://developer.newrelic.com/client-side-sdk/index.html)
-
diff --git a/src/markdown-pages/build-apps/map-pageviews-by-region.mdx b/src/markdown-pages/build-apps/map-pageviews-by-region.mdx
index 6ed0a8814..6a3a11771 100644
--- a/src/markdown-pages/build-apps/map-pageviews-by-region.mdx
+++ b/src/markdown-pages/build-apps/map-pageviews-by-region.mdx
@@ -8,6 +8,15 @@ promote: true
tileShorthand:
title: 'Create a custom map view'
description: 'Build an app to show page view data on a map'
+resources:
+ - title: 'Learn more about querying data'
+ url: https://docs.newrelic.com/docs/query-data/nrql-new-relic-query-language/getting-started/introduction-nrql
+tags:
+ - custom app
+ - map
+ - page views
+ - region
+ - nerdpack
---
@@ -15,8 +24,9 @@ tileShorthand:
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
+- 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.
@@ -27,43 +37,45 @@ Please review the **Before you begin** section to make sure you have everything
## 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](/build-apps/set-up-dev-env)
- 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](https://www.npmjs.com/package/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](https://nodejs.org/en/download/).
+
+- npm, which you'll use during this section of the guide to install [Leaflet](https://www.npmjs.com/package/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](https://nodejs.org/en/download/).
## 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](/explore-docs/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.
-
+- 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](/explore-docs/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
-## Query your browser data
+## Query your browser data
-Use Chart Builder to write a NRQL query to see your page view data, as follows.
+Use Query builder to write a NRQL query to see your page view data, as follows.
-1. On New Relic One, select **Query your data** (in the top right corner), and then select **Advanced (NRQL)**. You'll use NRQL to test your query before dropping the data into your table.
+1. 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.
-2. Copy and paste this query into the query field, and then select **Run**.
+2. Copy and paste this query into a clear query field, and then select **Run**.
```sql
FROM PageView SELECT count(*), average(duration) WHERE appName = 'WebPortal' FACET countryCode, regionCode SINCE 1 week ago LIMIT 1000
```
+
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](https://docs.newrelic.com/docs/browser/new-relic-browser/installation/install-new-relic-browser-agent) installed.
-
@@ -77,6 +89,7 @@ To get started, create a new Nerdpack, and serve it up to New Relic from your lo
```
nr1 create --type nerdpack --name pageviews-app
```
+
2. Serve the project up to New Relic:
```
@@ -90,9 +103,9 @@ cd pageviews-app && nr1 nerdpack:serve
## Review your app files and view your app locally
1. 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](/explore-docs/nerdpack-file-structure.mdx).
+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](/explore-docs/nerdpack-file-structure).
-2. Now in your browser, open `https://one.newrelic.com/?nerdpacks=local` to see the `pageview-apps` Nerdpack that you served up.
+2. 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.
@@ -103,9 +116,11 @@ When you select the launcher, you see a `Hello` message.
## 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](https://docs.newrelic.com/docs/accounts/install-new-relic/account-setup/account-id)).
+
```jsx
const accountId = [Replace with your account ID];
```
+
@@ -117,6 +132,7 @@ To show your data in a table chart, import the [`TableChart` component](/client-
```jsx
import { TableChart } from `nr1`;
```
+
@@ -130,25 +146,26 @@ return Hello, pageview-app-nerdlet Nerdlet! ;
```
with this `export` code:
+
```jsx
export default class PageViewApp extends React.Component {
- render() {
- return
- }
+ render() {
+ return (
+
+ );
+ }
}
```
+
### Customize the look of your table (optional)
-You can use standard CSS to customize the look of your components.
+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.
@@ -169,6 +186,7 @@ Feel free to customize this CSS to your taste.
}
}
```
+
@@ -180,12 +198,18 @@ Now that you've got a table, you can drop a `TableChart` populated with data fro
Put this code into the `row` div.
```jsx
-
+
```
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.
+
@@ -205,6 +229,7 @@ Like you did with the `TableChart` component, you need to import a [`TextField`
```jsx
import { TextField } from 'nr1';
```
+
@@ -213,13 +238,18 @@ import { TextField } from 'nr1';
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".
+
```jsx
- {
- this.setState({ countryCode: event.target.value });
- }} />
+ {
+ this.setState({ countryCode: event.target.value });
+ }}
+ />
```
+
@@ -246,7 +276,14 @@ const { countryCode } = this.state;
Now add `countryCode` to your table chart query.
```jsx
-
+
```
Reload your app to try out the text field.
@@ -266,16 +303,19 @@ To create the map, you use npm to install `Leaflet`.
### Install `Leaflet`
In your terminal, type:
+
```
-npm install --save leaflet react-leaflet
+npm install --save leaflet react-leaflet
```
In your nerdlets `styles.scss` file, import the `Leaflet` CSS:
+
```css
-@import `~leaflet/dist/leaflet.css`
+@import `~leaflet/dist/leaflet.css`;
```
While you're in `styles.scss`, fix the width and height of your map:
+
```css
.containerMap {
width: 100%;
@@ -283,6 +323,7 @@ While you're in `styles.scss`, fix the width and height of your map:
height: 70vh;
}
```
+
@@ -290,6 +331,7 @@ While you're in `styles.scss`, fix the width and height of your map:
### 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`.
+
```jsx
module.exports = {
module: {
@@ -304,13 +346,14 @@ module.exports = {
{
loader: 'url-loader',
options: { limit: 25000 },
- }
- ]
- }
- ]
- }
+ },
+ ],
+ },
+ ],
+ },
};
```
+
@@ -318,9 +361,11 @@ module.exports = {
### Import modules from `Leaflet`
In `index.js`, import modules from `Leaflet`.
+
```jsx
import { Map, CircleMarker, TileLayer } from 'react-leaflet';
```
+
@@ -359,6 +404,7 @@ mapData() {
return query;
};
```
+
@@ -388,36 +434,37 @@ Feel free to change the HTML color code values to your taste. In this example, `
### Set your map's default center point
Set a default center point for your map using latitude and longitude.
+
```jsx
const defaultMapCenter = [10.5731, -7.5898];
```
+
### 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`.
+Between the text field row and the table chart row, insert a new row for the map content using `NerdGraphQuery`.
+
```jsx
-
- {({ loading, error, data}) => {
- if (loading) {
- return
- }
- if (error) {
- return "Error";
- }
- const { results } =
- data.actor.account.mapData;
- console.debug(results);
- return "Hello";
- }
- }
-
-
+
+ {({ loading, error, data }) => {
+ if (loading) {
+ return ;
+ }
+ if (error) {
+ return 'Error';
+ }
+ const { results } = data.actor.account.mapData;
+ console.debug(results);
+ return 'Hello';
+ }}
+
```
+
Reload your application in New Relic One to test that it works.
@@ -429,11 +476,8 @@ Reload your application in New Relic One to test that it works.
Replace `return "Hello";` with:
```jsx
- return
+return (
+
);
})}
-
+
+);
```
+
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!
-
-
-## Related info
-
-- Learn more about [querying data](https://docs.newrelic.com/docs/query-data/nrql-new-relic-query-language/getting-started/introduction-nrql)
-- Check out other guides for [building apps](/build-apps)
-- Join the discussion in our [community portal](https://discuss.newrelic.com/c/build-on-new-relic)
+
diff --git a/src/markdown-pages/build-apps/publish-deploy.mdx b/src/markdown-pages/build-apps/publish-deploy.mdx
index 14e46490a..071455d38 100644
--- a/src/markdown-pages/build-apps/publish-deploy.mdx
+++ b/src/markdown-pages/build-apps/publish-deploy.mdx
@@ -6,19 +6,24 @@ template: 'GuideTemplate'
description: 'Start sharing and using the custom New Relic One apps you build.'
tileShorthand:
title: 'Publish and deploy apps'
- description: 'Start sharing the New Relic apps you build'
+ description: 'Start sharing the apps you build'
redirects:
- /build-tools/new-relic-one-applications/publish-deploy
+ - /build-tools/new-relic-one-applications/guide-to-authentication--data-access--and-permissions
+resources:
+ - title: 'Discover and manage applications'
+ url: https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/discover-manage-applications-new-relic-one-catalog
+ - title: 'Create a "Hello, World!" application'
+ url: /build-apps/build-hello-world-app
---
-When you build a New Relic One app, chances are you'll want to share it with others in your organization. You might even want to share it through our open source channel. But first, you probably want to try it out locally to make sure it's working properly. The following sections describe how to serve your app locally, add it to New Relic One, and then share it with coworkers.
+When you build a New Relic One app, chances are you'll want to share it with others in your organization. You might even want to share it through our open source channel. But first, you probably want to try it out locally to make sure it's working properly. The following sections describe how to serve your app locally, add it to New Relic One, and then share it with coworkers.
-- Serve it locally: During development, you can serve it locally to test it out.
-
-- Publish it: When your application is ready for the world, you can publish and deploy it, and subscribe accounts to it.
+- Serve it locally: During development, you can serve it locally to test it out.
+- Publish it: When your application is ready for the world, you can publish and deploy it, and subscribe accounts to it.
@@ -27,8 +32,8 @@ When you build a New Relic One app, chances are you'll want to share it with oth
This guide requires the following:
- A New Relic One app or Nerdpack
-- New Relic One CLI
-- The Nerdpack manager role for publishing, deploying, and subscribing apps.
+- New Relic One CLI
+- The Nerdpack manager role for publishing, deploying, and subscribing apps.
### About permissions
@@ -38,10 +43,10 @@ The Nerdpack manager role is a [New Relic add-on role](https://docs.newrelic.com
New Relic One requires that only one version (following semantic versioning) of a Nerdpack can be published. Thus, the `nr1 nerdpack:publish` command requires the following:
-- The Nerdpack Manager role
+- The Nerdpack manager role
- A unique version as specified in the version attribute found in the app's `package.json`.
-
+
@@ -49,17 +54,14 @@ New Relic One requires that only one version (following semantic versioning) of
## Serve your app locally
-While developing your application, you can locally serve the Nerdpack, which will display it in New Relic One.
+While developing your application, you can locally serve the Nerdpack, which will display it in New Relic One.
+1. In the parent root folder of your Nerdpack, run `nr1 nerdpack:serve`.
-1. In the parent root folder of your Nerdpack, run `nr1 nerdpack:serve`.
-
-2. Go to [one.newrelic.com/?nerdpacks=local](http://one.newrelic.com/?nerdpack=local). The `?nerdpacks=local` URL suffix will load any locally served Nerdpacks that are available.
-
+2. Go to [one.newrelic.com/?nerdpacks=local](http://one.newrelic.com/?nerdpack=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.
-
@@ -70,7 +72,6 @@ Publishing places your Nerdpack in New Relic One. To publish or deploy, you must
- To publish your Nerdpack, run `nr1 nerdpack:publish`.
-
@@ -79,8 +80,7 @@ Publishing places your Nerdpack in New Relic One. To publish or deploy, you must
Deploying is applying a Nerdpack version to a specific channel (for example, BETA, or STABLE). A channel can only have one Nerdpack version deployed to it at one time. If a channel has an existing Nerdpack associated with it, deploying a new Nerdpack version to that channel will undeploy the previous one. Channels are meant to be an easier way to control application version access than having to be concerned with many specific version numbers.
-1. To deploy an application, run `nr1 nerdpack:deploy`.
-
+1. To deploy an application, run `nr1 nerdpack:deploy`.
@@ -88,14 +88,8 @@ Deploying is applying a Nerdpack version to a specific channel (for example, BET
## Subscribe
-You provide access to the Nerdpacks you create (or manage) by subscribing accounts to them. When you publish and deploy your application, it’s available to you in the New Relic One Catalog. Use the Catalog to manage the information that you want to share about your application, as well as how it appears on the New Relic One home page. Subscribe accounts to your applications with the Catalog too. For information about subscribing, see [Discover and manage applications with New Relic One Catalog](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/discover-manage-applications-new-relic-one-catalog).
+You provide access to the Nerdpacks you create (or manage) by subscribing accounts to them. When you publish and deploy your application, it’s available to you in the New Relic One catalog. Use the catalog to manage the information that you want to share about your application, as well as how it appears on the Apps page. Subscribe accounts to your applications with the catalog too. For information about subscribing, see [Discover and manage applications with New Relic One catalog](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/discover-manage-applications-new-relic-one-catalog).
-
-
-
-### Related info
-
-- [Discover and manage applications with New Relic One](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/discover-manage-applications-new-relic-one-catalog)
-- [Create a "Hello, World!" application](/build-apps/build-hello-world-app)
+
diff --git a/src/markdown-pages/build-apps/set-up-dev-env.mdx b/src/markdown-pages/build-apps/set-up-dev-env.mdx
index 2053d34c5..c125982b1 100644
--- a/src/markdown-pages/build-apps/set-up-dev-env.mdx
+++ b/src/markdown-pages/build-apps/set-up-dev-env.mdx
@@ -4,13 +4,22 @@ duration: '20 min'
title: 'Set up your development environment'
template: 'GuideTemplate'
description: 'Prepare to build apps and contribute to this site'
+resources:
+ - title: New Relic One VSCode extension
+ url: https://marketplace.visualstudio.com/items?itemName=new-relic.nr1
+ - title: 'Guides to build apps'
+ url: /build-apps
+tags:
+ - developer account
+ - API key
+ - New Relic One CLI
---
-If you've decided to build a custom app or modify one of our open source apps, you need a few essential tools:
+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)
+- The [New Relic One command line interface (CLI)](https://one.newrelic.com/launcher/developer-center.launcher?pane=eyJuZXJkbGV0SWQiOiJkZXZlbG9wZXItY2VudGVyLmRldmVsb3Blci1jZW50ZXIifQ==)
- 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:
@@ -18,18 +27,21 @@ Depending on what you want to do with your app, you might have some additional s
- 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](https://github.com/) account - While not strictly necessary for building apps, a GitHub account enables you to [download and customize our open source apps](https://opensource.newrelic.com/explore-projects), and contribute an [open source project](https://opensource.newrelic.com/contributing/).
-- A [New Relic developer account](https://newrelic.com/signup/?partner=Developer+Edition) - if you don't already have one, you can get a free trial account for developing New Relic applications.
-- [npm](https://www.npmjs.com/get-npm) - If you've installed [Node.js](https://nodejs.org/en/download/), 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 [github account](https://github.com/) account - While not strictly necessary for building apps, a GitHub account enables you to [download and customize our open source apps](https://opensource.newrelic.com/explore-projects), and contribute an [open source project](https://opensource.newrelic.com/contributing/).
+- A [New Relic developer account](https://newrelic.com/signup/?partner=Developer+Edition) - if you don't already have one, you can get a free trial account for developing New Relic applications.
+- [npm](https://www.npmjs.com/get-npm) - If you've installed [Node.js](https://nodejs.org/en/download/), 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.
+
-
+Use the [New Relic One VSCode extension](https://marketplace.visualstudio.com/items?itemName=new-relic.nr1) to build your apps.
+
+
## Prepare to build or modify apps
@@ -37,15 +49,15 @@ You must have:
-## Download the CLI and API key
+Download the CLI and API key
On the [Build New Relic One applications page](https://one.newrelic.com/launcher/developer-center.launcher?pane=eyJuZXJkbGV0SWQiOiJkZXZlbG9wZXItY2VudGVyLmRldmVsb3Blci1jZW50ZXIifQ==), 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.
+- 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.
@@ -58,13 +70,13 @@ 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](/build-apps/build-hello-world-app) 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](/build-apps/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.
+- [Map pageviews by region](/build-apps/map-pageviews-by-region) takes you through the steps to create one of our popular open source apps. You learn to add a custom query to an app and view it in a table, then add that data to a map.
-## Contributing to developer.newrelic.com
+Contributing to developer.newrelic.com
This site is open source, and we want your input. Create a pull request if you see a mistake you know how to fix. Drop us a GitHub issue if you see some content gaps you want us to work on. Or write up a whole new guide if you have one you'd like to share. Read on to learn how.
@@ -72,35 +84,30 @@ This site is open source, and we want your input. Create a pull request if you s
-## Edit a page with a pull request
+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](https://github.com/newrelic/developer-website#developernewreliccom). It also enables us to more easily manage incomimg pull requests.
-1. At the top right corner of the page you want to edit, select the edit button (it looks like a pencil).
-2. In GitHub, on the markdown version of the page, select the **Edit this file** button, type your changes.
-3. At the bottom of the page, add a title and description for your pull request, and select **Commit changes**, and then select **Create pull request**.
+- On the [developer-website](https://github.com/newrelic/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](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork) to keep your fork up to date with changes and additions to the main branch upstream.
-## Make a feature or documentation request
+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.
+- 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.
-## Contribute a new guide
+Contribute a new guide
- Check out our [contributors guidelines](https://github.com/newrelic/developer-website/blob/master/CONTRIBUTING.md#creating-new-pages), which will walk you through the process.
-
-
-### Related info
-
-- The [Build apps](/build-apps) overview page links to other helpful guides for building and enhancing apps
-- The [New Relic community site](https://discuss.newrelic.com/c/build-on-new-relic) for ideas and answers from New Relic employees and community members
diff --git a/src/markdown-pages/collect-data/add-custom-attributes.mdx b/src/markdown-pages/collect-data/add-custom-attributes.mdx
index fc6dfa1fc..969893886 100644
--- a/src/markdown-pages/collect-data/add-custom-attributes.mdx
+++ b/src/markdown-pages/collect-data/add-custom-attributes.mdx
@@ -8,18 +8,32 @@ tileShorthand:
description: 'Use custom attributes for deeper analysis'
redirects:
- /build-tools/tools-for-ingesting-data/custom-attributes
+resources:
+ - title: 'New Relic APM: Report custom attributes'
+ url: https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/add-custom-attributes-new-relic-apm-data
+
+ - title: Learn more about NRQL
+ url: /technology/nrql
+tags:
+ - Custom Attributes
+ - NRQL
---
There are countless filters and pivots you might want to apply to your data. By adding custom attributes to your data, you can see beyond your code and analyze your business in-depth.
+
+A common pattern when using custom attributes is to capture user information, such as name, ID, email, and more. This allows you to 'link' your operational data with your business data. For example, if you have the user information, you tie together your service desk and CRM data with the operational data in New Relic.
+
+## Create a custom attribute
+
-You can add a `userid` custom attribute to your APM-reported data (`Transaction` and `TransactionError events`) with the Java APM agent's API.
+Use the open source Java APM agent's API to add a `userid` custom attribute to your APM-reported data, `Transaction` and `TransactionError events`.
```
NewRelic.addCustomParameter("userid", userId);
@@ -27,31 +41,19 @@ NewRelic.addCustomParameter("userid", userId);
-
-
-Once added, you can run a NRQL query that uses the 'userid' custom attribute.
+After you add the `userid` custom attribute, run a NRQL query that uses it.
-Once you have added a custom attribute like 'userid', you can use it to filter and facet your NRQL queries.
+As the query shows, the `userid` attribute enables you to filter and facet your NRQL queries.
-![UC2-sec1-query.png](../../images/add-custom-attributes/UC2-sec1-query.png)
+![custom-attribute-query.png](../../images/custom-attributes/custom-attribute-query.png)
```
-- Get a count of errors experienced by a single filtered userid faceted by date and error message
-SELECT count(*) FROM TransactionError WHERE userid = '616e6472-6577-7340-7961-686f6f2e636f' FACET dateOf(timestamp), `error.message` SINCE 1 week ago
+SELECT count(*) FROM TransactionError WHERE userid = '1401961100' FACET dateOf(timestamp), `error.message` SINCE 1 week ago
```
-
-
-
-
-
-### Related Info
-
-For more information, see [New Relic APM: Report custom attributes](https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/add-custom-attributes-new-relic-apm-data)
-
-For more about the New Relic Query Language, see [Learn more about NRQL](https://developer.newrelic.com/technology/nrql)
diff --git a/src/markdown-pages/collect-data/collect-data-from-any-source.mdx b/src/markdown-pages/collect-data/collect-data-from-any-source.mdx
index f1253d8c5..4c94f32e4 100644
--- a/src/markdown-pages/collect-data/collect-data-from-any-source.mdx
+++ b/src/markdown-pages/collect-data/collect-data-from-any-source.mdx
@@ -10,11 +10,17 @@ tileShorthand:
description: 'APIs, agents, OS emitters - get any data'
redirects:
- /use-cases/collect-data-from-any-source
+tags:
+ - Agent API
+ - Telemetry SDK
+ - Trace API
+ - Metric API
+ - Event API
---
-New Relic products report a lot of data “out of the box.” When you use New Relic products like [APM](https://docs.newrelic.com/docs/apm), [Browser](https://docs.newrelic.com/docs/browser), [Mobile](https://docs.newrelic.com/docs/mobile-monitoring), [Infrastructure](https://docs.newrelic.com/docs/infrastructure), or an [integration](https://docs.newrelic.com/docs/integrations), by default you receive performance data.
+New Relic products report a lot of data “out of the box.” When you use products like [APM](https://docs.newrelic.com/docs/apm), [Browser](https://docs.newrelic.com/docs/browser), [Mobile](https://docs.newrelic.com/docs/mobile-monitoring), [Infrastructure monitoring](https://docs.newrelic.com/docs/infrastructure), or an [integration](https://docs.newrelic.com/docs/integrations), 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.
@@ -26,16 +32,16 @@ But you may want to bring data into New Relic that isn't collected by default. M
## 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 New Relic APM Python agent, you can use the [Python agent API](https://docs.newrelic.com/docs/agents/python-agent/api-guides/guide-using-python-agent-api) to set up custom instrumentation.
+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](https://docs.newrelic.com/docs/agents/python-agent/api-guides/guide-using-python-agent-api) to set up custom instrumentation.
-See the [agent APIs](https://developer.newrelic.com/technology/rest-apis).
+See the [agent APIs](https://docs.newrelic.com/docs/agents).
## Telemetry SDK
-Our Telemetry SDKs are language wrappers for our [Trace API](https://docs.newrelic.com/docs/apm/distributed-tracing/trace-api/introduction-new-relic-trace-api) and [Metric API](https://docs.newrelic.com/docs/introduction-new-relic-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 New Relic customers, we offer open-source exporters and integrations that use the Telemetry SDKs to send metrics and trace data:
+Our Telemetry SDKs are language wrappers for our [Trace API](https://docs.newrelic.com/docs/apm/distributed-tracing/trace-api/introduction-new-relic-trace-api) and [Metric API](https://docs.newrelic.com/docs/introduction-new-relic-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](https://github.com/newrelic/newrelic-istio-adapter)
- Prometheus OpenMetrics ([for Docker](https://docs.newrelic.com/docs/new-relic-prometheus-openmetrics-integration-docker) | [for Kubernetes](https://docs.newrelic.com/docs/new-relic-prometheus-openmetrics-integration-kubernetes))
@@ -51,7 +57,7 @@ Want to build your own solution? [See our Telemetry SDK docs.](https://docs.newr
## Trace API
-New Relic's [Trace API](https://docs.newrelic.com/docs/apm/distributed-tracing/trace-api/introduction-new-relic-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:
+Our [Trace API](https://docs.newrelic.com/docs/apm/distributed-tracing/trace-api/introduction-new-relic-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)
@@ -130,7 +136,7 @@ curl -i -X POST https://metric-api.newrelic.com/metric/v1 \
## Event API
-For sending arbitrary events to New Relic, you can use our Event API. We save these events as a new [event type](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/get-started/glossary#event), which can then be queried in New Relic via NRQL. (Eventually, the Telemetry SDKs will support the Event API.)
+For sending arbitrary events to New Relic, you can use our Event API. We save these events as a new [event type](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/get-started/glossary#event), which can then be queried via NRQL. (Eventually, the Telemetry SDKs will support the Event API.)
```shell lineNumbers=true
curl -i -X POST https://insights-collector.newrelic.com/v1/accounts/$ACCOUNT_ID/events \
diff --git a/src/markdown-pages/collect-data/custom-events.mdx b/src/markdown-pages/collect-data/custom-events.mdx
index 17d9888be..2ba2a450c 100644
--- a/src/markdown-pages/collect-data/custom-events.mdx
+++ b/src/markdown-pages/collect-data/custom-events.mdx
@@ -9,15 +9,17 @@ tileShorthand:
description: 'Define, visualize, and get alerts on the data you want using custom events'
redirects:
- /build-tools/tools-for-ingesting-data/custom-events
+tags:
+ - events
+ - custom events
+ - Agent APIs
---
-## _Measure what you need by creating your own event types._
-
+## Measure what you need by creating your own event types.
Whereas adding [custom attributes](/collect-data/custom-attributes) adds metadata to an existing event, a custom event creates an entirely new event type. Create custom events to define, visualize, and get alerts on additional data, just as you would with any data we provide from our core agents.
-
-_Custom events can be inserted through the Agent APIs or directly via the Insights Insert API. The following example shows how to send a custom event named CLIRun that tracks when a command line tool written in Ruby has its process exit due to an exception._
+Custom events can be inserted through the Agent APIs or directly via the Insights Insert API. The following example shows how to send a custom event named CLIRun that tracks when a command line tool written in Ruby has its process exit due to an exception.
```ruby
# Hook into the runtime 'at_exit' event
@@ -57,14 +59,12 @@ end
```
-_Here, a NRQL query retrieves information about the custom event, and the result can be added to a dashboard._
-
+Here, a NRQL query retrieves information about the custom event, and the result can be added to a dashboard.
![nrql query example](../../images/UC2-sec2-query.png)
-```
+```sql
SELECT count(*) FROM CLIRun FACET errors SINCE 1 week ago
```
-
-[Learn more about custom events.](https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/introduction-event-api)
\ No newline at end of file
+[Learn more about custom events.](https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/introduction-event-api)
diff --git a/src/markdown-pages/collect-data/get-started-nerdgraph-api-explorer.mdx b/src/markdown-pages/collect-data/get-started-nerdgraph-api-explorer.mdx
index 74a6813ac..d8b1d6fa7 100644
--- a/src/markdown-pages/collect-data/get-started-nerdgraph-api-explorer.mdx
+++ b/src/markdown-pages/collect-data/get-started-nerdgraph-api-explorer.mdx
@@ -3,10 +3,22 @@ path: '/collect-data/get-started-nerdgraph-api-explorer'
duration: '25 min'
title: 'Explore NerdGraph using the API Explorer'
template: 'GuideTemplate'
-description: 'Learn to explore NerdGraph, our GraphQL API, and build the queries you need.'
+description: 'Explore NerdGraph, our GraphQL API, and build the queries you need.'
tileShorthand:
title: 'Build queries with NerdGraph'
description: 'Try NerdGraph and build the queries you need'
+redirects:
+ - /technology/graphql
+resources:
+ - title: Introduction to New Relic NerdGraph
+ url: https://docs.newrelic.com/docs/apis/nerdgraph/get-started/introduction-new-relic-nerdgraph
+
+ - title: NerdGraph tutorials
+ url: https://docs.newrelic.com/docs/apis/nerdgraph/tutorials
+tags:
+ - nerdgraph
+ - mutations
+ - nerdgraph query terminal
---
@@ -32,14 +44,14 @@ Make sure you have a valid New Relic API key. You can create one directly from t
## Build a query to retrieve your name
-Time for your first NerdGraph query. You are going to search for your name in the New Relic database:
+Time for your first NerdGraph query. Search for your name in the New Relic database:
1. Erase everything in the query editor.
2. Select the following fields in the query explorer in this order: `actor`, `user`, `name`.
This GraphQL snippet appears in the editor.
-```jsx lineNumbers=false
+```graphql
{
actor {
user {
@@ -68,7 +80,7 @@ Now you can try adding more fields to your query. The simplest way is clicking t
Once again, running the GraphQL query results in just the data you need, without over or under-fetching data. Notice that the `id` field has an argument: passing arguments is a powerful way of customizing your NerdGraph queries. Every field and object can contain arguments, so instead of running multiple queries, you just compose the one that you need.
-```jsx lineNumbers=false
+```graphql
{
actor {
user {
@@ -109,11 +121,11 @@ Unlike REST, GraphQL APIs like NerdGraph can return partial responses. For examp
Let's say that you've built a NerdGraph query you're happy with and you want to test it elsewhere. To capture code-ready queries and mutations:
1. Select the **Tools** menu.
-2. Copy the query as a cURL call or as a [New Relic CLI](...) command.
+2. Copy the query as a curl call or as a [New Relic CLI](...) command.
![Tools menu](../../images/graphql-guide/tools-menu.png)
-```bash lineNumbers=false
+```bash
# cURL version
curl https://api.newrelic.com/graphql \
-H 'Content-Type: application/json' \
@@ -142,8 +154,3 @@ Now you know the basics of composing and testing NerdGraph queries, but how do y
Try creating more complex queries by clicking fields and expanding objects in the Query Builder (be careful with mutations though, since they could write data to your account).
For more information on NerdGraph and explore other projects from the developer community, check out the [threads on the Explorer’s Hub](https://discuss.newrelic.com/search?q=nerdgraph).
-
-## Related info
-
-- [Introduction to New Relic NerdGraph](https://docs.newrelic.com/docs/apis/nerdgraph/get-started/introduction-new-relic-nerdgraph)
-- [NerdGraph tutorials](https://docs.newrelic.com/docs/apis/nerdgraph/tutorials)
diff --git a/src/markdown-pages/collect-data/index.mdx b/src/markdown-pages/collect-data/index.mdx
index a17f48c23..dadd3c1b0 100644
--- a/src/markdown-pages/collect-data/index.mdx
+++ b/src/markdown-pages/collect-data/index.mdx
@@ -7,8 +7,7 @@ description: ''
-Through our agents or APIs, New Relic makes it easy to collect data from any source. The guides in this section provide strategies for collecting and querying data for use in your existing New Relic implementation, or in apps you build. The opportunities are endless.
-
+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.
diff --git a/src/markdown-pages/collect-data/query-data-nrql.mdx b/src/markdown-pages/collect-data/query-data-nrql.mdx
index 7adedc8d8..285e41598 100644
--- a/src/markdown-pages/collect-data/query-data-nrql.mdx
+++ b/src/markdown-pages/collect-data/query-data-nrql.mdx
@@ -8,7 +8,11 @@ tileShorthand:
title: 'Query data with NRQL'
description: 'Query default event data, custom events, and attributes'
redirects:
- - /technology/nrql
+ - /technology/nrql
+tags:
+ - NRQL
+ - NRQL syntax
+ - calculate data NRQL
---
@@ -44,10 +48,10 @@ SELECT function(attribute) [AS 'label'][, ...]
NRQL queries can be as simple as fetching rows of data in a raw tabular form to inspect individual events.
-[Learn what events New Relic agents provide out of the box](https://docs.newrelic.com/docs/insights/insights-data-sources/default-data/insights-default-data-other-new-relic-products)
+[Learn what events open source agents provide out of the box](https://docs.newrelic.com/docs/insights/insights-data-sources/default-data/insights-default-data-other-new-relic-products)
```sql
--- Fetch a list of New Relic Browser PageView events
+-- Fetch a list of Browser PageView events
SELECT * FROM PageView
```
@@ -74,7 +78,7 @@ SELECT funnel(session,
-Using NRQL, you can customize your New Relic experience by crafting diverse dashboards in New Relic One that show your data from multiple angles. These dashboards can be shared with technical and non-technical stakeholders alike.
+Using NRQL, you can customize your New Relic experience by crafting diverse dashboards that show your data from multiple angles. You can share these dashboards with technical and non-technical stakeholders alike.
![Dashboard created with NRQL](../../images/nr1-dashboard.png)
@@ -96,9 +100,9 @@ For an overview of NRQL syntax, see [Introduction to NRQL](https://docs.newrelic
To learn how to query and narrow a large data store by a specific parameter, watch the tutorial on [Filtering queries with NRQL](https://learn.newrelic.com/writing-nrql-queries).
-### Community Forum
+### Community forum
-Connect with other developers in the [New Relic Explorers Hub](http://discuss.newrelic.com/tags/developer).
+Connect with other developers in the [our Explorers Hub](http://discuss.newrelic.com/tags/developer).
### GitHub
diff --git a/src/markdown-pages/explore-docs/intro-to-sdk.mdx b/src/markdown-pages/explore-docs/intro-to-sdk.mdx
index b24496b5d..9085ec7e2 100644
--- a/src/markdown-pages/explore-docs/intro-to-sdk.mdx
+++ b/src/markdown-pages/explore-docs/intro-to-sdk.mdx
@@ -9,16 +9,30 @@ tileShorthand:
redirects:
- /build-tools/new-relic-one-applications/intro-to-sdk
- /client-side-sdk/index
+resources:
+ - title: 'New Relic documentation'
+ url: https://docs.newrelic.com
+ - title: 'How to add a time picker'
+ url: https://discuss.newrelic.com/t/how-to-add-the-time-picker-to-nrql-queries/94268
+ - title: 'Nerdpack boilerplate layouts'
+ url: https://github.com/newrelic?q=layout&type=&language=
+tags:
+ - SDK components
+ - New Relic One apps
+ - UI components
+ - chart components
+ - query and storage components
+ - Platform APIs
---
-To help you build a New Relic One application we provide you with the New Relic One SDK.
-Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch data (New Relic or third-party).
+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 New Relic SDK
+## Components of the SDK
SDK components are located in the Node module package named `nr1`, which you get when you install [the NR1 CLI](/explore-docs/nr1-cli). The `nr1` components can be divided into several categories:
@@ -67,22 +81,22 @@ The **UI components** category of the SDK contains React UI components, includin
### Chart components
-The **Charts** category of New Relic One SDK contains components representing different types of charts. The [`ChartGroup`](/components/chart-group)
+The **Charts** category of the SDK contains components representing different types of charts. The [`ChartGroup`](/components/chart-group)
component helps a group of related charts share data and be aligned.
Some chart components can perform NRQL queries on their own; some accept a customized set of data.
### Query and storage components
-The **Query components** category of the New Relic One SDK contains components for fetching and storing New Relic data.
+The **Query components** category contains components for fetching and storing New Relic data.
-The main way to fetch New Relic data is with NerdGraph, our GraphQL endpoint. This can be queried using [`NerdGraphQuery`](/components/nerd-graph-query). To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see [Queries and mutations](/collect-data/get-started-nerdgraph-api-explorer).
+The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using [`NerdGraphQuery`](/components/nerd-graph-query). To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see [Queries and mutations](/collect-data/get-started-nerdgraph-api-explorer).
We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see [NerdStorage](/explore-docs/nerdstorage).
### Platform APIs
-The Platform API components of the New Relic One SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories:
+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`](/components/platform-state-context): provides read access to the platform URL state variables.
Example: `timeRange` in the time picker.
@@ -91,8 +105,3 @@ The Platform API components of the New Relic One SDK enable your application to
- [`NerdletStateContext`](/components/nerdlet-state-context): provides read access to the Nerdlet URL state variables.
Example: an `entityGuid` in the [entity explorer](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/ui-data/new-relic-one-entity-explorer-view-performance-across-apps-services-hosts).
- [`nerdlet`](/apis/navigation): an object that provides write access to the Nerdlet URL state.
-
-## Related info
-
-- [New Relic documentation](https://docs.newrelic.com)
-- [Community page for how to add a time picker](https://discuss.newrelic.com/t/how-to-add-the-time-picker-to-nrql-queries/94268)
diff --git a/src/markdown-pages/explore-docs/nerdpack-file-structure.mdx b/src/markdown-pages/explore-docs/nerdpack-file-structure.mdx
index 59e1e3add..00ffec6d1 100644
--- a/src/markdown-pages/explore-docs/nerdpack-file-structure.mdx
+++ b/src/markdown-pages/explore-docs/nerdpack-file-structure.mdx
@@ -6,12 +6,22 @@ description: 'An overview of the Nerdpack File Structure'
tileShorthand:
title: 'Nerdpack file structure'
description: 'Learn the structure of Nerdpacks'
+resources:
+ - title: 'Build an app'
+ url: /build-apps
+ - title: 'Intro to New Relic One API components'
+ url: /explore-docs/intro-to-sdk
+tags:
+ - New Relic One CLI
+ - nerdpack
+ - file structure
+ - nerdlets
+ - launchers
---
-A [New Relic One application](https://developer.newrelic.com/use-cases/build-new-relic-one-applications
-"Link opens in a new window.") is represented by a **Nerdpack** folder, which can include one or more **Nerdlet** files,
+A [New Relic One application](/build-apps) 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
@@ -26,10 +36,10 @@ For basic component definitions, see our [component reference](/explore-docs/int
There are two ways to generate a Nerdpack template:
-- **Generate a Nerdpack**: Use the [New Relic One CLI](https://developer.newrelic.com/build-tools/new-relic-one-applications/cli "Link opens in a new window.") 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](https://developer.newrelic.com/build-tools/new-relic-one-applications/cli "Link opens in a new window.") command `nr1 create` and choose either a Nerdlet or a launcher. This may be useful when adding Nerdlets to an existing Nerdpack.
+- **Generate a Nerdpack**: Use the [New Relic One CLI](/nr1-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](/nr1-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 workshop](https://github.com/newrelic/nr1-workshop/blob/master/lab0/INSTRUCTIONS.md "Link opens in a new window.").
+For documentation on generating and connecting Nerdpack components, see [our app building guides](/build-apps) and the [New Relic One CLI command reference](/nr1-cli).
## Nerdpack file structure
@@ -60,6 +70,7 @@ my-nerdlet
├── package-lock.json
└── package.json
```
+
## Nerdlet file structure
@@ -75,7 +86,7 @@ import React from 'react';
export default class MyAwesomeNerdpack extends React.Component {
render() {
- return Hello, my-awesome-nerdpack Nerdlet!
+ return Hello, my-awesome-nerdpack Nerdlet! ;
}
}
```
@@ -92,13 +103,13 @@ The Nerdlet configuration file.
"displayName": "MyAwesomeNerdpack"
}
```
-
-Besides using the [launcher](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/new-relic-one-application-nerdpack-file-structure#launcher-file)
-as the access point for your application, you can also associate the application with
-a monitored entity to get it to appear in the New Relic One [entity explorer](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/ui-data/new-relic-one-entity-explorer-view-performance-across-apps-services-hosts). To do this, add two additional fields to the config file of the first-launched Nerdlet: `entities` and `actionCategory`.
+
+
+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](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/ui-data/new-relic-one-entity-explorer-view-performance-across-apps-services-hosts). To do this, add two additional fields to the config file of the first-launched Nerdlet: `entities` and `actionCategory`.
-In the following example, the Nerdlet has been associated with all New Relic Browser-monitored applications and will appear under the **Monitor** UI category :
+In the following example, the Nerdlet has been associated with all Browser-monitored applications and will appear under the **Monitor** UI category :
```json copy=false lineNumbers=false
{
@@ -106,15 +117,16 @@ In the following example, the Nerdlet has been associated with all New Relic Bro
"id": "my-nerdlet",
"description": "Describe me",
"displayName": "Custom Data",
- "entities": [{"domain": "BROWSER", "type": "APPLICATION"}],
+ "entities": [{ "domain": "BROWSER", "type": "APPLICATION" }],
"actionCategory": "monitor"
}
```
+
-To see this application in the UI, you would go to the New Relic One
+To see this application in the UI, you would go to the
[entity explorer](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/ui-data/new-relic-one-entity-explorer-view-performance-across-apps-services-hosts),
- select Browser applications, and select a monitored application.
+select Browser applications, and select a monitored application.
### `styles.scss`
@@ -122,40 +134,35 @@ An empty SCSS file for styling your application.
### `icon.png`
-The launcher icon that appears on the [one.newrelic.com](http://one.newrelic.com/)
-home page when an application is deployed.
+The launcher icon that appears on the **Apps** page in New Relic One when an application is deployed.
## Launcher file structure
-When an application with a launcher file has been deployed, its launcher is located on the New Relic One home page ([one.newrelic.com](http://one.newrelic.com/ "Link opens in a new window.") ). Note that:
+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](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/new-relic-one-application-nerdpack-file-structure#nerdlet-json).
-- An application can have more than one launcher; this may be desired for an application with multiple Nerdlets.
+- 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.
+
```json copy=false lineNumbers=false
{
- "schemaType": "LAUNCHER",
- "id": "my-awesome-nerdpack-launcher",
- "description": "Describe me",
- "displayName": "MyAwesomeNerdpack",
- "rootNerdletId": "my-awesome-nerdpack-nerdlet"
+ "schemaType": "LAUNCHER",
+ "id": "my-awesome-nerdpack-launcher",
+ "description": "Describe me",
+ "displayName": "MyAwesomeNerdpack",
+ "rootNerdletId": "my-awesome-nerdpack-nerdlet"
}
```
+
-To connect a launcher to a Nerdlet, the `rootNerdletId` must match the `id` in the launched Nerdlet's `nr1.json` config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet.
+To connect a launcher to a Nerdlet, the `rootNerdletId` must match the `id` in the launched Nerdlet's `nr1.json` config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet.
### `icon.png`
-The launcher icon that appears on the [one.newrelic.com](http://one.newrelic.com/ "Link opens in a new window.") home page when an application is deployed.
-
-### Related info
-
-- [Build apps](/build-apps) - start building applications
-- [Intro to New Relic One API components](/explore-docs/intro-to-sdk)
-
+The icon displayed on the launcher for the app on the **Apps** page.
diff --git a/src/markdown-pages/explore-docs/nerdstorage.mdx b/src/markdown-pages/explore-docs/nerdstorage.mdx
index 8c06d6863..54ffa53e7 100644
--- a/src/markdown-pages/explore-docs/nerdstorage.mdx
+++ b/src/markdown-pages/explore-docs/nerdstorage.mdx
@@ -9,6 +9,11 @@ tileShorthand:
description: 'Learn about NerdStorage components'
redirects:
- /build-tools/new-relic-one-applications/nerdstorage
+tags:
+ - nerdstorage
+ - nerdstorage components
+ - new relic one apps
+ - data access
---
@@ -75,10 +80,4 @@ Each of these components can operate declaratively (for example, as part of your
### 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 one of the following roles:
-
-- ```admin```
-- ```owner```
-- ```user```
-- ```all_product_admin```
-- ```standard_user```
\ No newline at end of file
+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](https://docs.newrelic.com/docs/accounts/accounts-billing/new-relic-one-pricing-users/users-roles).
diff --git a/src/markdown-pages/explore-docs/newrelic-CLI.mdx b/src/markdown-pages/explore-docs/newrelic-CLI.mdx
index 9b95dfb6e..8840367ab 100644
--- a/src/markdown-pages/explore-docs/newrelic-CLI.mdx
+++ b/src/markdown-pages/explore-docs/newrelic-CLI.mdx
@@ -4,15 +4,22 @@ duration: ''
title: 'New Relic CLI Reference'
template: 'GuideTemplate'
description: 'The command line tools for performing tasks against New Relic APIs'
+resources:
+ - title: 'Get started with the New Relic CLI'
+ url: /automate-workflows/get-started-new-relic-cli
+ - title: 'New Relic CLI Github repository'
+ url: https://github.com/newrelic/newrelic-cli
+tags:
+ - new relic cli
---
-The New Relic CLI enables integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline.
+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
@@ -28,19 +35,14 @@ Find details for the New Relic CLI command docs in GitHub.
### Commands
-* [newrelic apm](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_apm.md) - Interact with New Relic APM
-* [newrelic completion](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_completion.md) - Generates shell completion functions
-* [newrelic config](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_config.md) - Manage the configuration of the New Relic CLI
-* [newrelic documentation](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_documentation.md) - Generate CLI documentation
-* [newrelic entity](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_entity.md) - Interact with New Relic entities
-* [newrelic nerdgraph](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_nerdgraph.md) - Execute GraphQL requests to the NerdGraph API
-* [newrelic nerdstorage](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_nerdstorage.md) - Read, write, and delete NerdStorage documents and collections.
-* [newrelic nrql](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_nrql.md) - Commands for interacting with the New Relic Database
-* [newrelic profile](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_profile.md) - Manage the authentication profiles for this tool
-* [newrelic version](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_version.md) - Show the version of the New Relic CLI
-* [newrelic workload](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_workload.md) - Interact with New Relic One workloads
-
-
-### Related info
-
-- [Getting started with the New Relic CLI](/automate-workflows/get-started-new-relic-cli)
+- [newrelic apm](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_apm.md) - Interact with New Relic APM
+- [newrelic completion](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_completion.md) - Generates shell completion functions
+- [newrelic config](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_config.md) - Manage the configuration of the New Relic CLI
+- [newrelic documentation](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_documentation.md) - Generate CLI documentation
+- [newrelic entity](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_entity.md) - Interact with New Relic entities
+- [newrelic nerdgraph](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_nerdgraph.md) - Execute GraphQL requests to the NerdGraph API
+- [newrelic nerdstorage](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_nerdstorage.md) - Read, write, and delete NerdStorage documents and collections.
+- [newrelic nrql](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_nrql.md) - Commands for interacting with the New Relic Database
+- [newrelic profile](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_profile.md) - Manage the authentication profiles for this tool
+- [newrelic version](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_version.md) - Show the version of the New Relic CLI
+- [newrelic workload](https://github.com/newrelic/newrelic-cli/blob/master/docs/cli/newrelic_workload.md) - Interact with New Relic One workloads
diff --git a/src/markdown-pages/explore-docs/nr1-catalog.mdx b/src/markdown-pages/explore-docs/nr1-catalog.mdx
new file mode 100644
index 000000000..81e043d9f
--- /dev/null
+++ b/src/markdown-pages/explore-docs/nr1-catalog.mdx
@@ -0,0 +1,64 @@
+---
+path: '/explore-docs/nr1-catalog'
+title: 'New Relic One CLI catalog commands'
+template: 'GuideTemplate'
+description: 'An overview of the CLI commands you can use to manage your New Relic One catalog information.'
+tileShorthand:
+ title: 'Catalog CLI commands'
+ description: 'Manage your New Relic One catalog with our CLI.'
+---
+
+
+
+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`](#nr1-cataloginfo) | Shows the Nerdpack info stored in the catalog. |
+| [`nr1 catalog:submit`](#nr1-catalogsubmit) | 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](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/discover-manage-applications-new-relic-one-catalog#add_images_metadata_to_apps) 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. |
diff --git a/src/markdown-pages/explore-docs/nr1-cli.mdx b/src/markdown-pages/explore-docs/nr1-cli.mdx
index a39a2f00f..a2fa85a2f 100644
--- a/src/markdown-pages/explore-docs/nr1-cli.mdx
+++ b/src/markdown-pages/explore-docs/nr1-cli.mdx
@@ -3,76 +3,114 @@ path: '/explore-docs/nr1-cli'
title: 'New Relic One CLI reference'
template: 'GuideTemplate'
description: 'An overview of the CLI to help you build, deploy, and manage New Relic apps.'
-promote: true
tileShorthand:
title: 'New Relic One CLI reference'
description: 'Learn commands to build and enhance apps'
redirects:
- /build-tools/new-relic-one-applications/cli
+resources:
+ - title: NR1 VS Code extension
+ url: https://marketplace.visualstudio.com/items?itemName=new-relic.nr1
+ - title: Deploy an app
+ url: /build-apps/publish-deploy
+tags:
+ - New Relic One app
+ - nerdpack commands
---
To build a [New Relic One app](/build-apps/build-hello-world-app), you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app.
-
-
-
+
-We provide a variety of tools for building New Relic One apps, including the New Relic One CLI (command line interface). This page will explain how to use [CLI commands](#new-relic-one-cli-commands) to:
+
-- Generate Nerdpack/Nerdlet templates
+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](#new-relic-one-cli-commands) to:
-- Locally serve Nerdpacks (when developing)
+- Generate Nerdpack/Nerdlet templates
-- Publish and deploy
+- Locally serve Nerdpacks (when developing)
-- Subscribe to Nerdpacks
+- Publish and deploy
-- Add screenshots and metadata to the New Relic One Catalog
+- Subscribe to Nerdpacks
+- Add screenshots and metadata to the catalog
## Installing the New Relic One CLI
-From *within* New Relic, go to the [**Build your own application** launcher](https://one.newrelic.com/launcher/developer-center.launcher) and follow the instructions. This launcher will automatically generate an API key for the account you select, and give you the pre-populated commands to create a profile, generate your first "Hello World" app, and serve it locally.
+In New Relic, click **Apps** and then in the **New Relic One catalog** area, click the [**Build your own application** launcher](https://one.newrelic.com/launcher/developer-center.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.
![Build New Relic One application](../../images/developercenter.png)
+
+
+
+Use the [NR1 VS Code extension](https://marketplace.visualstudio.com/items?itemName=new-relic.nr1) to build your apps.
+
+
## New Relic One CLI Commands
-This table gives descriptions and context for some of the most important CLI commands. For details on user permissions, see [Authentication and permissions](/build-apps/set-up-dev-env).
-
-| Topic | Command | Description |
-| --- | --- | --- |
-| Help | `nr1 help` | See all `nr1` commands. For more details about a command, run `nr1 help COMMAND_NAME`. |
-| autocomplete | `nr1 autocomplete` | Displays autocomplete installation instructions. |
-| Set CLI config | `nr1 config:set` | Sets a specific configuration value. |
-| Get CLI config | `nr1 config:get` | Shows a specific configuration. |
-| list CLI config | `nr1 config:list` | Lists your configuration choices. |
-| Delete CLI config | `nr1 config:delete` | Removes the value of a specific configuration. |
-| Update | `nr1 update` | Update to newest version of the CLI. |
-| Profiles | `nr1 profiles` | Controls the profile you'll be running CLI commands as. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. For more on this, see [the workshop](https://github.com/newrelic/nr1-workshop/blob/master/lab-cli/INSTRUCTIONS.md). |
-| Create | `nr1 create` | Create a new component template (Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. For an explanation of the file structure, see [Nerdpack file structure](/explore-docs/nerdpack-file-structure). |
-| Clone | `nr1 nerdpack:clone` | Clone an [open source Nerdpack from our GitHub repository](https://opensource.newrelic.com/explore-projects). |
-| Serve locally | `nr1 nerdpack:serve` | Serves your Nerdpack locally, which makes it visible at [one.newrelic.com/?nerdpacks=local](https://one.newrelic.com/?nerdpacks=local). For details, see [Local development](/client-side-sdk/index.html#cli/LocalDevelopment). |
-| Change associated accounts | `nr1 nerdpack:uuid` | Commands related to the Nerdpack's UUID (universal unique ID). This ID dictates the data a Nerdpack has access to, and who can subscribe to it. To deploy a Nerdpack you didn't make, you'll have to assign it a new UUID. For details, see [Access to data](/build-tools/new-relic-one-applications/guide-to-authentication--data-access--and-permissions#Appaccesstodata) and [the workshop](https://github.com/newrelic/nr1-workshop/blob/master/lab-cli/INSTRUCTIONS.md). |
-| Publish | `nr1 nerdpack:publish` | Publishes your Nerdpack to New Relic. For more on publishing, see [Deploy to New Relic One](/build-tools/new-relic-one-applications/publish-deploy). After publishing, you can use `nr1 nerdpack: deploy` to deploy it to a channel and make it available to users. |
-| Deploy a Nerdpack | `nr1 nerdpack:deploy` | Deploys 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. For more on deploying, see [Deploy to New Relic One](/build-tools/new-relic-one-applications/publish-deploy). |
-| Get Catalog info | `nr1 catalog:info` | Shows the information about your application that's displayed in the New Relic One Catalog. |
-| Submit Catalog information | `nr1 catalog:submit` | Gathers the information you add to the `catalog`directory for your application and saves it to the New Relic One Catalog. See [New Relic One Catalog docs](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/build-new-relic-one/discover-manage-applications-new-relic-one-catalog#add_images_metadata_to_apps) for details on adding screenshots and metadata to your applications to make them easy to find, attractive, and informative. |
-| Subscribe | `nr1 nerdpack:subscribe` | Subscribes an account (the one associated with the API key used to run this command) to a channel (default: STABLE). Can be run with a Nerdpack UUID or run in a specific Nerdpack's directory (the UUID in package.json file is used). An account can only be subscribed to one Nerdpack channel at a time. For more details, see [Deploy to New Relic One](/build-tools/new-relic-one-applications/publish-deploy#Subscribe). |
-| Unsubscribe | `nr1 nerdpack:unsubscribe` | Unsubscribes an account from a Nerdpack whose UUID you provide. The account unsubscribed is the one associated with the API key used to run the command. |
-| NRQL query | `nr1 nrql` | Fetches data from New Relic using [NRQL](https://newrelic.com/docs/query-data/nrql-new-relic-query-language/getting-started/introduction-nrql) (New Relic query language). |
-| Install a plugin | `nr1 plugins:install` | Installs a plugin into the CLI. |
-| Link a plugin | `nr1 plugins:link` | Links a plugin into the CLI for development. |
-| Update a plugins | `nr1 plugins:update` | Updates your installed plugins. |
-| Uninstall a plugin | `nr1 plugins:uninstall` | Removes a plugin from the CLI. |
-| Subscribe to a Nerdpack | `nr1 subscription:set` | Subscribes your account to a Nerdpack and channel. |
-| List subscriptions | `nr1 subscription:list` | Lists all the Nerdpacks your account is subscribed to. |
-| Unsubscribe from Nerdpacks | `nr1 subscription:unset` | Unsubscribes your account from a Nerdpack. |
-
-### Publish and deploy
-
-For details on how to publish and deploy, see [Deploy an app](/build-tools/new-relic-one-applications/publish-deploy).
+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](/build-apps/set-up-dev-env).
+
+For more on how to serve and publish your application, see our guide on [Deploying your New Relic One app](/build-tools/new-relic-one-applications/publish-deploy).
+
+### [Get started](/explore-docs/nr1-common)
+
+| | |
+| ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| [`nr1 help`](/explore-docs/nr1-common/#nr1-help) | Shows all `nr1` commands or details about each command. |
+| [`nr1 update`](/explore-docs/nr1-common/#nr1-update) | Updates to the latest version of the CLI. |
+| [`nr1 create`](/explore-docs/nr1-common/#nr1-create) | Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). |
+| [`nr1 profiles`](/explore-docs/nr1-common/#nr1-profiles) | Manages the profiles you use to run CLI commands. |
+| [`nr1 autocomplete`](/explore-docs/nr1-common/#nr1-autocomplete) | Displays autocomplete installation instructions. |
+| [`nr1 nrql`](/explore-docs/nr1-common/#nr1-nrql) | Fetches data using [NRQL](https://newrelic.com/docs/query-data/nrql-new-relic-query-language/getting-started/introduction-nrql) (New Relic query language). | |
+
+### [Configure your CLI preferences](/explore-docs/nr1-config)
+
+| | |
+| ----------------------------------------------------------------- | ---------------------------------------------- |
+| [`nr1 config:set`](/explore-docs/nr1-config/#nr1-configset) | Sets a specific configuration value. |
+| [`nr1 config:get`](/explore-docs/nr1-config/#nr1-configget) | Shows a specific configuration. |
+| [`nr1 config:list`](/explore-docs/nr1-config/#nr1-configlist) | Lists your configuration choices. |
+| [`nr1 config:delete`](/explore-docs/nr1-config/#nr1-configdelete) | Removes the value of a specific configuration. |
+
+### [Set up your Nerdpacks](/explore-docs/nr1-nerdpack)
+
+| | |
+| --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
+| [`nr1 nerdpack:clone`](/explore-docs/nr1-nerdpack/#nr1-nerdpackclone) | Clones an open source Nerdpack from [our GitHub repository](https://opensource.newrelic.com/explore-projects). |
+| [`nr1 nerdpack:serve`](/explore-docs/nr1-nerdpack/#nr1-nerdpackserve) | Serves your Nerdpack for testing and development purposes. |
+| [`nr1 nerdpack:uuid`](/explore-docs/nr1-nerdpack/#nr1-nerdpackuuid) | Shows or regenerates the UUID of a Nerdpack. |
+| [`nr1 nerdpack:publish`](/explore-docs/nr1-nerdpack/#nr1-nerdpackpublish) | Publishes your Nerdpack to New Relic. |
+| [`nr1 nerdpack:deploy`](/explore-docs/nr1-nerdpack/#nr1-nerdpackdeploy) | Deploys a Nerdpack version to a specific channel. |
+| [`nr1 nerdpack:undeploy`](/explore-docs/nr1-nerdpack/#nr1-nerdpackundeploy) | Undeploys a Nerdpack version from a specific channel. |
+
+### [Manage your Nerdpack subscriptions](/explore-docs/nr1-subscriptions)
+
+| | |
+| --------------------------------------------------------------------------------- | ------------------------------------------------------ |
+| [`nr1 subscription:set`](/explore-docs/nr1-subscription/#nr1-subscriptionset) | Subscribes your account to a Nerdpack and channel. |
+| [`nr1 subscription:list`](/explore-docs/nr1-subscription/#nr1-subscriptionlist) | Lists all the Nerdpacks your account is subscribed to. |
+| [`nr1 subscription:unset`](/explore-docs/nr1-subscription/#nr1-subscriptionunset) | Unsubscribes your account from a Nerdpack. |
+
+### [Install and manage plugins](/explore-docs/nr1-plugins)
+
+| | |
+| -------------------------------------------------------------------------- | -------------------------------------------- |
+| [`nr1 plugins:install`](/explore-docs/nr1-plugins/#nr1-pluginsinstall) | Installs a plugin into the CLI. |
+| [`nr1 plugins:link`](/explore-docs/nr1-plugins/#nr1-pluginslink) | Links a plugin into the CLI for development. |
+| [`nr1 plugins:update`](/explore-docs/nr1-plugins/#nr1-pluginsupdate) | Updates your installed plugins. |
+| [`nr1 plugins:uninstall`](/explore-docs/nr1-plugins/#nr1-pluginsuninstall) | Removes a plugin from the CLI. |
+
+### [Manage catalog information](/explore-docs/nr1-catalog)
+
+| | |
+| -------------------------------------------------------------------- | ----------------------------------------------------------- |
+| [`nr1 catalog:info`](/explore-docs/nr1-catalog/#nr1-cataloginfo) | Shows the Nerdpack info stored in the catalog. |
+| [`nr1 catalog:submit`](/explore-docs/nr1-catalog/#nr1-catalogsubmit) | Gathers and submits the catalog info on the current folder. |
diff --git a/src/markdown-pages/explore-docs/nr1-common.mdx b/src/markdown-pages/explore-docs/nr1-common.mdx
new file mode 100644
index 000000000..8cc32ea41
--- /dev/null
+++ b/src/markdown-pages/explore-docs/nr1-common.mdx
@@ -0,0 +1,192 @@
+---
+path: '/explore-docs/nr1-common'
+title: 'New Relic One CLI common commands'
+template: 'GuideTemplate'
+description: 'An overview of common commands you can use with the New Relic One CLI.'
+tileShorthand:
+ title: 'New Relic One general commands'
+ description: 'Common commands to get you started with the New Relic One CLI.'
+---
+
+
+
+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`](#nr1-help) | Shows all `nr1` commands or details about each command. |
+| [`nr1 update`](#nr1-update) | Updates to the latest version of the CLI. |
+| [`nr1 create`](#nr1-create) | Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). |
+| [`nr1 profiles`](#nr1-profiles) | Manages the profiles you use to run CLI commands. |
+| [`nr1 autocomplete`](#nr1-autocomplete) | Displays autocomplete installation instructions. |
+| [`nr1 nrql`](#nr1-nrql) | Fetches data using [NRQL](https://newrelic.com/docs/query-data/nrql-new-relic-query-language/getting-started/introduction-nrql) (New Relic query language). | |
+
+See our other New Relic One CLI docs for commands specific to [Nerdpack set-up](/explore-docs/nr1-nerdpack), [Nerdpack subscriptions](explore-docs/nr1-subscription), [CLI configuration](/explore-docs/nr1-config), [plugins](/explore-docs/nr1-plugins), or [catalogs](/explore-docs/nr1-catalog).
+
+# 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](/explore-docs/nerdpack-file-structure). For more on how to set up your Nerdpacks, see our [Nerdpack CLI commands](/explore-docs/nr1-nerdpack).
+
+### 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](https://github.com/newrelic/nr1-workshop/blob/master/lab-cli/INSTRUCTIONS.md).
+
+### 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](https://newrelic.com/docs/query-data/nrql-new-relic-query-language/getting-started/introduction-nrql).
+
+### 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. |
diff --git a/src/markdown-pages/explore-docs/nr1-config.mdx b/src/markdown-pages/explore-docs/nr1-config.mdx
new file mode 100644
index 000000000..620529c61
--- /dev/null
+++ b/src/markdown-pages/explore-docs/nr1-config.mdx
@@ -0,0 +1,134 @@
+---
+path: '/explore-docs/nr1-config'
+title: 'New Relic One CLI config commands'
+template: 'GuideTemplate'
+description: 'An overview of the commands you can use to configure your New Relic One CLI preferences.'
+tileShorthand:
+ title: 'Config CLI commands'
+ description: 'Configure your New Relic One CLI preferences.'
+---
+
+
+
+To configure your New Relic One CLI preferences, use the commands below. You can click any command to see its usage options and additional details about the command.
+
+Run `nr1 config:list` to see all your existing configurations and their keys.
+
+
+
+
+
+| Command | Description |
+| ---------------------------------------- | ---------------------------------------------- |
+| [`nr1 config:set`](#nr1-configset) | Sets a specific configuration value. |
+| [`nr1 config:get`](#nr1-configget) | Shows a specific configuration. |
+| [`nr1 config:list`](#nr1-configlist) | Lists your configuration choices. |
+| [`nr1 config:delete`](#nr1-configdelete) | Removes the value of a specific configuration. |
+
+# Command details
+
+---
+
+## `nr1 config:set`
+
+### Set a configuration
+
+Sets a specific configuration value given a configuration key. By default, the command will prompt you for a new value after providing a key, but you can also use the `--k, --key=KEY` option to skip this step.
+
+### Usage
+
+`$ nr1 config:set OPTION`
+
+### Options
+
+| | |
+| ------------------------- | ---------------------------------------------------------------------------------------- |
+| `-k, --key=KEY` | The key of the config. **(required)** |
+| `-V, --value=VALUE` | The value of the config. |
+| `--profile=PROFILE` | The authentication profile you want to use. |
+| `-t, --this-profile-only` | If present, this configuration will only apply while running with the specified profile. |
+| `--verbose` | Adds extra information to the output. |
+
+### Examples
+
+- `$ nr1 config:set --key=proxyEnabled`
+- `$ nr1 config:set --key=proxyEnabled --value=ENABLED`
+
+
+
+---
+
+## `nr1 config:get`
+
+### See your configuration
+
+Shows the value for a specific configuration.
+
+### Usage
+
+`$ nr1 config:get OPTION`
+
+### Options
+
+| | |
+| ------------------- | ------------------------------------------- |
+| `-k, --key=KEY` | The key of the config. **(required)** |
+| `--profile=PROFILE` | The authentication profile you want to use. |
+| `--verbose` | Adds extra information to the output. |
+
+
+
+---
+
+## `nr1 config:list`
+
+### See all your configurations
+
+Shows a list of all your configuration choices, including the configuration key, value, and origin.
+
+### Usage
+
+`$ nr1 config:list`
+
+### Options
+
+| | |
+| ------------------- | ------------------------------------------- |
+| `--profile=PROFILE` | The authentication profile you want to use. |
+| `--verbose` | Adds extra information to the output. |
+
+### Aliases
+
+- `$ nr1 config:ls`
+
+
+
+---
+
+## `nr1 config:delete`
+
+### Remove a configuration
+
+Removes the value of a specific configuration.
+
+### Usage
+
+`$ nr1 config:delete OPTION`
+
+### Options
+
+| | |
+| ------------------------- | ---------------------------------------------------------------------------------------- |
+| `-k, --key=KEY` | The key of the config. **(required)** |
+| `--profile=PROFILE` | The authentication profile you want to use. |
+| `-t, --this-profile-only` | If present, this configuration will only apply while running with the specified profile. |
+| `--verbose` | Adds extra information to the output. |
+
+### Aliases
+
+- `nr1 config:remove`
+- `nr1 config:rm`
+
+### Examples:
+
+- `$ nr1 config:delete --key=proxyHttp`
diff --git a/src/markdown-pages/explore-docs/nr1-nerdpack.mdx b/src/markdown-pages/explore-docs/nr1-nerdpack.mdx
new file mode 100644
index 000000000..0f6837a83
--- /dev/null
+++ b/src/markdown-pages/explore-docs/nr1-nerdpack.mdx
@@ -0,0 +1,163 @@
+---
+path: '/explore-docs/nr1-nerdpack'
+title: 'New Relic One CLI Nerdpack commands'
+template: 'GuideTemplate'
+description: 'An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.'
+tileShorthand:
+ title: 'Nerdpack CLI commands'
+ description: 'Set up your Nerdpacks with the New Relic One CLI.'
+---
+
+
+
+To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command.
+
+
+
+
+
+| Command | Description |
+|---|---|
+| [`nr1 nerdpack:clone`](#nr1-nerdpackclone) | Clones a Nerdpack from a git repository. |
+| [`nr1 nerdpack:serve`](#nr1-nerdpackserve) | Serves your Nerdpack for testing and development purposes. |
+| [`nr1 nerdpack:uuid`](#nr1-nerdpackuuid) | Shows or regenerates the UUID of a Nerdpack. |
+| [`nr1 nerdpack:publish`](#nr1-nerdpackpublish) | Publishes your Nerdpack to New Relic. |
+| [`nr1 nerdpack:deploy`](#nr1-nerdpackdeploy) | Deploys a Nerdpack version to a specific channel. |
+| [`nr1 nerdpack:undeploy`](#nr1-nerdpackundeploy) | Undeploys a Nerdpack version from a specific channel. |
+
+# Command details
+
+***
+
+## `nr1 nerdpack:clone`
+
+### Clone an existing Nerdpack
+Duplicates an existing Nerdpack onto your local computer. You can clone an open source Nerdpack from [our Open Source GitHub repositories](https://opensource.newrelic.com/explore-projects/). After choosing a git repository, this command performs the following actions so that you can start using the Nerdpack:
+1. Clones the repository.
+2. Sets the repository as remote upstream.
+3. Installs all of its dependencies (using npm).
+4. 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](https://one.newrelic.com/?nerdpacks=local), 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](/build-apps/publish-deploy/).
+
+### 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](https://github.com/newrelic/nr1-workshop/blob/master/lab-cli/INSTRUCTIONS.md) 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](/build-tools/new-relic-one-applications/publish-deploy).
+
+### 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](/build-tools/new-relic-one-applications/publish-deploy).
+
+### 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. |
\ No newline at end of file
diff --git a/src/markdown-pages/explore-docs/nr1-plugins.mdx b/src/markdown-pages/explore-docs/nr1-plugins.mdx
new file mode 100644
index 000000000..d679ebcc2
--- /dev/null
+++ b/src/markdown-pages/explore-docs/nr1-plugins.mdx
@@ -0,0 +1,128 @@
+---
+path: '/explore-docs/nr1-plugins'
+title: 'New Relic One CLI plugin commands'
+template: 'GuideTemplate'
+description: 'An overview of the CLI commands you can use to install and manage your plugins.'
+tileShorthand:
+ title: 'Plugin CLI commands'
+ description: 'Install and manage plugins with the New Relic One CLI.'
+---
+
+
+
+To install and manage your plugins, use the commands below. You can click any command to see its usage options and additional details about the command.
+
+
+
+
+
+| Command | Description |
+|---|---|
+| [`nr1 plugins:install`](#nr1-pluginsinstall) | Installs a plugin into the CLI. |
+| [`nr1 plugins:link`](#nr1-pluginslink) | Links a plugin into the CLI for development. |
+| [`nr1 plugins:update`](#nr1-pluginsupdate) | Updates your installed plugins. |
+| [`nr1 plugins:uninstall`](#nr1-pluginsuninstall) | Removes a plugin from the CLI. |
+
+# Command details
+
+***
+
+## `nr1 plugins:install`
+### Install a plugin
+Installs a plugin into the CLI. You can install plugins from npm or a Git URL.
+
+Please note that installing a plugin will override the core plugin.
+
+ For example, if you have a core plugin that has a 'hello' command, then installing a plugin with a 'hello' command will override the core plugin implementation. This is useful if you want to update the core plugin functionality without patching and updating the whole CLI.
+
+### Usage
+`$ nr1 plugins:install PLUGIN`
+
+### Arguments
+* `PLUGIN`: the name, path, or URL of the plugin you want to install. **required**
+
+### Options
+| | |
+|---|---|
+| `-f, --force` | Runs `yarn install --force`. This forces a re-download of all the plugin's packages. |
+| `-h, --help` | Shows CLI help. |
+| `--verbose` | Adds extra information to the output. |
+
+### Examples
+* `$ nr1 plugins:install myplugin`
+* `$ nr1 plugins:install https://github.com/someuser/someplugin`
+* `$ nr1 plugins:install someuser/someplugin`
+
+### Aliases
+* `$ nr1 plugins:add`
+
+
+
+***
+
+## `nr1 plugins:link`
+### Link your plugin
+Links a local plugin into the CLI for development.
+
+Please note that linking a plugin will override your user-installed plugin or core plugin.
+
+For example, if you have a user-installed or core plugin that has a 'hello' command, linking a plugin with a 'hello' command will override the user-installed or core plugin implementation. This is useful for development work.
+
+
+
+### Usage
+`$ nr1 plugins:link PLUGIN`
+
+### Arguments
+* `PLUGIN`: the name, path, or URL of the plugin you want to link. **required**
+
+### Options
+| | |
+|---|---|
+| `-h, --help` | Shows CLI help. |
+| `--verbose` | Adds extra information to the output. |
+
+### Examples
+* `$ nr1 plugins:link myplugin`
+* `$ nr1 plugins:link someuser/someplugin`
+
+
+
+***
+
+## `nr1 plugins:update`
+### Update your plugins
+Updates all of your installed plugins.
+
+### Usage
+`$ nr1 plugins:update`
+
+### Options
+| | |
+|---|---|
+| `-h, --help` | Shows CLI help. |
+| `--verbose` | Adds extra information to the output. |
+
+
+
+***
+
+## `nr1 plugins:uninstall`
+### Uninstall your plugin
+Removes a plugin from the CLI.
+
+### Usage
+`$ nr1 plugins:uninstall PLUGIN`
+
+### Arguments
+* `PLUGIN`: the name of the plugin you want to uninstall. **required**
+
+### Options
+| | |
+|---|---|
+| `-h, --help` | Shows CLI help. |
+| `--verbose` | Adds extra information to the output. |
+
+### Aliases
+* `$ nr1 plugins:unlink`
+* `$ nr1 plugins:remove`
\ No newline at end of file
diff --git a/src/markdown-pages/explore-docs/nr1-subscription.mdx b/src/markdown-pages/explore-docs/nr1-subscription.mdx
new file mode 100644
index 000000000..297a7ca1a
--- /dev/null
+++ b/src/markdown-pages/explore-docs/nr1-subscription.mdx
@@ -0,0 +1,89 @@
+---
+path: '/explore-docs/nr1-subscription'
+title: 'New Relic One CLI subscription commands'
+template: 'GuideTemplate'
+description: 'An overview of the CLI commands you can use to manage your Nerdpack subscriptions.'
+tileShorthand:
+ title: 'Subscription CLI commands'
+ description: 'Manage your Nerdpack subscriptions with the New Relic One CLI.'
+---
+
+
+
+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`](#nr1-subscriptionset) | Subscribes your account to a Nerdpack and channel. |
+| [`nr1 subscription:list`](#nr1-subscriptionlist) | Lists all the Nerdpacks your account is subscribed to. |
+| [`nr1 subscription:unset`](#nr1-subscriptionunset) | 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`
\ No newline at end of file
diff --git a/src/markdown-pages/explore-docs/query-and-store-data.mdx b/src/markdown-pages/explore-docs/query-and-store-data.mdx
index 04dfc315e..8ea3fe1f1 100644
--- a/src/markdown-pages/explore-docs/query-and-store-data.mdx
+++ b/src/markdown-pages/explore-docs/query-and-store-data.mdx
@@ -9,6 +9,10 @@ tileShorthand:
description: 'Reference for query components using NerdGraph'
redirects:
- /build-tools/new-relic-one-applications/query-and-store-data
+tags:
+ - nerdgraph query components
+ - mutation components
+ - static methods
---
@@ -92,6 +96,6 @@ Similarly, a mutation can happen either way; either declaratively or imperativel
- `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](/components), and some examples.
+- `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](/intro-to-sdk), 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.
diff --git a/src/markdown-pages/terms.mdx b/src/markdown-pages/terms.mdx
index 613c482b7..1b3f02a79 100644
--- a/src/markdown-pages/terms.mdx
+++ b/src/markdown-pages/terms.mdx
@@ -5,7 +5,7 @@ description: 'Create custom attributes to filter for the data you need'
template: 'GuideTemplate'
---
-Welcome to New Relic's developer program ("**Developer Program**")! We are excited that you're here. Our intent is to maintain a vibrant software development community. We require that all users that develop on the New Relic platform adhere to these terms.
+Welcome to New Relic's developer program ("**Developer Program**")! We are excited that you're here. Our intent is to maintain a vibrant software development community. We require that all users who develop on the New Relic platform adhere to these terms.
These terms ("**Terms**") apply to participation in the Developer Program and form a legal agreement between you ("**you**" or "**Developer**") and New Relic, Inc. (**"New Relic", "we", "our",** or** "us"**), so please read them carefully. If you are entering into these Terms on behalf of a company, organization or another legal entity, then "you" or "Developer" means that entity, and you represent and warrant that you have the authority to bind that entity to these Terms. Please ensure you have that authority, since otherwise you may not accept these Terms or use the Developer Resources. New Relic may modify these Terms from time to time, subject to Section 19 (Changes to Terms) below. **By clicking "I agree" (or a similar button) or by accessing or using the Developer Resources, you agree to be bound by these Terms.**
diff --git a/src/pages/404.js b/src/pages/404.js
index 2db19a51c..a0135fcbc 100644
--- a/src/pages/404.js
+++ b/src/pages/404.js
@@ -1,34 +1,51 @@
import React from 'react';
import cx from 'classnames';
-import { Link } from 'gatsby';
+import { Link, useStaticQuery, graphql } from 'gatsby';
import SEO from '../components/Seo';
import SkewedContainer from '../components/SkewedContainer';
-import GlobalHeader from '../components/GlobalHeader';
+import { GlobalHeader } from '@newrelic/gatsby-theme-newrelic';
import Footer from '../components/Footer';
import { PageContext } from '../components/PageContext';
import { pageContext } from '../types';
import styles from './404.module.scss';
-const NotFoundPage = ({ pageContext }) => (
-
-
-
-
-
-
- 404
-
- The URL you entered may be broken, or the page has been removed.{' '}
- Go back to the home page.
-
-
-
-
-
+const NotFoundPage = ({ pageContext }) => {
+ const {
+ site: { siteMetadata },
+ } = useStaticQuery(graphql`
+ query {
+ site {
+ siteMetadata {
+ repository
+ }
+ }
+ }
+ `);
+
+ return (
+
+
+
+
+
+
+ 404
+
+ The URL you entered may be broken, or the page has been removed.{' '}
+ Go back to the home page.
+
+
+
+
+
+
-
-
-);
+
+ );
+};
NotFoundPage.propTypes = {
pageContext,
diff --git a/src/pages/developer-champion.js b/src/pages/developer-champion.js
index 7f9fac41b..c391ad51c 100644
--- a/src/pages/developer-champion.js
+++ b/src/pages/developer-champion.js
@@ -1,9 +1,8 @@
import React from 'react';
import cx from 'classnames';
-import Layout from '../components/Layout';
import SEO from '../components/Seo';
-import Button from '../components/Button';
-import PageTitle from '../components/PageTitle';
+import { Button } from '@newrelic/gatsby-theme-newrelic';
+import PageLayout from '../components/PageLayout';
import ExternalLink from '../components/ExternalLink';
import FeatherIcon from '../components/FeatherIcon';
import devChampionHeader from '../images/developer-champion/developer-champions.jpg';
@@ -12,135 +11,155 @@ import styles from './developer-champion.module.scss';
const DeveloperChampionPage = () => {
return (
-
+ <>
- New Relic Developer Champions
-
-
-
- New Relic Champions are the voice of the developer community. As
- experts and innovators, they are given the resources to not only
- share the newest product innovations and updates but also to provide
- feedback of the community back to New Relic product and engineering
- teams.
-
-
- Champions solve big problems using New Relic as their toolkit and
- are recognized as experts and leaders in the New Relic technical
- community.{' '}
-
-
- Nominate a developer champion
-
+
+
+
+
+
+ New Relic Champions are the voice of the developer community. As
+ experts and innovators, they are given the resources to not only
+ share the newest product innovations and updates but also to
+ provide feedback of the community back to New Relic product and
+ engineering teams.
+
+
+ Champions solve big problems using New Relic as their toolkit
+ and are recognized as experts and leaders in the New Relic
+ technical community.{' '}
+
+
+ Nominate a developer champion
+
+
+
+
-
-
-
-
-
- What do Developer Champions do?
-
- New Relic Champions demonstrate expertise in using New Relic products
- by solving large problems and positioning New Relic as a central force
- in their strategies. The New Relic Champions is a recognition and
- partnership program designed to acknowledge the developers that are
- driving innovation within their companies and making top contributions
- to the developer community.They also commit to making their work
- public by:
-
-
-
-
-
-
Open-source contributions
-
- Serving as an open-source author or maintainer for an accepted
- public project related to New Relic One
-
-
-
-
-
Content creation
-
- Authoring two pieces of content in the New Relic Explorers Hub / Dev
- website
-
-
-
-
-
Community engagement
-
- Delivering and/or organizing two events focused on an observability
- platform theme in which New Relic plays a crucial role
-
-
-
- Nominate a Developer Champion{' '}
-
-
-
-
-
-
Why should you join and how will we support?
-
- As a benefit of being a Developer Champion, New Relic provides
- unique access to our Developer Advocacy team and the resources of
- our product organization, as well as specialized recognition and
- rewards.
-
-
Developer Champions benefits:
-
-
- Formal, specialized access to the New Relic Product organization
+
+
+ What do Developer Champions do?
+
+ New Relic Champions demonstrate expertise in using New Relic
+ products by solving large problems and positioning New Relic as a
+ central force in their strategies. The New Relic Champions is a
+ recognition and partnership program designed to acknowledge the
+ developers that are driving innovation within their companies and
+ making top contributions to the developer community.They also
+ commit to making their work public by:
+
+
+
+
+
+
Open-source contributions
+
+ Serving as an open-source author or maintainer for an accepted
+ public project related to New Relic One
+
+
+
+
+
Content creation
+
+ Authoring two pieces of content in the New Relic Explorers Hub /
+ Dev website
+
+
+
+
+
Community engagement
+
+ Delivering and/or organizing two events focused on an
+ observability platform theme in which New Relic plays a crucial
+ role
+
+
+
+ Nominate a Developer Champion{' '}
+
+
+
+
+
+
Why should you join and how will we support?
+
+ As a benefit of being a Developer Champion, New Relic provides
+ unique access to our Developer Advocacy team and the resources
+ of our product organization, as well as specialized recognition
+ and rewards.
+
+
Developer Champions benefits:
- Champions have direct access to the New Relic’s Developer
- Ecosystem team
+ Formal, specialized access to the New Relic Product
+ organization
+
+
+ Champions have direct access to the New Relic’s Developer
+ Ecosystem team
+
+ Custom badge to wear with pride at events
+
+
+
+ Public recognition on the New Relic Developer website and
+ badging in the New Relic Explorers Hub as a Champion
+
+ Exclusive Champion-only swag
+
+ Early access program for some of our products (under NDA)
+
+
+ Priority access to off-site FutureHack events (including when
+ Lew is participating)
+
+
+ Increased Explorer’s Hub support SLA Access to private
+ Developer Champion Explorer’s Hub group
- Custom badge to wear with pride at events
-
-
- Public recognition on the New Relic Developer website and badging
- in the New Relic Explorers Hub as a Champion
-
-
Exclusive Champion-only swag
-
Early access program for some of our products (under NDA)
-
- Priority access to off-site FutureHack events (including when Lew
- is participating)
-
-
- Increased Explorer’s Hub support SLA Access to private Developer
- Champion Explorer’s Hub group
-
-
-
-
-
-
+
+
+
+
+
+ >
);
};
diff --git a/src/pages/developer-champion.module.scss b/src/pages/developer-champion.module.scss
index 632c6c277..f0bf866bd 100644
--- a/src/pages/developer-champion.module.scss
+++ b/src/pages/developer-champion.module.scss
@@ -8,6 +8,10 @@
display: grid;
grid-template-columns: repeat(2, calc(50% - 1rem));
grid-gap: 2rem;
+
+ @media (max-width: 760px) {
+ grid-template-columns: 1fr;
+ }
}
.img {
@@ -18,17 +22,28 @@
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 2rem;
+
+ @media (max-width: 760px) {
+ display: block;
+ text-align: center;
+ }
}
.point {
text-align: center;
+ max-width: 400px;
+ margin: auto;
+
+ @media (max-width: 760px) {
+ margin-bottom: 40px;
+ }
}
.pointIcon {
--feather-icon-stroke-width: 1;
margin-bottom: 2rem;
- color: var(--color-brand-400);
+ color: var(--color-brand-500);
}
.nominateButton {
diff --git a/src/pages/index.js b/src/pages/index.js
index 12f891b58..427c21688 100644
--- a/src/pages/index.js
+++ b/src/pages/index.js
@@ -1,14 +1,14 @@
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
+import { css } from '@emotion/core';
import { graphql, Link } from 'gatsby';
-import Layout from '../components/Layout';
import SEO from '../components/Seo';
-import Button from '../components/Button';
+import { Button } from '@newrelic/gatsby-theme-newrelic';
import GuideListing from '../components/GuideListing/GuideListing';
import GuideTile from '../components/GuideTile/GuideTile';
-import PageTitle from '../components/PageTitle';
+import PageLayout from '../components/PageLayout';
import Video from '../components/Video';
import FeatherIcon from '../components/FeatherIcon';
import ExternalLink from '../components/ExternalLink';
@@ -16,6 +16,7 @@ import { PageContext } from '../components/PageContext';
import { pageContext } from '../types';
import styles from './index.module.scss';
import devChampionBadge from '../images/developer-champion/dev-champion-badge.png';
+import podcastBadge from '../images/podcasts/podcasts-badge.png';
const getStartedGuides = [
{
@@ -42,28 +43,6 @@ const getStartedGuides = [
},
];
-// TODO: Remove the following after the guides have been created
-// const guides = [
-// {
-// minutes: 25,
-// title: 'Provision with Terraform',
-// description: 'Provision an alert policy with notifications using Terraform',
-// path: '/',
-// },
-// {
-// minutes: 15,
-// title: ' Set up dev tools',
-// description: 'Get an API key, download the CLI, and start building apps',
-// path: '/build-apps/set-up-dev-env',
-// },
-// {
-// minutes: 30,
-// title: 'Add a table to your app',
-// description: 'Use New Relic One components to add a table to your app',
-// path: '/build-apps/howto-use-nrone-table-components',
-// },
-// ];
-
const IndexPage = ({ data, pageContext }) => {
const {
allMdx: { nodes },
@@ -74,151 +53,183 @@ const IndexPage = ({ data, pageContext }) => {
return (
-
-
- Observability for every developer
+
+
+
-
-
-
- Whether you're new to New Relic or already a data nerd, you can
- start building right now. For free.
-
-
- With our platform as your foundation, create custom observability
- apps fast. Answer your unique questions, improve your software,
- and deliver new value to your business.
-
-
We're glad you are here. Let's start building.
-
-
-
+
+
+
+
+ New Relic’s Kubernetes cluster explorer empowers Kubernetes
+ nerds to move beyond infrastructure metrics and investigate
+ deeper into applications, traces, logs, and events—with a single
+ click—while staying grounded in a centralized UI. Join us at
+ KubeCon and CloudNativeCon Europe August 17-20 to learn more.
+
-
-
-
-
- Get coding
-
-
- Create an account
-
-
-
- {getStartedGuides.map((guide, index) => (
+
+ Check out the complete schedule of New Relic talks to make the
+ most of your KubeCon experience.{' '}
+ Learn more.
+
+
+
+
+
+
+
+
+
+ Get coding
+
+
+ Create a free account
+
+
+
+ {getStartedGuides.map((guide, index) => (
+
+
+ Start the guide
+
+
+ ))}
+
+
+
+
+
+
+ Get inspired
+
+
+ {guides.map(({ frontmatter }, index) => (
-
- Start the guide
-
-
+ duration={frontmatter.duration}
+ title={frontmatter.tileShorthand?.title || frontmatter.title}
+ description={
+ frontmatter.tileShorthand?.description ||
+ frontmatter.description
+ }
+ path={frontmatter.path}
+ alignment={GuideTile.ALIGNMENT.LEFT}
+ />
))}
-
-
-
-
- Get inspired
-
-
- {guides.map(({ frontmatter }, index) => (
-
- ))}
-
-
- {guides.length === numberOfPromotedGuides && (
-
- setGuides(nodes)}
- variant={Button.VARIANT.NORMAL}
- >
- {`Show ${guidesMinusPromoted} more guides`}
-
-
- )}
-
-
- Looking for more inspiration? Check out the{' '}
-
- open source projects
-
- {' '}
- built by the New Relic community.
-
-
-
+ setGuides(nodes)}
+ variant={Button.VARIANT.NORMAL}
+ >
+ {`Show ${guidesMinusPromoted} more guides`}
+
+
)}
- >
-
-
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.
-
-
+ Looking for more inspiration? Check out the{' '}
+
- Nominate a developer champion
+ open source projects
-
-
- Learn more about developer champions
-
-
-
-
-
+ {' '}
+ 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
+
+
+
+
+
+
+
);
};
diff --git a/src/pages/kubecon-europe-2020.js b/src/pages/kubecon-europe-2020.js
new file mode 100644
index 000000000..159e7c27e
--- /dev/null
+++ b/src/pages/kubecon-europe-2020.js
@@ -0,0 +1,134 @@
+import React from 'react';
+import cx from 'classnames';
+import SEO from '../components/Seo';
+import { Button, Video } from '@newrelic/gatsby-theme-newrelic';
+import PageLayout from '../components/PageLayout';
+import ExternalLink from '../components/ExternalLink';
+import FeatherIcon from '../components/FeatherIcon';
+import kubeconHeader from '../images/kubecon-europe-2020/kubecon-europe-2020.jpg';
+import styles from './kubecon-europe-2020.module.scss';
+import Important from '../components/Important';
+
+const KubeConPage = () => {
+ return (
+ <>
+
+
+
+
+
+
+
+ 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
+
+ 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
+
+
+
+
+
+ >
+ );
+};
+
+export default KubeConPage;
diff --git a/src/pages/kubecon-europe-2020.module.scss b/src/pages/kubecon-europe-2020.module.scss
new file mode 100644
index 000000000..c2d6f7f30
--- /dev/null
+++ b/src/pages/kubecon-europe-2020.module.scss
@@ -0,0 +1,51 @@
+.section {
+ &:not(:last-child) {
+ margin-bottom: 4rem;
+ }
+}
+
+.twoColumn {
+ display: grid;
+ grid-template-columns: repeat(2, calc(50% - 1rem));
+ grid-gap: 2rem;
+
+ @media (max-width: 760px) {
+ grid-template-columns: 1fr;
+ }
+}
+
+.img {
+ width: 100%;
+}
+
+.assetTable {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ grid-gap: 2rem;
+
+ @media (max-width: 760px) {
+ display: block;
+ text-align: center;
+ }
+}
+
+.point {
+ text-align: center;
+ width: 100%;
+
+ @media (max-width: 760px) {
+ margin-bottom: 40px;
+ }
+}
+
+.externalLinkIcon {
+ margin-left: 0.5rem;
+}
+
+.point h4 {
+ min-height: 3rem;
+}
+
+.highlightDiv {
+ margin: auto;
+}
diff --git a/src/pages/podcasts.js b/src/pages/podcasts.js
new file mode 100644
index 000000000..63a2f6549
--- /dev/null
+++ b/src/pages/podcasts.js
@@ -0,0 +1,71 @@
+import React from 'react';
+import cx from 'classnames';
+import SEO from '../components/Seo';
+import PageLayout from '../components/PageLayout';
+import podcastsHeader from '../images/podcasts/podcasts.jpg';
+import styles from './podcasts.module.scss';
+
+const PodcastsPage = () => {
+ return (
+ <>
+
+
+
+
+
+
+
+ Sometimes we talk on the internet about some things. You
+ probably listen to some things on the internet sometimes. We're
+ perfect for each other.
+
+
+ We're in the process of spinning up a few podcasts to bring you
+ all the news, code and pontification that's fit for publication,
+ and rather a lot that isn't as well.
+
+
+ For the time being we have one podcast, so we're including it
+ here for your listening enjoyment.
+
+
+ While it may seem silly to start an entire page for podcasts
+ when we only have the one (we should really have called it
+ 'podcast' page), we had to start somewhere.
+
+
+
+
+ "Omnium rerum principia parva sunt" (All things have small
+ beginnings)
+
+ - Marcus Tullius Cicero (106 BC - 43 BC)
+
+
+
+ We hope you enjoy it. If you don't please feel free to{' '}
+ send us mean emails. {' '}
+ It's internet tradition.
+
+
+
+
+
+
+
+ >
+ );
+};
+
+export default PodcastsPage;
diff --git a/src/pages/podcasts.module.scss b/src/pages/podcasts.module.scss
new file mode 100644
index 000000000..649d76c2f
--- /dev/null
+++ b/src/pages/podcasts.module.scss
@@ -0,0 +1,37 @@
+.section {
+ &:not(:last-child) {
+ margin-bottom: 4rem;
+ }
+}
+
+.twoColumn {
+ display: grid;
+ grid-gap: 2rem;
+ grid-template-columns: repeat(2, calc(50% - 1rem));
+
+ @media (max-width: 760px) {
+ grid-template-columns: 1fr
+ }
+}
+
+.bodyText {
+ @media (max-width: 760px) {
+ order: 1;
+ }
+}
+
+.img {
+ width: 100%;
+ max-width: 350px;
+ margin: 0 auto;
+
+ @media (max-width: 760px) {
+ order: 0;
+ }
+}
+
+.player iframe {
+ width: 100%;
+ height: 421px;
+ border: none;
+}
diff --git a/src/templates/ApiReferenceTemplate.js b/src/templates/ApiReferenceTemplate.js
index bb29016cb..857dbd8d5 100644
--- a/src/templates/ApiReferenceTemplate.js
+++ b/src/templates/ApiReferenceTemplate.js
@@ -2,9 +2,8 @@ import React from 'react';
import cx from 'classnames';
import { graphql } from 'gatsby';
import PropTypes from 'prop-types';
-import CodeBlock from '../components/CodeBlock';
-import Layout from '../components/Layout';
-import PageTitle from '../components/PageTitle';
+import { CodeBlock } from '@newrelic/gatsby-theme-newrelic';
+import PageLayout from '../components/PageLayout';
import Markdown from '../components/Markdown';
import MethodReference from '../components/MethodReference';
import TypeDefReference from '../components/TypeDefReference';
@@ -27,58 +26,61 @@ const ApiReferenceTemplate = ({ data }) => {
} = useApiDoc(api) ?? {};
return (
-
+ <>
- {api}
-
- {apiDescription && (
-
+
+
+ {apiDescription && (
+
)}
- >
-
-
- )}
-
+
- {methods.length > 0 && (
-
- API methods
- {methods.map((method, i) => (
-
- ))}
-
- )}
+ {methods.length > 0 && (
+
+ API methods
+ {methods.map((method, i) => (
+
+ ))}
+
+ )}
- {typeDefs.length > 0 && (
-
- Type definitions
- {typeDefs.map((typeDef, i) => (
-
- ))}
-
- )}
+ {typeDefs.length > 0 && (
+
+ Type definitions
+ {typeDefs.map((typeDef, i) => (
+
+ ))}
+
+ )}
- {constants.length > 0 && (
-
- Constants
- {constants.map((constant, i) => (
-
- ))}
-
- )}
-
+ {constants.length > 0 && (
+
+ Constants
+ {constants.map((constant, i) => (
+
+ ))}
+
+ )}
+
+
+ >
);
};
diff --git a/src/templates/ComponentReferenceTemplate.js b/src/templates/ComponentReferenceTemplate.js
index 499b25f84..b1953a289 100644
--- a/src/templates/ComponentReferenceTemplate.js
+++ b/src/templates/ComponentReferenceTemplate.js
@@ -3,10 +3,9 @@ import cx from 'classnames';
import { graphql } from 'gatsby';
import PropTypes from 'prop-types';
-import CodeBlock from '../components/CodeBlock';
+import { CodeBlock } from '@newrelic/gatsby-theme-newrelic';
import ReferenceExample from '../components/ReferenceExample';
-import Layout from '../components/Layout';
-import PageTitle from '../components/PageTitle';
+import PageLayout from '../components/PageLayout';
import Markdown from '../components/Markdown';
import MethodReference from '../components/MethodReference';
import SEO from '../components/Seo';
@@ -54,68 +53,72 @@ const ComponentReferenceTemplate = ({ data }) => {
} = useComponentDoc(component) ?? {};
return (
-
+ <>
- {component}
-
+
+
+
+
-
+
- {examples.length > 0 && (
-
-
-
Examples
- {examples.map((example, i) => (
-
- ))}
-
-
- )}
+ {examples.length > 0 && (
+
+
+
Examples
+ {examples.map((example, i) => (
+
+ ))}
+
+
+ )}
- {component === 'Icon' && (
-
- )}
+ {component === 'Icon' && (
+
+ )}
-
+
- {methods.length > 0 && (
-
- Methods
- {methods.map((method, i) => (
-
- ))}
-
- )}
+ {methods.length > 0 && (
+
+ Methods
+ {methods.map((method, i) => (
+
+ ))}
+
+ )}
- {typeDefs.length > 0 && (
-
- Type definitions
- {typeDefs.map((typeDef, i) => (
-
- ))}
-
- )}
-
+ {typeDefs.length > 0 && (
+
+ Type definitions
+ {typeDefs.map((typeDef, i) => (
+
+ ))}
+
+ )}
+
+
+ >
);
};
diff --git a/src/templates/GuideTemplate.js b/src/templates/GuideTemplate.js
index cbcfcba64..e7ab0bf29 100644
--- a/src/templates/GuideTemplate.js
+++ b/src/templates/GuideTemplate.js
@@ -1,36 +1,53 @@
import React from 'react';
import { graphql } from 'gatsby';
+import { css } from '@emotion/core';
import PropTypes from 'prop-types';
-import MDXContainer from '../components/MDXContainer';
-import Layout from '../components/Layout';
+import {
+ Contribute,
+ PageUpdated,
+ Resources,
+} from '../components/RelatedContentModules';
+import PageLayout from '../components/PageLayout';
import FeatherIcon from '../components/FeatherIcon';
-import PageTitle from '../components/PageTitle';
import SEO from '../components/Seo';
-import styles from './GuideTemplate.module.scss';
const GuideTemplate = ({ data }) => {
const { mdx } = data;
- const { frontmatter, body, fields } = mdx;
- const { title, description, duration } = frontmatter;
+ const { frontmatter, body } = mdx;
+ const { title, description, duration, tags } = frontmatter;
return (
-
-
-
-
{title}
- {duration && (
-
-
- {duration}
-
- )}
-
- {body}
-
- {`Page last modified on ${fields.gitAuthorTime}`}
-
-
+ <>
+
+
+
+ {duration && (
+
+
+ {duration}
+
+ )}
+
+ {body}
+
+
+ >
);
};
@@ -39,7 +56,7 @@ GuideTemplate.propTypes = {
};
export const pageQuery = graphql`
- query($path: String!) {
+ query($path: String!, $relatedResourceLimit: Int!) {
mdx(frontmatter: { path: { eq: $path } }) {
body
frontmatter {
@@ -47,10 +64,11 @@ export const pageQuery = graphql`
path
title
description
+ tags
}
- fields {
- gitAuthorTime(formatString: "MMMM DD, YYYY")
- }
+
+ ...Resources_page
+ ...PageUpdated_page
}
}
`;
diff --git a/src/templates/GuideTemplate.module.scss b/src/templates/GuideTemplate.module.scss
deleted file mode 100644
index 5ca58a07d..000000000
--- a/src/templates/GuideTemplate.module.scss
+++ /dev/null
@@ -1,73 +0,0 @@
-.mdxContainer {
- > *:first-child {
- margin-top: 0;
- }
-
- code {
- padding: 0.125rem;
- background: var(--tertiary-background-color);
- border-radius: 2px;
- }
-
- p:last-child {
- margin-bottom: 0;
- }
- h1,
- h2 {
- font-weight: bold;
-
- &:not(:first-child) {
- margin-top: 2rem;
- }
- }
-
- h3,
- h4 {
- margin-top: 1rem;
- font-weight: bold;
- }
-
- li {
- margin-bottom: 1rem;
- }
-
- ul li ul {
- margin-top: 1rem;
- line-height: 1;
- }
-
- hr {
- border: 0;
- border-bottom: 1px solid var(--divider-color);
- }
-}
-
-.header {
- display: flex;
- margin-bottom: 2rem;
- align-items: center;
- justify-content: space-between;
- @media screen and (max-width: 1080px) {
- flex-direction: column;
- align-items: flex-start;
- }
-}
-
-.duration {
- display: flex;
- align-items: center;
- color: var(--secondary-text-color);
-}
-
-.clock {
- margin-right: 0.25rem;
-}
-
-.lastUpdated {
- display: flex;
- flex-direction: row;
- justify-content: flex-end;
- font-size: 0.875rem;
- font-style: italic;
- margin-top: 4rem;
-}
diff --git a/src/templates/OverviewTemplate.js b/src/templates/OverviewTemplate.js
index d65ce367b..862fd81c6 100644
--- a/src/templates/OverviewTemplate.js
+++ b/src/templates/OverviewTemplate.js
@@ -2,8 +2,7 @@ import React from 'react';
import { graphql, Link } from 'gatsby';
import PropTypes from 'prop-types';
-import Layout from '../components/Layout';
-import PageTitle from '../components/PageTitle';
+import PageLayout from '../components/PageLayout';
import MDXContainer from '../components/MDXContainer';
import GuideListing from '../components/GuideListing/GuideListing';
import GuideTile from '../components/GuideTile/GuideTile';
@@ -17,37 +16,43 @@ const OverviewTemplate = ({ data }) => {
const { title, description } = frontmatter;
return (
-
+ <>
- {title}
- {body}
- {!!guides?.nodes.length && (
- <>
- {`Guides to ${title.toLowerCase()}`}
-
-
- {guides?.nodes.map(({ frontmatter }, index) => (
-
- ))}
-
-
- >
- )}
-
+
+
+
+ {body}
+ {!!guides?.nodes.length && (
+ <>
+ {`Guides to ${title.toLowerCase()}`}
+
+
+ {guides?.nodes.map(({ frontmatter }, index) => (
+
+ ))}
+
+
+ >
+ )}
+
+
+ >
);
};
diff --git a/src/theme.scss b/src/theme.scss
deleted file mode 100644
index 8683313b8..000000000
--- a/src/theme.scss
+++ /dev/null
@@ -1,53 +0,0 @@
-.light-mode {
- --primary-background-color: var(--color-white);
- --primary-text-color: var(--color-neutrals-700);
- --primary-text-hover-color: var(--color-neutrals-600);
- --primary-surface-background-color: var(--color-white);
-
- --secondary-background-color: var(--color-neutrals-100);
- --secondary-text-color: var(--color-neutrals-600);
- --secondary-text-hover-color: var(--color-neutrals-700);
- --secondary-surface-background-color: var(--color-white);
-
- --tertiary-background-color: var(--color-neutrals-200);
-
- --accent-text-color: var(--color-neutrals-500);
- --link-color: var(--color-brand-800);
- --border-color: var(--color-neutrals-400);
- --border-hover-color: var(--color-neutrals-500);
- --divider-color: var(--color-neutrals-100);
- --heading-text-color: var(--color-neutrals-900);
- --boxshadow: 0 0.24905px 0.55345px rgba(0, 0, 0, 0.00562291),
- 0 0.59851px 1.33002px rgba(0, 0, 0, 0.00807786),
- 0 1.12694px 2.50431px rgba(0, 0, 0, 0.01),
- 0 2.01027px 4.46726px rgba(0, 0, 0, 0.0119221),
- 0 3.75998px 8.35552px rgba(0, 0, 0, 0.0143771),
- 0 9px 20px rgba(0, 0, 0, 0.02);
-}
-
-.dark-mode {
- --primary-background-color: #1c2a2f;
- --primary-text-color: var(--color-dark-700);
- --primary-text-hover-color: var(--color-dark-900);
- --primary-surface-background-color: var(--primary-background-color);
-
- --secondary-background-color: var(--color-dark-050);
- --secondary-text-color: var(--color-dark-600);
- --secondary-text-hover-color: var(--color-dark-700);
- --secondary-surface-background-color: var(--color-dark-100);
-
- --tertiary-background-color: var(--color-dark-100);
-
- --accent-text-color: var(--color-dark-600);
- --link-color: var(--color-brand-400);
- --border-color: var(--color-dark-400);
- --border-hover-color: var(--color-dark-500);
- --divider-color: var(--color-dark-200);
- --heading-text-color: var(--color-dark-900);
- --boxshadow: 0 1.66035px 2.10311px rgba(3, 15, 16, 0.0393604),
- 0 3.99006px 5.05408px rgba(3, 15, 16, 0.056545),
- 0 7.51293px 9.51638px rgba(3, 15, 16, 0.07),
- 0 13.4018px 16.9756px rgba(3, 15, 16, 0.083455),
- 0 25.0666px 31.751px rgba(3, 15, 16, 0.10064),
- 0 60px 76px rgba(3, 15, 16, 0.14);
-}
diff --git a/src/utils/sdk.js b/src/utils/sdk.js
index 786954413..4f24476d6 100644
--- a/src/utils/sdk.js
+++ b/src/utils/sdk.js
@@ -1,6 +1,6 @@
const BASE_URL =
'//hypertext-sandbox.nr-assets.net/wanda--wanda-ec-ui--nr1-docs';
-const RELEASE = 'release-1093';
+const RELEASE = 'release-1339';
export const JS_BUNDLE = `${BASE_URL}-${RELEASE}.js`;
export const CSS_BUNDLE = `${BASE_URL}-${RELEASE}.css`;
diff --git a/static/tessen.min-1.3.0.js b/static/tessen.min-1.3.0.js
new file mode 100644
index 000000000..bdd996940
--- /dev/null
+++ b/static/tessen.min-1.3.0.js
@@ -0,0 +1,2 @@
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Tessen=t():e.Tessen=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="/",t(0)}([function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c.default.trace("Loading Tessen");var n=new f.default;Array.isArray(e)||n.add("Plugins should be an Array"),(0,y.default)(t)||n.add("Configuration should be an Object literal"),n.hasErrors()||(e.indexOf("NewRelicInsights")==-1&&0==k&&e.push("NewRelicInsights"),e.forEach(function(e){E[e]&&new E[e](t[e]||{})}))}},{key:"debugLevel",value:function(e){return c.default.level(e),c.default.log("Set debug level to "+e+" ("+["disabled","errors and logs","verbose"][e]+")"),c.default.level()}},{key:"identify",value:function(){for(var e={},t=arguments.length,n=Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t.trackOrPage=b.TRACK_EVENT_TYPES.page,c.default.trace("Tessen.page()",e,t,n);var r=new m.default(e,t,n);if(!r.valid())return!1;T={name:e,properties:t,config:n};var i=p.default.registered();for(var o in i)if(i.hasOwnProperty(o)){var a=p.default.registered()[o];a.queuePage(e,t,n)}}},{key:"track",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t.trackOrPage=b.TRACK_EVENT_TYPES.track,c.default.trace("Tessen.track()",e,t,n);var r=p.default.registered(),i=new m.default(e,t,n);if(!i.valid())return!1;for(var o in r)if(r.hasOwnProperty(o)){var a=p.default.registered()[o];a.queueTrack(e,t,n)}return!0}},{key:"version",get:function(){return g.default}},{key:"lastPageContext",get:function(){return T}},{key:"locations",get:function(){return b.LOCATIONS}}]),e}();window.Tessen=window.Tessen||O,"undefined"!=typeof e&&e.exports&&(e.exports=O)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n0&&(t=console).error.apply(t,arguments)}},{key:"log",value:function(){var t;e.level()>0&&(t=console).log.apply(t,arguments)}},{key:"trace",value:function(){var t;e.level()>1&&(t=console).log.apply(t,arguments)}}]),e}();e.exports=a},function(e,t){"use strict";!function(e){e.console||(e.console={});for(var t,n,r=e.console,i=function(){},o=["memory"],a="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");t=o.pop();)r[t]||(r[t]={});for(;n=a.pop();)"function"!=typeof r[n]&&(r[n]=i)}("undefined"==typeof window?void 0:window)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n1?t-1:0),r=1;r0}},{key:"errorMessages",get:function(){return this.errors.map(function(e){return e.message})}}]),e}();e.exports=a},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},r=arguments[1];o(this,e),this.__name=r,l.default.trace("new "+this.__name+"()",n);var i=new d.default;Object.defineProperty(this,"_hasIdentified",{value:!1,configurable:!0}),this.eventQueue=[],this.promises={},this.options=(0,_.default)({identifiable:!0},n),this.validateConfiguration()?(this.register(),this.promises.initialize=this.initialize(),this.promises.initialize.then(function(){l.default.trace(t.__name+" initialized"),t.options.identifiable&&t.hasGloballyIdentified()&&t.queueIdentify(),t.options.identifiable||t.drainEventQueue()},function(e){i.add("Error loading API for "+t.__name,{pluginName:t.__name,reason:e})})):i.add(this.__name+" was not loaded")}return a(e,[{key:"drainEventQueue",value:function(){var e=this;l.default.trace(this.__name+".drainEventQueue()");var t=this.eventQueue.slice(0);t.filter(function(e){return e.untracked()}).forEach(function(n){n.markTracked(),l.default.trace(e.__name+".track()",n),e.track(n).then(function(n){t.splice(t.indexOf(n),1),e.eventQueue=t,l.default.trace('"'+n.eventNameFormatted+'" tracked successfully for '+e.__name)},function(e){var t=new d.default;t.add(e)})})}},{key:"hasIdentified",value:function(e){return"boolean"==typeof e&&(Object.defineProperty(this,"_hasIdentified",{value:e,configurable:!0}),l.default.trace(this.__name+".hasIdentified()",e)),this._hasIdentified}},{key:"hasGloballyIdentified",value:function(){return S}},{key:"identify",value:function(){}},{key:"initialize",value:function(){return new T.Promise(function(e,t){setTimeout(function(){e(!0)},1)})}},{key:"page",value:function(){}},{key:"queueIdentify",value:function(){var e=this;if(this.identifyQueued)return!1;this.identifyQueued=!0,l.default.trace(this.__name+".queueIdentify()");var t=new d.default;this.options.identifiable?this.promises.initialize.then(function(){S=!0,e.hasIdentified(!0),l.default.trace(e.__name+".identify()");var t=e.identify();"function"==typeof(t||{}).then?t.then(function(){e.identifyQueued=!1},function(){e.identifyQueued=!1}):e.identifyQueued=!1,e.drainEventQueue()},function(e){}):t.add("Could not identify because plugin is not identifiable",{pluginName:this.__name})}},{key:"queuePage",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};l.default.trace(this.__name+".queuePage()",e,t,r);var i=new d.default;this.promises.initialize.then(function(){try{l.default.trace(n.__name+".page()",e,t,r),n.page(e,t,r)}catch(o){i.add(n.__name+".page() could not be called",{name:e,properties:t,config:r},o)}},function(e){})}},{key:"queueTrack",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};l.default.trace(this.__name+".queueTrack()",e,n);var i=new d.default;return e||i.add("eventName is required"),"string"!=typeof e&&i.add("eventName must be a string"),n&&!(0,h.default)(n)&&i.add("properties should be a plain object"),!i.hasErrors()&&(this.eventQueue.push(new v.default(e,n,r)),void this.promises.initialize.then(function(){(!t.options.identifiable||t.options.identifiable&&t.hasIdentified())&&t.drainEventQueue()},function(e){}))}},{key:"register",value:function(){k[this.__name]=this,l.default.trace(this.__name+" registered")}},{key:"$script",value:function(e,t){l.default.trace(this.__name+".$script()",e);var n=new d.default;e||n.add("You must specify a file to load"),n.hasErrors()||(0,w.default)(e,t)}},{key:"track",value:function(e){return new T.Promise(function(t,n){t(e)})}},{key:"validateConfiguration",value:function(){var e=new d.default;return!e.hasErrors()}},{key:"guid",get:function(){return I.get("TSNGUID")},set:function(e){I.set("TSNGUID",e,{path:"/",expiresIn:31536e3})}},{key:"identity",get:function(){return O}}],[{key:"registered",value:function(){return k}},{key:"setIdentity",value:function(){for(var e=arguments.length,t=Array(e),n=0;n1&&(0,h.default)(t[1])?(i=t[1],(0,h.default)(t[2])&&(a=(0,_.default)(a,t[2]))):r.add("Traits argument must be an Object literal"));for(var u in E)i[u]&&r.add(u+" should be passed as "+E[u]);O.traits=i,O.userId=o,O.config=a}}]),e}();e.exports=P},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:(0,s.default)(window.location.hostname);o(this,e),this.domain=t}return a(e,[{key:"destroy",value:function(e){this.set(e,null,{expiresIn:-3600})}},{key:"get",value:function(e){var t=document.cookie.split(";").map(function(e){return e.trim().split("=")}).reduce(function(e,t){return e[t[0]]=t[1],e},{});return t[e]}},{key:"set",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=new Date,a=r.path,u=r.expiresIn,s=(n={},i(n,e,t),i(n,"domain",this.domain),n);a&&(s.path=a),u&&(s.expires=new Date(o.getTime()+1e3*u).toUTCString()),document.cookie=Object.keys(s).map(function(e){return e+"="+s[e]}).join(";")}}]),e}();t.default=c,e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.split(".").splice(-2,2).join(".")},e.exports=t.default},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o(this,e);var i=n.pageName?n.pageName:n.nr_subproduct,a=n.pageComponent?n.pageComponent:n.category,u=[i,a,t].join("_");n.tessenVersionNumber=v.default;var s={id:{value:y++},eventName:{value:t},eventNameFormatted:{value:u},properties:{value:n},config:{value:r},_tracked:{value:!1,configurable:!0}};this.__name="TrackEvent",Object.defineProperties(this,s)}return a(e,[{key:"markTracked",value:function(){Object.defineProperty(this,"_tracked",{value:!0})}},{key:"tracked",value:function(){return this._tracked}},{key:"untracked",value:function(){return!this._tracked}},{key:"valid",value:function(){var e=this,t=new s.default,n=l.LOCATIONS,r=n.mobapps,i=n.nr1,o=n.private,a=n.public,u=n.seldon,c=n.wanda,f=this.properties,p=f.interactionType,v=f.location,y=f.trackOrPage,h=void 0;if(this.eventName||t.add("eventName is required"),l.CAMEL_CASE.test(this.eventName)||t.add("eventName must be camelCase"),this.properties.category&&!l.TITLE_CASE.test(this.properties.category)&&t.add("category property must be Title Case"),!v)return t.add(l.VALIDATION_MESSAGES.locationInvalid),!t.hasErrors();switch(v.toLowerCase()){case i:case c:l.REQUIRED_PROPERTIES.nr1.forEach(function(n){e.properties[n]||t.add(n+" property is required")}),l.OPTIONAL_PROPERTIES.nr1.forEach(function(t){if(!e.properties[t]){var n="`"+t+"`"+l.VALIDATION_MESSAGES.nr1Optional;d.default.trace(n)}}),h=l.NR1_EVENT_TYPES[y],p&&!h[p]&&t.add('Value "'+p+'" for `interactionType` property is invalid for the combination of location "nr1" and the use of `Tessen.page()` or `Tessen.track()`.');break;case o:case u:case a:case r:v===o&&d.default.log(l.VALIDATION_MESSAGES.locationPrivate),l.REQUIRED_PROPERTIES.seldon.forEach(function(n){e.properties[n]||t.add(n+" property is required")});break;default:t.add(l.VALIDATION_MESSAGES.locationInvalid)}return!t.hasErrors()}}]),e}();e.exports=h},function(e,t){"use strict";function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r,i={mobapps:"mobapps",nr1:"nr1",private:"private",public:"public",seldon:"seldon",wanda:"wanda"};Object.freeze(i);var o={nr1:["currentAuthorizedAccounts","location","pageComponent","pageName"],seldon:["location","nr_product","nr_subproduct","category"]},a={nr1:["dashboardID","chartID","entityIDs","interactionType","isUserInteraction"]},u={locationInvalid:'You must provide a valid value for `location`. Valid values are "nr1", "seldon", "public", and "mobapps".',locationPrivate:'"private" is no longer valid for `location` and should be changed to "seldon".',nr1Optional:" property is optional but frequently used in NR1."},s={page:"page",track:"track"},c=(r={},n(r,s.page,{view:"view"}),n(r,s.track,{click:"click",drag:"drag",hover:"hover",keystroke:"keystroke"}),r),l={helix:"helix",newrelic:"newrelic"};Object.freeze(l);var f={production:"production",staging:"staging"};Object.freeze(f);var d={};d[f.production]="intercom-auth.service.newrelic.com",d[f.staging]="intercom-auth.staging-service.newrelic.com",Object.freeze(d),e.exports={CAMEL_CASE:/^[a-z]+([A-Z][a-z]*|[0-9]+)*$/,INTERCOM_INSTANCES:l,INTERCOM_AUTH_ENVIRONMENTS:f,INTERCOM_AUTH_HOSTNAMES:d,LOCATIONS:i,NR1_EVENT_TYPES:c,OPTIONAL_PROPERTIES:a,REQUIRED_PROPERTIES:o,TITLE_CASE:/^((^| )[A-Z\d][\w-]+)+$/,TRACK_EVENT_TYPES:s,VALIDATION_MESSAGES:u}},function(e,t,n){"use strict";e.exports="1.3.0"},function(e,t){"use strict";function n(e){if("object"==("undefined"==typeof e?"undefined":r(e))&&null!==e){if("function"==typeof Object.getPrototypeOf){var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}return"[object Object]"==Object.prototype.toString.call(e)}return!1}var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=n},function(e,t){"use strict";function n(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n1)for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:{};return i(this,t),e=(0,h.default)({identifiable:!0},e),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"NewRelic"))}return a(t,e),u(t,[{key:"identify",value:function(){var e=this;return new g(function(t,n){for(var r in e.identity.traits)if(e.identity.traits.hasOwnProperty(r)){var i=e.identity.traits[r];window.newrelic.setCustomAttribute(r,i)}e.guid=e.guid||e.options.guid||(0,_.default)(),window.newrelic.setCustomAttribute("guid",e.guid),t(!0)})}},{key:"initialize",value:function(){var e=this;return new g(function(t,n){e.retry(function(e){return window.newrelic&&"function"==typeof window.newrelic.addPageAction},5,100,function(e,n){c.default.trace("window.newrelic found after "+(n+1)+" tries"),t(!0)},function(e){n("window.newrelic could NOT be found after "+e+" tries")})})}},{key:"page",value:function(e,t){var n=new v.default(e,t);this.track(n)}},{key:"retry",value:function(e,t,n,r,i,o){var a=this;o=o||t;var u=e(),s=o-t;u?r(u,s):t>0?setTimeout(function(){a.retry(e,--t,2*n,r,i,o)},n):i(s)}},{key:"track",value:function(e){var t=this;return new g(function(n,r){e&&e.__name&&"TrackEvent"==e.__name?(window.newrelic.addPageAction(e.eventNameFormatted,(0,h.default)({},t.identity.traits,e.properties)),n(e)):r("`event` must be a valid TrackEvent instance")})}}]),t}(d.default);e.exports=w},function(e,t){"use strict";function n(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};i(this,t),e=(0,y.default)(e,{
+identifiable:!1});var n={key:{get:function(){return"staging"==r._currentEnv()?"1mz1pjBqh38DZUSw8gjG-YrM6dBNqk7i":"9lWE0ITAJr03cUUQAFN7N-4wvgOojjwp"}},url:{get:function(){return"https://"+r._collectorUrl()+"/v1/accounts/"+r.accountId+"/events"}},accountId:{get:function(){return"staging"==r._currentEnv()?1478838:1002319}},defaultEventType:{value:"TessenAction"},customStagingPatterns:{get:function(){return e.additionalStagingUrlPatterns||[]}}},r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"NewRelicInsights"));return Object.defineProperties(r,n),r}return a(t,e),u(t,[{key:"track",value:function(e){return this.submitEvent(this.accountId,e)}},{key:"page",value:function(e,t){var n=new c.default(e,t);this.track(n)}},{key:"submitEvent",value:function(e,t){var n=this;return new h(function(r,i){var o=new p.default;if((!Number.isInteger(e)||e<=0)&&o.add("accountId must be a positive integer"),t.valid()||o.add("Event object must be valid."),o.hasErrors())return void i(o);var a=(0,y.default)({},n.identity.traits,t.properties);a.eventType=n.defaultEventType,a.eventName=t.eventNameFormatted;var u=new XMLHttpRequest;u.open("POST",n.url),u.setRequestHeader("Content-Type","application/json"),u.setRequestHeader("X-Insert-Key",n.key),u.onreadystatechange=function(){if(u.readyState==XMLHttpRequest.DONE){if(!(u.status>=200&&u.status<=299))return o.add(u.responseText),void i(o);r(t)}},u.send(JSON.stringify(a))})}},{key:"_collectorUrl",value:function(){return"staging"==this._currentEnv()?"insights-collector.newrelic.com":"staging-insights-collector.newrelic.com"}},{key:"_currentEnv",value:function(){var e=this.customStagingPatterns.concat([/staging|localhost|rpm-branch/]),t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;if(a.test(window.location.host))return"staging"}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}return"production"}}]),t}(f.default);e.exports=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return i(this,t),e=(0,m.default)({identifiable:!0},e),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"Segment"))}return a(t,e),u(t,[{key:"identify",value:function(){var e=this,t=this.identity.config,n=this.identity.userId,r={identity:{name:null},group:{}},i=[],o=new f.default,a=t.Segment||{};for(var u in this.identity.traits)if(this.identity.traits.hasOwnProperty(u)){var s=this.identity.traits[u];T.indexOf(u)!==-1?r.identity[u]=s:r.group[u]=s}return r.identity.customer_user_full_name&&(r.identity.name=r.identity.customer_user_full_name),r.group.customer_account_name&&(r.group.name=r.group.customer_account_name),i.push(new b.Promise(function(t,i){var o=function(n,i){window.analytics.user().anonymousId(null),i.Intercom=i.Intercom||{},i.Intercom.user_hash=n,window.intercomSettings=window.intercomSettings||{},window.intercomSettings.user_hash=n,c.default.trace("Identifying to Intercom with user ID and user hash"),window.analytics.identify(e.identity.userId,r.identity,i,function(){return t(!0)})},u=function(e){n=void 0,c.default.trace("Identifying to Intercom as an anonymous user"),window.analytics.user().anonymousId(),window.analytics.user().traits(r.identity),window.analytics.user().save();var t=window.Intercom&&window.Intercom.booted?"update":"boot";window.Intercom(t,e)};n?e.getUserHash(n).then(function(e){return o(e,a)}).catch(function(e){c.default.log("Tessen.js encountered an error trying to retrieve the user's hashed email for Intercom identification: "+e.status+" "+e.statusText),u(a)}):u(a)})),r.group.customer_account_id||r.group.current_customer_account_id?i.push(new Promise(function(e){c.default.trace("analytics.group()",r.group.current_customer_account_id||r.group.customer_account_id,r.group),window.analytics.group(r.group.current_customer_account_id||r.group.customer_account_id,r.group,function(){e(!0)})})):c.default.log("`analytics.group()` was not fired because the `customer_account_id` or `current_customer_account_id` trait was not set"),new b.Promise(function(t,n){b.Promise.all(i).then(function(e){t(!0)},function(t){o.add(e.__name+" had a problem identifying the user")})})}},{key:"initialize",value:function(){var e=arguments,t=this,n=new f.default;return new b.Promise(function(r,i){function o(e){return"You are incorrectly attempting to "+e+" multiple instances of Segment's analytic.js library (used internally by Tessen.js's Segment plugin). Make sure to call `Tessen.load()` only one time in your application."}if(window.analytics.initialize&&(n.add(o("initialize")),i(!0)),window.analytics.invoked&&(n.add(o("invoke")),i(!1)),!n.hasErrors()){window.analytics.invoked=!0,window.analytics.methods=E,window.analytics.factory=function(t){return function(){var n=Array.prototype.slice.call(e);return n.unshift(t),window.analytics.push(n),window.analytics}};for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{},r=new y.default(e,t,n);window.analytics.page(r.eventNameFormatted,t,n.Segment||{}),window.analytics.track(r.eventNameFormatted,t||{},{integrations:{All:!1,Intercom:!0,"Amazon Kinesis Firehose":!0}})}},{key:"track",value:function(e){var t=this;return new b.Promise(function(n,r){"TrackEvent"==e.__name?(window.analytics.track(e.eventNameFormatted,(0,m.default)({},t.identity.traits,e.properties),e.config.Segment||{}),n(e)):r("`event` must be a valid TrackEvent instance")})}},{key:"validateConfiguration",value:function(){var e=new f.default;return this.options.writeKey||e.add("You must provide a Segment Write Key. Get it at Segment > Project Settings > Keys"),!e.hasErrors()}},{key:"getUserHash",value:function(e){var t=this.getIntercomAuthUrl(),n=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);return new b.Promise(function(r,i){if(!n)return void i("Intercom authentication requires a valid email address");var o=function(e,t){return{status:e,statusText:t}},a=(new f.default,new XMLHttpRequest);new Headers;a.open("GET",t+"?email="+encodeURIComponent(e)),a.withCredentials=!0,a.onerror=function(e){i(o(a.status,a.statusText))},a.onreadystatechange=function(){if(a.readyState===XMLHttpRequest.DONE){if(a.status>=200&&a.status<=299)try{var e=JSON.parse(a.responseText);r(e.hmac)}catch(e){i(o(a.status,a.statusText))}i(o(a.status,a.statusText))}},a.send()})}},{key:"getIntercomInstance",value:function(e){return e.indexOf("helix.newrelic.com")>1?w.INTERCOM_INSTANCES.helix:w.INTERCOM_INSTANCES.newrelic}},{key:"getIntercomAuthUrl",value:function(){var e=this.getIntercomInstance(window.location.hostname),t=window.location.hostname.indexOf(w.INTERCOM_AUTH_ENVIRONMENTS.staging)===-1?w.INTERCOM_AUTH_HOSTNAMES.production:w.INTERCOM_AUTH_HOSTNAMES.staging;return"https://"+t+"/api/v1/"+e+"/hmac"}}]),t}(p.default);e.exports=k},function(e,t){"use strict";var n=function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,n)};e.exports=n}])});
\ No newline at end of file