); } // Imperative way (using promises). async function getAccountList() { let data = {}; try { data = await AccountsQuery.query(); } catch (error) { console.log('Failed to retrieve list: ' + error.message); return; } return data.actor.accounts.map((account) => { return account.name; }); } Copy Similarly, a mutation can happen either way; either declaratively or imperatively. NrqlQuery NrqlQuery deserves additional explanation, because there are multiple formats in which you can return data from it. To provide maximum functionality, all three are exposed through a formatType property. You can find its different values under NrqlQuery.formatType: NERD_GRAPH: Returns the format in which it arrives from NerdGraph. RAW: The format exposed by default in Insights and dashboards when being plotted as JSON. This format is useful if you have a pre-existing script in this format that you're willing to migrate to or incorporate with. CHART: The format used by the charting engine that we also expose. You can find a more detailed explanation of how to manipulate this format in the guide to chart components, and some examples. If you are willing to push data, we currently do not expose NrqlMutation. To do that, see the Event API for how to add custom events.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Reference guide for SDK query components using NerdGraph",
+ "sections": [
+ "Query and store data",
+ "Components overview",
+ "Query components",
+ "Mutation components",
+ "Static methods",
+ "NrqlQuery"
+ ],
+ "title": "Query and store data",
+ "popularity": 1,
+ "external_id": "cbbf363393edeefbc4c08f9754b43d38fd911026",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/query-and-store-data/",
+ "published_at": "2020-08-13T01:50:34Z",
+ "updated_at": "2020-08-01T01:42:02Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.002621669,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Queryand store data",
+ "sections": "Queryand store data",
+ "info": "Reference guide for SDK query components usingNerdGraph",
+ "body": ", EntityByGuidQuery, EntityByNameQuery. Storage queries: New Relic One provides a simple storage mechanism that we call NerdStorage. This can be used by Nerdpack creators to store application configuration setting data, user-specific data, and other small pieces of data. Components in this category"
+ },
+ "id": "5efa989e28ccbc2f15307deb"
}
],
- "/terms": [
+ "/automate-workflows/get-started-terraform": [
+ {
+ "body": "In order to provide a unified experience, we're deprecating Synthetics monitor alert notifications and alert conditions violations, and replacing these pages with a new synthetic monitor overview experience in New Relic One. This new experience provides visibility into a monitor's open violations and alert conditions with the monitor results in a single view, removing the need to open multiple tabs to view violations or alert conditions. For more information, check the EoL Announcements page. If you want to receive alert notifications when a synthetic monitor fails, you can configure the alert notification either while creating a monitor or after you have created one. You can configure your monitor's alert policy directly from the Synthetics UI or via the Alerts UI for existing monitors. To identify which monitors do not have policies assigned to them, review their color-coded health status. Add a synthetic monitor to alert policies A monitor can be included in multiple alert policies. You can view the alert policies and conditions for the selected monitor from the Synthetics UI or from the Alerts UI. To add an existing monitor to an alert policy: Go to one.newrelic.com > Alerts & AI > Policies. From the list of existing alert policies, use the search box or scroll the list to locate one or more alert policies where the monitor has not already been added. Open the policy, then click Add a condition. Click Synthetics and then select the monitor. Fill out the remaining settings and click Create condition. Existing monitor: Remove from alert policy To remove an existing monitor from an existing alert policy: Go to one.newrelic.com > Alerts & AI > Policies. From the list of existing alert policies, use the search box or scroll the list to locate one or more alert policies where the monitor has not already been added. Select the trash can (delete) icon on the monitor's row. Receive alert notifications on a three-strike basis Synthetic alert notifications operate on a three-strike basis, sending an alert after three monitor attempts from a single location return an error. Your alert policy configuration and notification channel settings will determine when you receive alerts for specific monitors and locations. If you monitor a non-public app and add your selected public minion IPs to your allow list, you may very infrequently receive a false downtime alert. When a synthetic monitoring data center goes down, New Relic may decide to temporarily use an alternate host, which results in the temporary server's IP being blocked by your app. Mute (disable) monitor's alert notifications To temporarily disable alerting for a monitor, mute it: Go to one.newrelic.com > Synthetics > Monitors > (select a monitor). Click General under the Settings menu in the left menu sidebar. Click the Notifications button to Off. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Synthetic monitoring / Synthetic monitoring / Using monitors",
+ "info": "New Relic can use alerts to notify you about synthetic monitors's failures.",
+ "nodeid": 6371,
+ "sections": [
+ "Synthetic monitoring",
+ "Getting started",
+ "Guides",
+ "Using monitors",
+ "Monitor scripting",
+ "Administration",
+ "Private locations",
+ "UI pages",
+ "Synthetics API",
+ "Troubleshooting",
+ "Alerts for synthetic monitoring",
+ "Add a synthetic monitor to alert policies",
+ "Existing monitor: Remove from alert policy",
+ "Receive alert notifications on a three-strike basis",
+ "Mute (disable) monitor's alert notifications",
+ "For more help"
+ ],
+ "title": "Alerts for synthetic monitoring",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/synthetics/synthetic-monitoring/using-monitors/alerts-synthetic-monitoring",
+ "popularity": 1,
+ "external_id": "b69353439d3cc180ca46c64bef5e8470cdda1636",
+ "category_1": "Synthetic monitoring",
+ "category_2": "Using monitors",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/synthetics/synthetic-monitoring/using-monitors/alerts-synthetic-monitoring",
+ "published_at": "2020-08-10T21:03:10Z",
+ "updated_at": "2020-08-10T21:03:10Z",
+ "category_0": "Synthetic monitoring",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.64609873,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Alerts for syntheticmonitoring",
+ "sections": "Mute (disable) monitor's alert notifications",
+ "info": "New Relic can use alerts to notify you about syntheticmonitors's failures.",
+ "category_0": "Syntheticmonitoring",
+ "category_1": "Syntheticmonitoring",
+ "category_2": "Using monitors",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/synthetics/synthetic-monitoring/using-monitors/alerts-synthetic-monitoring",
+ "body": " the alert notification either while creating a monitor or after you have created one. You can configure your monitor's alert policy directly from the Synthetics UI or via the Alerts UI for existing monitors. To identify which monitors do not have policies assigned to them, review their color-coded health",
+ "breadcrumb": "Contents / Synthetic monitoring / Synthetic monitoring / Using monitors"
+ },
+ "id": "5f31b60e196a6742d2fbd6c8"
+ },
+ {
+ "body": "Depending on the selected channel type, different values appear. Reference for updating channels Here's a quick reference for updating channels which also includes links to more detailed information and procedures. Add or remove policies assigned to a channel To add or remove policies assigned to a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. Choose a channel, and then click Alert policies. From the selected policy, use the windows to select, remove, or clear all notification channels. Assign a channel to policies To add a notification channel to one or more policies: Go to one.newrelic.com, in the top nav click Alerts & AI, click Policies. Choose a policy, click Notification channels, and then click Add notification channels. Choose a channel, and then click Update policy. Change a channel's name To rename an existing notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels, then choose a channel. From the Channel details, change the name (maximum 64 characters) based on the channel type if applicable, and then save. Check for policies assigned to a user To check whether an account user has any policies assigned: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. Optional: Search by \"user\" to browse users or a specific username or email. Choose the user, then click Alert policies. Check how many policies are assigned to a channel To check whether a notification channel has any policies assigned: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. The Policy subscriptions column lists how many policies are assigned to the channel. Create more channels To create a new notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. Click New notification channel. Delete a channel To delete a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. In the list, click the Delete icon. Test a saved channelView assigned alert policies To view the policies assigned to a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels, choose a channel, and then click Alert policies. OR To view the notification channels assigned to a policy: Go to one.newrelic.com, in the top nav click Alerts & AI, click Policies, choose a policy, then click Notification channels. Basic process Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels, then choose a channel. From the Channel details page, make any necessary changes, and then save. The user interface shows a Last modified time stamp for any changes to policies, including their conditions and notification channels. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert notifications",
+ "info": "Read about how to update alerts notification channels. ",
+ "nodeid": 6481,
+ "sections": [
+ "New Relic Alerts",
+ "Get started",
+ "Alert policies",
+ "Alert conditions",
+ "Alert violations",
+ "Alert Incidents",
+ "Alert notifications",
+ "Troubleshooting",
+ "Rules, limits, and glossary",
+ "Alerts and Nerdgraph",
+ "REST API alerts",
+ "Update alert notification channels",
+ "Reference for updating channels",
+ "Basic process",
+ "For more help"
+ ],
+ "title": "Update alert notification channels",
+ "popularity": 1,
+ "external_id": "ee8bce401d0623e8b85d84a6a20bd8a72b9764ef",
+ "category_1": "New Relic Alerts",
+ "category_2": "Alert notifications",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/update-alert-notification-channels",
+ "published_at": "2020-08-11T06:42:27Z",
+ "updated_at": "2020-08-11T06:42:27Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.61570364,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Update alert notificationchannels",
+ "sections": "Update alert notificationchannels",
+ "info": "Read about how to update alerts notificationchannels. ",
+ "category_2": "Alert notifications",
+ "body": " to a notificationchannel: Go to one.newrelic.com, in the top nav click Alerts & AI, click Notification channels. Choose a channel, and then click Alert policies. From the selected policy, use the windows to select, remove, or clear all notification channels. Assign a channel to policies To add"
+ },
+ "id": "5f2dbad928ccbcb8ca88dfed"
+ },
+ {
+ "body": "If you delete a channel, you cannot restore it. If you want to keep the notification channel, you can remove it from any associated policy. Delete a channel To delete a channel permanently: Go to alerts.newrelic.com > Notification channels. Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Optional: To find the notification channel easily, search the Notification channels index. From the Notification channels index, select the channel's delete icon, and then select the confirmation prompt to cancel or continue. When you delete (or remove) a channel, any policies associated with it will still remain. You must delete policies separately. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert notifications",
+ "info": "You can delete alerts notification channels permanently or you can keep channels but remove them from associated policies.",
+ "nodeid": 6471,
+ "sections": [
+ "New Relic Alerts",
+ "Get started",
+ "Alert policies",
+ "Alert conditions",
+ "Alert violations",
+ "Alert Incidents",
+ "Alert notifications",
+ "Troubleshooting",
+ "Rules, limits, and glossary",
+ "Alerts and Nerdgraph",
+ "REST API alerts",
+ "Delete alert notification channels",
+ "Delete a channel",
+ "For more help"
+ ],
+ "title": "Delete alert notification channels",
+ "popularity": 1,
+ "external_id": "dcea3b60f23ddeb74a7a0a0f44a5130cd9e2885d",
+ "category_1": "New Relic Alerts",
+ "category_2": "Alert notifications",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/delete-alert-notification-channels",
+ "published_at": "2020-08-11T04:16:54Z",
+ "updated_at": "2020-08-11T04:16:54Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.611537,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Delete alert notificationchannels",
+ "sections": "Delete alert notificationchannels",
+ "info": "You can delete alerts notificationchannels permanently or you can keep channels but remove them from associated policies.",
+ "category_2": "Alert notifications",
+ "body": "If you delete a channel, you cannot restore it. If you want to keep the notificationchannel, you can remove it from any associated policy. Delete a channel To delete a channel permanently: Go to alerts.newrelic.com > Notification channels. Go to one.newrelic.com, in the top nav click Alerts & AI"
+ },
+ "id": "5f2dbb3628ccbc65c788dfcb"
+ },
+ {
+ "body": "You must save a new notification channel or any changes to an existing notification channel before testing it. Alerts will then send a test message to your chosen destination. Request the test To test a notification channel: Go to one.newrelic.com, in the top nav click Alerts & AI, then click Notification channels. Follow standard procedures to add a new notification channel or to update an existing notification channel, and save it. Select a notification channel, and then click Envelope Message Icon Send a test notification. Review the test confirmation message, and then click Got it. Troubleshoot the test results A confirmation message will automatically show up in the user interface that indicates where the test was sent (for example, email) and whether it was successful. Also, the test notification message itself includes detailed information, including: The person who requested the test Links to policies for the channel Links to all notification channels and policies for the account When troubleshooting problems, review the test notification message, and verify the setup requirements for the type of notification channel you selected. If necessary, make additional changes to your notification channel, and test it again as needed. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "type": "docs",
+ "document_type": "page",
+ "breadcrumb": "Contents / Alerts and Applied intelligence / New Relic Alerts / Alert notifications",
+ "info": "Be sure to save your alerts notification channels before testing them to make sure they're working properly.",
+ "nodeid": 6491,
+ "sections": [
+ "New Relic Alerts",
+ "Get started",
+ "Alert policies",
+ "Alert conditions",
+ "Alert violations",
+ "Alert Incidents",
+ "Alert notifications",
+ "Troubleshooting",
+ "Rules, limits, and glossary",
+ "Alerts and Nerdgraph",
+ "REST API alerts",
+ "Test alert notification channels",
+ "Request the test",
+ "Troubleshoot the test results",
+ "For more help"
+ ],
+ "title": "Test alert notification channels",
+ "popularity": 1,
+ "external_id": "fcea4cf920f099fa1fcf7fab3760d57bdf2e02b7",
+ "category_1": "New Relic Alerts",
+ "category_2": "Alert notifications",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/test-alert-notification-channels",
+ "published_at": "2020-08-11T04:16:54Z",
+ "updated_at": "2020-08-11T04:16:54Z",
+ "category_0": "Alerts and Applied intelligence",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.611537,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Test alert notificationchannels",
+ "sections": "Test alert notificationchannels",
+ "info": "Be sure to save your alerts notificationchannels before testing them to make sure they're working properly.",
+ "category_2": "Alert notifications",
+ "body": "You must save a new notificationchannel or any changes to an existing notificationchannel before testing it. Alerts will then send a test message to your chosen destination. Request the test To test a notificationchannel: Go to one.newrelic.com, in the top nav click Alerts & AI, then click"
+ },
+ "id": "5f2dbb3664441fd3a556a97c"
+ },
+ {
+ "body": "Products & Pricing Solutions Help Center About LEARN Docs Build on New Relic Explore open source projects Training GET HELP Community forum Global technical support Expert services The Platform New Relic One Capabilities Programmability Infinite Tracing Integrations Security Alerts New Relic for Android and iOS Insights Manage Complex Systems Logs Metrics and Traces Applied Intelligence Serverless Improve Client-side Experiences Browser Mobile Synthetics Build and Run Better Software APM Infrastructure BY TOPIC DevOps Cloud Adoption 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 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 Feature Idea: How to get notification channel information for a Synthetic monitor with REST API? Support: Full-Stack Observability (FSO) Synthetic restapi featureidea synthetic Alan_Tsui December 31, 2019, 10:36am #1 Hi all, Specifically, how can I get a list of notification channel email addresses of each Synthetic monitor with REST API? Regards, Alan New Relic Edit I want this too I have more info to share (reply below) I have a solution for this 0 voters We take feature ideas seriously and our product managers review every one when plotting their roadmaps. However, there is no guarantee this feature will be implemented. This post ensures the idea is put on the table and discussed though. So please vote and share your extra details with our team. philweber December 30, 2019, 2:34pm #2 Hi, @Alan_Tsui: I think you will have to: Get a list of all alert policies For each alert policy, check if it includes Synthetic monitors Get a list of all alert channels Compare the channels[links][policy_ids] list of each alert channel with the list of Synthetics-containing alert policies from Step 2 1 Like stefan_garnham December 30, 2019, 4:25pm #3 That is really painful. I hear a feature request being warmed up Alan_Tsui December 31, 2019, 12:55am #4 Thank you @philweber for your confirmation. And yes @stefan_garnham, it’s very painful… May I know which feature request did you refer to? stefan_garnham December 31, 2019, 8:32am #5 I meant that your original enquiry would make a great feature request. An API method to get the notification channels for a synthetic would be a great new feature. RyanVeitch December 31, 2019, 10:34am #6 Hey @Alan_Tsui - @stefan_garnham is right, a clean solution for this doesn’t currently exist. I have created a feature idea for you, and I have converted your post into a feature idea poll 1 Like Alan_Tsui December 31, 2019, 1:46pm #7 Hi @RyanVeitch, Please loop me in. Happy new year~ 1 Like RyanVeitch December 31, 2019, 2:20pm #8 Thanks Alan, Happy New Year to you too. We’ll try to keep this thread up to date as we hear more on the feature idea! @Alan_Tsui -Ryan. anon85944545 December 31, 2019, 9:22pm #9 I agree that the nested queries via API can be a bit troublesome; but just in case you need a solution faster than the FR can be implemented; you can try this out: note: this is based on a few of the functions I keep in my public Github repo results: image.png932×222 52.5 KB PowerShell script: #region Top of Script #requires -version 2 <# .SYNOPSIS Queries the New Relic API to audit alert policies and their associated Synthetics alert conditions and notification channels .DESCRIPTION Requires the Account API Key for the target account .NOTES Version: 1.0 Author: Zack Mutchler Creation Date: 12/31/2019 Purpose/Change: Initial script development. #> #endregion #####-----------------------------------------------------------------------------------------##### #region Script Parameters Param( [ Parameter( Mandatory = $true ) ] [ValidateNotNullOrEmpty() ] [ string ] $AccountAPIKey ) #endregion Script Parameters #####-----------------------------------------------------------------------------------------##### #region Functions # Create a function to enumerate all Alert Policies for an account Function Get-NRAlertPolicies { Param ( [ Parameter (Mandatory = $true ) ] [ string ] $AccountAPIKey, [ Parameter (Mandatory = $false ) ] [ string ] $FilterName, [ Parameter (Mandatory = $false ) ] [ ValidateSet( 'true', 'false' ) ] [ string ] $ExactMatch = 'false' ) # Set the target URI if no FilterName is provided If ( ( !$FilterName ) ) { $getPoliciesUri = \"https://api.newrelic.com/v2/alerts_policies.json\" } # Set the target URI with provided filter Else { $getPoliciesUri = \"https://api.newrelic.com/v2/alerts_policies.json/?filter[name]=\" + $FilterName + '&filter[exact_match]=' + $ExactMatch } # Set the headers to pass $headers = @{ 'X-Api-Key' = $AccountAPIKey; 'Content-Type' = 'application/json' } # Query the API $results = ( Invoke-RestMethod -Method Get -Uri $getPoliciesUri -Headers $headers ).policies RETURN $results } # Create a function to enumerate all Synthetics Alert Conditions for an account Function Get-NRSyntheticsConditions { Param ( [ Parameter (Mandatory = $true ) ] [ string ] $AccountAPIKey, [ Parameter (Mandatory = $true ) ] [ string ] $PolicyID ) # Set the target URI with query string $getSyntheticsConditionsUri = \"https://api.newrelic.com/v2/alerts_synthetics_conditions.json?policy_id=\" + $PolicyID # Set the headers to pass $headers = @{ 'X-Api-Key' = $AccountAPIKey; 'Content-Type' = 'application/json' } # Query the API $results = ( Invoke-RestMethod -Method Get -Uri $getSyntheticsConditionsUri -Headers $headers ).synthetics_conditions RETURN $results } # Create a function to enumerate all Notification Channels for an account Function Get-NRNotificationChannels { Param( [ Parameter ( Mandatory = $true ) ] [ string ] $AccountAPIKey ) # Set the target URI $uri = 'https://api.newrelic.com/v2/alerts_channels.json' # Set the headers to pass $headers = @{ 'X-Api-Key' = $AccountAPIKey } # Query the API $results = ( Invoke-RestMethod -Method Get -Uri $uri -Headers $headers -ContentType 'application/json' ).channels RETURN $results } #endregion Functions #####-----------------------------------------------------------------------------------------##### #region Execution # Get a list of all Alert Policies $policies = Get-NRAlertPolicies -AccountAPIKey $AccountAPIKey # Get a list of all Notification Channels $channels = Get-NRNotificationChannels -AccountAPIKey $AccountAPIKey # Build an empty array to hold our Alert Policy IDs that have Synthetics Alert Conditions $syntheticsPolicies = @() # Iterate through each policy and isolate the ones with Synthetics Alert Conditions foreach ( $p in $policies ) { $query = Get-SyntheticsConditions -AccountAPIKey $AccountAPIKey -PolicyID $p.id foreach ( $q in $query ) { Write-Host \"Synthetics Conditions found in Alert Policy: $( $p.name )\" -ForegroundColor Cyan $syntheticsPolicies += $p.id } } # Build an empty array to hold our results $results = @() # Iterate through the Notification Channels to see if any are assigned to a Policy with Synthetics Alert Conditions foreach ( $c in $channels ) { foreach( $l in $c.links.policy_ids ) { # Build a PSObject to add to our results $item = New-Object -TypeName psobject if( $l -in $syntheticsPolicies ) { # Grab the alert policy name for readability in the results $pName = ( $policies | Where-Object { $_.id -eq $l } ).name Write-Host \"Notification Channel \"$( $c.name )\" is assigned to Alert Policy: $( $pName )\" -ForegroundColor Yellow # Fill the PSObject $item | Add-Member -MemberType NoteProperty -Name 'AlertPolicyID' -Value $l $item | Add-Member -MemberType NoteProperty -Name 'AlertPolicyName' -Value $pName $item | Add-Member -MemberType NoteProperty -Name 'ChannelID' -Value $c.id $item | Add-Member -MemberType NoteProperty -Name 'ChannelName' -Value $c.name $item | Add-Member -MemberType NoteProperty -Name 'ChannelType' -Value $c.type # Add the PSObject to our results array $results += $item } } } #endregion Execution # Play that beautiful bean footage... $results | Format-Table -AutoSize 4 Likes Alan_Tsui January 1, 2020, 3:42pm #10 Thank you @anon85944545. I programmed a Python script for this too, please free feel to comment on my public GitHub repo. Sample output result_df.png2032×1169 478 KB 2 Likes RyanVeitch January 2, 2020, 10:09am #11 This is great! Thanks both of you for sharing those scripts! @anon85944545 @Alan_Tsui Home Categories FAQ/Guidelines Terms of Service Privacy Policy Powered by Discourse, best viewed with JavaScript enabled",
+ "type": "forum",
+ "info": "",
+ "sections": [
+ "Feature Idea: How to get notification channel information for a Synthetic monitor with REST API?"
+ ],
+ "title": "Feature Idea: How to get notification channel information for a Synthetic monitor with REST API? - Synthetic - New Relic Explorers Hub",
+ "popularity": 1,
+ "external_id": "bdbb045c3d65f768754131aee97c0199d48ede1d",
+ "image": "https://nr-production-discourse.s3.dualstack.us-east-1.amazonaws.com/optimized/3X/5/1/51a1bab08a8e6e700fa097c886d462adb65b3e27_2_690x396.png",
+ "url": "https://discuss.newrelic.com/t/feature-idea-how-to-get-notification-channel-information-for-a-synthetic-monitor-with-rest-api/90820",
+ "published_at": "2020-08-11T02:23:24Z",
+ "updated_at": "2020-07-30T21:07:50Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.5424356,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Feature Idea: How to get notificationchannel information for a Syntheticmonitor with REST API? - Synthetic - New Relic Explorers Hub",
+ "sections": "Feature Idea: How to get notificationchannel information for a Syntheticmonitor with REST API?",
+ "body": " 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 Feature Idea: How to get notificationchannel information for a Synthetic monitor with REST API? Support: Full-Stack Observability"
+ },
+ "id": "5e0b6ce064441fabd8392627"
+ }
+ ],
+ "/build-apps/add-nerdgraphquery-guide": [
+ {
+ "body": "Build apps You know better than anyone what information is crucial to your business, and how best to visualize it. Sometimes, this means going beyond dashboards to creating your own app. With React and GraphQL, you can create custom views tailored to your business. These guides are designed to help you start building apps, and dive into our library of components. We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a \"Hello, World!\" application Build a \"Hello, World!\" app and publish it to New Relic One 20 min Set up your development environment Prepare to build apps and contribute to this site 20 min Publish and deploy apps Start sharing the New Relic apps you build 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 30 min Add a table to your app Add a table to your New Relic One app 30 min Create a custom map view Build an app to show page view data on a map",
+ "type": "developer",
+ "document_type": "page",
+ "info": "",
+ "sections": [
+ "Build apps",
+ "Guides to build apps",
+ "Create a \"Hello, World!\" application",
+ "Set up your development environment",
+ "Publish and deploy apps",
+ "Add, query, and mutate data using NerdStorage",
+ "Add the NerdGraphQuery component to an application",
+ "Add a time picker to your app",
+ "Add a table to your app",
+ "Create a custom map view"
+ ],
+ "title": "Build apps",
+ "popularity": 1,
+ "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d",
+ "image": "",
+ "url": "https://developer.newrelic.com/build-apps/",
+ "published_at": "2020-08-13T01:45:07Z",
+ "updated_at": "2020-08-12T01:57:08Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 1.1805475,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "AddtheNerdGraphQuerycomponenttoanapplication",
+ "body": " to modify, save, and retrieve documents from one session to the next. 20 minutes Add the NerdGraphQuerycomponent to an application The NerdGraphQuerycomponent 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"
+ },
+ "id": "5efa999d64441fc0f75f7e21"
+ },
+ {
+ "body": "NerdGraphQuery Usage Copy Props There are no props for this component.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "A NerdGraphQuery component!",
+ "sections": [
+ "NerdGraphQuery",
+ "Usage",
+ "Props"
+ ],
+ "title": "NerdGraphQuery",
+ "popularity": 1,
+ "external_id": "1ada6e056e031c141b2bb989e4ec200b3a7ce988",
+ "image": "",
+ "url": "https://developer.newrelic.com/components/nerd-graph-query/",
+ "published_at": "2020-08-13T01:47:34Z",
+ "updated_at": "2020-08-01T01:48:20Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.026767705,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NerdGraphQuery",
+ "sections": "NerdGraphQuery",
+ "info": "A NerdGraphQuerycomponent!",
+ "body": "NerdGraphQuery Usage Copy Props There are no props for this component."
+ },
+ "id": "5efa999d28ccbc6bfd307ddb"
+ },
+ {
+ "body": "Products & Pricing Solutions Help Center About LEARN Docs Build on New Relic Explore open source projects Training GET HELP Community forum Global technical support Expert services The Platform New Relic One Capabilities Programmability Infinite Tracing Integrations Security Alerts New Relic for Android and iOS Insights Manage Complex Systems Logs Metrics and Traces Applied Intelligence Serverless Improve Client-side Experiences Browser Mobile Synthetics Build and Run Better Software APM Infrastructure BY TOPIC DevOps Cloud Adoption 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 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 How To: Use the NerdGraphQuery component Build on New Relic Nerdpacks nerdpack nrnerdpack jsius April 12, 2020, 1:13pm #1 Use the NerdGraphQuery component Difficulty Level: Intermediate Products: APM Getting Started For this how-to example, we will be adding the NerdGraph component to our transaction overview application to query data from our account and add it to a dropdown menu. NerdGraph is New Relic’s GraphQl implementation. GraphQL has some key differences when compared to REST. For example, it’s the client, not the server, that determines what data will be returned. Also, it becomes easy to collect data from multiple sources. In the case of New Relic, we’ll see you can get account information, data about infrastructure, and issue an NRQL request, all in one GraphQL query. Explore NerdGraph To get started, we will clone the example applications from our how-to GitHub repo: Next, we will use the NR1 CLI to update the application UUID and run our application locally. In the terminal, let’s change into the /nr1-howto/use-nerdgraph directory. cd /nr1-howto/use-nerdgraph Before moving forward, let’s make sure we are getting data from the right New Relic account. If you open the sample code in your preferred text editor, open the /use-nerdgraphd/nerdlets/use-nerdgraph-nerdlet/index.js. In your text editor, you want to update the line below to include your account id. this.accountId = ; Note: Your account id is viewable in the profile selection menu of the developer center, where you downloaded in the nr1 CLI. Now, we want to update the UUID and serve our application. nr1 nerdpack:uuid -gf nr1 nerdpack:serve Once our app is successfully served, in your terminal, you’ll be provided with a URL to access New Relic One and see your running application. New Relic link: https://one.newrelic.com/?nerdpacks=local Now on the New Relic homepage, you should have a new launcher to the how-to example. use-nerdgraph-launcher.png3178×1098 497 KB After launching the 'Use NerdGraph application, you will see a dashboard that gives an overview of the transactions in your New Relic account. no-name.png3174×1494 417 KB Adding the NerdGraphQuery component In this application, you will see an overview of the Transaction data that is your account. By following the instructions in this how-to, you will add the NerdGraphQuery component to access to build a dropdown menu to change the account the application is viewing. The first step is to import the NerdGraphQuery Component. We can find the component and details on how to import it on the APIs and components page on https://developer.newrelic.com/client-side-sdk/index.html#data-fetching/NerdGraphQuery. Please take a moment to get caught up on the NerdGraphQuery component, then import the component into our application’s index.js file. 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; }} The NerdGraphQuery component takes an an query object that states the what source you’d like to access and the data you want to have returned. Add the following code to your index.js file in the render method. const query = ` query($id: Int!) { actor { account(id: $id) { name } } } `; If you take a look at your browser console, you should see something similar to below: console-screenshot.png3176×548 113 KB You can see the data from your query returned in an object following the same structure of the object provided in the initial query. Now, you want 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 the return statement below. return {data.actor.account.name} Apps:; If you go back to the browser and view your application, you will see a new headline showing the name of your account returned from NerdGraph. with-name.png3174×1612 443 KB Using the NerdGraphQuery.query We have implemented the NerdGraphQuery component with the application’s render method and displayed the return data within the transaction overview application. Now, we want to be able to query NerdGraph outside of the render method and save the returned data for later usage throughout the NR1 app. To do this, we will use the NerdGraphQuery.query method within the componentDidMount react lifecycle method. Add the following code into the index.js just under the constructor. componentDidMount(){ const accountId = this.state; const gql = `{ actor { accounts { id name } } }`; const accounts = NerdGraphQuery.query({query: gql}) 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); }) } In the code, we just added to the transaction app a few things would happen after the HTML in the render method is successfully rendered, and the componentDidMount lifecycle method has been called. The NerdGraphQuery.query method called with the query object to get your account data will be stored into a variable called accounts. Once the response has come back from NerdGraph, the results will be logged to the browser console for your viewing, processed, and stored into the application state. After the data is stored into state, we want to use it to display and account selection for users to change accounts and update the application quickly. Add the following code into the second StackItem in the index.js return statement. {accounts && } If you look at the application in your browser, you will see a dropdown menu that displays the data returned from the NerdGraphQuery.query and allows the user to select an account. Once a new account is selected, the application will render showing data from the new selection. complete.png3172×1432 441 KB The final index.js file should have code similar to the code below. This completed sample code is in your nerdlet final.js. import React from 'react'; import { PlatformStateContext, NerdGraphQuery, Spinner, HeadingText, Grid, GridItem, Stack, StackItem, Select, SelectItem, AreaChart, TableChart, PieChart } from 'nr1' import { timeRangeToNrql } from '@newrelic/nr1-community'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class UseNerdgraphNerdletNerdlet extends React.Component { constructor(props){ super(props) this.state = { accountId: , accounts: null, selectedAccount: null, } } componentDidMount(){ const accountId = this.state; const gql = `{ actor { accounts { id name } } }`; const accounts = NerdGraphQuery.query({query: gql}) accounts.then(results => { console.log('Nerdgraph Response:', results); const accounts = results.data.actor.accounts.map(account => { return account; }); const account = accounts.length > 0 && accounts[0]; this.setState({ selectedAccount: account, accounts }); }).catch((error) => { console.log('Nerdgraph Error:', error); }) } selectAccount(option) { this.setState({ accountId: option.id,selectedAccount: option }); } render() { const { accountId, accounts, selectedAccount } = this.state; console.log({accountId, accounts, selectedAccount}); const query = ` query($id: Int!) { actor { account(id: $id) { name } } } `; const variables = { id: accountId, }; const avgResTime = `SELECT average(duration) FROM Transaction FACET appName TIMESERIES AUTO `; const trxOverview = `FROM Transaction SELECT count(*) as 'Transactions', apdex(duration) as 'apdex', percentile(duration, 99, 95) FACET appName `; const errCount = `FROM TransactionError SELECT count(*) as 'Transaction Errors' FACET error.message `; const responseCodes = `SELECT count(*) as 'Response Code' FROM Transaction FACET httpResponseCode `; return ( {({loading, error, data}) => { if (loading) { return ; } if (error) { return 'Error!'; } return {data.actor.account.name} Apps:; }} {accounts && } {(PlatformState) => { /* Taking a peek at the PlatformState */ const since = timeRangeToNrql(PlatformState); return ( <> Transaction Overview Average Response Time Response Code Transaction Errors > ); }} ) } } How to use the NerdGraph component recap Wrapping up this how-to example, you’ve successfully queried data from your account using the NerdGraphQuery component. Using the NerdGraphQuery.query method allows the separation of querying data and visualization. For more experience querying your data with NerdGraph, use New Relic’s GraphQL tool to explore what’s possible. To continue your learning, take a look at our self-paced workshop on Github. 2 Likes Home Categories FAQ/Guidelines Terms of Service Privacy Policy Powered by Discourse, best viewed with JavaScript enabled",
+ "type": "forum",
+ "info": "",
+ "sections": [
+ "How To: Use the NerdGraphQuery component",
+ "Use the NerdGraphQuery component",
+ "Getting Started",
+ "Adding the NerdGraphQuery component",
+ "Using the NerdGraphQuery.query",
+ "How to use the NerdGraph component recap"
+ ],
+ "title": "How To: Use the NerdGraphQuery component - Nerdpacks - New Relic Explorers Hub",
+ "popularity": 1,
+ "external_id": "54afe87c7dc00daab3cab31d9fc01b774391d3d3",
+ "image": "https://nr-production-discourse.s3.dualstack.us-east-1.amazonaws.com/optimized/3X/a/4/a43c1bd30420ce0a39563ad803a05c512a681ab7_2_690x238.png",
+ "url": "https://discuss.newrelic.com/t/how-to-use-the-nerdgraphquery-component/96289",
+ "published_at": "2020-08-12T04:52:18Z",
+ "updated_at": "2020-07-22T05:47:01Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.017421223,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "How To: Use theNerdGraphQuerycomponent - Nerdpacks - New Relic Explorers Hub",
+ "sections": "How To: Use theNerdGraphQuerycomponent",
+ "body": " the NerdGraphQuerycomponent Difficulty Level: Intermediate Products: APM Getting Started For this how-to example, we will be adding the NerdGraphcomponent to our transaction overview application to query data from our account and add it to a dropdown menu. NerdGraph is New Relic’s GraphQl implementation"
+ },
+ "id": "5e61d6b9196a67486b7ed48e"
+ },
+ {
+ "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, we'll show you how to create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. We also have a 5-minute video that covers the steps below. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need our New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in our CLI wizard. For additional details about setting up your environment, see Set up your development environment. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI wizard, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return
\"Hello, World!\"
; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the New Relic One Catalog launcher. Step 4 of 4 Under Your company applications, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application on the New Relic One homepage, you need to subscribe accounts to the application. Any user with the NerdPack Manager role can subscribe accounts to an application. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update access to save your selections. When you return to the New Relic One homepage, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to create a custom application: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Build a \"Hello, World!\" app and publish it to New Relic One",
+ "sections": [
+ "Create a \"Hello, World!\" application",
+ "Before you begin",
+ "Create a local version of the \"Hello, World!\" application",
+ "Publish your application to New Relic",
+ "Add details to describe your project",
+ "Subscribe accounts to your application",
+ "Summary"
+ ],
+ "title": "Create a \"Hello, World!\" application",
+ "popularity": 1,
+ "tags": [
+ "nr1 cli",
+ "Nerdpack file structure",
+ "NR One Catalog",
+ "Subscribe applications"
+ ],
+ "external_id": "aa427030169067481fb69a3560798265b6b52b7c",
+ "image": "https://developer.newrelic.com/static/cb65a35ad6fa52f5245359ecd24158ff/9466d/hello-world-output-local.png",
+ "url": "https://developer.newrelic.com/build-apps/build-hello-world-app/",
+ "published_at": "2020-08-13T01:45:06Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.0044204337,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Create a "Hello, World!" application",
+ "sections": "Create a local version of the "Hello, World!" application",
+ "info": "Build a "Hello, World!" app and publish it to New Relic One",
+ "tags": "Subscribe applications",
+ "body": " how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following"
+ },
+ "id": "5efa9973196a67d16d76645c"
+ },
{
- "url": "https://developer.newrelic.com/terms",
- "title": "The title!",
- "q": "Terms and conditions",
- "search_fields": {
- "page": [
- "tags^10",
- "body^5",
- "title^1.5",
- "*"
- ]
- },
- "filters": {
- "page": {
- "url": [
- "!https://developer.newrelic.com/terms/",
- "!https://developer.newrelic.com/terms"
- ],
- "document_type": [
- "!views_page_menu",
- "!term_page_api_menu",
- "!term_page_landing_page"
- ]
- }
- },
- "engine_key": "Ad9HfGjDw4GRkcmJjUut",
- "per_page": 5
+ "body": "Products & Pricing Solutions Help Center About LEARN Docs Build on New Relic Explore open source projects Training GET HELP Community forum Global technical support Expert services The Platform New Relic One Capabilities Programmability Infinite Tracing Integrations Security Alerts New Relic for Android and iOS Insights Manage Complex Systems Logs Metrics and Traces Applied Intelligence Serverless Improve Client-side Experiences Browser Mobile Synthetics Build and Run Better Software APM Infrastructure BY TOPIC DevOps Cloud Adoption 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 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 Use NrqlQuery component to execute query and store result in nerdlets Build on New Relic Nerdpacks nrql nerdpack sikharam May 6, 2020, 1:07am #1 Is it possible to use the NrqlQuery component to execute a query and store the result of it? sikharam May 5, 2020, 11:20pm #2 I’m trying to get the results of one query, and then use the results in other queries/operations… RyanVeitch May 6, 2020, 8:50am #3 Hey @sikharam that should absolutely be possible! There is an example of similar happening here: Is it possible to query the Insights API from a Nerdpack? Nerdpacks I can’t diagnose the invariant violation in this setting, but I can verify that the following code works, using the NerdGraphQuery static method and models the idea of using an initial query to feed a secondary query in the render. Maybe this is helpful. import React from 'react'; import { Spinner, NerdGraphQuery } from 'nr1'; import { NerdGraphError } from '@newrelic/nr1-community'; import gql from \"graphql-tag\"; import get from 'lodash.get'; import camelCase from 'lodash.camelcase'; // http… I see that this is using NerdGraphQuery rather than NrqlQuery, but, this NerdGraph Query is querying NRQL data, and the same result chaining should be possible in the NRQL query component. 1 Like sikharam May 6, 2020, 6:19pm #4 That works! Thank you! 1 Like RyanVeitch May 7, 2020, 6:56am #5 Awesome! Thanks for confirming Home Categories FAQ/Guidelines Terms of Service Privacy Policy Powered by Discourse, best viewed with JavaScript enabled",
+ "type": "forum",
+ "info": "",
+ "sections": [
+ "Use NrqlQuery component to execute query and store result in nerdlets"
+ ],
+ "title": "Use NrqlQuery component to execute query and store result in nerdlets - Nerdpacks - New Relic Explorers Hub",
+ "popularity": 1,
+ "external_id": "8bf23a29e60f7ef15ebd24d982166ad7540e98d4",
+ "image": "https://nr-production-discourse.s3.amazonaws.com/original/2X/f/f6107441676f77294613ec559377aa90da19dd52.png",
+ "url": "https://discuss.newrelic.com/t/use-nrqlquery-component-to-execute-query-and-store-result-in-nerdlets/101450",
+ "published_at": "2020-08-11T17:17:45Z",
+ "updated_at": "2020-07-23T02:43:53Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.004134622,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Use NrqlQuery componentto execute queryand store result in nerdlets - Nerdpacks - New Relic Explorers Hub",
+ "sections": "Use NrqlQuery componentto execute queryand store result in nerdlets",
+ "body": " from 'lodash.camelcase'; // http… I see that this is using NerdGraphQuery rather than NrqlQuery, but, this NerdGraphQuery is querying NRQL data, and the same result chaining should be possible in the NRQL querycomponent. 1 Like sikharam May 6, 2020, 6:19pm #4 That works! Thank you! 1 Like"
+ },
+ "id": "5eb2c51c28ccbcd7f7c213ce"
}
],
- "/explore-docs/query-and-store-data": [
+ "/collect-data/custom-events": [
+ {
+ "body": "New Relic CLI Reference The New Relic CLI enables integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
+ "type": "developer",
+ "document_type": "page",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "sections": [
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
+ ],
+ "title": "New Relic CLI Reference",
+ "popularity": 1,
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-08-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:40:44Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.13377646,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelic CLI Reference",
+ "sections": "NewRelic CLI Reference",
+ "info": "The command line tools for performing tasks against NewRelic APIs",
+ "tags": "newrelic cli",
+ "body": "NewRelic CLI Reference The NewRelic CLI enables integration of NewRelic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding NewRelic into your CI/CD pipeline. NewRelic CLI commands Find details for the NewRelic CLI command docs"
+ },
+ "id": "5efa989ee7b9d2024b7bab97"
+ },
+ {
+ "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.",
+ "sections": [
+ "Get started with the New Relic CLI",
+ "Before you begin",
+ "Install the New Relic CLI",
+ "Linux",
+ "macOS",
+ "Windows",
+ "Create your New Relic CLI profile",
+ "Get your application details",
+ "Add a simple tag to your application",
+ "Bonus step: Create a deployment marker",
+ "Next steps"
+ ],
+ "title": "Get started with the New Relic CLI",
+ "popularity": 1,
+ "tags": [
+ "api key",
+ "New Relic CLI",
+ "Tags",
+ "Entity",
+ "Deployment markers"
+ ],
+ "external_id": "531f2f3985bf64bb0dc92a642445887095048882",
+ "image": "",
+ "url": "https://developer.newrelic.com/automate-workflows/get-started-new-relic-cli/",
+ "published_at": "2020-08-13T01:49:30Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.093906194,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Get started with the NewRelic CLI",
+ "sections": "Create your NewRelic CLI profile",
+ "info": "Learn the essentials of the NewRelic CLI, from install and configuration to basic usage.",
+ "tags": "NewRelic CLI",
+ "body": ". This guide walks you through the essentials of NewRelic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your NewRelic personal API Key, which you can create from the Account settings of your NewRelic account An instrumented application in your"
+ },
+ "id": "5efa999c196a67c4e1766461"
+ },
+ {
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building New Relic One apps, including the New Relic One CLI (command line interface). This page will explain how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the New Relic One Catalog Installing the New Relic One CLI From within New Relic, go to the Build your own application launcher and follow the instructions. This launcher will automatically generate an API key for the account you select, and give you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. New Relic One CLI Commands This table provides descriptions for the New Relic One CLI commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data from New Relic using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "type": "developer",
+ "document_type": "page",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "popularity": 1,
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-08-13T01:50:34Z",
+ "updated_at": "2020-08-04T01:41:46Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.08688526,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "NewRelic One CLI reference",
+ "sections": "NewRelic One CLI reference",
+ "info": "An overview of the CLI to help you build, deploy, and manage NewRelic apps.",
+ "tags": "NewRelic One app",
+ "body": " application launcher and follow the instructions. This launcher will automatically generate an API key for the account you select, and give you the pre-populated commands to create a profile, generate your first "Hello World" app, and serve it locally. NewRelic One CLI Commands This table provides"
+ },
+ "id": "5efa989e28ccbc535a307dd0"
+ },
+ {
+ "body": "Products & Pricing Solutions Help Center About LEARN Docs Build on New Relic Explore open source projects Training GET HELP Community forum Global technical support Expert services The Platform New Relic One Capabilities Programmability Infinite Tracing Integrations Security Alerts New Relic for Android and iOS Insights Manage Complex Systems Logs Metrics and Traces Applied Intelligence Serverless Improve Client-side Experiences Browser Mobile Synthetics Build and Run Better Software APM Infrastructure BY TOPIC DevOps Cloud Adoption 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 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 Determine who created a custom event type Support: Telemetry Data Platform (TDP) Dashboards insights mhernandez1 May 17, 2018, 3:04pm #1 Is there a way to query who created a custom event type or do I need to create a support ticket? hross May 17, 2018, 4:40pm #2 Hey there @mhernandez1 - welcome back to the Explorers Hub! There is no way to do this through the New Relic UI, so this is a feature idea. We’re not certain that we can, but it’s possible that a support engineer could extract this data. If you want to give that a shot, I can create a ticket from this post. Please just let me know. 1 Like Home Categories FAQ/Guidelines Terms of Service Privacy Policy Powered by Discourse, best viewed with JavaScript enabled",
+ "type": "forum",
+ "info": "",
+ "sections": [
+ "Determine who created a custom event type"
+ ],
+ "title": "Determine who created a custom event type - Dashboards - New Relic Explorers Hub",
+ "popularity": 1,
+ "external_id": "311375cb1610f0f082cd9c6fd2960afdc1f5e620",
+ "image": "https://nr-production-discourse.s3.amazonaws.com/original/2X/f/f6107441676f77294613ec559377aa90da19dd52.png",
+ "url": "https://discuss.newrelic.com/t/determine-who-created-a-custom-event-type/55789",
+ "published_at": "2020-08-11T00:49:29Z",
+ "updated_at": "2020-07-31T14:01:10Z",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 0.060816064,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Determine who created a customevent type - Dashboards - NewRelic Explorers Hub",
+ "sections": "Determine who created a customevent type",
+ "body": " from the world of NewRelic and digital intelligence. Our Company About Us Leadership Meetups and Events Resources Investor Relations Newsroom Partner Program Contact Us Determine who created a customevent type Support: Telemetry Data Platform (TDP) Dashboards insights mhernandez1 May 17, 2018, 3"
+ },
+ "id": "5b0011d88e9c0f01cc598512"
+ },
{
- "url": "https://developer.newrelic.com/explore-docs/query-and-store-data",
- "q": "Query and store data",
- "search_fields": {
- "page": [
- "tags^10",
- "body^5",
- "title^1.5",
- "*"
- ]
- },
- "filters": {
- "page": {
- "url": [
- "!https://developer.newrelic.com/explore-docs/query-and-store-data/",
- "!https://developer.newrelic.com/explore-docs/query-and-store-data",
- "!https://developer.newrelic.com/build-tools/new-relic-one-applications/query-and-store-data/",
- "!https://developer.newrelic.com/build-tools/new-relic-one-applications/query-and-store-data"
- ],
- "document_type": [
- "!views_page_menu",
- "!term_page_api_menu",
- "!term_page_landing_page"
- ]
- }
- },
- "engine_key": "Ad9HfGjDw4GRkcmJjUut",
- "per_page": 5
+ "body": "Products & Pricing Solutions Help Center About LEARN Docs Build on New Relic Explore open source projects Training GET HELP Community forum Global technical support Expert services The Platform New Relic One Capabilities Programmability Infinite Tracing Integrations Security Alerts New Relic for Android and iOS Insights Manage Complex Systems Logs Metrics and Traces Applied Intelligence Serverless Improve Client-side Experiences Browser Mobile Synthetics Build and Run Better Software APM Infrastructure BY TOPIC DevOps Cloud Adoption 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 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 Monitor NR1 App with Browser Agent Build on New Relic Nerdpacks browser nerdpack alex.plaza.gonzalez July 30, 2020, 4:21am #1 Hi, I’m attempting to install the New Relic Browser agent on a New Relic One application. I downloaded the agent script and uploaded in a publicly accessible S3 bucket and then tried to use the following to create the