(); NewRelic.Api.Agent.NewRelic.RecordCustomEvent('MyCustomEvent', eventAttributes); The first argument defines the name of your event type, and the second argument is an IEnumerable with the attributes for your custom event. Ensure you limit the number of unique event type names that you create, and do not generate these names dynamically. For restrictions on event type names, see Limits and restricted characters and Reserved words. You can turn off custom events entirely by setting customEvents.enabled to false in newrelic.config. Node.js Custom event collection is enabled by default in Node.js agent version 1.15.0 or higher. To send custom events, simply call the relevant API. For example: recordCustomEvent(eventType, attributes) Use recordCustomEvent to record an event-based metric, usually associated with a particular duration. The eventType must be an alphanumeric string less than 255 characters. The attributes must be an object of key and value pairs. The keys must be shorter than 255 characters, and the values must be string, number, or boolean. For restrictions on event type names, see Limits and restricted characters and Reserved words. To disable custom events entirely, add custom_insights_events.enabled: false to newrelic.js. PHP Custom event collection is enabled by default in PHP agent version 4.18 or higher. To send custom events, simply call the relevant API function. For example: newrelic_record_custom_event(\"WidgetSale\", array(\"color\"=>\"red\", \"weight\"=>12.5)); The first argument defines the name of your event type, and the second argument is an array with the attributes for your custom event. Ensure you limit the number of unique event type names that you create, and do not generate these names dynamically. For restrictions on event type names, see Limits and restricted characters and Reserved words. By default, the maximum number of custom events recorded per minute is 10,000. This setting cannot be changed. To disable custom events entirely, add newrelic.custom_insights_events.enabled = false to your newrelic.ini and restart the agent. Python Custom event collection is enabled by default in Python agent version 2.60.0.46 or higher. To send custom events, simply call the relevant API. For example: newrelic.agent. record_custom_event (event_type, params, application=None) The event_type defines the name (or type) of the custom event. Attributes of the custom event should be passed in as a dictionary via the params keyword argument. Ensure you limit the number of unique event type names that you create, and do not generate these names dynamically. For limits and restrictions on event_type and params, see Limits and restricted characters and Reserved words If called outside of the context of a monitored web request or background task, the call will be ignored unless the application keyword argument is provided and an application object corresponding to the application against which the exception should be recorded is provided. A suitable application object can be obtained using the newrelic.agent.application() function. To disable custom events entirely, set custom_insights_events.enabled to False in your newrelic.ini configuration file. Ruby Custom event collection is enabled by default in Ruby agent version 3.9.8.273 or higher. To send custom events, simply call the relevant API. For example: ::NewRelic::Agent.record_custom_event('WidgetSale', color: 'red', weight: 12.5) The first argument defines the name of your event type, and the second argument is a hash with the attributes for your custom event. Ensure you limit the number of unique event type names that you create, and do not generate these names dynamically. For restrictions on event type names, see Limits and restricted characters and Reserved words. You can change the maximum number of events recorded by the Ruby agent via a configuration parameter in newrelic.yml: Add custom_insights_events.max_samples_stored: to your configuration file. Specify the maximum number of events to record per minute as an integer. For example, if you want to be able to send up to 5000 events per minute, add: custom_insights_events.max_samples_stored: 5000 To disable custom events entirely, add custom_insights_events.enabled: false to newrelic.yml. Timestamps You may not specify a timestamp on events that are collected and recorded via the agent. The agent will automatically assign a timestamp to events based on when they are recorded via the API. Limits and restricted characters See Custom event data requirements for size limits, data types, and naming syntax requirements. Reserved words Before creating custom attributes, review New Relic's list of reserved terms used by NRQL. Otherwise unexpected results may occur. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "info": "New Relic PHP agent API call to add custom instrumentation to particular methods in your app code. ",
+ "body": "newrelic_add_custom_tracer(string $function_name) Specify functions or methods for the agent to instrument with custom instrumentation. Requirements Compatible with all agent versions. Description Specify functions or methods for the agent to target for custom instrumentation. This is the API equivalent of the newrelic.transaction_tracer.custom setting. You cannot apply custom tracing to internal PHP functions. Parameters Parameter Description $function_name string Required. The name can be formatted either as function_name for procedural functions, or as \"ClassName::method\" for methods. Both static and instance methods will be instrumented if the method syntax is used, and the class name must be fully qualified: it must include the full namespace if the class was defined within a namespace. Return value(s) Returns true if the tracer was added successfully. Example(s) Instrument a function function example_function() { if (extension_loaded('newrelic')) { // Ensure PHP agent is available newrelic_add_custom_tracer(\"example_function\"); } } Instrument a method within a class class ExampleClass { function example_method() { if (extension_loaded('newrelic')) { // Ensure PHP agent is available newrelic_add_custom_tracer(\"ExampleClass::example_method\"); } } } Instrument a method within a namespaced class namespace Foo\\Bar; class ExampleClass { function example_method() { if (extension_loaded('newrelic')) { // Ensure PHP agent is available newrelic_add_custom_tracer(\"Foo\\\\Bar\\\\ExampleClass::example_method\"); } } } Alternatively, on PHP 5.5 or later, the ::class syntax can be used instead: namespace Foo\\Bar { class ExampleClass { function example_method() { // ... } } } namespace { use Foo\\Bar; if (extension_loaded('newrelic')) { // Ensure PHP agent is available newrelic_add_custom_tracer(Bar::class . \"::example_method\"); } } }",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 79.82938,
+ "_score": 26.0898,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "APM: Report custom events",
- "sections": "Custom events",
- "info": "New Relic APM: how to report custom events and attributes.",
- "category_1": "Event data sources",
- "category_2": "Custom events",
- "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/event-data-sources/custom-events/apm-report-custom-events",
- "body": "If you have APM, you can report custom event data, which is then available for querying in New Relic. Related documentation: Add custom attributes to existing events Send custom events using the Event API (without need for APM) Custom events sent with the agent APIs are not compatible with high",
- "breadcrumb": "Contents / Insights / Event data sources / Custom events"
+ "sections": "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": "5f480a5a64441f578bfdcdb1"
+ "id": "58ca4191e621f45edd466e7a"
},
{
- "category_2": "Custom events",
- "nodeid": 13806,
+ "nodeid": 9691,
"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",
+ "Introduction to New Relic Mobile (Unity)",
+ "Contents",
+ "Monitor mobile app performance",
+ "Install and configure",
+ "Use Unity SDK API",
+ "Send custom events and attributes to Insights",
+ "Track custom network requests",
+ "Uninstall plugin",
+ "Unity release notes",
"For more help"
],
- "title": "Report custom event data",
- "category_0": "Insights",
+ "title": "Introduction to New Relic Mobile (Unity)",
"type": "docs",
- "category_1": "Event data sources",
- "external_id": "afb5f5a81ae06b22935d98c470ed9cabd7c9da6b",
+ "external_id": "9e03a54ec6df360532302d4dfe7484070f8ba80c",
"image": "",
- "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/report-custom-event-data",
- "published_at": "2020-09-30T06:47:46Z",
- "updated_at": "2020-07-26T05:52:23Z",
- "breadcrumb": "Contents / Insights / Event data sources / Custom events",
+ "url": "https://docs.newrelic.com/docs/introduction-new-relic-mobile-unity",
+ "published_at": "2020-10-04T04:12:22Z",
+ "updated_at": "2020-07-25T00:44:01Z",
+ "breadcrumb": "Contents",
"document_type": "page",
"popularity": 1,
- "info": "An overview of the options for sending custom event data to New Relic. ",
- "body": "New Relic products report a variety of default event data to your account. This document will explain how to report your own custom events and attributes. Overview of reporting custom events and attributes Event data is one of the fundamental New Relic data types. Events are reported by most New Relic products, and we give you several options for reporting your own custom events. Reporting custom events allows you to create more useful and customized queries and charts of your data, and is a key part of optimizing how New Relic works for you. Before beginning, it's important to know that reporting a large number of custom events and/or attributes can cause degraded query performance, or cause you to approach or pass data collection rate limits. For optimal performance, first think about what data you want to analyze, and then create only the events and/or attributes necessary to meet these specific goals. Be aware of the following data and subscription requirements for inserting and accessing custom data: Ensure you follow limits and requirements around event/attribute data types, naming syntax, and size. The amount of data you have access to over time depends on your data retention policy. Send custom events and attributes Methods for sending custom events and attributes include: Source How to send custom data APM agent Use APM agent APIs to report custom events and custom attributes. Browser agent Add custom attributes to the PageView event via the Browser API call addCustomAttribute. Send PageAction event and attributes via Browser API. Forward APM agent custom attributes to PageView event. Event API To report custom events not associated with other New Relic products, use the Event API. Infrastructure Add custom attributes to default Infrastructure events. Use the Flex integration tool to report your own custom event data. Mobile agent Use the mobile agent API to send custom events and attributes. Synthetics Add custom attributes to the SyntheticCheck event via the $util.insights tools. For ways to report other types of custom data, see: Metric API Logs Trace API Extend data retention To learn about how to extend how long events are retained in your account, see Event data retention. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
- "_index": "520d1d5d14cc8a32e600034b",
- "_type": "520d1d5d14cc8a32e600034c",
- "_score": 58.117706,
- "_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"
- },
- {
- "sections": [
- "Collect data from any source",
- "Agent APIs",
- "Telemetry SDK",
- "Trace API",
- "Metric API",
- "Event API",
- "Log API"
- ],
- "title": "Collect data from any source",
- "type": "developer",
- "tags": [
- "Agent API",
- "Telemetry SDK",
- "Trace API",
- "Metric API",
- "Event API"
- ],
- "external_id": "5bfb043fffe42ea4a78d5a90bf8e92aa8b8f8c33",
- "image": "",
- "url": "https://developer.newrelic.com/collect-data/collect-data-from-any-source/",
- "published_at": "2020-10-01T01:52:42Z",
- "updated_at": "2020-08-14T01:45:09Z",
- "document_type": "page",
- "popularity": 1,
- "info": "Open source emitters. APIs. New Relic agents. Get data from anywhere. ",
- "body": "Collect data from any source 15 min New Relic products report a lot of data “out of the box.” When you use products like APM, Browser, Mobile, Infrastructure monitoring, or an integration, by default you receive performance data. But you may want to bring data into New Relic that isn't collected by default. Maybe you want an API-based solution that doesn't require install of an agent. Maybe you want to bring telemetry data from another analysis service into New Relic. This page describes several ways to get data into New Relic. Step 1 of 6 Agent APIs If you use our APM, Browser, or Mobile agents to report data, you can use their associated APIs to report custom data. For example, if you monitor your application with the our APM Python agent, you can use the Python agent API to set up custom instrumentation. See the agent APIs. Step 2 of 6 Telemetry SDK Our Telemetry SDKs are language wrappers for our Trace API and Metric API (and eventually our Log API and Event API). These SDKs let you easily send metrics and trace data to New Relic without needing to install an agent. For customers, we offer open-source exporters and integrations that use the Telemetry SDKs to send metrics and trace data: Istio adaptor Prometheus OpenMetrics (for Docker | for Kubernetes) OpenCensus exporter (for Go | for Python) DropWizard exporter Micrometer exporter Want to build your own solution? See our Telemetry SDK docs. Step 3 of 6 Trace API Our Trace API lets you send distributed tracing data to New Relic and consolidate tracing data from multiple sources in one place. We accept trace data in two formats: Zipkin format New Relic format (if you don’t have Zipkin-format data, you’d use this) 1 curl -i -X POST https://trace-api.newrelic.com/trace/v1 \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"Api-Key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -H 'Data-Format: newrelic' \\ 5 -H 'Data-Format-Version: 1' \\ 6 -d '[ 7 { 8 \"common\": { 9 \"attributes\": { 10 \"service.name\": \"Test Service A\", 11 \"host\": \"host123.test.com\" 12 } 13 }, 14 \"spans\": [ 15 { 16 \"trace.id\": \"123456\", 17 \"id\": \"ABC\", 18 \"attributes\": { 19 \"duration.ms\": 12.53, 20 \"name\": \"/home\" 21 } 22 }, 23 { 24 \"trace.id\": \"123456\", 25 \"id\": \"DEF\", 26 \"attributes\": { 27 \"service.name\": \"Test Service A\", 28 \"host\": \"host456.test.com\", 29 \"duration.ms\": 2.97, 30 \"name\": \"/auth\", 31 \"parent.id\": \"ABC\" 32 } 33 } 34 ] 35 } 36 ]' Copy Step 4 of 6 Metric API You can use our Metric API to send metric data to New Relic from any source. 1 curl -i -X POST https://metric-api.newrelic.com/metric/v1 \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"Api-Key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -d '[ 5 { 6 \"metrics\": [ 7 { 8 \"name\": \"memory.heap\", 9 \"type\": \"gauge\", 10 \"value\": 2.3, 11 \"timestamp\": 1531414060739, 12 \"attributes\": { 13 \"host.name\": \"dev.server.com\" 14 } 15 } 16 ] 17 } 18 ]' Copy Step 5 of 6 Event API For sending arbitrary events to New Relic, you can use our Event API. We save these events as a new event type, which can then be queried via NRQL. (Eventually, the Telemetry SDKs will support the Event API.) 1 curl -i -X POST https://insights-collector.newrelic.com/v1/accounts/$ACCOUNT_ID/events \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"x-insert-key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -d '[ 5 { 6 \"eventType\": \"LoginEvent\", 7 \"service\": \"login-service\", 8 \"customerId\": \"xyz\" 9 } 10 ]' Copy Step 6 of 6 Log API If our existing logging integrations don’t meet your needs, you can use our Log API to send any arbitrary log data to New Relic. (Eventually, the Telemetry SDKs will support the Log API.) 1 curl -i -X POST https://log-api.newrelic.com/log/v1 \\ 2 -H \"Content-Type: application/json\" \\ 3 -H \"Api-Key: $INSIGHTS_INSERT_API_KEY\" \\ 4 -d '[ 5 \"logs\": [ 6 { 7 \"timestamp\": 1593538496000, 8 \"message\": \"User xyz logged in\", 9 \"service\": \"login-service\", 10 \"hostname\": \"login.example.com\" 11 } 12 ] 13 ]' Copy",
+ "body": "Legacy feature This document is for historical reference. Unity is no longer supported for new customers. Contents Monitor mobile app performance The New Relic Unity plugin allows Unity developers to embed a New Relic Mobile agent (iOS or Android) in a Unity app build for mobile devices to monitor your app's performance. The plugin is written in C#, but it includes the native iOS and Android agents that embed the appropriate files for your build. Features New Relic Mobile Features Comprehensive performance data View your mobile app's performance Overview page for summary information about active sessions, or drill down to detailed information, including (note limitations below): Interaction times and trace details Crash reporting Devices Operating systems Detailed network views Available by using the API to track custom network requests For iOS apps, receive automatic instrumentation for networking for any parts of the app that are native and non-Unity (using standard Apple networking components such as NSURLConnection) Examine HTTP errors and network failures (such as DNS lookups, timeouts, SSL errors, etc.) and server error traces. Usage details at a glance Compare performance between versions of your app with detailed information for memory, CPU (iOS only), interaction speed, network requests per minute, and network failures. View a monthly report with a bar chart tracking the number of devices running your app for each month over the last year. Mobile SDK API options Use the Unity API to: Create and complete interactions Record custom metrics Send custom events to Insights Track custom network requests Known limitations The New Relic Unity plugin does not automatically instrument interactions. You must use the Unity API to track specific interactions. The New Relic Unity plugin does not automatically instrument network requests. You must use the Unity API to track network calls. Android builds: Unity still generates an Eclipse project, but Android Studio can import the Eclipse project. Install and configure The Unity plugin includes iOS and Android agent files that will embed the appropriate files for your build. To instrument interactions and network requests, you must use the Unity API to manually instrument your code. Install the Unity plugin As part of the installation process, New Relic Mobile automatically generates an application token. This is a 40-character hexadecimal string for authenticating each mobile project you monitor in New Relic Mobile. For Admins with existing New Relic accounts, follow these steps to install and configure your Unity application. (If you do not have a New Relic account, see New Relic Mobile.) Go to rpm.newrelic.com/mobile. From the mobile apps index, select Add a new app. From the Get started page, select Unity as the platform for mobile monitoring. Type a name for your mobile project, then select Continue. Continue with the procedures to configure the Unity plugin. Configure the Unity plugin These procedures to configure your app also appear on the Get started page in the New Relic UI. Install NewRelic-Unity-Plugin.unitypackage into your project by going to Assets > Import package > Custom package... and selecting NewRelic-Unity-Plugin.unitypackage. Create a new GameObject in your project's initial scene by going to GameObject > Create empty and naming it NewRelicAgent. Add NewRelicAgent.cs script (located in Assets/Plugins) to the NewRelicAgent GameObject: Drag it on top of NewRelicAgent in the Hierarchy tab. OR Click Add Component button, then select New Relic Agent from the Scripts option. In the Inspector tab, set the iOS or Android application token from your New Relic Mobile apps. (Recommendation: Keep New Relic Mobile apps on separate platforms.) Build for your platform (iOS or Android), then open the resulting project (Xcode or Eclipse). For Eclipse, import the generated project into Android Studio. Android only: Ensure that your app requests the INTERNET permission through the Player Settings inspector window. In Other Settings, Configuration, ensure the Internet access dropdown is set to Required. This will result in the following permission added to the app's manifest: Run your app in an emulator or device to generate data. Check New Relic Mobile to ensure the data is reporting to your account. Configure crash reporting The New Relic Unity plugin cannot automatically upload dSYMs for iOS crash reporting. You must manually upload dSYMs once your iOS unity app is built for release. If the application is bitcode enabled, follow the procedures for bitcode enabled apps once the your iOS app is submitted to Apple. If you are building an Android app with ProGuard enabled, you must follow similar steps. The ProGuard mapping must be uploaded to New Relic so crash reports can be de-obfuscated. For more information, see Android agent crash reporting. Optional: Change the logging level Six logging levels are available for mobile apps monitoring: NONE ERROR WARNING INFO VERBOSE DEBUG Recommendation: Set the logging level from the Unity Inspector tab. Use Unity SDK API Use the New Relic Unity SDK API to further configure and extend the plugin's instrumentation. Create and complete interactions To start an interaction: string interactionIdentifier = NewRelicAgent.StartInteractionWithName(\"new interaction\"); To stop the current interaction: NewRelicAgent.StopCurrentInteraction(interactionIdentifier); Interactions work in conjuction with method tracing. To trace a method insert startTracingMethod, insert at the start of the method to trace, and insert endTracingMethodWithTimer at each exit point of the method. To start tracing a method: Timer methodTimer = new Timer(); NewRelicAgent.StartTracingMethod(\"MethodName\",\"ClassName\",methodTimer,NewRelicAgent.NRTraceType.None); To end tracing a method, use the same timer as the startTracingMethod:> NewRelicAgent.EndTracingMethodWithTimer(methodTimer); Set a custom build identifier Custom build identifiers are set as the Application Build property in the inspector pane for the NewRelicAgent game object, under the New Relic Agent (Script) settings. Execute a demo crash If you have trouble getting your project to crash, use the New Relic Unity plugin API to execute a demo crash. Recommendation: Add this line of code to a button click event handler as applicable: NewRelicAgent.CrashNow(\"message\")> Record custom metrics With the custom metric API, you can record arbitrary numerical data and named events. Custom metrics can help to track high level events specific to your application. You can use several API calls to record custom metrics that provide different levels of detail. To create a custom metric, use this method: NewRelicAgent.RecordMetricWithName(String name, String category) The name parameter is the textual name of the metric that will appear in the user interface for New Relic Mobile. Using clear, concise metric names will help you get the most out of the metrics. The guidelines for naming a custom metric include: Use case and white space characters appropriate for display in the user interface. Metric names are rendered as-is. Capitalize the metric name. Avoid using the characters / ] [ | * when naming things. Avoid multi-byte characters. If you want to specify more details about a custom metric, three other API methods are available: NewRelicAgent.RecordMetricWithName(String name, String category, double value) NewRelicAgent.RecordMetricWithName(string name, string category, double value, string valueUnits) NewRelicAgent.RecordMetricWithName(string name, string category, double value, string valueUnits, string countUnits) With these methods, you can record additional details: Parameter Description count The number of times the event has happened totalValue The total value of the recording exclusiveValue The exclusive value of the recording; for example, if the total value contains measurements accounted for elsewhere countUnit Unit of measurement for the metric count, including PERCENT, BYTES, SECONDS, BYTES_PER_SECOND, or OPERATIONS valueUnit Unit of measurement for the metric value, including PERCENT, BYTES, SECONDS, BYTES_PER_SECOND, or OPERATIONS To view the custom metrics you collect, follow standard procedures to create custom dashboards. Send custom events and attributes to Insights The SDK can store up to 64 user-defined attributes at a time. If you attempt to store more than 64 attributes, the SDK returns false. Use the following static methods in the NewRelicAgent namespace to send custom attributes and events to New Relic Insights. Methods that return boolean results return true if they succeed, or false if the operation did not complete. The following methods are available for custom attributes and events: RecordEvent (name, attributes) NewRelicAgent.RecordEvent (string name, string dictionary attributes) Records a custom Insights event. Includes a list of attributes specified as a map. SetAttribute (name, value) NewRelicAgent.SetAttribute (string name, string value) NewRelicAgent.SetAttribute (string name, double value) Creates an attribute with the specified text name and text/float value. SetAttribute overwrites its previous value and type each time it is called. Examples boolean attributeSet = NewRelicAgent.SetAttribute(\"username\", \"SampleUserName\"); boolean attributeSet = NewRelicAgent.SetAttribute(\"rate\", 9999.99); IncrementAttribute (name [, value]) public static boolean IncrementAttribute(String name); public static boolean incrementAttribute(String name, double value) If value is not specified, this method increments the count for the specified attribute by 1. If the attribute does not exist, it creates the attribute with a value of 1. If value is specified, the method will increment the attribute by the specified amount. Examples boolean incremented = NewRelicAgent.IncrementAttribute(\"rate\"); boolean incremented = NewRelicAgent.IncrementAttribute(\"rate\", 9999.99, false); RemoveAttribute (name) NewRelicAgent.RemoveAttribute(String name) Removes the specified attribute. Example boolean attributeRemoved = NewRelicAgent.RemoveAttribute(\"rate\"); removeAllAttributes NewRelicAgent.removeAllAttributes() Removes all attributes from the session. Example boolean attributesRemoved = NewRelicAgent.RemoveAllAttributes(); Track custom network requests New Relic Mobile's API provides several methods to track network requests and network failures. For example, use the noticeHttpTransaction family of methods to record HTTP transactions with several available levels of detail. If a network request fails, you can record details about the failure with noticeNetworkFailure. NoticeNetworkRequest NewRelicAgent.NoticeNetworkRequest (\"http://newrelic.com\", \"GET\", timer, null, 200, 1024, 8192, bytes, httpParameters); Parameter Description url The URL of the request httpMethod The HTTP method used, such as GET or POST statusCode The statusCode of the HTTP response, such as 200 for OK timer A timer created when the network request was started bytesSent The number of bytes sent in the request bytesReceived The number of bytes received in the response responseBody The response body of the HTTP response. The response body will be truncated and included in an HTTP Error metric if the HTTP transaction is an error. params Additional parameters included in an HTTP Error metric if the HTTP transaction is an error. NoticeNetworkFailure NewRelicAgent.NoticeNetworkFailure(String url, String httpMethod, Timer timer, NewRelicAgent.NetworkFailureCode failureCode, String message) Parameter Description url The URL of the request httpMethod The HTTP method used, such as GET or POST timer A timer created when the network request was started exception The exception that occurred. New Relic Mobile can automatically translate many common exceptions into network failure types. failure The type of network failure that occurred. If an exception cannot be resolved to a network failure automatically, this method can be used to categorize the failure accurately. The values are defined by the NetworkFailure enum. Valid values include Unknown, BadURL, TimedOut, CannotConnectToHost, DNSLookupFailed, BadServerResponse, and SecureConnectionFailed. Uninstall plugin To uninstall the Unity plugin, use the project console to remove all related files and resources that were installed with the Unity package: Delete NewRelicAgent object from the Hierarchy pane of the Unity project console. From All Scripts, delete all the scripts that start with newrelic. Then do the following as applicable: From Assets > Plugin > iOS, delete the NewRelicIos, NewRelicUnityPlugin, post-build, and restore-framework files. Then remove the mod_pbxproj and NewRelicAgent.framework directories. From Assets > Plugin > Android, delete the newrelic.android and NewRelicAndroid files. Then remove the LICENSE and README directories. Unity release notes These release notes are for historical reference. Unity is no longer supported for new customers. Unity plugin 1.2.0 Released on: Monday, March 13, 2017 - 13:00 Download URL: https://download.newrelic.com/unity/NewRelic-Unity-Plugin_1.2.0.zip Notes: Updated Unity plugin to iOS agent 5.9.0 and Android agent 5.9.0 Unity plugin 1.1.0 Released on: Tuesday, September 6, 2016 - 14:53 Download URL: https://download.newrelic.com/unity/NewRelic-Unity-Plugin_1.1.0.zip Notes: Updated Unity plugin to iOS agent 5.8.0 and Android agent 5.7.1 Unity plugin 1.0.1 Released on: Monday, August 8, 2016 - 14:00 Download URL: https://download.newrelic.com/unity/NewRelic-Unity-Plugin_1.0.1.zip Notes: Bundle Android class rewriter JAR file (version 5.6.1) into the Unity package. Unity plugin 1.0.0 Released on: Wednesday, May 25, 2016 - 14:00 Download URL: http://download.newrelic.com/unity/NewRelic-Unity-Plugin_1.0.0.zip Notes: This plugin provides New Relic Mobile agent support for iOS and Android applications built with Unity. It also gives Unity developers access to New Relic crash reporting. It provides information about app performance, sessions, devices, operating systems, and more. It also includes APIs for custom instrumentation to gain deeper insights into specific areas of your app. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "info": "",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 54.824837,
+ "_score": 17.185205,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "sections": "Agent APIs",
- "info": "Open source emitters. APIs. New Relic agents. Get data from anywhere. ",
- "tags": "Agent API",
- "body": " agents to report data, you can use their associated APIs to report custom data. For example, if you monitor your application with the our APM Python agent, you can use the Python agent API to set up custom instrumentation. See the agent APIs. Step 2 of 6 Telemetry SDK Our Telemetry SDKs are language"
+ "body": " The SDK can store up to 64 user-defined attributes at a time. If you attempt to store more than 64 attributes, the SDK returns false. Use the following static methods in the NewRelicAgent namespace to send custom attributes and events to New Relic Insights. Methods that return boolean results return"
},
- "id": "5efa997128ccbc3c9a307dfd"
+ "id": "5c52cbec8e9c0f0b286080ec"
}
],
- "/explore-docs/newrelic-cli": [
- {
- "category_2": "Measure DevOps success",
- "nodeid": 34966,
- "sections": [
- "New Relic solutions",
- "Measure DevOps success",
- "Cloud adoption",
- "Optimize your cloud native environment",
- "Automate instrumentation",
- "Prerequisite",
- "1. Make instrumentation part of every build",
- "2. Take advantage of integrations and existing tools",
- "3. Leverage the power of APIs",
- "For more help"
- ],
- "title": "Automate instrumentation",
- "category_0": "New Relic solutions",
- "type": "docs",
- "category_1": "New Relic solutions",
- "external_id": "91b25e8572d235c7f95963650848fc6ab6cf4b39",
- "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/NRCLItool.png",
- "url": "https://docs.newrelic.com/docs/new-relic-solutions/new-relic-solutions/measure-devops-success/automate-instrumentation",
- "published_at": "2020-09-30T16:47:41Z",
- "updated_at": "2020-09-28T01:04:02Z",
- "breadcrumb": "Contents / New Relic solutions / New Relic solutions / Measure DevOps success",
- "document_type": "page",
- "popularity": 1,
- "info": "Capture tangible, measurable metrics from before and after deployments to optimize your DevOps team. ",
- "body": "Replacing manual instrumentation with automated setup benefits you in many ways. Automation can make you faster, and it helps to eliminate fat-finger errors—and more importantly, it improves observability. You'll spend less time instrumenting systems, and reduce toil as your development ecosystem grows. Prerequisite Before starting this tutorial, be sure to complete the Measure code pipeline tutorial. 1. Make instrumentation part of every build Rolling instrumentation into your standard build process makes visibility the default, instead of being viewed as yet another burden on your developers. Modern build tools like Gradle can do almost anything; you can take advantage of that power to instrument your code quickly and efficiently. Read this Best Practices post for more information about automating instrumentation in your pipeline 2. Take advantage of integrations and existing tools It’s always worth taking a little extra time to look for time-saving integrations and tools that can help to achieve your automation goals. For example, you can use IBM’s open-sourced New Relic CLI (command line interface) tool to automate a variety of tasks, such as managing New Relic Synthetics monitors; creating, editing, and deleting New Relic Alerts policies and conditions; and managing user accounts. Use IBM's New Relic CLI tool to manage your Synthetics monitors, alert policies, and user accounts. 3. Leverage the power of APIs Now that you've instrumented your services, you can take advantage of New Relic's REST API to harvest information from your instrumentation and to manage your monitoring process. The New Relic API Explorer can help you to determine the cURL request format, available parameters, potential response status codes, and JSON response structure for each of the available API calls. The New Relic documentation includes a wealth of additional information on APIs that you can use to automate a number of important tasks, including: APIs to set up alert conditions APIs to define synthetic monitors APIs to create dashboards For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
- "_index": "520d1d5d14cc8a32e600034b",
- "_type": "520d1d5d14cc8a32e600034c",
- "_score": 819.3552,
- "_version": null,
- "_explanation": null,
- "sort": null,
- "highlight": {
- "sections": "New Relic solutions",
- "category_0": "New Relic solutions",
- "category_1": "New Relic solutions",
- "body": " It’s always worth taking a little extra time to look for time-saving integrations and tools that can help to achieve your automation goals. For example, you can use IBM’s open-sourced New Relic CLI (command line interface) tool to automate a variety of tasks, such as managing New Relic Synthetics",
- "breadcrumb": "Contents / New Relic solutions / New Relic solutions / Measure DevOps success"
- },
- "id": "5f5e0c14196a67e25fce6a8a"
- },
+ "/explore-docs/nerdpack-file-structure": [
{
- "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png",
- "url": "https://developer.newrelic.com/",
"sections": [
- "Mark your calendar for Nerd Days 1.0",
- "Get coding",
- "Create custom events",
- "Add tags to apps",
- "Build a Hello, World! app",
- "Get inspired",
- "Add a table to your app",
- "Collect data - any source",
- "Automate common tasks",
- "Create a custom map view",
- "Add a time picker to your app",
- "Add custom attributes",
- "New Relic developer champions",
- "New Relic Podcasts"
+ "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"
],
- "published_at": "2020-10-01T01:45:23Z",
- "title": "New Relic Developers",
- "updated_at": "2020-09-30T01:36:50Z",
- "type": "developer",
- "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab",
- "document_type": "page",
- "popularity": 1,
- "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 13 Days : 21 Hours : 58 Minutes : 23 Seconds Register Get coding Create a free account 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events Start the guide 7 min Add tags to apps Add tags to applications you instrument for easier filtering and organization Start the guide 12 min Build a Hello, World! app Build a Hello, World! app and publish it to your local New Relic One Catalog Start the guide Get inspired 30 min Add a table to your app Add a table to your New Relic One app 15 min Collect data - any source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add a time picker to your app Add a time picker to a sample application Add custom attributes Use custom attributes for deeper analysis Show 20 more guides Looking for more inspiration? Check out the open source projects built by the New Relic community. New Relic developer champions New Relic Champions are solving big problems using New Relic as their linchpin and are recognized as experts and leaders in the New Relic technical community. Nominate a developer champion Learn more about developer champions New Relic Podcasts We like to talk, especially to developers about developer things. Join us for conversations on open source, observability, software design and industry news. Listen",
- "info": "",
- "_index": "520d1d5d14cc8a32e600034b",
- "_type": "520d1d5d14cc8a32e600034c",
- "_score": 766.3325,
- "_version": null,
- "_explanation": null,
- "sort": null,
- "highlight": {
- "title": "New Relic Developers",
- "sections": "New Relic developer champions",
- "body": " source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add a time picker to your app Add a time picker to a sample application Add"
- },
- "id": "5d6fe49a64441f8d6100a50f"
- },
- {
- "image": "https://developer.newrelic.com/static/AaronSoto-d72d9bb5f5e6165751e67367612525f4.jpg",
- "url": "https://developer.newrelic.com/nerd-days/",
- "sections": [
- "Nerd Days is a free 1-day event focused on building more perfect software",
- "Register for Nerd Days 1.0",
- "What’s is Nerd Days exactly…",
- "Save the date & join us online",
- "Additional Nerd Days Events",
- "REGISTER FOR NERD DAYS | AMERICAS",
- "Speaker line up",
- "Aaron Soto",
- "Caitlin Halla",
- "David Shanker",
- "Jeremy Cooper",
- "Joel Worrall",
- "John Vajda",
- "Jon Thurman",
- "Justin Eveland",
- "Leon Chapman",
- "Lindsy Farina",
- "Talia Nassi",
- "Thomas Martin",
- "Tracks",
- "Observability",
- "Cloud migration",
- "Open source",
- "Devops journey",
- "Fundamentals",
- "Nerd Days AMER Agenda",
- "DevOps journey",
- "Keynote: Jemiah Sius, Lew Cirne, and Special Guest Announcements",
- "Instrumenting your service using agents",
- "Increased Maturity with Full Stack Observability",
- "Deploying an app on Kubernetes",
- "Delivering SRE as a Service",
- "Building applications on New Relic One",
- "Exploring your data using NRQL",
- "New Relic AI",
- "Going Serverless: Chipping at the monolith",
- "Logging for Modern Organizations",
- "Grafana and Prometheus with TDP",
- "Lunch with Lew",
- "Custom Instrumentation",
- "Exploring Data with NerdGraph",
- "Tool Consolidation",
- "Flex Integration - Build Your First Linux Configuration",
- "Open Source powers the New Relic One Catalog",
- "Alerts Best Practices",
- "The Art & Science of Deciphering Perceived Performance: A look at how user behavior affects your data",
- "Kubernetes Observability",
- "Measuring code pipelines",
- "New Relic CLI Wizardry/ Reducing toil with Terraform",
- "True availability using Synthetics",
- "How Observability-Driven Development accelerates DevOps transformations",
- "CFP Customer Session: Cloud fundamentals",
- "Testing in Production",
- "NerdStorageVault: ThirdParty Secrets",
- "Closing + Swag",
- "Engage with the developer community"
- ],
- "published_at": "2020-10-01T02:03:39Z",
- "title": "New Relic Developers",
- "updated_at": "2020-09-30T01:45:03Z",
+ "title": "Create a \"Hello, World!\" application",
"type": "developer",
- "external_id": "0b8374051901a77e242ce296c00eeb3c760439d1",
+ "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-10-06T02:07:12Z",
+ "updated_at": "2020-08-21T01:45:19Z",
"document_type": "page",
"popularity": 1,
- "body": "Nerd Days is a free 1-day event focused on building more perfect software Register for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region) What’s is Nerd Days exactly… A FREE developer focused live digital conference covering a broad range of topics at varying levels for all skill sets. Including: Live workshops Live coding and demos Customer examples Panel / Q&A sessions Presented by Relics, partners, Developer Champions, and customers Save the date & join us online Whether you’re new or a data nerd, there’s an interactive session for you. Choose the sessions you're interested in and add Nerd Days to your calendar. Date: October 13, 2020 Time: 9AM PST - 3PM PST We look forward to building with you during Nerd Days! If you have any questions about Nerd Days please emails deco@newrelic.com. Additional Nerd Days Events EMEA RegistrationNov 10, 2020 APJ RegistrationOct 22, 2020 REGISTER FOR NERD DAYS | AMERICAS Speaker line up Get hands on with sessions presented by the following Relics, partners, Developer Champions, and customers. Aaron Soto Sr. Partner Solutions Architect AWS Caitlin Halla Software Engineer New Relic David Shanker Director, Platform Engineering Kinect Consulting Jeremy Cooper Sr. TechOps Strategy Consultant New Relic Joel Worrall Director, Open Source and Developer Advocacy New Relic John Vajda Senior Product Manager New Relic Jon Thurman Senior Solutions Consultant New Relic Justin Eveland Software Engineer New Relic Leon Chapman Senior TechOps Strategy Consultant New Relic Lindsy Farina Senior Product Manager New Relic Talia Nassi Developer Advocate Split Software Thomas Martin Director, Site Reliability 27 Global Tracks Tracks will vary by region. All sessions will be recorded and distributed after the event. Observability Cloud migration Open source Devops journey Fundamentals Nerd Days AMER Agenda We’ve got a packed schedule with thought-leaders of their respective industries Fundamentals Observability Cloud migration DevOps journey Open source 9:00 AM Keynote: Jemiah Sius, Lew Cirne, and Special Guest Announcements Lew Cirne 10:00 AM Instrumenting your service using agents Increased Maturity with Full Stack Observability Deploying an app on Kubernetes Delivering SRE as a Service Building applications on New Relic One 11:00 AM Exploring your data using NRQL New Relic AI Going Serverless: Chipping at the monolith Logging for Modern Organizations Grafana and Prometheus with TDP 12:00 PM Lunch with Lew Lew Cirne and Jemiah Sius 1:00 PM Custom Instrumentation Exploring Data with NerdGraph Tool Consolidation Flex Integration - Build Your First Linux Configuration Open Source powers the New Relic One Catalog 2:00 PM Alerts Best Practices The Art & Science of Deciphering Perceived Performance: A look at how user behavior affects your data Kubernetes Observability Measuring code pipelines New Relic CLI Wizardry/ Reducing toil with Terraform 3:00 PM True availability using Synthetics How Observability-Driven Development accelerates DevOps transformations CFP Customer Session: Cloud fundamentals Testing in Production NerdStorageVault: ThirdParty Secrets 4:00 PM Closing + Swag Jemiah Sius and Team Engage with the developer community @newrelic New Relic Forum Developers Hopin logo Event powered by Hopin",
- "info": "",
+ "info": "Build a \"Hello, World!\" app and publish it to New Relic One",
+ "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return \"Hello, World!\"
; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack manager or admin role can subscribe to an application from accounts that they have permission to manage. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 644.9543,
+ "_score": 413.16742,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "New Relic Developers",
- "sections": "New Relic CLI Wizardry/ Reducing toil with Terraform",
- "body": " the New Relic One Catalog 2:00 PM Alerts Best Practices The Art & Science of Deciphering Perceived Performance: A look at how user behavior affects your data Kubernetes Observability Measuring code pipelines New Relic CLI Wizardry/ Reducing toil with Terraform 3:00 PM True availability using"
+ "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": "5f3dd5bf28ccbc2349f56e4e"
+ "id": "5efa9973196a67d16d76645c"
},
{
"sections": [
@@ -4818,7 +4615,7 @@
"external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
"image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
"url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
- "published_at": "2020-10-01T01:56:53Z",
+ "published_at": "2020-10-06T02:13:01Z",
"updated_at": "2020-09-17T01:51:10Z",
"document_type": "page",
"popularity": 1,
@@ -4826,163 +4623,204 @@
"body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 612.8459,
+ "_score": 321.2166,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "New Relic One CLI reference",
- "sections": "New Relic One CLI reference",
+ "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"
+ "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"
},
{
- "image": "",
- "url": "https://developer.newrelic.com/automate-workflows/",
"sections": [
- "Automate workflows",
- "Guides to automate workflows",
- "Quickly tag resources",
- "Set up New Relic using Helm charts",
- "Automatically tag a simple \"Hello World\" Demo across the entire stack",
- "Set up New Relic using the Kubernetes operator",
- "Automate common tasks",
- "Set up New Relic using Terraform"
+ "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"
],
- "published_at": "2020-10-01T01:54:34Z",
- "title": "Automate workflows",
- "updated_at": "2020-09-25T01:49:59Z",
+ "title": "Map page views by region in a custom app",
"type": "developer",
- "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871",
+ "tags": [
+ "custom app",
+ "map",
+ "page views",
+ "region",
+ "nerdpack"
+ ],
+ "external_id": "6ff5d696556512bb8d8b33fb31732f22bab455cb",
+ "image": "https://developer.newrelic.com/static/d87a72e8ee14c52fdfcb91895567d268/0086b/pageview.png",
+ "url": "https://developer.newrelic.com/build-apps/map-pageviews-by-region/",
+ "published_at": "2020-10-06T02:08:36Z",
+ "updated_at": "2020-09-17T01:48:42Z",
"document_type": "page",
"popularity": 1,
- "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 30 min Automatically tag a simple \"Hello World\" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform",
- "info": "",
+ "info": "Build a New Relic app showing page view data on a world map.",
+ "body": "Map page views by region in a custom app 30 min New Relic has powerful and flexible tools for building custom apps and populating them with data. This guide shows you how to build a custom app and populate it with page view data using New Relic's Query Language (NRQL - pronounced 'nurkle'). Then you make your data interactive. And last, if you have a little more time and want to install a third-party React library, you can display the page view data you collect on a map of the world. In this guide, you build an app to display page view data in two ways: In a table On a map Please review the Before you begin section to make sure you have everything you need and don't get stuck halfway through. Before you begin In order to get the most out of this guide, you must have: A New Relic developer account, API key, and the command-line tool. If you don't have these yet, see the steps in Setting up your development environment New Relic Browser page view data to populate the app. Without this data, you won't be able to complete this guide. To add your data to a world map in the second half of the guide: npm, which you'll use during this section of the guide to install Leaflet, a third-party JavaScript React library used to build interactive maps. If you're new to React and npm, you can go here to install Node.js and npm. New Relic terminology The following are some terms used in this guide: New Relic application: The finished product where data is rendered in New Relic One. This might look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One that launches your application. Nerdlets: New Relic React components used to build your application. The three default files are index.js, nr1.json, and styles.scss, but you can customize and add your own. Build a custom app with a table chart Step 1 of 8 Query your browser data Use Query builder to write a NRQL query to see your page view data, as follows. On New Relic One, select Query your data (in the top right corner). That puts you in NRQL mode. You'll use NRQL to test your query before dropping the data into your table. Copy and paste this query into a clear query field, and then select Run. FROM PageView SELECT count(*), average(duration) WHERE appName = 'WebPortal' FACET countryCode, regionCode SINCE 1 week ago LIMIT 1000 Copy If you have PageView data, this query shows a week of average page views broken down by country and limited to a thousand items. The table will be full width and use the \"chart\" class defined in the CSS. If you don't have any results at this point, ensure your query doesn't have any errors. If your query is correct, you might not have the Browser agent installed. Step 2 of 8 Create and serve a new Nerdpack To get started, create a new Nerdpack, and serve it up to New Relic from your local development environment: Create a new Nerdpack for this app: nr1 create --type nerdpack --name pageviews-app Copy Serve the project up to New Relic: cd pageviews-app && nr1 nerdpack:serve Copy Step 3 of 8 Review your app files and view your app locally Navigate to your pageviews-app to see how it's structured. It contains a launcher folder, where you can customize the description and icon that will be displayed on the app's launcher in New Relic One. It also contains nerdlets, which each contain three default files: index.js, nr1.json, and styles.scss. You'll edit some of these files as part of this guide. For more information, see Nerdpack file structure. Now in your browser, open https://one.newrelic.com/?nerdpacks=local, and then click Apps to see the pageview-apps Nerdpack that you served up. When you select the launcher, you see a Hello message. Step 4 of 8 Hard code your account ID For the purposes of this exercise and for your convenience, hard code your account ID. In the pageview-app-nerdlet directory, in the index.js file, add this code between the import and export lines. (Read about finding your account ID here). const accountId = [Replace with your account ID]; Copy Step 5 of 8 Import the TableChart component To show your data in a table chart, import the TableChart component from New Relic One. To do so, in index.js, add this code under import React. import { TableChart } from 'nr1'; Copy Step 6 of 8 Add a table with a single row To add a table with a single row, in the index.js file, replace this line: return Hello, pageview-app-nerdlet Nerdlet!
; Copy with this export code: export default class PageViewApp extends React.Component { render() { return ( ); } } Copy Step 7 of 8 Customize the look of your table (optional) You can use standard CSS to customize the look of your components. In the styles.scss file, add this CSS. Feel free to customize this CSS to your taste. .container { width: 100%; height: 99vh; display: flex; flex-direction: column; .row { margin: 10px; display: flex; flex-direction: row; } .chart { height: 250px; } } Copy Step 8 of 8 Get your data into that table Now that you've got a table, you can drop a TableChart populated with data from the NRQL query you wrote at the very beginning of this guide. Put this code into the row div. ; Copy Go to New Relic One and click your app to see your data in the table. (You might need to serve your app to New Relic again.) Congratulations! You made your app! Continue on to make it interactive and show your data on a map. Make your app interactive with a text field Once you confirm that data is getting to New Relic from your app, you can start customizing it and making it interactive. To do this, you add a text field to filter your data. Later, you use a third-party library called Leaflet to show that data on a world map. Step 1 of 3 Import the TextField component Like you did with the TableChart component, you need to import a TextField component from New Relic One. import { TextField } from 'nr1'; Copy Step 2 of 3 Add a row for your text field To add a text field filter above the table, put this code above the TableChart div. The text field will have a default value of \"US\". { this.setState({ countryCode: event.target.value }); }} />
; Copy Step 3 of 3 Build the text field object Above the render() function, add a constructor to build the text field object. constructor(props) { super(props); this.state = { countryCode: null } } Copy Then, add a constructor to your render() function. Above return, add: const { countryCode } = this.state; Copy Now add countryCode to your table chart query. ; Copy Reload your app to try out the text field. Get your data on a map To create the map, you use npm to install Leaflet. Step 1 of 9 Install Leaflet In your terminal, type: npm install --save leaflet react-leaflet Copy In your nerdlets styles.scss file, import the Leaflet CSS: @import `~leaflet/dist/leaflet.css`; Copy While you're in styles.scss, fix the width and height of your map: .containerMap { width: 100%; z-index: 0; height: 70vh; } Copy Step 2 of 9 Add a webpack config file for Leaflet Add a webpack configuration file .extended-webpackrc.js to the top-level folder in your nerdpack. This supports your use of map tiling information data from Leaflet. module.exports = { module: { rules: [ { test: /\\.(png|jpe?g|gif)$/, use: [ { loader: 'file-loader', options: {}, }, { loader: 'url-loader', options: { limit: 25000 }, }, ], }, ], }, }; Copy Step 3 of 9 Import modules from Leaflet In index.js, import modules from Leaflet. import { Map, CircleMarker, TileLayer } from 'react-leaflet'; Copy Step 4 of 9 Import additional modules from New Relic One You need several more modules from New Relic One to make the Leaflet map work well. Import them with this code: import { NerdGraphQuery, Spinner, Button, BlockText } from 'nr1'; Copy NerdGraphQuery lets you make multiple NRQL queries at once and is what will populate the map with data. Spinner adds a loading spinner. Button gives you button components. BlockText give you block text components. Step 5 of 9 Get data for the map Using latitude and longitude with country codes, you can put New Relic data on a map. mapData() { const { countryCode } = this.state; const query = `{ actor { account(id: 1606862) { mapData: nrql(query: \"SELECT count(*) as x, average(duration) as y, sum(asnLatitude)/count(*) as lat, sum(asnLongitude)/count(*) as lng FROM PageView FACET regionCode, countryCode WHERE appName = 'WebPortal' ${countryCode ? ` WHERE countryCode like '%${countryCode}%' ` : ''} LIMIT 1000 \") { results nrql } } } }`; return query; }; Copy Step 6 of 9 Customize the map marker colors Above the mapData function, add this code to customize the map marker colors. getMarkerColor(measure, apdexTarget = 1.7) { if (measure <= apdexTarget) { return '#11A600'; } else if (measure >= apdexTarget && measure <= apdexTarget * 4) { return '#FFD966'; } else { return '#BF0016'; } }; Copy Feel free to change the HTML color code values to your taste. In this example, #11A600 is green, #FFD966 is sort of yellow, and #BF0016 is red. Step 7 of 9 Set your map's default center point Set a default center point for your map using latitude and longitude. const defaultMapCenter = [10.5731, -7.5898]; Copy Step 8 of 9 Add a row for your map Between the text field row and the table chart row, insert a new row for the map content using NerdGraphQuery. {({ loading, error, data }) => { if (loading) { return ; } if (error) { return 'Error'; } const { results } = data.actor.account.mapData; console.debug(results); return 'Hello'; }}
; Copy Reload your application in New Relic One to test that it works. Step 9 of 9 Replace \"Hello\" with the Leaflet code Replace return \"Hello\"; with: return ( ); Copy This code creates a world map centered on the latitude and longitude you chose using OpenStreetMap data and your marker colors. Reload your app to see the pageview data on the map!",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 595.20825,
+ "_score": 281.5746,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "sections": "Set up New Relic using Helm charts",
- "body": " CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation"
+ "sections": "Import additional modules from New Relic One",
+ "info": "Build a New Relic app showing page view data on a world map.",
+ "tags": "nerdpack",
+ "body": " look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One"
},
- "id": "5efa999c196a67dfb4766445"
- }
- ],
- "/build-apps/howto-use-nrone-table-components": [
+ "id": "5efa993c196a67066b766469"
+ },
{
- "image": "",
- "url": "https://developer.newrelic.com/components/table-header-cell/",
"sections": [
- "TableHeaderCell",
- "Usage",
- "Props"
+ "Set up your development environment",
+ "Before you begin",
+ "A note on support",
+ "Tip",
+ "Prepare to build or modify apps",
+ "Start building",
+ "Contribute to developer.newrelic.com"
],
- "published_at": "2020-10-01T01:54:34Z",
- "title": "TableHeaderCell",
- "updated_at": "2020-08-03T04:46:36Z",
+ "title": "Set up your development environment",
"type": "developer",
- "external_id": "2a4be1419d1a6e501a8eed915b8acf7c9798259d",
- "document_type": "page",
- "popularity": 1,
- "info": "A TableHeaderCell component!",
- "body": "TableHeaderCell Usage Copy Props There are no props for this component.",
- "_index": "520d1d5d14cc8a32e600034b",
- "_type": "520d1d5d14cc8a32e600034c",
- "_score": 527.07007,
+ "tags": [
+ "developer account",
+ "API key",
+ "New Relic One CLI"
+ ],
+ "external_id": "c45638a9cd548d1ffffc9f1c7708f115a92ae04a",
+ "image": "",
+ "url": "https://developer.newrelic.com/build-apps/set-up-dev-env/",
+ "published_at": "2020-10-06T02:08:36Z",
+ "updated_at": "2020-08-26T01:47:20Z",
+ "document_type": "page",
+ "popularity": 1,
+ "info": "Prepare to build apps and contribute to this site",
+ "body": "Set up your development environment 20 min If you've decided to build a custom app or modify one of our open source apps, you need a few essential tools: The New Relic One command line interface (CLI) An API key, which you get when you download the CLI Depending on what you want to do with your app, you might have some additional setup and configuration. This guide covers: Downloading the New Relic One CLI to build or modify apps Contribute content to this website Before you begin You must have: A github account account - While not strictly necessary for building apps, a GitHub account enables you to download and customize our open source apps, and contribute an open source project. A New Relic developer account - if you don't already have one, you can get a free trial account for developing New Relic applications. npm - If you've installed Node.js, then you already have npm, which is used to share, reuse, and update JavaScript code, and is necessary for working with React components that are the framework for New Relic apps and this website. A note on support Building a New Relic One application is the same as building any JavaScript/React application. We offer support to help with our building tools (our CLI and SDK library). However, we don't offer support for basic JavaScript or React coding questions or issues. For common questions and answers about building, see the Explorers Hub page on building on New Relic One. Tip Use the New Relic One VSCode extension to build your apps. Prepare to build or modify apps Step 1 of 1 Download the CLI and API key. On the Build New Relic One applications page, complete the Quick start steps. These six Quick start steps get you an API key for use with developing apps, and the New Relic One CLI, for building and deploying apps. At the end of the Quick start, you have a project consisting of the following: A Nerdpack - The package containing all the files required by your application. It contains two types of files that you customize to build your app: Nerdlets, and the launcher. One or more Nerdlet files - A specific UI view or window. A Nerdlet is a React JavaScript package that includes an index.js file, a stylesheet, and a JSON-format config file. It can contain any JS functionality (charts, interactive fields, tooltips, etc.). A launcher file: This is the basis for the launcher, which is used to open your application from New Relic One after you publish your app. Start building Step 1 of 1 If you're ready to code, cd to your Nerdpack and get started. If you want to learn more about building applications, try these step-by-step guides: Build a \"Hello, World!\" application shows how to create a little application, publish it to New Relic One, and share it with others by subscribing accounts to it. Map pageviews by region takes you through the steps to create one of our popular open source apps. You learn to add a custom query to an app and view it in a table, then add that data to a map. Contribute to developer.newrelic.com This site is open source, and we want your input. Create a pull request if you see a mistake you know how to fix. Drop us a GitHub issue if you see some content gaps you want us to work on. Or write up a whole new guide if you have one you'd like to share. Read on to learn how. Step 1 of 3 Fork the developer-website GithHub repo. Forking the repo enables you to work on your own copy of the developer.newrelic.com files, and build the site locally. It also enables us to more easily manage incomimg pull requests. On the developer-website page in GitHub, select the Fork button on the top right of the page, choose the account you want to fork to, and wait a few seconds while the fork is created. Sync regularly to keep your fork up to date with changes and additions to the main branch upstream. Step 2 of 3 Make a feature or documentation request. On any page, select the GitHub button at the top of the page, and then select the kind of change you want, and fill out the GitHub form. Step 3 of 3 Contribute a new guide. Check out our contributors guidelines, which will walk you through the process.",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 278.2782,
"_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."
+ "tags": "New Relic One CLI",
+ "body": ". 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"
},
- "id": "5efa9906196a67523e76646e"
+ "id": "5efa9973e7b9d242237bab39"
},
{
"image": "",
- "url": "https://developer.newrelic.com/components/table-row/",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-common/",
"sections": [
- "TableRow",
+ "New Relic One CLI common commands",
+ "Command details",
+ "nr1 help",
+ "See commands and get details",
"Usage",
- "Props"
+ "Arguments",
+ "Examples",
+ "nr1 update",
+ "Update your CLI",
+ "nr1 create",
+ "Create a new component",
+ "Options",
+ "nr1 profiles",
+ "Manage your profiles keychain",
+ "Commands",
+ "nr1 autocomplete",
+ "See autocomplete installation instructions",
+ "nr1 nrql",
+ "Query using NRQL"
],
- "published_at": "2020-10-01T01:54:33Z",
- "title": "TableRow",
- "updated_at": "2020-08-03T04:45:42Z",
+ "published_at": "2020-10-06T02:14:19Z",
+ "title": "New Relic One CLI common commands",
+ "updated_at": "2020-08-14T01:48:10Z",
"type": "developer",
- "external_id": "b9ca0d4e07a506dd961eb2194c5344bfa9ab770d",
+ "external_id": "503e515e1095418f8d19329517344ab209d143a4",
"document_type": "page",
"popularity": 1,
- "info": "A TableRow component!",
- "body": "TableRow Usage Copy Props There are no props for this component.",
+ "info": "An overview of common commands you can use with the New Relic One CLI.",
+ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 431.5422,
+ "_score": 277.20374,
"_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."
+ "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": "5efa98d564441f93435f7e24"
- },
+ "id": "5f28bd6ae7b9d267996ade94"
+ }
+ ],
+ "/build-apps/add-nerdgraphquery-guide": [
{
- "category_2": "Cloud adoption",
- "nodeid": 16121,
+ "image": "",
+ "url": "https://developer.newrelic.com/build-apps/",
"sections": [
- "New Relic solutions",
- "Measure DevOps success",
- "Cloud adoption",
- "Optimize your cloud native environment",
- "Create application baselines",
- "1. Identify components",
- "2. Determine compatibility",
- "3. Deploy monitoring",
- "4. Gather metrics",
- "5. Set up Dashboards",
- "Expert tips",
- "For more help"
+ "Build apps",
+ "Guides to build apps",
+ "Create a \"Hello, World!\" application",
+ "Permissions for managing applications",
+ "Set up your development environment",
+ "Add, query, and mutate data using NerdStorage",
+ "Add the NerdGraphQuery component to an application",
+ "Add a table to your app",
+ "Add a time picker to your app",
+ "Create a custom map view",
+ "Publish and deploy apps"
],
- "title": "Create application baselines",
- "category_0": "New Relic solutions",
- "type": "docs",
- "category_1": "New Relic solutions",
- "external_id": "e971df6f5f6a6360b22e2929f33f9d7af6ff130f",
- "image": "",
- "url": "https://docs.newrelic.com/docs/new-relic-solutions/new-relic-solutions/plan-your-cloud-adoption/create-application-baselines",
- "published_at": "2020-09-30T04:42:24Z",
- "updated_at": "2020-09-27T20:07:57Z",
- "breadcrumb": "Contents / New Relic solutions / New Relic solutions / Cloud adoption",
+ "published_at": "2020-10-06T02:08:36Z",
+ "title": "Build apps",
+ "updated_at": "2020-10-06T02:08:36Z",
+ "type": "developer",
+ "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d",
"document_type": "page",
"popularity": 1,
- "info": "Use New Relic to establish a baseline to use for comparison during your cloud adoption process.",
- "body": "Cloud migrations can take many forms. Some companies choose to port their applications directly from their data center to the cloud (a “Lift and Shift” migration) while others focus on completely re-architecting their applications to take advantage of benefits available only in the cloud. No matter your approach, there are three primary questions you want to answer after your migration: Has my application gotten slower? Is my application less stable than before? Am I losing customers due to either of the previous questions? To answer these questions, start by performing some basic testing to establish a baseline for the performance and availability of your systems. A baseline is a measurement of the current performance and availability of your application, which you then use as a comparison after your migration to validate your business case. In some cases, you may change a baseline when you perform migration acceptance testing. You can also use a baseline as a comparison point during your migration to make sure that you are on track. 1. Identify components Before you begin a cloud migration, identify all the tiers of your entire application stack. List all of the components (applications, services, etc.) that you want to migrate. Segment the application stack as follows: Application (backend/microservices/cron jobs) Dependency services, such as the message queue Database Website Underlying server and infrastructure Make sure that you have access to applications and instances before you start creating application baselines. Engage your application owners, DevOps engineers, and product managers for access. Example: List of components Here is an example of the list of components in an application stack: Component Name Owner Language Stack Accessibility (Internet, Intranet) Operating System Service 1 John Doe Java Internet RHEL 6 Service 2 Maya Wiz .NET Intranet Win2003 R2 RabbitMQ John Doe Java Intranet AIX Website Maya Wiz Classic ASP Internet Win2000 MS SQL Dave Z NA Intranet Win2003 R2 2. Determine compatibility Once you identify the applications that you want to migrate, it is time to verify which application tiers to monitor with the New Relic platform. Work with stakeholders in your organization to determine the amount of instrumentation that is possible–or allowed–within your organization. This is an important step and one that will pay off, as the more you can instrument, the better your baselines. Here are the New Relic products to use for baselining, depending on the components that you identified: New Relic APM: Monitor your web apps with New Relic APM. See Compatibility and requirements for New Relic agents and products to learn precise compatibility details for each supported language. New Relic Infrastructure: Monitor your hosts with New Relic Infrastructure. See Compatibility and requirements for New Relic Infrastructure for supported operating systems and environments. You can also instrument other products and services with on-host integrations. New Relic Synthetics: Monitor web frontends and APIs with New Relic Synthetics. Sometimes, you may not be able to instrument your on-premise environment with APM or Infrastructure. For example, maybe your organization's policy forbids installing an agent behind a firewall. In these cases, if the application has a web frontend, use Synthetics, as it offers non-agent monitoring while still providing the ability to establish a baseline. Example: Components matched to New Relic products Match the components that you identified with their corresponding products: Component Name Tier Owner Language Stack Accessibility (Internet/ Intranet) Operating System New Relic Products Service 1 John Doe Java Internet RHEL 6 APM, Infrastructure, Synthetics Service 2 Maya Wiz .NET Intranet Win2003 R2 APM, Infrastructure ActiveMQ John Doe Java Intranet AIX APM, Plugin Website Maya Wiz Classic ASP Internet Win2000 Synthetics MS SQL Dave Z n/a Intranet Win2003 R2 Infrastructure, On-host Integration 3. Deploy monitoring Based on the component-product matches you made, deploy agents or monitors across your architecture: Deploy New Relic APM Install the APM agent on your application stack. The steps to install the APM agent are different based on language. Deploy New Relic Infrastructure After reviewing the requirements for New Relic Infrastructure, follow the instructions to install the Infrastructure agent on your hosts: Install for Linux Install for Windows Server Install on AWS Elastic Beanstalk Install with a configuration management tool Deploy Infrastructure on-host integrations To gain extended visibility into applications that your code depends on, deploy on-host integrations. Available integrations include Apache, MySQL, NGINX, and others. Create New Relic Synthetics monitors New Relic Synthetics is a suite of automated, scriptable tools to monitor your websites, critical business transactions, and API endpoints. To get started add a monitor. Make sure to verify that your website URL is accessible from the public network. You may also need to add New Relic IPs to your allow list. 4. Gather metrics After you deploy the agents and monitors, identify which metrics are the most important to your business and use these metrics to define your KPIs. Some recommendations include: Response time: Time taken to respond to a request. Throughput: Number of requests that came in through the application. Requesting queuing (Apache, IIS, NGINX): Duration of time taken for a request to reach your application. Database call duration: Duration of time taken to complete a database call. DB call counts: Number of calls made by application code to the database. Error rate: Percent of errors reported. Apdex score: An industry standard to measure user satisfaction with the response time of web applications and services. DNS setup timing: The time it takes to connect and receive data from DNS. SSL setup timing: The time it takes to establish an SSL connection. You can find some of these metrics in service maps, as well as on APM, and Browser overview pages. For more detailed information about navigating, interpreting, and using New Relic APM, check out these New Relic University’s tutorials: Overview dashboard tour Transactions dashboard Understanding Apdex 5. Set up Dashboards After you define your KPIs, it is easy to visualize them in New Relic Dashboards. Dashboards provide a single location to view all the data that New Relic products gather. Dashboards data consists of events, and each event has an event type, a timestamp, and key-value attributes. For more information about events, see Data collection and Default events for New Relic products. You can locate your KPIs and business metrics data in New Relic using the data explorer and the NRQL query language. You can also build Dashboards to track the performance of those KPIs: Example: Component performance compared against baselines Continuing the examples in this document, the following table illustrates the maturity of your application performance over a period of time based on deployment milestones. Each milestone will serve as a new baseline for your applications: Component Milestone 1 Milestone 2 Milestone N Environment Component Name Response Time SLA Apdex Response Time SLA Apdex Response On-Prem Service 1 1.5 secs 80% 70% 1.5 secs 68% 0.65 1.4 secs Cloud Service 1 0.9 secs 96.8% 95% 0.9 secs 98% 0.99 0.7 secs On-Prem Service 2 0.7 secs 73% 68% 0.7 secs 80% 0.78 0.85 secs Cloud Service 2 0.6 secs 90% 92% 0.6 secs 89% 0.90 0.5 secs After your migration, compare these baselines against your migration acceptance testing baselines. Expert tips If you find that you need data that is not captured by default instrumentation, New Relic makes it easy to capture custom data: APM custom instrumentation Browser custom data Infrastructure custom attributes Custom event data Mobile custom data Synthetics custom attributes You can also learn more about APM custom instrumentation with the New Relic University Custom data tutorial series. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "body": "Build apps You know better than anyone what information is crucial to your business, and how best to visualize it. Sometimes, this means going beyond dashboards to creating your own app. With React and GraphQL, you can create custom views tailored to your business. These guides are designed to help you start building apps, and dive into our library of components. We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a \"Hello, World!\" application Build a \"Hello, World!\" app and publish it to New Relic One Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 30 min Add a table to your app Add a table to your New Relic One app 20 min Add a time picker to your app Add a time picker to a sample application 30 min Create a custom map view Build an app to show page view data on a map 30 min Publish and deploy apps Start sharing the apps you build",
+ "info": "",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 339.70355,
+ "_score": 750.39343,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "Create application baselines",
- "sections": "1. Identify components",
- "info": "Use New Relic to establish a baseline to use for comparison during your cloud adoption process.",
- "category_0": "New Relic solutions",
- "category_1": "New Relic solutions",
- "body": " ASP Internet Win2000 Synthetics MS SQL Dave Z n/a Intranet Win2003 R2 Infrastructure, On-host Integration 3. Deploy monitoring Based on the component-product matches you made, deploy agents or monitors across your architecture: Deploy New Relic APM Install the APM agent on your application stack"
+ "title": "Build apps",
+ "sections": "Add the NerdGraphQuery component to an application",
+ "body": ". It allows you to modify, save, and retrieve documents from one session to the next. 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 30 min Add a table to your app Add"
},
- "id": "5ad48685c75d0766faa181bd"
+ "id": "5efa999d64441fc0f75f7e21"
},
{
"sections": [
@@ -5025,7 +4863,7 @@
"external_id": "6ff5d696556512bb8d8b33fb31732f22bab455cb",
"image": "https://developer.newrelic.com/static/d87a72e8ee14c52fdfcb91895567d268/0086b/pageview.png",
"url": "https://developer.newrelic.com/build-apps/map-pageviews-by-region/",
- "published_at": "2020-10-01T01:52:42Z",
+ "published_at": "2020-10-06T02:08:36Z",
"updated_at": "2020-09-17T01:48:42Z",
"document_type": "page",
"popularity": 1,
@@ -5033,59 +4871,59 @@
"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 ( ); Copy This code creates a world map centered on the latitude and longitude you chose using OpenStreetMap data and your marker colors. Reload your app to see the pageview data on the map!",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 307.99503,
+ "_score": 353.73676,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "Map page views by region in a custom app",
- "sections": "Import the TableChart component",
- "info": "Build a New Relic app showing page view data on a world map.",
+ "title": "Map page views by region in a custom app",
+ "sections": "Query your browser data",
+ "info": "Build a New Relic app showing page view data on a world map.",
"tags": "custom app",
- "body": " with a single row To add a table with a single row, in the index.js file, replace this line: return <h1>Hello, pageview-app-nerdlet Nerdlet!</h1>; Copy with this export code: export default class PageViewApp extends React.Component { render() { return ( <div className="container"> <div className="row"></div"
+ "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"
},
{
- "image": "",
- "url": "https://developer.newrelic.com/build-apps/",
"sections": [
- "Build apps",
- "Guides to build apps",
- "Create a \"Hello, World!\" application",
- "Permissions for managing applications",
- "Set up your development environment",
- "Add, query, and mutate data using NerdStorage",
- "Add the NerdGraphQuery component to an application",
- "Add a time picker to your app",
- "Add a table to your app",
- "Create a custom map view",
- "Publish and deploy apps"
+ "Query and store data",
+ "Components overview",
+ "Query components",
+ "Mutation components",
+ "Static methods",
+ "NrqlQuery"
],
- "published_at": "2020-10-01T01:54:33Z",
- "title": "Build apps",
- "updated_at": "2020-09-25T01:49:59Z",
+ "title": "Query and store data",
"type": "developer",
- "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d",
+ "tags": [
+ "nerdgraph query components",
+ "mutation components",
+ "static methods"
+ ],
+ "external_id": "cbbf363393edeefbc4c08f9754b43d38fd911026",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/query-and-store-data/",
+ "published_at": "2020-10-06T02:14:19Z",
+ "updated_at": "2020-08-01T01:42:02Z",
"document_type": "page",
"popularity": 1,
- "body": "Build apps You know better than anyone what information is crucial to your business, and how best to visualize it. Sometimes, this means going beyond dashboards to creating your own app. With React and GraphQL, you can create custom views tailored to your business. These guides are designed to help you start building apps, and dive into our library of components. We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a \"Hello, World!\" application Build a \"Hello, World!\" app and publish it to New Relic One Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 30 min Add a table to your app Add a table to your New Relic One app 30 min Create a custom map view Build an app to show page view data on a map 30 min Publish and deploy apps Start sharing the apps you build",
- "info": "",
+ "info": "Reference guide for SDK query components using NerdGraph",
+ "body": "Query and store data 10 min To help you build a New Relic One application, we provide you with the New Relic One SDK. Here you can learn how to use the SDK query components, which allow you to make queries and mutations via NerdGraph, our GraphQL endpoint. Query-related React components can be identified by the Query suffix. Mutation-related components can be identified by the Mutation prefix. Components overview Our data components are based on React Apollo. The most basic component is NerdGraphQuery, which accepts any GraphQL (or GraphQL AST generated by the graphql-tag library as the query parameter, and a set of query variables passed as variables. Over this query, we have created an additional set of queries, which can be divided into four groups: User queries: These allow you to query the current user and its associated accounts. Components in this category: UserStorageQuery and AccountsQuery. Entities queries: Because New Relic One is entity-centric, we use queries to make access to your entities easier. You can count, search, list, query, and favorite them. Components in this category: EntityCountQuery, EntitySearchQuery, EntitiesByDomainTypeQuery, EntitiesByGuidsQuery, EntityByGuidQuery, EntityByNameQuery. Storage queries: New Relic One provides a simple storage mechanism that we call NerdStorage. This can be used by Nerdpack creators to store application configuration setting data, user-specific data, and other small pieces of data. Components in this category: UserStorageQuery, AccountStorageQuery, EntityStorageQuery, UserStorageMutation, AccountStorageMutation, and EntityStorageMutation. For details, see NerdStorage. NRQL queries: To be able to query your New Relic data via NRQL (New Relic Query Language), we provide a NrqlQuery component. This component can return data in different formats, so that you can use it for charting and not only for querying. Query components All query components accept a function as a children prop where the different statuses can be passed. This callback receives an object with the following properties: loading: Boolean that is set to true when data fetching is happening. Our components use the cache-and-network strategy, meaning that after the data has loaded, subsequent data reloads might be triggered first with stale data, then refreshed when the most recent data has arrived. data: Root property where the data requested is retrieved. The structure matches a root structure based on the NerdGraph schema. This is true even for highly nested data structures, which means you’ll have to traverse down to find the desired data. error: Contains an Error instance when the query fails. Set to undefined when data is loading or the fetch was successful. fetchMore: Callback function that can be called when the query is being loaded in chunks. The function will only be present when it’s feasible to do so, more data is available, and no fetchMore has already been triggered. Data is loaded in batches of 200 by default. Other components provided by the platform (like the Dropdown or the List) are capable of accepting fetchMore, meaning you can combine them easily. Mutation components Mutation components also accept a children as a function, like the query ones. The mutation can be preconfigured at the component level, and a function is passed back that you can use in your component. This is the standard React Apollo approach for performing mutations, but you might find it easier to use our static mutation method added to the component. More on this topic below. Static methods All of the described components also expose a static method so that they can be used imperatively rather than declaratively. All Query components have a static Query method, and all Mutation components have a mutation method. These static methods accept the same props as their query component, but passed as an object. For example: // Declarative way (using components). function renderAccountList() { return ( ({data, error}) => { if (error) { return - Failed to retrieve list: {error.message}
; } return data.map((account) => { - {account.name}
}); }}
); } // Imperative way (using promises). async function getAccountList() { let data = {}; try { data = await AccountsQuery.query(); } catch (error) { console.log('Failed to retrieve list: ' + error.message); return; } return data.actor.accounts.map((account) => { return account.name; }); } Copy Similarly, a mutation can happen either way; either declaratively or imperatively. NrqlQuery NrqlQuery deserves additional explanation, because there are multiple formats in which you can return data from it. To provide maximum functionality, all three are exposed through a formatType property. You can find its different values under NrqlQuery.formatType: NERD_GRAPH: Returns the format in which it arrives from NerdGraph. RAW: The format exposed by default in Insights and dashboards when being plotted as JSON. This format is useful if you have a pre-existing script in this format that you're willing to migrate to or incorporate with. CHART: The format used by the charting engine that we also expose. You can find a more detailed explanation of how to manipulate this format in the guide to chart components, and some examples. If you are willing to push data, we currently do not expose NrqlMutation. To do that, see the Event API for how to add custom events.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 306.30048,
+ "_score": 263.1992,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "Build apps",
- "sections": "Add the NerdGraphQuery component to an application",
- "body": " app Add a time picker to a sample application 30 min Add a table to your app Add a table to your New Relic One app 30 min Create a custom map view Build an app to show page view data on a map 30 min Publish and deploy apps Start sharing the apps you build"
+ "title": "Query and store data",
+ "sections": "Components overview",
+ "info": "Reference guide for SDK query components using NerdGraph",
+ "tags": "nerdgraph query components",
+ "body": " be identified by the Query suffix. Mutation-related components can be identified by the Mutation prefix. Components overview Our data components are based on React Apollo. The most basic component is NerdGraphQuery, which accepts any GraphQL (or GraphQL AST generated by the graphql-tag library as the query"
},
- "id": "5efa999d64441fc0f75f7e21"
- }
- ],
- "/automate-workflows/get-started-kubernetes": [
+ "id": "5efa989e28ccbc2f15307deb"
+ },
{
"category_2": "Alert conditions",
"nodeid": 9231,
@@ -5121,293 +4959,216 @@
"external_id": "956a7a0b84d2afac5e6236df3143085ebc4f7459",
"image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/signal-loss-ui.png",
"url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions",
- "published_at": "2020-09-30T20:06:36Z",
- "updated_at": "2020-09-30T20:06:35Z",
+ "published_at": "2020-10-04T08:33:54Z",
+ "updated_at": "2020-10-04T08:33:54Z",
"breadcrumb": "Contents / Alerts and Applied Intelligence / New Relic Alerts / Alert conditions",
"document_type": "page",
"popularity": 1,
"info": "How to define thresholds that trigger alert notifications based on your NRQL queries.",
- "body": "You can create alert conditions using NRQL queries. Create NRQL alert condition To create a NRQL alert condition: When you start to create a condition, where it prompts you to Select a product, click NRQL. Tips for creating and using a NRQL condition: Topic Tips Condition types NRQL condition types include static, baseline, and outlier. Create a description For some condition types, you can create a Description. Query results Queries must return a number. The condition works by evaluating that returned number against the thresholds you set. Time period As with all alert conditions, NRQL conditions evaluate one single minute at a time. The implicit SINCE ... UNTIL clause specifying which minute to evaluate is controlled by your Evaluation offset setting. Since very recent data may be incomplete, you may want to query data from 3 minutes ago or longer, especially for: Applications that run on multiple hosts. SyntheticCheck data: Timeouts can take 3 minutes, so 5 minutes or more is recommended. Also, if a query will generate intermittent data, consider using the sum of query results option. Loss of signal Use the signal loss settings to: Set the signal loss time limit Close all current open violations Open new violations To learn more about signal loss and how to request access to it, see this announcement. Condition settings Use the Condition settings to: Create a concise and descriptive condition name. Choose how long data is collected before it's aggregated. Adjust the evaluation offset. Select whether or not to fill gaps with data and what values to use. Provide a text description for the condition that will be included in violations and notifications. Sometimes a signal will have an aggregation window that does not contain data. This creates a gap in the data that is evaluated. This feature allows you to fill gaps in data with either the last known or a custom value that you choose. It is common to use a zero as the custom value. The default behavior is to leave gaps empty, which will restart the evaluation duration timer. To learn more about gap filling and how to request access to it, see this announcement. Troubleshooting procedures Optional: To include your organization's procedures for handling the incident, add the runbook URL to the condition. Limits on conditions See the maximum values. Health status NRQL alert conditions do not affect an entity's health status display. Examples For more information, see: Expected NRQL syntax Examples of NRQL condition queries Alert threshold types When you create a NRQL alert, you can choose from different types of thresholds: NRQL alert threshold types Description Static This is the simplest type of NRQL threshold. It allows you to create a condition based on a NRQL query that returns a numeric value. Optional: Include a FACET clause. Baseline Uses a self-adjusting condition based on the past behavior of the monitored values. Uses the same NRQL query form as the static type, except you cannot use a FACET clause. Outlier Looks for group behavior and values that are outliers from those groups. Uses the same NRQL query form as the static type, but requires a FACET clause. NRQL alert syntax Here is the basic syntax for creating all NRQL alert conditions. Depending on the threshold type, also include a FACET clause as applicable. SELECT function(attribute) FROM Event WHERE attribute [comparison] [AND|OR ...] Clause Notes SELECT function(attribute) Required Supported functions that return numbers include: apdex average count latest max min percentage percentile sum uniqueCount If you use the percentile aggregator in a faceted alert condition with many facets, this may cause the following error to appear: An error occurred while fetching chart data. If you see this error, use average instead. FROM data type Required Only one data type can be targeted. Supported data types: Event Metric (RAW data points will be returned) WHERE attribute [comparison] [AND|OR ...] Optional Use the WHERE clause to specify a series of one or more conditions. All the operators are supported. FACET attribute Static: Optional Baseline: Not allowed Outlier: Required Including a FACET clause in your NRQL syntax depends on the threshold type: static, baseline, or outlier. Use the FACET clause to separate your results by attribute and alert on each attribute independently. Faceted queries can return a maximum of 5000 values for static conditions and a maximum of 500 values for outlier conditions. If the query returns more than this number of values, the alert condition cannot be created. If you create the condition and the query returns more than this number later, the alert will fail. Sum of query results (limited or intermittent data) Available only for static (basic) threshold types. If a query returns intermittent or limited data, it may be difficult to set a meaningful threshold. Missing or limited data will sometimes generate false positives or false negatives. To avoid this problem when using the static threshold type, you can set the selector to sum of query results. This lets you set the alert on an aggregated sum instead of a value from a single harvest cycle. Up to two hours of the one-minute data checks can be aggregated. The duration you select determines the width of the rolling sum, and the preview chart will update accordingly. Set the loss of signal threshold Go to one.newrelic.com, click Alerts & AI, in the left sidebar click Policies, select a policy, then Create a condition. Loss of signal is only available for NRQL conditions. A loss of signal is a period of time when no data is received by New Relic. Sometimes, there's no data being sent and sometimes data is being lost. You can use loss of signal to customize whether and when you'll be notified after your last known signal. To create a NRQL alert that uses loss of signal: When creating a condition, under Select a product, click NRQL, then click Next, define thresholds. Create a NRQL query that returns the values you want to alert on. For Threshold type, select Static or Baseline. Click + Add lost signal threshold, then set the time in minutes or seconds after which the signal will be considered lost. When the signal is lost, check the boxes to Close all current open violations and Open new \"lost signal\" violation. Make sure you name your condition and then save it. You can use a signal loss to close all of your currently open violations, open a lost signal violation, or do both. 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%' Nested Aggregation NRQL Alerts Nested aggregation queries are a powerful way to query your data and open up new possibilities to alert on. However, they have a few restrictions that are important to note. Nested queries with a non-faceted innermost query are not currently supported Without a FACET, the inner query will produce a single result thus giving the outer query nothing to aggregate. Registering the inner query alone would be equivalent. SELECT max(cpu) FROM (FROM Event SELECT min(cpuTime) as cpu) Queries at all levels must have the same aggregation window Assuming the alert is registered with an aggregation window of 1 minute, this inner query would produce 2 smaller windows of width 30 seconds which could be aggregated by the outer query. However, this is not currently supported. SELECT max(cpu) FROM (FROM Event SELECT min(cpuTime) as cpu TIMESERIES 30 seconds) Signal loss is not yet supported for nested queries For more information on signal loss, see NerdGraph API: Loss of signal and gap filling. 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.",
+ "body": "You can create alert conditions using NRQL queries. Create NRQL alert condition To create a NRQL alert condition: When you start to create a condition, where it prompts you to Select a product, click NRQL. Tips for creating and using a NRQL condition: Topic Tips Condition types NRQL condition types include static, baseline, and outlier. Create a description For some condition types, you can create a Description. Query results Queries must return a number. The condition works by evaluating that returned number against the thresholds you set. Time period As with all alert conditions, NRQL conditions evaluate one single minute at a time. The implicit SINCE ... UNTIL clause specifying which minute to evaluate is controlled by your Evaluation offset setting. Since very recent data may be incomplete, you may want to query data from 3 minutes ago or longer, especially for: Applications that run on multiple hosts. SyntheticCheck data: Timeouts can take 3 minutes, so 5 minutes or more is recommended. Also, if a query will generate intermittent data, consider using the sum of query results option. Loss of signal Use the signal loss settings to: Set the signal loss time limit Close all current open violations Open new violations To learn more about signal loss and how to request access to it, see this announcement. Condition settings Use the Condition settings to: Create a concise and descriptive condition name. Choose how long data is collected before it's aggregated. Adjust the evaluation offset. Select whether or not to fill gaps with data and what values to use. To learn more about gap filling and how to request access to it, see this announcement. Provide a text description for the condition that will be included in violations and notifications. Sometimes a signal will have an aggregation window that does not contain data. This creates a gap in the data that is evaluated. This feature allows you to fill gaps in data with either the last known or a custom value that you choose. It is common to use a zero as the custom value. The default behavior is to leave gaps empty, which will restart the evaluation duration timer. Troubleshooting procedures Optional: To include your organization's procedures for handling the incident, add the runbook URL to the condition. Limits on conditions See the maximum values. Health status NRQL alert conditions do not affect an entity's health status display. Examples For more information, see: Expected NRQL syntax Examples of NRQL condition queries Alert threshold types When you create a NRQL alert, you can choose from different types of thresholds: NRQL alert threshold types Description Static This is the simplest type of NRQL threshold. It allows you to create a condition based on a NRQL query that returns a numeric value. Optional: Include a FACET clause. Baseline Uses a self-adjusting condition based on the past behavior of the monitored values. Uses the same NRQL query form as the static type, except you cannot use a FACET clause. Outlier Looks for group behavior and values that are outliers from those groups. Uses the same NRQL query form as the static type, but requires a FACET clause. NRQL alert syntax Here is the basic syntax for creating all NRQL alert conditions. Depending on the threshold type, also include a FACET clause as applicable. SELECT function(attribute) FROM Event WHERE attribute [comparison] [AND|OR ...] Clause Notes SELECT function(attribute) Required Supported functions that return numbers include: apdex average count latest max min percentage percentile sum uniqueCount If you use the percentile aggregator in a faceted alert condition with many facets, this may cause the following error to appear: An error occurred while fetching chart data. If you see this error, use average instead. FROM data type Required Only one data type can be targeted. Supported data types: Event Metric (RAW data points will be returned) WHERE attribute [comparison] [AND|OR ...] Optional Use the WHERE clause to specify a series of one or more conditions. All the operators are supported. FACET attribute Static: Optional Baseline: Not allowed Outlier: Required Including a FACET clause in your NRQL syntax depends on the threshold type: static, baseline, or outlier. Use the FACET clause to separate your results by attribute and alert on each attribute independently. Faceted queries can return a maximum of 5000 values for static conditions and a maximum of 500 values for outlier conditions. If the query returns more than this number of values, the alert condition cannot be created. If you create the condition and the query returns more than this number later, the alert will fail. Sum of query results (limited or intermittent data) Available only for static (basic) threshold types. If a query returns intermittent or limited data, it may be difficult to set a meaningful threshold. Missing or limited data will sometimes generate false positives or false negatives. To avoid this problem when using the static threshold type, you can set the selector to sum of query results. This lets you set the alert on an aggregated sum instead of a value from a single harvest cycle. Up to two hours of the one-minute data checks can be aggregated. The duration you select determines the width of the rolling sum, and the preview chart will update accordingly. Set the loss of signal threshold Go to one.newrelic.com, click Alerts & AI, in the left sidebar click Policies, select a policy, then Create a condition. Loss of signal is only available for NRQL conditions. A loss of signal is a period of time when no data is received by New Relic. Sometimes, there's no data being sent and sometimes data is being lost. You can use loss of signal to customize whether and when you'll be notified after your last known signal. To create a NRQL alert that uses loss of signal: When creating a condition, under Select a product, click NRQL, then click Next, define thresholds. Create a NRQL query that returns the values you want to alert on. For Threshold type, select Static or Baseline. Click + Add lost signal threshold, then set the time in minutes or seconds after which the signal will be considered lost. When the signal is lost, check the boxes to Close all current open violations and Open new \"lost signal\" violation. Make sure you name your condition and then save it. You can use a signal loss to close all of your currently open violations, open a lost signal violation, or do both. 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%' Nested Aggregation NRQL Alerts Nested aggregation queries are a powerful way to query your data and open up new possibilities to alert on. However, they have a few restrictions that are important to note. Nested queries with a non-faceted innermost query are not currently supported Without a FACET, the inner query will produce a single result thus giving the outer query nothing to aggregate. Registering the inner query alone would be equivalent. SELECT max(cpu) FROM (FROM Event SELECT min(cpuTime) as cpu) Queries at all levels must have the same aggregation window Assuming the alert is registered with an aggregation window of 1 minute, this inner query would produce 2 smaller windows of width 30 seconds which could be aggregated by the outer query. However, this is not currently supported. SELECT max(cpu) FROM (FROM Event SELECT min(cpuTime) as cpu TIMESERIES 30 seconds) Signal loss is not yet supported for nested queries For more information on signal loss, see NerdGraph API: Loss of signal and gap filling. Create a description You can define a description that passes useful information downstream for better violation responses or for use by downstream systems. For details, see Description. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 121.83852,
+ "_score": 260.53986,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "Create NRQL alert conditions",
- "sections": "Create NRQL alert conditions",
- "info": "How to define thresholds that trigger alert notifications based on your NRQL queries.",
- "category_0": "Alerts and Applied Intelligence",
- "category_1": "New Relic Alerts",
- "category_2": "Alert conditions",
- "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions",
- "body": "You can create alert conditions using NRQL queries. Create NRQL alert condition To create a NRQL alert condition: When you start to create a condition, where it prompts you to Select a product, click NRQL. Tips for creating and using a NRQL condition: Topic Tips Condition types NRQL condition types",
- "breadcrumb": "Contents / Alerts and Applied Intelligence / New Relic Alerts / Alert conditions"
+ "sections": "Sum of query results (limited or intermittent data)",
+ "info": "How to define thresholds that trigger alert notifications based on your NRQL queries.",
+ "category_0": "Alerts and Applied Intelligence",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions",
+ "body": " 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"
},
"id": "5f2d992528ccbc489d88dfc1"
},
{
- "category_2": "Alerts release notes",
- "nodeid": 40776,
+ "category_2": "NRQL query tutorials",
+ "nodeid": 36916,
"sections": [
- "New Relic Platform release notes",
- "Alerts release notes",
- "APM release notes",
- "Cloud Integrations release notes",
- "Diagnostics release notes",
- "Mobile release notes",
- "Kubernetes integration release notes",
- "09-28-2020 : Action Required : New Relic One Streaming Alerts for NRQL Conditions",
- "Component: NRQL Conditions (Review Required)",
- "Announcing : New Relic One Streaming Alerts",
- "Please read the full announcement and FAQ here , and follow the links to enroll."
+ "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?",
+ "Get available metrics",
+ "Facet on a wildcarded metric name segment",
+ "Recommended aggregator functions",
+ "Query examples",
+ "For more help"
],
- "title": "09-28-2020 : Action Required : New Relic One Streaming Alerts for NRQL Conditions",
- "category_0": "Release notes",
+ "title": "Query APM metric timeslice data with NRQL",
+ "category_0": "Query your data",
"type": "docs",
- "category_1": "New Relic Platform release notes",
- "external_id": "74ae41c7360962287ea605016bf7731035382166",
- "image": "",
- "url": "https://docs.newrelic.com/docs/release-notes/platform-release-notes/alerts-release-notes/09-28-2020-action-required-new-relic-one-streaming-alerts-nrql-conditions",
- "published_at": "2020-09-30T09:07:43Z",
- "updated_at": "2020-09-29T22:06:08Z",
- "breadcrumb": "Contents / New Relic Platform Release Notes / Alerts release notes",
- "document_type": "release_notes_platform",
+ "category_1": "NRQL: New Relic Query Language",
+ "external_id": "f536406572d7d2aafd2df6acd5da36a035ef82c3",
+ "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-10-03T23:04:50Z",
+ "updated_at": "2020-09-30T16:27:58Z",
+ "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / NRQL query tutorials",
+ "document_type": "page",
"popularity": 1,
- "body": "[RSS] Released on: September 28, 2020 Component: NRQL Conditions (Review Required) Announcing : New Relic One Streaming Alerts New Relic is rolling out a new, unified streaming alerts platform for New Relic One. This new streaming alerts platform will power NRQL Alert Conditions, and over the next year, all alert condition types will be consolidated into NRQL conditions. New Relic One Streaming Alerts delivers: More reliable alerting that is far less susceptible to data latency and processing lag. Increased accuracy of the data points that are being evaluated Reduced time-to-detect through improvements in the streaming algorithm, and configurable aggregation duration. Greater control over the signals being monitored. You can specify how to evaluate signal gaps, when to consider a signal as lost, and what actions should be taken. Consistent behavior and configuration of Alert conditions regardless of the telemetry type, source of the signal being monitored, or specifics of your NRQL query. Increased scalability in the number of time series that an Alert Condition can monitor and in the total number of conditions that can be configured ** Action Required : Opt-in Migration ** When we roll out this new streaming platform, there is a change in behavior related to how we process aggregation time windows that do not have data. If you are monitoring for when a signal goes to “0” in order to determine if an entity stops reporting, this approach will no longer work after moving to the new platform. To maintain this functionality you must enable Loss of Signal detection on these conditions in advance of moving your account in order to prevent false negatives. You may opt-in to this new platform now. Read more about the rollout plan in the FAQ section below. Please read the full announcement and FAQ here , and follow the links to enroll. When is this available? You can opt-in to enable New Relic Streaming Alerts on NRQL conditions right now. We plan to enable the majority of accounts the week of October 5th. Accounts that have NRQL Conditions that may be monitoring for loss of signal will not be enabled automatically until October 28th. These are NRQL Conditions that either use the “Less Than” operator, or have an operator and threshold of “Equals 0”. During the initial roll out the week of October 5th, you will see a banner on the top of the policy page and the NRQL Conditions create/edit page that will indicate whether your account has been enabled or whether you must update your configurations and opt-in.",
- "info": "",
+ "info": "In New Relic, you can query metric timeslice data from APM using NRQL. ",
+ "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. To explore timeslice data in the data explorer, see Explore your metrics. 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 Learn how to see all metrics available to you. 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 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. Get available metrics To get a list of available metrics for an application, you can use a query like: SELECT uniques(metricTimesliceName) FROM Metric WHERE appName='YOUR_APP_NAME' AND newrelic.timeslice.value IS NOT NULL 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.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 112.883255,
+ "_score": 254.10881,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "09-28-2020 : Action Required : New Relic One Streaming Alerts for NRQL Conditions",
- "sections": "09-28-2020 : Action Required : New Relic One Streaming Alerts for NRQL Conditions",
- "category_2": "Alerts release notes",
- "body": "[RSS] Released on: September 28, 2020 Component: NRQL Conditions (Review Required) Announcing : New Relic One Streaming Alerts New Relic is rolling out a new, unified streaming alerts platform for New Relic One. This new streaming alerts platform will power NRQL Alert Conditions, and over the next"
+ "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": " 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",
+ "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / NRQL query tutorials"
},
- "id": "5f735c6964441f8a6aeb7297"
- },
- {
- "category_2": "Alert conditions",
- "nodeid": 7261,
- "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",
- "Set thresholds for an alert condition",
- "What is a threshold?",
- "View and set thresholds",
- "For more help"
- ],
- "title": "Set thresholds for an alert condition",
- "category_0": "Alerts and Applied Intelligence",
- "type": "docs",
- "category_1": "New Relic Alerts",
- "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/set-thresholds-alert-condition",
- "external_id": "3b8b9a21021955bde8536ec49e7348f9bc1b6307",
- "image": "",
- "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/set-thresholds-alert-condition",
- "published_at": "2020-09-30T13:34:48Z",
- "updated_at": "2020-09-30T13:34:48Z",
- "breadcrumb": "Contents / Alerts and Applied Intelligence / New Relic Alerts / Alert conditions",
- "document_type": "page",
- "popularity": 1,
- "info": "In Alerts, thresholds are what determines when a condition will trigger a violation.",
- "body": "When you create a condition, you set thresholds that determine what will open a violation. This document explains what thresholds are and how to set them. What is a threshold? For a condition, thresholds are the settings that determine what opens a violation. Depending on a policy's incident preference, a violation may result in: The creation of an incident. Notifications being sent. Examples of thresholds: An application’s average web response time is greater than 5 seconds for 15 minutes. An application’s error rate per minute hits 10% or higher at least once in an hour. An application’s AJAX response time deviates a certain amount from its expected baseline behavior. Besides a mandatory critical threshold level, you can also set thresholds for a less serious warning level, which doesn't generate an incident or send a notification. View and set thresholds Thresholds are set during the process of creating a condition: Goal Instructions Set thresholds for a new condition Set thresholds as part of the process of creating a condition. View and update thresholds for existing conditions To view a condition’s thresholds: find that condition in the UI. To update thresholds, select a condition’s thresholds and make changes. To learn more about specific alert condition types (like baseline and NRQL), see Types of conditions. Details about other functionality and rules: Use the Alerts API You can list and edit conditions with the Alerts API. Set optional warning level You can set thresholds for two levels: critical (required) and warning (optional). Threshold level Details Critical (red) Required. When a violation occurs, it will send notifications depending on incident preference settings. Warning (yellow) Optional. Doesn't generate notifications. Use a warning threshold when you want to monitor when a system behavior is concerning or noteworthy but not important enough to require a notification. Loss of signal (NRQL only) A loss of signal is a period of time when no data is received by New Relic. This could be the result of an entity or service going offline, an issue with an agent or collector, or networking problems in a data center or the internet. You can use loss of signal detection to create a new violation and notification if a signal stops and you expect a service to be stable. You may also want to use this to determine when an ephemeral service stops and set the action to close any open violations that exist for this condition. To learn more about signal loss, gap filling, and how to request access to these features, see this announcement. Set time intervals Different condition types have different minimum time intervals. For example, some condition types have a minimum time interval of 5 minutes (for example, APM metric alert conditions), and others have a minimum time interval of 1 minute (for example, NRQL alert conditions). Set URL for runbook instructions For how to set this via the UI, see Runbook instructions. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
- "_index": "520d1d5d14cc8a32e600034b",
- "_type": "520d1d5d14cc8a32e600034c",
- "_score": 106.77141,
- "_version": null,
- "_explanation": null,
- "sort": null,
- "highlight": {
- "title": "Set thresholds for an alert condition",
- "sections": "Alert conditions",
- "info": "In Alerts, thresholds are what determines when a condition will trigger a violation.",
- "category_0": "Alerts and Applied Intelligence",
- "category_1": "New Relic Alerts",
- "category_2": "Alert conditions",
- "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/set-thresholds-alert-condition",
- "body": " a condition’s thresholds and make changes. To learn more about specific alert condition types (like baseline and NRQL), see Types of conditions. Details about other functionality and rules: Use the Alerts API You can list and edit conditions with the Alerts API. Set optional warning level You can set",
- "breadcrumb": "Contents / Alerts and Applied Intelligence / New Relic Alerts / Alert conditions"
- },
- "id": "5f2d847c64441fc0a656a98a"
- },
+ "id": "5f2b1349196a67379343fbcf"
+ }
+ ],
+ "/explore-docs/nr1-config": [
{
- "image": "",
- "url": "https://developer.newrelic.com/automate-workflows/",
"sections": [
- "Automate workflows",
- "Guides to automate workflows",
- "Quickly tag resources",
- "Set up New Relic using Helm charts",
- "Automatically tag a simple \"Hello World\" Demo across the entire stack",
- "Set up New Relic using the Kubernetes operator",
- "Automate common tasks",
- "Set up New Relic using Terraform"
+ "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"
],
- "published_at": "2020-10-01T01:54:34Z",
- "title": "Automate workflows",
- "updated_at": "2020-09-25T01:49:59Z",
+ "title": "New Relic One CLI reference",
"type": "developer",
- "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871",
- "document_type": "page",
- "popularity": 1,
- "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 30 min Automatically tag a simple \"Hello World\" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform",
- "info": "",
- "_index": "520d1d5d14cc8a32e600034b",
- "_type": "520d1d5d14cc8a32e600034c",
- "_score": 100.16582,
- "_version": null,
- "_explanation": null,
- "sort": null,
- "highlight": {
- "sections": "Set up New Relic using the Kubernetes operator",
- "body": " it is to leverage automation in your DevOps environment! 20 min Set up New Relic using the Kubernetes operator Learn how to provision New Relic resources using the Kubernetes operator 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform"
- },
- "id": "5efa999c196a67dfb4766445"
- },
- {
- "category_2": "Understand and use data",
- "nodeid": 37981,
- "sections": [
- "Elastic Container Service integration",
- "Get started",
- "Install",
- "Understand and use data",
- "Troubleshooting",
- "Recommended ECS alert conditions",
- "Recommended alert conditions",
- "For more help"
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
],
- "title": "Recommended ECS alert conditions",
- "category_0": "Integrations",
- "type": "docs",
- "category_1": "Elastic Container Service integration",
- "external_id": "304f01e7a5c68e9ef4dc76782eb9ff6847854065",
- "image": "",
- "url": "https://docs.newrelic.com/docs/integrations/elastic-container-service-integration/understand-use-data/ecs-integration-recommended-alert-conditions",
- "published_at": "2020-09-30T14:33:21Z",
- "updated_at": "2020-08-06T00:29:40Z",
- "breadcrumb": "Contents / Integrations / Elastic Container Service integration / Understand and use data",
+ "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-10-06T02:13:01Z",
+ "updated_at": "2020-09-17T01:51:10Z",
"document_type": "page",
"popularity": 1,
- "info": "Tips for useful alert conditions to set for New Relic's Amazon ECS integration. ",
- "body": "New Relic's ECS integration reports and displays performance data from your Amazon ECS environment. This document provides some recommended alert conditions for monitoring ECS performance. Recommended alert conditions Here are some recommended ECS alert conditions. To add these alerts, go to the Alerts UI and add the following NRQL alert conditions to an existing or new alert policy: High CPU usage NRQL: FROM ContainerSample SELECT cpuUsed / cpuLimitCores Critical: > 90% for 5 minutes High memory usage NRQL: FROM ContainerSample SELECT memoryUsageBytes / memorySizeLimitBytes Critical: > 80% for 5 minutes Restart count NRQL: FROM ContainerSample SELECT max(restartCount) - min(restartCount) Critical: > 5 for 5 minutes For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 60.799225,
+ "_score": 229.33054,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "Recommended ECS alert conditions",
- "sections": "Recommended ECS alert conditions",
- "info": "Tips for useful alert conditions to set for New Relic's Amazon ECS integration. ",
- "body": " to the Alerts UI and add the following NRQL alert conditions to an existing or new alert policy: High CPU usage NRQL: FROM ContainerSample SELECT cpuUsed / cpuLimitCores Critical: > 90% for 5 minutes High memory usage NRQL: FROM ContainerSample SELECT memoryUsageBytes / memorySizeLimitBytes Critical: > 80"
+ "title": "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": "5ee05e9e28ccbcef4f4c8dda"
- }
- ],
- "/build-apps/build-hello-world-app": [
+ "id": "5efa989e28ccbc535a307dd0"
+ },
{
"sections": [
- "Intro to New Relic One API components",
- "Components of the SDK",
- "UI components",
- "Chart components",
- "Query and storage components",
- "Platform APIs"
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
],
- "title": "Intro to New Relic One API components",
+ "title": "New Relic CLI Reference",
"type": "developer",
- "tags": [
- "SDK components",
- "New Relic One apps",
- "UI components",
- "chart components",
- "query and storage components",
- "Platform APIs"
- ],
- "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2",
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
"image": "",
- "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/",
- "published_at": "2020-10-01T01:55:36Z",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-10-06T02:13:01Z",
"updated_at": "2020-08-14T01:47:12Z",
"document_type": "page",
"popularity": 1,
- "info": "Intro to New Relic One API components",
- "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 198.72672,
+ "_score": 151.85236,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "Intro to New Relic One API components",
- "sections": "Intro to New Relic One API components",
- "info": "Intro to New Relic One API components",
- "tags": "New Relic One apps",
- "body": ", and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform"
+ "title": "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": "5efa989e28ccbc4071307de5"
+ "id": "5efa989ee7b9d2024b7bab97"
},
{
+ "category_2": "Troubleshooting",
+ "nodeid": 13726,
"sections": [
- "Nerdpack file structure",
- "Generate Nerdpack components",
- "Nerdlet file structure",
- "index.js",
- "nr1.json",
- "styles.scss",
- "icon.png",
- "Launcher file structure"
- ],
- "title": "Nerdpack file structure",
- "type": "developer",
- "tags": [
- "New Relic One CLI",
- "nerdpack",
- "file structure",
- "nerdlets",
- "launchers"
+ "Cross-product functions",
+ "Install and configure",
+ "Troubleshooting",
+ "New Relic Diagnostics",
+ "Compatibility",
+ "Run New Relic Diagnostics",
+ "Suites flag (highly recommended CLI option)",
+ "View suites",
+ "Run suites",
+ "View or copy attachment key",
+ "Upload results to a support ticket",
+ "Automatic upload",
+ "Manual upload",
+ "Pass command line options",
+ "Validate your config file settings",
+ "Interpret the output",
+ "File output",
+ "Result status codes",
+ "Run New Relic Diagnostics in a Docker container",
+ "Licensing and security",
+ "For more help"
],
- "external_id": "c97bcbb0a2b3d32ac93b5b379a1933e7b4e00161",
- "image": "",
- "url": "https://developer.newrelic.com/explore-docs/nerdpack-file-structure/",
- "published_at": "2020-10-01T01:55:36Z",
- "updated_at": "2020-08-14T01:49:25Z",
+ "title": "New Relic Diagnostics",
+ "category_0": "Using New Relic",
+ "type": "docs",
+ "category_1": "Cross-product functions",
+ "external_id": "e3727dcd782d57b0ccb3dbc1711cdeecda46c218",
+ "image": "https://docs.newrelic.com/sites/default/files/styles/inline_660px/public/thumbnails/image/screen-nrdiag-output_0.png?itok=chbRj-vb",
+ "url": "https://docs.newrelic.com/docs/using-new-relic/cross-product-functions/troubleshooting/new-relic-diagnostics",
+ "published_at": "2020-10-03T18:09:20Z",
+ "updated_at": "2020-10-03T18:09:20Z",
+ "breadcrumb": "Contents / Using New Relic / Cross-product functions / Troubleshooting",
"document_type": "page",
"popularity": 1,
- "info": "An overview of the Nerdpack File Structure",
- "body": "Nerdpack file structure A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. Here we explain: The file structure for a Nerdpack, a Nerdlet, and a launcher How to link a launcher file to a Nerdlet How to link your application with a monitored entity For basic component definitions, see our component reference. Generate Nerdpack components There are two ways to generate a Nerdpack template: Generate a Nerdpack: Use the New Relic One CLI command nr1 create and select Nerdpack to create a Nerdpack template that includes a Nerdlet and a launcher. Generate Nerdlet or launcher individually: Use the New Relic One CLI command nr1 create and choose either Nerdlet or launcher. This can be useful when adding Nerdlets to an existing Nerdpack. For documentation on generating and connecting Nerdpack components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │ └── my-nerdlet-launcher │ ├── icon.png │ └── nr1.json ├── nerdlets │ └── my-nerdlet-nerdlet │ ├── index.js │ ├── nr1.json │ └── styles.scss ├── node_modules │ ├── js-tokens │ ├── loose-envify │ ├── object-assign │ ├── prop-types │ ├── react │ ├── react-dom │ ├── react-is │ └── scheduler ├── nr1.json ├── package-lock.json └── package.json Copy Nerdlet file structure A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files, index.js, nr1.json, and styles.scss. Here is what the default files look like after being generated using the nr1 create command: index.js The JavaScript code of the Nerdlet. import React from 'react'; export default class MyAwesomeNerdpack extends React.Component { render() { return Hello, my-awesome-nerdpack Nerdlet!
; } } Copy nr1.json The Nerdlet configuration file. { \"schemaType\": \"NERDLET\", \"id\": \"my-awesome-nerdpack-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\" } Copy Besides using the launcher as the access point for your application, you can also associate the application with a monitored entity to get it to appear in the entity explorer. To do this, add two additional fields to the config file of the first-launched Nerdlet: entities and actionCategory. In the following example, the Nerdlet has been associated with all Browser-monitored applications and will appear under the Monitor UI category : { \"schemaType\": \"NERDLET\", \"id\": \"my-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"Custom Data\", \"entities\": [{ \"domain\": \"BROWSER\", \"type\": \"APPLICATION\" }], \"actionCategory\": \"monitor\" } Copy To see this application in the UI, you would go to the entity explorer, select Browser applications, and select a monitored application. styles.scss An empty SCSS file for styling your application. icon.png The launcher icon that appears on the Apps page in New Relic One when an application is deployed. Launcher file structure Launchers have their own file structure. Note that: A launcher is not required; as an alternative to using a launcher, you can associate your application with a monitored entity. An application can have more than one launcher, which might be desired for an application with multiple Nerdlets. After generating a launcher using the nr1 create command, its folder contains two files: nr1.json The configuration file. { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy To connect a launcher to a Nerdlet, the rootNerdletId must match the id in the launched Nerdlet's nr1.json config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet. icon.png The icon displayed on the launcher for the app on the Apps page.",
+ "info": "Use New Relic Diagnostics to automatically diagnose common problems with New Relic agents, and send the results to Support.",
+ "body": "Download latest version New Relic Diagnostics is a utility that automatically detects common problems with New Relic agents. If Diagnostics detects a problem, it suggests troubleshooting steps. New Relic Diagnostics can also automatically attach troubleshooting data to a New Relic Support ticket. For additional troubleshooting steps for your agent, see Not seeing data. New Relic Diagnostics running on Ubuntu Linux. nrdiag checks the configuration of your agents for issues and can generate zipped troubleshooting logs, ready to be attached to support tickets. Compatibility New Relic Diagnostics is available for Linux, macOS, and Windows. It can detect common configuration issues for: APM: Available for all APM agents except C SDK. For the Go agent, only basic connectivity checks are available. Browser monitoring: Browser agent detection Infrastructure monitoring: Linux and Windows agents Diagnostics does not require superuser permissions to run, although New Relic does recommend those permissions for some checks. It will return an error if it does not have permissions to read the files it scans. Run New Relic Diagnostics To use New Relic Diagnostics: Review the release notes, to make sure you have the latest version. Download the latest version, which contains executable files for Linux, macOS, and Windows. Move the executable for your platform into the location of your application's root directory. Recommendation: Temporarily raise the logging level for the New Relic agent for more accurate troubleshooting. Note that changing the logging level requires you to restart your application. Run the executable. Recommendation: Run with a task suite (CLI option) to scope your troubleshooting. New Relic Diagnostics automatically searches its root directory and subdirectories for agent configuration files and other relevant data. To run Diagnostics, follow the procedures for your platform: Linux Ensure you have New Relic Diagnostics: From the command line, change the directory to your application's root directory and ensure that the nrdiag.zip file is present. OR Manually download the latest version. Unzip nrdiag.zip if necessary. From the nrdiag_1.2.3/linux directory, move nrdiag into the application's root directory. Run nrdiag (along with any CLI options and/or a ticket attachment key): ./nrdiag CLI_OPTIONS New Relic Diagnostics outputs issues it discovers to your terminal. If it doesn't, then include an attachment key as a CLI option. This will add relevant files to your support ticket for troubleshooting. macOS Ensure you have New Relic Diagnostics: From the command line, change directory to the application's root directory, and ensure that the nrdiag.zip file is present. OR Manually download the latest version. Unzip nrdiag.zip if necessary. From the nrdiag_1.2.3/mac directory, move nrdiag into the application's root directory. Run nrdiag (along with any CLI options, or a ticket attachment key): ./nrdiag CLI_OPTIONS New Relic Diagnostics outputs any issues it discovers, and uploads relevant files to your New Relic Support ticket if you include a ticket attachment key. Windows Ensure you have New Relic Diagnostics: From the command line, change directory to the application's root directory, and ensure that the nrdiag.zip file is present. OR Manually download the latest version. Unzip nrdiag.zip if necessary. From the nrdiag_1.2.3/win directory, move nrdiag.exe or nrdiag_x64.exe into the application's root directory. For troubleshooting web applications, ensure you are running the executable from your project's parent directory, or specify your config file location with the -c option. Run the executable (along with any CLI options or a ticket attachment key) from the directory you placed the binary. Since some checks require elevated permissions, for best results run from an Admin shell. Run via PowerShell if you add any CLI_OPTIONS: ./nrdiag.exe CLI_OPTIONS OR, for x64 systems: ./nrdiag_x64.exe CLI_OPTIONS New Relic Diagnostics outputs any issues it discovers, and it uploads relevant files to your New Relic Support ticket if you include a ticket attachment key. Browser monitoring Ensure you have the latest version of New Relic Diagnostics. If necessary, manually download the latest version. Unzip nrdiag.zip if necessary. From the nrdiag_1.2.3/OS directory, run nrdiag (along with any CLI options or a ticket attachment key): ./nrdiag -browser-url WEBSITE_URL CLI_OPTIONS New Relic Diagnostics outputs any issues it discovers, and uploads relevant files to your New Relic Support ticket if you include a ticket attachment key. Suites flag (highly recommended CLI option) A suite is a collection of health checks that target specific products or issues. Using a suite can help narrow the scope of troubleshooting and reduce the occurrence of false positives. View suites To review a list of available suites, run New Relic Diagnostics with the -help suites option. ./nrdiag --help suites Run suites Suites are run by providing the -suites flag and one or more suite names (for example, java) to run as arguments. System Command line flag Linux, macOS For 32-bit systems: ./nrdiag --suites SUITE NAMES For 64-bit systems: ./nrdiag_x64 --suites SUITE NAMES Windows To run from PowerShell, add ./ to the start of cmd. For 32-bit systems: nrdiag.exe --suites SUITE NAMES For 64-bit systems: nrdiag_x64.exe --suites SUITE NAMES View or copy attachment key New Relic Support generates an attachment key for your support ticket, which is used with Diagnostics. To view or copy your attachment key: Log in to your New Relic account at rpm.newrelic.com, then select Help > Get support. Select View open tickets, then select the ticket. Copy the NR Diagnostics attachment key that appears at the top of the ticket. If you do not see the attachment key code, notify Support. Use this attachment key to upload your Diagnostics results to your support ticket. Upload results to a support ticket If your system is configured to not connect to external IP addresses, this method will not work. Instead, attach the output files in an email to New Relic Support. Automatic upload To upload your results automatically to a New Relic Support ticket when Diagnostics is executed, use the -attachment-key command line flag with your ticket's attachment key. Uploading your results to a support ticket will automatically upload the contents of nrdiag-output.zip. If you would like to inspect or modify the contents of this file before upload, follow the manual upload process. System Command line flag Linux, macOS, Synthetics private minion ./nrdiag -attachment-key ATTACHMENT_KEY Windows To run from PowerShell, add ./ to the start of cmd. For 32-bit systems: nrdiag.exe -attachment-key ATTACHMENT_KEY For 64-bit systems: nrdiag_x64.exe -attachment-key ATTACHMENT_KEY Manual upload If you modified or inspected the content of nrdiag-output.zip and want to attach it to a support ticket, you can use the -file-upload and -attachment-key command line flags together to upload a specific file: ./nrdiag -attachment-key ATTACHMENT_KEY -file-upload ZIP_FILENAME Pass command line options These command line options are available for New Relic Diagnostics: Option Usage -a STRING -attachment-key STRING Attachment key for automatic upload to a support ticket. -browser-url STRING New Relic Diagnostics version 1.1.9 or higher When invoked, this will only run Browser-related Diagnostics checks.This command checks for the presence of the New Relic Browser agent and returns the agent version, the injection method (via APM or via copy/paste), and the Browser loader type (Pro, Lite, SPA). This can be used to provide detail to New Relic Support when troubleshooting intranet sites. -c STRING -config-file STRING Override default agent configuration file location. Can be used to specify either a folder to search in addition to the default folders, or a path to a specific configuration file. -file-upload STRING New Relic Diagnostics version 1.1.8 or higher Requires running with -a option. Allows upload of a single file at the path specified. This is in addition to files collected by default. --filter STRING Filter task results by result status. Accepts a comma separated list. Accepts: Success, Warning, Failure, Error, None. -h --help Displays full list of options. -help tasks will provide a full list of available tasks. -output-path STRING Specifies a different directory to write the results (nrdiag-output.zip, nrdiag-output.json and nrdiag-filelist.txt). Default location is ./ -o --override Pass in arguments to override. This should only generally be done when requested by New Relic Support. Example syntax: --override Java/Config/Agent.Status=Success -p STRING --proxy STRING Provide proxy to be used in HTTP connection tasks. Can be HTTP or HTTPS. Proxy should be in the format https://PROXY_IP:PROXY_PORT. If New Relic Diagnostics finds a proxy in the agent config file, it will use that proxy by default. -proxy-pw STRING Proxy password, if necessary. If New Relic Diagnostics finds a proxy in the agent config file, it will use that proxy by default. -proxy-user STRING Proxy username, if necessary. If New Relic Diagnostics finds a proxy in the agent config file, it will use that proxy by default. -s STRING --suites STRING Run a suite, a collection of tasks that target specific products or issues. You can specify multiple suites by separating them with commas. For a list of all suites, run: ./nrdiag -h suites -t STRING --tasks STRING Run only a subset of tasks, either by agent or by task type. You can specify multiple tasks by separating them with commas. For a list of all tasks, run: ./nrdiag -h tasks -usage-opt-out Decline to send anonymous New Relic Diagnostic tool usage data to New Relic for this run. -v --verbose Display verbose logging during check execution. Disabled by default. --version Display current New Relic Diagnostics version. Will also prompt to check for a newer version and prompt to download if a newer version is available. -y --yes Say yes to any prompt that comes up while running. Disabled by default. Validate your config file settings New Relic Diagnostics now features more detailed configuration setting validation. Currently the Java agent's newrelic.yml file is supported, and support for other agents' configuration files is planned. If you run nrdiag in the usual manner - on the system running your application, with the New Relic agent already installed - the new validation will be applied automatically, and any warnings will be shown. You can also use this feature as a \"linter\" - to validate a config file before deployment - by running the appropriate task and providing the path to your config file. For example, if your newrelic.yml and nrdiag are both in the current directory, you can run the following command to lint the config file: ./nrdiag -t Java/Config/ValidateSettings -c newrelic.yml. The screenshot below shows an example of the output for an incorrect setting. The agent_enabled setting in this case has a value of \"yes\", but the Java agent only accepts the values \"true\" or \"false\" - this misconfiguration will prevent the agent from running. When you've enabled your agent incorrectly, you'll see a message like this describing what setting needs to be updated and how it needs to be changed. Interpret the output After executing New Relic Diagnostics from your terminal, you will see the results for each task as they are completed. Tasks that result in a Warning or Failure status code will log additional details regarding possible issues found during execution, along with troubleshooting suggestions and relevant links to documentation: New Relic Diagnostics outputs any issues it found with your installation, along with troubleshooting suggestions. File output New Relic Diagnostics outputs three files: Diagnostics output files Comments nrdiag-output.zip A flattened folder structure with one or more config files and any existing New Relic logs. Attach this file to support tickets. This archive also contains a copy of nrdiag-output.json nrdiag-output.json Output of the individual tests. Attach this output to tickets. nrdiag-filelist.txt A list of files found. The nrdiag-output.zip file that you attach to support tickets automatically includes this list. You do not need to attach this .txt file separately. Result status codes New Relic Diagnostics returns the following status codes after running: Status code Definition Success Task successfully executed with no issues detected. Warning Task successfully executed. However, possible issues detected. Failure Task failed with issues detected. Error Task unable to execute. This could be due to a permissions issues. None Task was determined irrelevant to detected environment and was not executed. Run New Relic Diagnostics in a Docker container To troubleshoot your New Relic-instrumented application running in a Docker container you can use the docker exec command as follows: Download and unzip the nrdiag_latest.zip file. Copy the binary to the container. Replace IMAGE_NAME with the name of your docker container: docker cp nrdiag/linux/nrdiag IMAGE_NAME:/bin Run the nrdiag command in the docker container. Replace IMAGE_NAME as above, and replace APPLICATION_ROOT with the root directory of your application, where you installed the New Relic agent: docker exec -it -w APPLICATION_ROOT IMAGE_NAME nrdiag (Optional) Remove the nrdiag binary when finished: docker exec IMAGE_NAME rm /bin/nrdiag Licensing and security The use of New Relic Diagnostics is subject to this license agreement, as well as licensing agreements for open-source software used by New Relic Diagnostics. Like any other New Relic tool, the Diagnostic service is designed to protect you and your customers' data privacy. New Relic Diagnostics inspects system information and New Relic product artifacts (logs, config files) that are relevant for performing diagnostic checks that assess New Relic product configuration and operability. By default, this data is not transmitted to New Relic. You do have the option to upload this information to a support ticket over HTTPS. Data uploaded to support tickets Diagnostics does allow uploading of this information to a support ticket over HTTPS, with the use of a specific command-line argument. You will be prompted before collection of any files that we expect to have a likelihood of containing sensitive information. Before the collected files contained within nrdiag-output.zip are uploaded to New Relic, you will also be prompted. This allows you to review and edit any information that you do not want to provide. (For example, the nrdiag-output.zip will include your user name.) You also have the option to cancel the upload altogether. Data storage Any support ticket attachments made using Diagnostics or containing Diagnostics data that are less than or equal to 20MB are stored by Zendesk. Otherwise these attachments are stored by New Relic. For more information, see Zendesk's privacy and data protection policies. Environment variables New Relic Diagnostics examines the following environment variables to perform diagnostic checks. The values of these variables are recorded locally in the nrdiag-output.json file. Any environment variable containing NEWRELIC or NEW_RELIC Any environment variable beginning with NRIA PATH HOME RUBY_ENV RAILS_ENV APP_ENV RACK_ENV LOCALAPPDATA DOTNET_SDK_VERSION DOTNET_INSTALL_PATH COR_PROFILER COR_PROFILER_PATH COR_ENABLE_PROFILER CORECLR_ENABLE_PROFILING CORECLR_PROFILER CORECLR_PROFILER_PATH ProgramFiles ProgramData APPDATA JBOSS_HOME JAVA_VERSION_MAJOR JAVA_VERSION_MINOR JAVA_VERSION_BUILD JAVA_PACKAGE JAVA_JCE JAVA_HOME GLIBC_REPO GLIBC_VERSION LANG WORKDIR MINION_JAR DEFAULT_LOCALE_CFG_FILE MINION_PROVIDER MINION_USER MINION_GROUP MINION_LOG_LEVEL DOCKER_API_VERSION DOCKER_HOST MINION_API_ENDPOINT MINION_DOCKER_RUNNER_REGISTRY_ENDPOINT MINION_API_PROXY MINION_API_PROXY_SELF_SIGNED_CERT MINION_CHECK_TIMEOUT MINION_DOCKER_API_VERSION MINION_DOCKER_HOST MINION_DOCKER_RUNNER_APPARMOR MINION_JVM_MB MINION_JVM_OPTS For more information about New Relic's security measures, see our security and privacy documentation, or visit the New Relic security website. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 184.99704,
+ "_score": 142.72093,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "Nerdpack file structure",
- "sections": "Nerdpack file structure",
- "info": "An overview of the Nerdpack File Structure",
- "tags": "file structure",
- "body": " components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │ └── my-nerdlet-launcher │ ├── icon.png"
+ "title": "New Relic Diagnostics",
+ "sections": "New Relic Diagnostics",
+ "info": "Use New Relic Diagnostics to automatically diagnose common problems with New Relic agents, and send the results to Support.",
+ "category_0": "Using New Relic",
+ "body": " terminal. If it doesn't, then include an attachment key as a CLI option. This will add relevant files to your support ticket for troubleshooting. macOS Ensure you have New Relic Diagnostics: From the command line, change directory to the application's root directory, and ensure that the nrdiag.zip",
+ "breadcrumb": "Contents / Using New Relic / Cross-product functions / Troubleshooting"
},
- "id": "5efa989e196a671300766404"
+ "id": "5e9af5ba28ccbc3d4fd94a21"
},
{
"image": "",
@@ -5433,7 +5194,7 @@
"nr1 nrql",
"Query using NRQL"
],
- "published_at": "2020-10-01T01:56:53Z",
+ "published_at": "2020-10-06T02:14:19Z",
"title": "New Relic One CLI common commands",
"updated_at": "2020-08-14T01:48:10Z",
"type": "developer",
@@ -5444,117 +5205,96 @@
"body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 157.66064,
+ "_score": 118.52101,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "New Relic One CLI common commands",
- "sections": "New Relic One CLI common commands",
- "info": "An overview of common commands you can use with the New Relic One CLI.",
- "body": " Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies"
+ "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"
},
{
"sections": [
- "Map page views by region in a custom app",
+ "Set up your development environment",
"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"
+ "A note on support",
+ "Tip",
+ "Prepare to build or modify apps",
+ "Start building",
+ "Contribute to developer.newrelic.com"
],
- "title": "Map page views by region in a custom app",
+ "title": "Set up your development environment",
"type": "developer",
"tags": [
- "custom app",
- "map",
- "page views",
- "region",
- "nerdpack"
+ "developer account",
+ "API key",
+ "New Relic One CLI"
],
- "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-10-01T01:52:42Z",
- "updated_at": "2020-09-17T01:48:42Z",
+ "external_id": "c45638a9cd548d1ffffc9f1c7708f115a92ae04a",
+ "image": "",
+ "url": "https://developer.newrelic.com/build-apps/set-up-dev-env/",
+ "published_at": "2020-10-06T02:08:36Z",
+ "updated_at": "2020-08-26T01:47:20Z",
"document_type": "page",
"popularity": 1,
- "info": "Build a New Relic app showing page view data on a world map.",
- "body": "Map page views by region in a custom app 30 min New Relic has powerful and flexible tools for building custom apps and populating them with data. This guide shows you how to build a custom app and populate it with page view data using New Relic's Query Language (NRQL - pronounced 'nurkle'). Then you make your data interactive. And last, if you have a little more time and want to install a third-party React library, you can display the page view data you collect on a map of the world. In this guide, you build an app to display page view data in two ways: In a table On a map Please review the Before you begin section to make sure you have everything you need and don't get stuck halfway through. Before you begin In order to get the most out of this guide, you must have: A New Relic developer account, API key, and the command-line tool. If you don't have these yet, see the steps in Setting up your development environment New Relic Browser page view data to populate the app. Without this data, you won't be able to complete this guide. To add your data to a world map in the second half of the guide: npm, which you'll use during this section of the guide to install Leaflet, a third-party JavaScript React library used to build interactive maps. If you're new to React and npm, you can go here to install Node.js and npm. New Relic terminology The following are some terms used in this guide: New Relic application: The finished product where data is rendered in New Relic One. This might look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One that launches your application. Nerdlets: New Relic React components used to build your application. The three default files are index.js, nr1.json, and styles.scss, but you can customize and add your own. Build a custom app with a table chart Step 1 of 8 Query your browser data Use Query builder to write a NRQL query to see your page view data, as follows. On New Relic One, select Query your data (in the top right corner). That puts you in NRQL mode. You'll use NRQL to test your query before dropping the data into your table. Copy and paste this query into a clear query field, and then select Run. FROM PageView SELECT count(*), average(duration) WHERE appName = 'WebPortal' FACET countryCode, regionCode SINCE 1 week ago LIMIT 1000 Copy If you have PageView data, this query shows a week of average page views broken down by country and limited to a thousand items. The table will be full width and use the \"chart\" class defined in the CSS. If you don't have any results at this point, ensure your query doesn't have any errors. If your query is correct, you might not have the Browser agent installed. Step 2 of 8 Create and serve a new Nerdpack To get started, create a new Nerdpack, and serve it up to New Relic from your local development environment: Create a new Nerdpack for this app: nr1 create --type nerdpack --name pageviews-app Copy Serve the project up to New Relic: cd pageviews-app && nr1 nerdpack:serve Copy Step 3 of 8 Review your app files and view your app locally Navigate to your pageviews-app to see how it's structured. It contains a launcher folder, where you can customize the description and icon that will be displayed on the app's launcher in New Relic One. It also contains nerdlets, which each contain three default files: index.js, nr1.json, and styles.scss. You'll edit some of these files as part of this guide. For more information, see Nerdpack file structure. Now in your browser, open https://one.newrelic.com/?nerdpacks=local, and then click Apps to see the pageview-apps Nerdpack that you served up. When you select the launcher, you see a Hello message. Step 4 of 8 Hard code your account ID For the purposes of this exercise and for your convenience, hard code your account ID. In the pageview-app-nerdlet directory, in the index.js file, add this code between the import and export lines. (Read about finding your account ID here). const accountId = [Replace with your account ID]; Copy Step 5 of 8 Import the TableChart component To show your data in a table chart, import the TableChart component from New Relic One. To do so, in index.js, add this code under import React. import { TableChart } from 'nr1'; Copy Step 6 of 8 Add a table with a single row To add a table with a single row, in the index.js file, replace this line: return Hello, pageview-app-nerdlet Nerdlet!
; Copy with this export code: export default class PageViewApp extends React.Component { render() { return ( ); } } Copy Step 7 of 8 Customize the look of your table (optional) You can use standard CSS to customize the look of your components. In the styles.scss file, add this CSS. Feel free to customize this CSS to your taste. .container { width: 100%; height: 99vh; display: flex; flex-direction: column; .row { margin: 10px; display: flex; flex-direction: row; } .chart { height: 250px; } } Copy Step 8 of 8 Get your data into that table Now that you've got a table, you can drop a TableChart populated with data from the NRQL query you wrote at the very beginning of this guide. Put this code into the row div. ; Copy Go to New Relic One and click your app to see your data in the table. (You might need to serve your app to New Relic again.) Congratulations! You made your app! Continue on to make it interactive and show your data on a map. Make your app interactive with a text field Once you confirm that data is getting to New Relic from your app, you can start customizing it and making it interactive. To do this, you add a text field to filter your data. Later, you use a third-party library called Leaflet to show that data on a world map. Step 1 of 3 Import the TextField component Like you did with the TableChart component, you need to import a TextField component from New Relic One. import { TextField } from 'nr1'; Copy Step 2 of 3 Add a row for your text field To add a text field filter above the table, put this code above the TableChart div. The text field will have a default value of \"US\". { this.setState({ countryCode: event.target.value }); }} />
; Copy Step 3 of 3 Build the text field object Above the render() function, add a constructor to build the text field object. constructor(props) { super(props); this.state = { countryCode: null } } Copy Then, add a constructor to your render() function. Above return, add: const { countryCode } = this.state; Copy Now add countryCode to your table chart query. ; Copy Reload your app to try out the text field. Get your data on a map To create the map, you use npm to install Leaflet. Step 1 of 9 Install Leaflet In your terminal, type: npm install --save leaflet react-leaflet Copy In your nerdlets styles.scss file, import the Leaflet CSS: @import `~leaflet/dist/leaflet.css`; Copy While you're in styles.scss, fix the width and height of your map: .containerMap { width: 100%; z-index: 0; height: 70vh; } Copy Step 2 of 9 Add a webpack config file for Leaflet Add a webpack configuration file .extended-webpackrc.js to the top-level folder in your nerdpack. This supports your use of map tiling information data from Leaflet. module.exports = { module: { rules: [ { test: /\\.(png|jpe?g|gif)$/, use: [ { loader: 'file-loader', options: {}, }, { loader: 'url-loader', options: { limit: 25000 }, }, ], }, ], }, }; Copy Step 3 of 9 Import modules from Leaflet In index.js, import modules from Leaflet. import { Map, CircleMarker, TileLayer } from 'react-leaflet'; Copy Step 4 of 9 Import additional modules from New Relic One You need several more modules from New Relic One to make the Leaflet map work well. Import them with this code: import { NerdGraphQuery, Spinner, Button, BlockText } from 'nr1'; Copy NerdGraphQuery lets you make multiple NRQL queries at once and is what will populate the map with data. Spinner adds a loading spinner. Button gives you button components. BlockText give you block text components. Step 5 of 9 Get data for the map Using latitude and longitude with country codes, you can put New Relic data on a map. mapData() { const { countryCode } = this.state; const query = `{ actor { account(id: 1606862) { mapData: nrql(query: \"SELECT count(*) as x, average(duration) as y, sum(asnLatitude)/count(*) as lat, sum(asnLongitude)/count(*) as lng FROM PageView FACET regionCode, countryCode WHERE appName = 'WebPortal' ${countryCode ? ` WHERE countryCode like '%${countryCode}%' ` : ''} LIMIT 1000 \") { results nrql } } } }`; return query; }; Copy Step 6 of 9 Customize the map marker colors Above the mapData function, add this code to customize the map marker colors. getMarkerColor(measure, apdexTarget = 1.7) { if (measure <= apdexTarget) { return '#11A600'; } else if (measure >= apdexTarget && measure <= apdexTarget * 4) { return '#FFD966'; } else { return '#BF0016'; } }; Copy Feel free to change the HTML color code values to your taste. In this example, #11A600 is green, #FFD966 is sort of yellow, and #BF0016 is red. Step 7 of 9 Set your map's default center point Set a default center point for your map using latitude and longitude. const defaultMapCenter = [10.5731, -7.5898]; Copy Step 8 of 9 Add a row for your map Between the text field row and the table chart row, insert a new row for the map content using NerdGraphQuery. {({ loading, error, data }) => { if (loading) { return ; } if (error) { return 'Error'; } const { results } = data.actor.account.mapData; console.debug(results); return 'Hello'; }}
; Copy Reload your application in New Relic One to test that it works. Step 9 of 9 Replace \"Hello\" with the Leaflet code Replace return \"Hello\"; with: return ( ); Copy This code creates a world map centered on the latitude and longitude you chose using OpenStreetMap data and your marker colors. Reload your app to see the pageview data on the map!",
+ "info": "Prepare to build apps and contribute to this site",
+ "body": "Set up your development environment 20 min If you've decided to build a custom app or modify one of our open source apps, you need a few essential tools: The New Relic One command line interface (CLI) An API key, which you get when you download the CLI Depending on what you want to do with your app, you might have some additional setup and configuration. This guide covers: Downloading the New Relic One CLI to build or modify apps Contribute content to this website Before you begin You must have: A github account account - While not strictly necessary for building apps, a GitHub account enables you to download and customize our open source apps, and contribute an open source project. A New Relic developer account - if you don't already have one, you can get a free trial account for developing New Relic applications. npm - If you've installed Node.js, then you already have npm, which is used to share, reuse, and update JavaScript code, and is necessary for working with React components that are the framework for New Relic apps and this website. A note on support Building a New Relic One application is the same as building any JavaScript/React application. We offer support to help with our building tools (our CLI and SDK library). However, we don't offer support for basic JavaScript or React coding questions or issues. For common questions and answers about building, see the Explorers Hub page on building on New Relic One. Tip Use the New Relic One VSCode extension to build your apps. Prepare to build or modify apps Step 1 of 1 Download the CLI and API key. On the Build New Relic One applications page, complete the Quick start steps. These six Quick start steps get you an API key for use with developing apps, and the New Relic One CLI, for building and deploying apps. At the end of the Quick start, you have a project consisting of the following: A Nerdpack - The package containing all the files required by your application. It contains two types of files that you customize to build your app: Nerdlets, and the launcher. One or more Nerdlet files - A specific UI view or window. A Nerdlet is a React JavaScript package that includes an index.js file, a stylesheet, and a JSON-format config file. It can contain any JS functionality (charts, interactive fields, tooltips, etc.). A launcher file: This is the basis for the launcher, which is used to open your application from New Relic One after you publish your app. Start building Step 1 of 1 If you're ready to code, cd to your Nerdpack and get started. If you want to learn more about building applications, try these step-by-step guides: Build a \"Hello, World!\" application shows how to create a little application, publish it to New Relic One, and share it with others by subscribing accounts to it. Map pageviews by region takes you through the steps to create one of our popular open source apps. You learn to add a custom query to an app and view it in a table, then add that data to a map. Contribute to developer.newrelic.com This site is open source, and we want your input. Create a pull request if you see a mistake you know how to fix. Drop us a GitHub issue if you see some content gaps you want us to work on. Or write up a whole new guide if you have one you'd like to share. Read on to learn how. Step 1 of 3 Fork the developer-website GithHub repo. Forking the repo enables you to work on your own copy of the developer.newrelic.com files, and build the site locally. It also enables us to more easily manage incomimg pull requests. On the developer-website page in GitHub, select the Fork button on the top right of the page, choose the account you want to fork to, and wait a few seconds while the fork is created. Sync regularly to keep your fork up to date with changes and additions to the main branch upstream. Step 2 of 3 Make a feature or documentation request. On any page, select the GitHub button at the top of the page, and then select the kind of change you want, and fill out the GitHub form. Step 3 of 3 Contribute a new guide. Check out our contributors guidelines, which will walk you through the process.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 142.35085,
+ "_score": 112.36724,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "sections": "Create and serve a new Nerdpack",
- "tags": "nerdpack",
- "body": " look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One"
+ "tags": "New Relic One CLI",
+ "body": "Set up your development environment 20 min If you've decided to build a custom app or modify one of our open source apps, you need a few essential tools: The New Relic One command line interface (CLI) An API key, which you get when you download the CLI Depending on what you want to do with your app"
},
- "id": "5efa993c196a67066b766469"
- },
+ "id": "5efa9973e7b9d242237bab39"
+ }
+ ],
+ "/explore-docs/intro-to-sdk": [
{
+ "image": "",
+ "url": "https://developer.newrelic.com/build-apps/",
"sections": [
+ "Build apps",
+ "Guides to build apps",
+ "Create a \"Hello, World!\" application",
"Permissions for managing applications",
- "New Relic One pricing plan",
- "Original product-based pricing"
+ "Set up your development environment",
+ "Add, query, and mutate data using NerdStorage",
+ "Add the NerdGraphQuery component to an application",
+ "Add a table to your app",
+ "Add a time picker to your app",
+ "Create a custom map view",
+ "Publish and deploy apps"
],
- "title": "Permissions for managing applications",
+ "published_at": "2020-10-06T02:08:36Z",
+ "title": "Build apps",
+ "updated_at": "2020-10-06T02:08:36Z",
"type": "developer",
- "tags": [
- "nerdpack manager",
- "permissions",
- "managing apps"
- ],
- "external_id": "c7f4c7fbd9d093d303c7f8268f8560ff9f435230",
- "image": "",
- "url": "https://developer.newrelic.com/build-apps/permission-manage-apps/",
- "published_at": "2020-10-01T01:54:33Z",
- "updated_at": "2020-09-02T02:04:41Z",
+ "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d",
"document_type": "page",
"popularity": 1,
- "info": "Learn about permissions for subscribing to apps",
- "body": "Permissions for managing applications When you create an app, you'll likely want to share it. From New Relic One's Apps page, you can subscribe to apps you create, publish, and deploy, and to other publicly available apps. You must have the Nerdpack manager role to subcribe accounts to apps. Read on to learn about permissions and versions. Permissions for managing applications The Nerdpack manager role is a New Relic add-on role. When you create a Nerdpack, you have the Nerdpack manager role for handling that Nerdpack. New Relic account administrators have the Nerdpack manager role automatically, and can subscribe their accounts to available Nerdpacks. User permissions vary depending on which pricing plan you are on. New Relic One pricing plan For accounts with New Relic One pricing, there are permissions differences for basic users and full users: Full users have the Nerdpack manager role and have full capabilities for creating and managing New Relic One applications, as well as accessing all types of applications in the New Relic One catalog. A basic user can develop and view their own local New Relic One apps, but they cannot: Subscribe other users to apps they’ve created. Access or manage apps in the New Relic One catalog. Access apps in the entity explorer sidebar. Original product-based pricing For accounts on our original product-based pricing, here are access details: Subscribe to publicly available applications To subscribe to publicly available applications, you must have the Nerdpack manager role. Nerdpack manager permissions are automatically assigned to New Relic account owners and admins and can be assigned to individual users. If you aren’t an owner or admin, you can request Nerdpack manager permission, or ask your New Relic admin or owner to subscribe the apps to your account for you. You can add any of the publicly available applications to master accounts or separate sub-accounts on which you have the Nerdpack manager role, or to separate sub-accounts under a master account you own or administer. If you add the application to a master account, the access flows to all of its sub-accounts as well. Subscribe to applications that you create You also must have the Nerdpack manager role to subscribe the applications you create to accounts. Applications that you publish and deploy can only be subscribed to the master account that was used to publish them, or to its sub-accounts. This means you might want a New Relic admin to deploy your applications for you if they need to be available across the organization.",
+ "body": "Build apps You know better than anyone what information is crucial to your business, and how best to visualize it. Sometimes, this means going beyond dashboards to creating your own app. With React and GraphQL, you can create custom views tailored to your business. These guides are designed to help you start building apps, and dive into our library of components. We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a \"Hello, World!\" application Build a \"Hello, World!\" app and publish it to New Relic One Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 30 min Add a table to your app Add a table to your New Relic One app 20 min Add a time picker to your app Add a time picker to a sample application 30 min Create a custom map view Build an app to show page view data on a map 30 min Publish and deploy apps Start sharing the apps you build",
+ "info": "",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 108.269,
+ "_score": 865.7118,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "Permissions for managing applications",
- "sections": "Permissions for managing applications",
- "info": "Learn about permissions for subscribing to apps",
- "tags": "nerdpack manager",
- "body": "Permissions for managing applications When you create an app, you'll likely want to share it. From New Relic One's Apps page, you can subscribe to apps you create, publish, and deploy, and to other publicly available apps. You must have the Nerdpack manager role to subcribe accounts to apps. Read"
+ "title": "Build apps",
+ "sections": "Publish and deploy apps",
+ "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"
},
- "id": "5f45bf2864441ffb4dfdcdbb"
- }
- ],
- "/explore-docs/query-and-store-data": [
+ "id": "5efa999d64441fc0f75f7e21"
+ },
{
"sections": [
"Intro to NerdStorage",
@@ -5575,7 +5315,7 @@
"external_id": "709e06c25376d98b2191ca369b4d139e5084bd62",
"image": "",
"url": "https://developer.newrelic.com/explore-docs/nerdstorage/",
- "published_at": "2020-10-01T01:55:37Z",
+ "published_at": "2020-10-06T02:13:00Z",
"updated_at": "2020-09-08T01:50:19Z",
"document_type": "page",
"popularity": 1,
@@ -5583,621 +5323,996 @@
"body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,500 documents, plus storage type. Each document can have a maximum length of 1024 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 143.53603,
+ "_score": 652.256,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "tags": "nerdstorage components",
- "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"
+ "sections": "Use NerdStorage in your apps",
+ "info": "Intro to NerdStorage on New Relic One",
+ "tags": "new relic one apps",
+ "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users"
},
"id": "5efa989ee7b9d2048e7bab92"
},
{
- "category_2": "Java agent release notes",
- "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"
+ "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": "Java Agent 3.36.0",
- "category_0": "Release notes",
- "type": "docs",
- "category_1": "APM agent release notes",
- "external_id": "f94f5c53e522a9835ea42514e90d9a39e81fd050",
- "image": "",
- "url": "https://docs.newrelic.com/docs/release-notes/agent-release-notes/java-release-notes/java-agent-3360",
- "published_at": "2020-09-30T11:38:32Z",
- "updated_at": "2018-04-14T23:39:35Z",
- "breadcrumb": "Contents / Release notes / APM agent release notes / Java agent release notes",
- "document_type": "release_notes",
- "popularity": -2,
- "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.",
- "info": "",
+ "title": "Add tables to your New Relic One application",
+ "type": "developer",
+ "tags": [
+ "table in app",
+ "Table component",
+ "TableHeaderc omponent",
+ "TableHeaderCell component",
+ "TableRow component",
+ "TableRowCell component"
+ ],
+ "external_id": "7ff7a8426eb1758a08ec360835d9085fae829936",
+ "image": "https://developer.newrelic.com/static/e637c7eb75a9dc01740db8fecc4d85bf/1d6ec/table-new-cells.png",
+ "url": "https://developer.newrelic.com/build-apps/howto-use-nrone-table-components/",
+ "published_at": "2020-10-06T02:08:36Z",
+ "updated_at": "2020-09-17T01:48:42Z",
+ "document_type": "page",
+ "popularity": 1,
+ "info": "Add a table to your New Relic One app.",
+ "body": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application. In this guide, you are going to build a sample table using various New Relic One components. Before you begin If you haven't already installed the New Relic One CLI, step through the quick start in New Relic One. This process also gets you an API key. In addition, to complete the steps in this guide, you need a GitHub account and Node.js installed on your machine. See Setting up your development environment for more info. Clone and set up the example application Step 1 of 4 Clone the nr1-how-to example application from GitHub to your local machine. Then, navigate to the app directory. The example app lets you experiment with tables. git clone https://github.com/newrelic/nr1-how-to.git` cd nr1-how-to/create-a-table/nerdlets/create-a-table-nerdlet` Copy Step 2 of 4 Edit the index.json file and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install dependencies nr1 nerdpack:serve # Serve the demo app locally Copy Step 4 of 4 Open one.newrelic.com/?nerdpacks=local in your browser. Click Apps, and then in the Your apps section, you should see a Create a table launcher. That's the demo application you're going to work on. Go ahead and select it. Have a good look at the demo app. There's a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You'll use Table components to add a new table in the second row. Work with table components Step 1 of 10 Navigate to the nerdlets/create-a-table-nerdlet subdirectory and open the index.js file. Add the following components to the import statement at the top of the file so that it looks like the example: Table TableHeader TableHeaderCell TableRow TableRowCell import { Table, TableHeader, TableHeaderCell, TableRow, TableRowCell, PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart, } from 'nr1'; Copy Step 2 of 10 Add a basic Table component Locate the empty GridItem in index.js: This is where you start building the table. Add the initial component. The items property collects the data by calling _getItems(), which contains sample values. ; Copy Step 3 of 10 Add the header and rows As the Table component renders a fixed number of header cells and rows, your next step is adding header components, as well as a function that returns the required table rows. Inside of the Table component, add the TableHeader and then a TableHeaderCell child for each heading. Since you don't know how many rows you'll need, your best bet is to call a function to build as many TableRows as items returned by _getItems(). Application Size Company Team Commit ; { ({ item }) => ( {item.name} {item.value} {item.company} {item.team} {item.commit} ); } Copy Step 4 of 10 Take a look at the application running in New Relic One: you should see something similar to the screenshot below. Step 5 of 10 Replace standard table cells with smart cells The New Relic One library includes cell components that can automatically format certain data types, like users, metrics, and entity names. The table you've just created contains columns that can benefit from those components: Application (an entity name) and Size (a metric). Before you can use EntityTitleTableRowCell and MetricTableRowCell, you have to add them to the import statement first. import { EntityTitleTableRowCell, MetricTableRowCell, ... /* All previous components */ } from 'nr1'; Copy Step 6 of 10 Update your table rows by replacing the first and second TableRowCells with entity and metric cells. Notice that EntityTitleTableRowCell and MetricTableRowCell are self-closing tags. { ({ item }) => ( {item.company} {item.team} {item.commit} ); } Copy Step 7 of 10 Time to give your table a second look: The cell components you've added take care of properly formatting the data. Step 8 of 10 Add some action to your table! Tables are great, but interactive tables can be better: As a last update, you are going to allow users to act on each data row. Add the _getActions() method to your index.js file, right before _getItems(). As you may have guessed from the code, _getActions() spawns an alert box when you click Team or Commit cells. _getActions() { return [ { label: 'Alert Team', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__ALERT, onClick: (evt, { item, index }) => { alert(`Alert Team: ${item.team}`); }, }, { label: 'Rollback Version', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__UNDO, onClick: (evt, { item, index }) => { alert(`Rollback from: ${item.commit}`); }, }, ]; } Copy Step 9 of 10 Find the TableRow component in your return statement and point the actions property to _getActions(). The TableRow actions property defines a set of actions that appear when the user hovers over a table row. Actions have a mandatory text and an onClick callback, but can also display an icon or be disabled if needed. Copy Step 10 of 10 Go back to your application and try hovering over any of the rows: Notice how the two available actions appear. When you click them, a function triggers with the selected row data as an argument, and an alert displays in your browser. Next steps You've built a table into a New Relic One application, using components to format data automatically and provide contextual actions. Well done! Keep exploring the Table components, their properties, and how to use them, in our SDK documentation.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 47.740433,
+ "_score": 554.04913,
"_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"
+ "title": "Add tables to your New Relic One application",
+ "sections": "Add tables to your New Relic One application",
+ "info": "Add a table to your New Relic One app.",
+ "tags": "table in app",
+ "body": " 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."
},
- "id": "58a53cf38e9c0f755a81db4e"
+ "id": "5efa989ee7b9d2ad567bab51"
},
{
- "category_2": "API guides",
- "nodeid": 11521,
+ "category_2": "Optimize your cloud native environment",
+ "nodeid": 32786,
"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",
+ "New Relic solutions",
+ "Measure DevOps success",
+ "Cloud adoption",
+ "Optimize your cloud native environment",
+ "Migrate to microservices",
+ "1. Deploy instrumentation on all application tiers and components",
+ "2. Use key metrics to identify components that you can migrate to microservices",
+ "3. Use deployment markers to establish app performance baselines",
+ "4. Implement the new microservice-based architecture, and measure the success of your application development processes",
+ "5. Create a dashboard to monitor KPIs",
+ "6. Create a new baseline to use for comparisons",
"For more help"
],
- "title": "Guide to using the Java agent API ",
- "category_0": "APM agents",
+ "title": "Migrate to microservices ",
+ "category_0": "New Relic solutions",
"type": "docs",
- "category_1": "Java agent",
- "translation_ja_url": "https://docs.newrelic.co.jp/docs/agents/java-agent/api-guides/guide-using-java-agent-api",
- "external_id": "a31c751c7c29dd46effac2e568f7c0a92b033b18",
- "image": "",
- "url": "https://docs.newrelic.com/docs/agents/java-agent/api-guides/guide-using-java-agent-api",
- "published_at": "2020-09-30T11:30:28Z",
- "updated_at": "2020-09-03T11:06:02Z",
- "breadcrumb": "Contents / APM agents / Java agent / API guides",
+ "category_1": "New Relic solutions",
+ "external_id": "b8b8cd8f4c66a7b2d0af83e118b5c43bccfbd4a4",
+ "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new_processes.png",
+ "url": "https://docs.newrelic.com/docs/new-relic-solutions/new-relic-solutions/optimize-your-cloud-native-environment/migrate-microservices",
+ "published_at": "2020-10-04T01:38:12Z",
+ "updated_at": "2020-09-27T20:33:59Z",
+ "breadcrumb": "Contents / New Relic solutions / New Relic solutions / Optimize your cloud native environment",
"document_type": "page",
"popularity": 1,
- "info": "A goal-focused guide to New Relic's Java agent API, with links to relevant sections of the complete API documentation on GitHub.",
- "body": "The New Relic Java agent API lets you control, customize, and extend the functionality of the APM Java agent. This API consists of: Static methods on the com.newrelic.api.agent.NewRelic class A @Trace annotation for implementing custom instrumentation A hierarchy of API objects providing additional functionality Use this API to set up custom instrumentation of your Java app and collect more in-depth data. For detailed information about this API, see the complete Javadoc on GitHub. Another way to set up custom instrumentation is to use XML instrumentation. The XML option is simpler and does not require modification of your app code, but it lacks the complete functionality of the Java agent API. For best results when using the API, ensure that you have the latest Java agent release. Several APIs used in the examples require Java agent 3.36.0 or higher. For all available New Relic APIs, see Intro to APIs. Use the API To access the API class, add newrelic-api.jar to your application class path. The jar is in the New Relic Java agent's installation zip file. You can call the API when the Java agent is not running. The API methods are just stubs; the implementation is added when the Java agent loads the class. Transactions To instrument Transactions in your application, use the following APIs. If you want to... Use this Create a Transaction when New Relic does not create one automatically @Trace(dispatcher = true) on the method that encompasses the work to be reported. When this annotation is used on a method within the context of an existing transaction, this will not start a new transaction, but rather include the method in the existing transaction. Capture the duration of a method that New Relic does not automatically trace @Trace() on the method you want to time. Set the name of the current Transaction NewRelic.setTransactionName(...) Start the timer for the response time of the current Transaction and to cause a Transaction you create to be reported as a Web transaction, rather than as an Other transaction NewRelic.setRequestAndReponse(...) Add custom attributes to Transactions and TransactionEvents NewRelic.addCustomParameter(...) Prevent a Transaction from being reported to New Relic NewRelic.ignoreTransaction() Exclude a Transaction when calculating your app's Apdex score NewRelic.ignoreApdex() Instrument asynchronous work For detailed information, see Java agent API for asynchronous applications. If you want to... Use this Trace an asynchronous method if it is linked to an existing Transaction... @Trace(async = true) Link the Transaction associated with the Token on the current thread... Token.link() or Token.linkAndExpire() Expire a Token associated with the current Transaction... Token.expire() Stop timing a Segment and have it report as part of its parent Transaction Segment.end() Stop timing a Segment and not have it report as part of its parent Transaction Segment.ignore() Implement distributed tracing These APIs require distributed tracing to be enabled. Distributed tracing lets you see the path that a request takes as it travels through a distributed system. For general instructions on how to use the calls below to implement distributed tracing, see Use distributed tracing APIs. If you want to... Use this Create a payload to be sent to a called service. Transaction.createDistributedTracePayload() For more on obtaining references to the current transaction and other entities, see Obtain references. Accept a payload sent from the first service; this will link these services together in a trace. Transaction.acceptDistributedTracePayload(...) For more on obtaining references to the current transaction and other entities, see Obtain references. Payload used to connect services. The text() call returns a JSON string representation of the payload. DistributedTracePayload.text() Payload used to connect services. The httpSafe() call returns a base64 encoded JSON string representation of the payload. DistributedTracePayload.httpSafe() Add custom attributes to SpanEvents in distributed traces NewRelic.getAgent().getTracedMethod().addCustomAttribute(...) Implement cross application tracing To track external calls and add cross application tracing, use the following APIs: If you want to... Use this Trace across a custom transport channel that New Relic does not support by default, such as a proprietary RPC transport Transaction.getRequestMetadata(), .processRequestMetadata(...), .getResponseMetadata(), .processResponseMetadata(...) Also refer to the information in this document about using Transaction to obtain references to New Relic entities. View or change the metric name or a rollup metric name of a TracedMethod (A rollup metric name, such as OtherTransaction/all, is not scoped to a specific transaction. It represents all background transactions.) TracedMethod.getMetricName(), .setMetricName(...), .setRollupMetricName(...) Also refer to the information in this document about using TracedMethod to obtain references to New Relic entities. Report a call to an external HTTP service, database server, message queue, or other external resource that is being traced using the Java agent API's @Trace annotation TracedMethod.reportAsExternal(...) passing arguments constructed using ExternalParameters builder. Also refer to the information in this document about using TracedMethod to obtain references to New Relic entities. Enable and add cross application tracing when communicating with an external HTTP or JMS service that is instrumented by New Relic TracedMethod.addOutboundRequestHeaders(...) along with TracedMethod.reportAsExternal(...) Also refer to the information in this document about using TracedMethod to obtain references to New Relic entities. Add timing for an application server or dispatcher that is not supported automatically Transaction.setRequest(...), Transaction.setResponse(...), or NewRelic.setRequestAndResponse(...), and Transaction.markResponseSent() Also refer to the information in this document about using Transaction to obtain references to New Relic entities. Obtain references to New Relic entities Other tasks require the New Relic Agent object. The Agent object exposes multiple objects that give you the following functionality: If you want to... Use this Get a reference to the current Transaction NewRelic.getAgent().getTransaction() Get a Token to link asynchronous work NewRelic.getAgent().getTransaction().getToken() Start and get a reference to a Segment NewRelic.getAgent().getTransaction().startSegment() Get a reference to the method currently being traced NewRelic.getAgent().getTracedMethod() Get a reference to the Agent logger NewRelic.getAgent().getLogger() Get a reference to the Agent configuration NewRelic.getAgent().getConfig() Get a reference to an aggregator for custom metrics NewRelic.getAgent().getAggregator() Get a reference to Insights in order to record custom events NewRelic.getAgent().getInsights() Additional API functionality The following APIs provide additional functionality, such as setting app server info, reporting errors, adding page load timing information, recording custom metrics, and sending custom events to Insights. If you want to... Use this Explicitly set port, name, and version information for an application server or dispatcher and the instance name for a JVM NewRelic.setAppServerPort(...), .setServerInfo(...), and .setInstanceName(...) Report an error that New Relic does not report automatically NewRelic.noticeError(...) When inside a transaction, the first call to noticeError wins. Only 1 error will be reported per transaction. Add browser page load timing for Transactions that New Relic does not add to the header automatically NewRelic.getBrowserTimingHeader(), .getBrowserTimingFooter(), .setUserName(String name), .setAccountName(String name), and .setProductName(String name) Create and accumulate custom metrics NewRelic.recordMetric(...), .recordResponseTimeMetric(...), or .incrementCounter(...) Record custom events Insights.recordCustomEvent(...) Or, use NewRelic.addCustomParameter(...) to add custom attributes to the New Relic-defined TransactionEvent type. Also refer to the information in this document about using Insights to obtain references to New Relic entities. Additional API usage examples For detailed code examples about using the APIs, see New Relic's documentation about custom instrumentation for: External calls, cross application traces, messaging, datastores, and web frameworks Cross application tracing and external datastore calls Apps using custom instrumentation with annotation Custom framework instrumentation API Preventing unwanted instrumentation Inserting custom attributes Inserting custom events Collecting custom metrics For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "info": "Use microservices to optimize applications. With microservices, app developers can resolve issues faster and deliver an enhanced end-user experience.",
+ "body": "As IT departments seek to optimize their cloud applications, they are decomposing application monoliths into microservices. A microservice architecture is an approach that delivers a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms. Following a service-oriented architecture (SOA) model, each service should offer public API interfaces to any other service in the environment. Fragmenting applications into their most basic services enables the continuous delivery/deployment of large, complex applications by removing barriers and silos that previously lengthened the application release cycle. It also enables an organization to evolve its technology stack for modern cloud environments and to operate at internet-scale. With microservices, app developers can build, manage, scale, and reuse services independently, resolve issues faster, increase the rate of deployments, and ultimately deliver an enhanced end-user experience. This quest to use microservices to optimize applications is an iterative process. We recommend the following six steps, using the New Relic platform, to ensure an effective migration path to microservices. 1. Deploy instrumentation on all application tiers and components In order to determine which components of an application can be broken into microservices, you need to deploy instrumentation on all tiers and components of the target application. This will allow you to determine baseline application performance, quantify transaction volumes, and gather other key metrics that will determine where you begin your microservice journey. Specifically, you should: Monitor your web apps with APM. See Compatibility and requirements for New Relic agents and products to learn precise compatibility details for each supported language, and then install the APM agent on your application stack. Steps for installing APM agents vary based on language. Monitor your compute resources with Infrastructure. See Compatibility and requirements for Infrastructure for supported operating systems and environments. You can also instrument other products and services with on-host integrations. In some cases, it may be helpful to use custom instrumentation to gather detailed performance metrics that aren’t necessarily required in the course of normal application monitoring. For example, you may want to add custom instrumentation to key controllers that are candidates for decomposition to gather very granular response time and throughput information. 2. Use key metrics to identify components that you can migrate to microservices Once you have instrumented your application, you can begin to identify which components are strong candidates to migrate to microservices. It is important to consult with colleagues who have written, designed, and/or maintained the application, to supplement the context that your baseline data provides. Their experience and recommendations will help to guide the decomposition effort. In addition, you should analyze objective metrics such as transaction call volume and response time. These metrics will point to components in your monolithic application that are heavily called and/or are responding slowly, which means that they are adding disproportionate load to the monolith, possibly degrading application performance and end-user experience. As microservices, it will be easier to regularly improve and optimize these components. As a result, you will be able to break away and eliminate the most pressing bottlenecks from your monolithic application. one.newrelic.com > APM > Transactions: Identify which components are slowing you down. 3. Use deployment markers to establish app performance baselines Breaking down monolithic applications into a microservice architecture is typically an iterative project. You will be continually identifying monolithic components that can be decomposed into microservices, and then optimizing them as business and technology requirements dictate. Deployment tracking lets you quickly see, in a side-by-side comparative view, how architectural and code changes impact your application’s performance. You can then use this information to direct future development efforts and to demonstrate return on investment to the business. You should make deployment markers an integral part of the development process by adding them into your build/deployment process automation. You can view instructions on setting up deployment markers on the Deployments page in APM. one.newrelic.com > APM > Events > Deployments: Understand how deployments affect your performance. 4. Implement the new microservice-based architecture, and measure the success of your application development processes Your developers should now have marching orders for which application components to migrate to microservices. It’s important for these teams to embrace modern software development practices to support your overarching business and technology initiatives. Measuring process improvements is vital to driving alignment and velocity. You should instrument your build/test pipeline using custom events. This will allow you to gather data about: The rate at which new code is moving through the pipeline Quality metrics (for example, what percent of the code is passing tests, if there is automated testing involved) The rate of new deployments via deployment markers These quantitative data points will allow development and operations teams to visualize the adoption of new processes, measure development team productivity, and assess whether these new processes are moving the needle positively or negatively. one.newrelic.com > Dashboards: Visualize the adoption of new processes with dashboards. 5. Create a dashboard to monitor KPIs Once you have determined that the application and its microservices components are (somewhat) production-ready, compare the performance of your new, modern application to the monolithic application (either today or how it performed pre-migration). This will allow you to demonstrate success and to highlight areas for improvement. Key KPIs to monitor and compare include Response Time, Error Rate, Transaction Call Volume, Operational Cost, Availability, and Apdex. one.newrelic.com > Dashboards: Build KPI dashboards to view all your indicators in one place. 6. Create a new baseline to use for comparisons At this point, you have migrated components of your monolithic application to microservices, and you are now empowered with up-to-date data on how your new application is performing compared to your legacy application. Now you have a new launching point for evaluating which other components of your application can be decomposed into microservices, or which microservice components require more performance tuning. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 33.79003,
+ "_score": 536.9149,
"_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"
+ "sections": "1. Deploy instrumentation on all application tiers and components",
+ "info": "Use microservices to optimize applications. With microservices, app developers can resolve issues faster and deliver an enhanced end-user experience.",
+ "category_0": "New Relic solutions",
+ "category_1": "New Relic solutions",
+ "body": ", resolve issues faster, increase the rate of deployments, and ultimately deliver an enhanced end-user experience. This quest to use microservices to optimize applications is an iterative process. We recommend the following six steps, using the New Relic platform, to ensure an effective migration path",
+ "breadcrumb": "Contents / New Relic solutions / New Relic solutions / Optimize your cloud native environment"
},
- "id": "5a3137f4e621f4576cf1e35f"
+ "id": "5f58347e64441f8c45e0684c"
},
{
- "category_2": "PHP agent API",
- "nodeid": 11821,
+ "category_2": "Measure DevOps success",
+ "nodeid": 16416,
"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",
+ "New Relic solutions",
+ "Measure DevOps success",
+ "Cloud adoption",
+ "Optimize your cloud native environment",
+ "Establish objectives and baselines: define team SLOs",
+ "Service level components",
+ "Resources",
+ "1. Build an inventory of services requiring SLOs",
+ "2. Research customer expectations for SLOs",
+ "3. Define SLOs",
+ "4. Determine what can be instrumented",
+ "5. Review the default metrics",
+ "6. Set up custom instrumentation",
+ "7. Create Insights dashboards to track SLIs",
"For more help"
],
- "title": "newrelic_add_custom_tracer (PHP agent API)",
- "category_0": "APM agents",
+ "title": "Establish objectives and baselines: define team SLOs",
+ "category_0": "New Relic solutions",
"type": "docs",
- "category_1": "PHP agent",
- "external_id": "12242c1e6fe8cb70e2d42ff670cad04c01e9317e",
- "image": "",
- "url": "https://docs.newrelic.com/docs/agents/php-agent/php-agent-api/newrelic_add_custom_tracer",
- "published_at": "2020-09-30T11:16:38Z",
- "updated_at": "2019-09-30T22:55:59Z",
- "breadcrumb": "Contents » APM agents / PHP agent / PHP agent API",
- "document_type": "api_doc",
+ "category_1": "New Relic solutions",
+ "external_id": "c51fb6972a0e1d7cd72eaea21310026ec5ddb6a4",
+ "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/catalyst-establish-objectives-2.png",
+ "url": "https://docs.newrelic.com/docs/new-relic-solutions/new-relic-solutions/measure-devops-success/establish-objectives-baselines-define-team-slos",
+ "published_at": "2020-10-03T21:44:47Z",
+ "updated_at": "2020-09-28T00:26:46Z",
+ "breadcrumb": "Contents / New Relic solutions / New Relic solutions / Measure DevOps success",
+ "document_type": "page",
"popularity": 1,
- "info": "New Relic PHP agent API call to add custom instrumentation to particular methods in your app code. ",
- "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\"); } } }",
+ "info": "Service level objectives (SLOs) provide a powerful mechanism to codify the goals of a DevOps team in a way that can be measured and shared.",
+ "body": "A DevOps transformation requires a cultural shift so that teams can build new skills and motivations for the type of cross-team work required in a true DevOps practice. The transformation can be difficult when the people involved do not see the benefits of change as a clear objective. Service level objectives (SLOs) provide a powerful mechanism to codify the goals of a DevOps team in a way that can be measured and shared. They also provide clear boundaries on service expectations that help teams achieve greater velocity and freedom in experimenting with new approaches. This tutorial defines SLOs for successful service delivery objectives and utilize New Relic instrumentation to surface the current performance metrics relative to those objectives. Measurable SLOs and visibility into your current progress against those SLOs ensure that you will be able to properly assess future optimization efforts. Service level components An SLO is an agreed upon means of measuring the performance of your service. The SLO defines a target value of a specified quantitative measure, which is called a service level indicator (SLI); for example: Average response time Response time percentile Application availability SLOs clarify a target value for SLIs; for example: Average response time should be less than 200 ms 95% of requests should be completed within 250 ms Availability of the service should be 99.99% Logically group SLOs together to provide an overall boolean indicator of whether or not the service is meeting expectations. For example, a helpful SLO for alerting purposes could be: 95% of requests completed within 250 ms AND availability is 99.99% Service level components Example values SLI (Indicator) HTTP status codes SLO (Objective) < 1% HTTP 500s over 30 days SLA (Agreement) For every additional .1% of HTTP 500s, 5% refund of total contract Resources Value stream mapping can be a useful exercise to work through before setting SLOs. Work with your teams to clarify key components of your service and the appropriate metrics. Use these inputs as starting points for this tutorial. In addition: Learn about SLOs, SLIs, and SLAs from the Google Cloud Platform blog. Learn how New Relic has applied SLOs and SLIs into its reliability practices form this SREcon18 Americas presentation (approximately 21 minutes). 1. Build an inventory of services requiring SLOs Start defining SLOs for your application by first taking an inventory of the services that your application provides to both your internal and external customers. Draft a list of services. Make the scope of services you consider as comprehensive as possible. Engage your team members and other stakeholders to validate the list for completeness. Segment your application stack to understand the potential components that might require SLOs. For example, most applications can be segmented as: Application (backend/microservices) Dependency services (such as the message queue) Database Website Underlying servers This example lists components that would benefit from SLOs: Customer type Component name Owner Language stack Operating system External Service 1 John D. Java RHEL 6 Internal Service 2 Jane A. .NET Win2003 R2 Internal ActiveMQ John D. Java AIX External Website Jane A. Classic ASP Win2000 Internal MS SQL Dave Z. n/a Win2003 R2 Building a definitive list of services that require an SLO can be challenging, because an application often consists of many endpoints with complex interdependencies. Begin your SLO journey with pragmatism. Start by defining a broader, simpler set of SLOs that are driven by what your customers care about most and what your team can control. As your teams better align around SLOs, you can then begin to fine-tune and add more complexity. 2. Research customer expectations for SLOs Once you have an inventory of services, begin to gather the information you need to define the SLOs for those services. Interviews with customers that depend on your services are often valuable for understanding service expectations. For example, to define SLOs for internal teams, New Relic, ask questions such as: If possible, can you broadly categorize the types of requests we can expect from you and your service? To what extent do you or your service depend on timely responses to requests? Are there requests for which response time is not critical? How does your service handle unavailable dependencies or data? What is the maximum amount of unavailable data that your service can handle? At what threshold does your service fail if a request takes too long? What are acceptable rates of errors? What would a SLA look like between our product and yours? Existing usage data can also be a helpful research input. 3. Define SLOs Using the research on customer expectations that you gathered, draft a focused set of SLOs. New Relic recommends setting SLOs against one or more of the following SLIs: Application availability percentage Average response time Response percentile Error rate Apdex value Also, consider instrumenting and tracking the following SLIs: Throughput (peak and trough) Database call count and duration DNS and SSL timing DOM processing and page rendering Mean-time-to-detection (MTTD) For a more comprehensive list of potential areas to measure, see Measuring DevOps. Recommendation: To determine if your application is performing to customer expectations: Consider combining multiple SLIs (for example, availability and response time) into one SLO. Aim to define a consistent set of conditions across all of the services in your list. Consult your team and stakeholders to validate that the SLOs you set are reasonable, consistently attainable (even if you are not currently meeting them), and aligned to customer expectations. After you finish this step, you should have a set of well-defined SLOs and SLIs. 4. Determine what can be instrumented Now you are ready to deploy agents or monitors to establish a performance baseline for the SLIs you created. With proper instrumentation in place, you will have visibility into the performance indicators that matter for your team and your customers. In addition, you will also have a clear understanding of how to meet your SLOs. Identify the service components your team will optimize. Verify which application tiers meet New Relic monitoring requirements. To ensure you have robust baselines from which to work, determine the level of instrumentation that is possible (or allowed) within your organization. There may be situations where instrumentation of the current on-premise environment is not viable. For example, firewalls with certain settings may not permit New Relic agents to transmit data. Recommendation: If the application has a web front end in these situations, use New Relic Synthetics. Synthetics offers non-agent monitoring while still providing the ability to establish a baseline. To instrument the example applications and components in this tutorial, use these New Relic products: New Relic products Customer type Component name Tier owner Language stack Server OS New Relic products External Service 1 John D. Java RHEL 6 APM, Infrastructure, Synthetics Internal Service 2 Jane A. .Net Win2003 R2 APM, Infrastructure Internal ActiveMQ John D. Java AIX APM, Plugins External Website Jane A. Classic ASP Win2000 Synthetics Internal MS SQL Dave Z. NA Win2003 R2 Infrastructure, On-host integration APM installation After reviewing the compatibility and requirements for New Relic APM, install the APM agent on your application stack. Steps for installing APM agents vary based on language agent type. Follow the installation procedures for specific APM agents. Infrastructure installation After reviewing the requirements for New Relic Infrastructure, follow the installation procedures to install the Infrastructure agent on instances that host your applications. The New Relic Infrastructure agent requires the following host permissions: Linux: To install and run the agent, you must have root privileges. Windows: To install and run the agent, you must have Administrator privileges. Infrastructure on-host integrations To gain extended visibility into applications that your code depends on, deploy on-host integrations based on their availability. New Relic supports several commonly used application components, including MySQL, Apache, NGINX, and more. For more information, see New Relic's on-host integrations documentation. Synthetics New Relic Synthetics is a suite of automated, scriptable tools to monitor your websites, critical business transactions, and API endpoints. Follow the procedures to create a simple browser check. Be sure to verify that your website URL is accessible from the Synthetics public network locations. Browser New Relic Browser provides deep insights into how your users are interacting with your application or website. Browser complements Synthetics with data based on actual user experiences, which is useful in discerning how DevOps efforts are ultimately improving the experience for the customer. For more information, see the compatibility and requirements, then install the New Relic Browser agent. Mobile The growing role of mobile apps in customer experience often spurs new performance data needs. Installation of New Relic Mobile lets DevOps teams instrument iOS and Android applications to gain a fuller understanding of service delivery quality. Plugins Developers can use the New Relic Plugins product to create plugins that monitor numerical metrics provided by external services, hosts, or equipment. You can install existing plugins from Plugin Central, or plan, develop, test, and create your own plugins. 5. Review the default metrics After you deploy the agents and monitors, use service maps to review the default metrics that New Relic captures. For example, a typical service map show many of the common SLIs that application teams rely on, including response time, Apdex, throughput, and error rate metrics from APM. It also shows page load time, Ajax response, throughput, and error rate from Browser. rpm.newrelic.com > Service maps: To explore detailed granularity for any area, use the service map's nodes. 6. Set up custom instrumentation To close any remaining gaps in visibility for your SLIs, use custom instrumentation. New Relic provides several avenues for adding custom instrumentation, including: Making API calls to agents from inside your source code Packaging XML-based custom instrumentation modules with deployed applications Adding UI-based instrumentation without a code deploy In addition, you can add custom attributes to each transaction event that match application performance factors to critical business information. Then you can track those attributes in Insights dashboards. For more information, see the custom instrumentation documentation for your application: APM Browser Infrastructure Insights Mobile Synthetics 7. Create Insights dashboards to track SLIs Once you implement the appropriate instrumentation, it is easy to visualize your service level indicators with New Relic Insights dashboards. Insights provides a single location to query and view all the data that New Relic products gather. For example, Insights helps visualize the following data gathered from New Relic products: Infrastructure: Use default Infrastructure events and attributes for your systems, processes, events, storage, and network; Infrastructure integrations; and custom attributes. APM: Use Transaction and TransactionError event types. Browser: Use PageView and PageAction event types. Mobile: Use several Mobile event types. Synthetics: Use SyntheticCheck, SyntheticRequest, and SyntheticPrivateMinion event types. Each event has an event type, a timestamp, and one or more key attributes. For more information about the data that New Relic receives from your app, see Data collection. To query and view the data from the SLIs you selected for baselining: Use the Insights Data explorer to create widgets for your dashboards. Create dashboards that include widgets for the SLI baseline data. Use these widgets and dashboards to establish team dashboards that you can share and use to conduct operations reviews. insights.newrelic.com > (select a dashboard): Query your SLI baseline data, create dashboards with widgets to visualize the data, then share with your team and stakeholders. The metrics you capture will become your application's baseline. Share your Insights dashboard with your application team and stakeholders to provide visibility into what is happening with your application and to monitor future performance. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 26.681913,
+ "_score": 524.0277,
"_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"
+ "title": "Establish objectives and baselines: define team SLOs",
+ "sections": "New Relic solutions",
+ "info": "Service level objectives (SLOs) provide a powerful mechanism to codify the goals of a DevOps team in a way that can be measured and shared.",
+ "category_0": "New Relic solutions",
+ "category_1": "New Relic solutions",
+ "body": ". Each event has an event type, a timestamp, and one or more key attributes. For more information about the data that New Relic receives from your app, see Data collection. To query and view the data from the SLIs you selected for baselining: Use the Insights Data explorer to create widgets for your",
+ "breadcrumb": "Contents / New Relic solutions / New Relic solutions / Measure DevOps success"
},
- "id": "58ca4191e621f45edd466e7a"
- },
- {
- "nodeid": 9691,
+ "id": "5f5b215064441f4c48e06825"
+ }
+ ],
+ "/build-apps/build-hello-world-app": [
+ {
"sections": [
- "Introduction to New Relic Mobile (Unity)",
- "Contents",
- "Monitor mobile app performance",
- "Install and configure",
- "Use Unity SDK API",
- "Send custom events and attributes to Insights",
- "Track custom network requests",
- "Uninstall plugin",
- "Unity release notes",
- "For more help"
+ "Intro to New Relic One API components",
+ "Components of the SDK",
+ "UI components",
+ "Chart components",
+ "Query and storage components",
+ "Platform APIs"
],
- "title": "Introduction to New Relic Mobile (Unity)",
- "type": "docs",
- "external_id": "9e03a54ec6df360532302d4dfe7484070f8ba80c",
+ "title": "Intro to New Relic One API components",
+ "type": "developer",
+ "tags": [
+ "SDK components",
+ "New Relic One apps",
+ "UI components",
+ "chart components",
+ "query and storage components",
+ "Platform APIs"
+ ],
+ "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2",
"image": "",
- "url": "https://docs.newrelic.com/docs/introduction-new-relic-mobile-unity",
- "published_at": "2020-09-30T14:13:59Z",
- "updated_at": "2020-07-25T00:44:01Z",
- "breadcrumb": "Contents",
+ "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/",
+ "published_at": "2020-10-06T02:11:40Z",
+ "updated_at": "2020-08-14T01:47:12Z",
+ "document_type": "page",
+ "popularity": 1,
+ "info": "Intro to New Relic One API components",
+ "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 192.24942,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Intro to New Relic One API components",
+ "sections": "Intro to New Relic One API components",
+ "info": "Intro to New Relic One API components",
+ "tags": "New Relic One apps",
+ "body": ", 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"
+ },
+ {
+ "sections": [
+ "Nerdpack file structure",
+ "Generate Nerdpack components",
+ "Nerdlet file structure",
+ "index.js",
+ "nr1.json",
+ "styles.scss",
+ "icon.png",
+ "Launcher file structure"
+ ],
+ "title": "Nerdpack file structure",
+ "type": "developer",
+ "tags": [
+ "New Relic One CLI",
+ "nerdpack",
+ "file structure",
+ "nerdlets",
+ "launchers"
+ ],
+ "external_id": "c97bcbb0a2b3d32ac93b5b379a1933e7b4e00161",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nerdpack-file-structure/",
+ "published_at": "2020-10-06T02:10:04Z",
+ "updated_at": "2020-08-14T01:49:25Z",
+ "document_type": "page",
+ "popularity": 1,
+ "info": "An overview of the Nerdpack File Structure",
+ "body": "Nerdpack file structure A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. Here we explain: The file structure for a Nerdpack, a Nerdlet, and a launcher How to link a launcher file to a Nerdlet How to link your application with a monitored entity For basic component definitions, see our component reference. Generate Nerdpack components There are two ways to generate a Nerdpack template: Generate a Nerdpack: Use the New Relic One CLI command nr1 create and select Nerdpack to create a Nerdpack template that includes a Nerdlet and a launcher. Generate Nerdlet or launcher individually: Use the New Relic One CLI command nr1 create and choose either Nerdlet or launcher. This can be useful when adding Nerdlets to an existing Nerdpack. For documentation on generating and connecting Nerdpack components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │ └── my-nerdlet-launcher │ ├── icon.png │ └── nr1.json ├── nerdlets │ └── my-nerdlet-nerdlet │ ├── index.js │ ├── nr1.json │ └── styles.scss ├── node_modules │ ├── js-tokens │ ├── loose-envify │ ├── object-assign │ ├── prop-types │ ├── react │ ├── react-dom │ ├── react-is │ └── scheduler ├── nr1.json ├── package-lock.json └── package.json Copy Nerdlet file structure A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files, index.js, nr1.json, and styles.scss. Here is what the default files look like after being generated using the nr1 create command: index.js The JavaScript code of the Nerdlet. import React from 'react'; export default class MyAwesomeNerdpack extends React.Component { render() { return Hello, my-awesome-nerdpack Nerdlet!
; } } Copy nr1.json The Nerdlet configuration file. { \"schemaType\": \"NERDLET\", \"id\": \"my-awesome-nerdpack-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\" } Copy Besides using the launcher as the access point for your application, you can also associate the application with a monitored entity to get it to appear in the entity explorer. To do this, add two additional fields to the config file of the first-launched Nerdlet: entities and actionCategory. In the following example, the Nerdlet has been associated with all Browser-monitored applications and will appear under the Monitor UI category : { \"schemaType\": \"NERDLET\", \"id\": \"my-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"Custom Data\", \"entities\": [{ \"domain\": \"BROWSER\", \"type\": \"APPLICATION\" }], \"actionCategory\": \"monitor\" } Copy To see this application in the UI, you would go to the entity explorer, select Browser applications, and select a monitored application. styles.scss An empty SCSS file for styling your application. icon.png The launcher icon that appears on the Apps page in New Relic One when an application is deployed. Launcher file structure Launchers have their own file structure. Note that: A launcher is not required; as an alternative to using a launcher, you can associate your application with a monitored entity. An application can have more than one launcher, which might be desired for an application with multiple Nerdlets. After generating a launcher using the nr1 create command, its folder contains two files: nr1.json The configuration file. { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy To connect a launcher to a Nerdlet, the rootNerdletId must match the id in the launched Nerdlet's nr1.json config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet. icon.png The icon displayed on the launcher for the app on the Apps page.",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 179.26,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Nerdpack file structure",
+ "sections": "Nerdpack file structure",
+ "info": "An overview of the Nerdpack File Structure",
+ "tags": "file structure",
+ "body": " components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │ └── my-nerdlet-launcher │ ├── icon.png"
+ },
+ "id": "5efa989e196a671300766404"
+ },
+ {
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-common/",
+ "sections": [
+ "New Relic One CLI common commands",
+ "Command details",
+ "nr1 help",
+ "See commands and get details",
+ "Usage",
+ "Arguments",
+ "Examples",
+ "nr1 update",
+ "Update your CLI",
+ "nr1 create",
+ "Create a new component",
+ "Options",
+ "nr1 profiles",
+ "Manage your profiles keychain",
+ "Commands",
+ "nr1 autocomplete",
+ "See autocomplete installation instructions",
+ "nr1 nrql",
+ "Query using NRQL"
+ ],
+ "published_at": "2020-10-06T02:14:19Z",
+ "title": "New Relic One CLI common commands",
+ "updated_at": "2020-08-14T01:48:10Z",
+ "type": "developer",
+ "external_id": "503e515e1095418f8d19329517344ab209d143a4",
+ "document_type": "page",
+ "popularity": 1,
+ "info": "An overview of common commands you can use with the New Relic One CLI.",
+ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 152.19768,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic One CLI common commands",
+ "sections": "New Relic One CLI common commands",
+ "info": "An overview of common commands you can use with the New Relic One CLI.",
+ "body": " Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies"
+ },
+ "id": "5f28bd6ae7b9d267996ade94"
+ },
+ {
+ "sections": [
+ "Map page views by region in a custom app",
+ "Before you begin",
+ "New Relic terminology",
+ "Build a custom app with a table chart",
+ "Query your browser data",
+ "Create and serve a new Nerdpack",
+ "Review your app files and view your app locally",
+ "Hard code your account ID",
+ "Import the TableChart component",
+ "Add a table with a single row",
+ "Customize the look of your table (optional)",
+ "Get your data into that table",
+ "Make your app interactive with a text field",
+ "Import the TextField component",
+ "Add a row for your text field",
+ "Build the text field object",
+ "Get your data on a map",
+ "Install Leaflet",
+ "Add a webpack config file for Leaflet",
+ "Import modules from Leaflet",
+ "Import additional modules from New Relic One",
+ "Get data for the map",
+ "Customize the map marker colors",
+ "Set your map's default center point",
+ "Add a row for your map",
+ "Replace \"Hello\" with the Leaflet code"
+ ],
+ "title": "Map page views by region in a custom app",
+ "type": "developer",
+ "tags": [
+ "custom app",
+ "map",
+ "page views",
+ "region",
+ "nerdpack"
+ ],
+ "external_id": "6ff5d696556512bb8d8b33fb31732f22bab455cb",
+ "image": "https://developer.newrelic.com/static/d87a72e8ee14c52fdfcb91895567d268/0086b/pageview.png",
+ "url": "https://developer.newrelic.com/build-apps/map-pageviews-by-region/",
+ "published_at": "2020-10-06T02:08:36Z",
+ "updated_at": "2020-09-17T01:48:42Z",
+ "document_type": "page",
+ "popularity": 1,
+ "info": "Build a New Relic app showing page view data on a world map.",
+ "body": "Map page views by region in a custom app 30 min New Relic has powerful and flexible tools for building custom apps and populating them with data. This guide shows you how to build a custom app and populate it with page view data using New Relic's Query Language (NRQL - pronounced 'nurkle'). Then you make your data interactive. And last, if you have a little more time and want to install a third-party React library, you can display the page view data you collect on a map of the world. In this guide, you build an app to display page view data in two ways: In a table On a map Please review the Before you begin section to make sure you have everything you need and don't get stuck halfway through. Before you begin In order to get the most out of this guide, you must have: A New Relic developer account, API key, and the command-line tool. If you don't have these yet, see the steps in Setting up your development environment New Relic Browser page view data to populate the app. Without this data, you won't be able to complete this guide. To add your data to a world map in the second half of the guide: npm, which you'll use during this section of the guide to install Leaflet, a third-party JavaScript React library used to build interactive maps. If you're new to React and npm, you can go here to install Node.js and npm. New Relic terminology The following are some terms used in this guide: New Relic application: The finished product where data is rendered in New Relic One. This might look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One that launches your application. Nerdlets: New Relic React components used to build your application. The three default files are index.js, nr1.json, and styles.scss, but you can customize and add your own. Build a custom app with a table chart Step 1 of 8 Query your browser data Use Query builder to write a NRQL query to see your page view data, as follows. On New Relic One, select Query your data (in the top right corner). That puts you in NRQL mode. You'll use NRQL to test your query before dropping the data into your table. Copy and paste this query into a clear query field, and then select Run. FROM PageView SELECT count(*), average(duration) WHERE appName = 'WebPortal' FACET countryCode, regionCode SINCE 1 week ago LIMIT 1000 Copy If you have PageView data, this query shows a week of average page views broken down by country and limited to a thousand items. The table will be full width and use the \"chart\" class defined in the CSS. If you don't have any results at this point, ensure your query doesn't have any errors. If your query is correct, you might not have the Browser agent installed. Step 2 of 8 Create and serve a new Nerdpack To get started, create a new Nerdpack, and serve it up to New Relic from your local development environment: Create a new Nerdpack for this app: nr1 create --type nerdpack --name pageviews-app Copy Serve the project up to New Relic: cd pageviews-app && nr1 nerdpack:serve Copy Step 3 of 8 Review your app files and view your app locally Navigate to your pageviews-app to see how it's structured. It contains a launcher folder, where you can customize the description and icon that will be displayed on the app's launcher in New Relic One. It also contains nerdlets, which each contain three default files: index.js, nr1.json, and styles.scss. You'll edit some of these files as part of this guide. For more information, see Nerdpack file structure. Now in your browser, open https://one.newrelic.com/?nerdpacks=local, and then click Apps to see the pageview-apps Nerdpack that you served up. When you select the launcher, you see a Hello message. Step 4 of 8 Hard code your account ID For the purposes of this exercise and for your convenience, hard code your account ID. In the pageview-app-nerdlet directory, in the index.js file, add this code between the import and export lines. (Read about finding your account ID here). const accountId = [Replace with your account ID]; Copy Step 5 of 8 Import the TableChart component To show your data in a table chart, import the TableChart component from New Relic One. To do so, in index.js, add this code under import React. import { TableChart } from 'nr1'; Copy Step 6 of 8 Add a table with a single row To add a table with a single row, in the index.js file, replace this line: return Hello, pageview-app-nerdlet Nerdlet!
; Copy with this export code: export default class PageViewApp extends React.Component { render() { return ( ); } } Copy Step 7 of 8 Customize the look of your table (optional) You can use standard CSS to customize the look of your components. In the styles.scss file, add this CSS. Feel free to customize this CSS to your taste. .container { width: 100%; height: 99vh; display: flex; flex-direction: column; .row { margin: 10px; display: flex; flex-direction: row; } .chart { height: 250px; } } Copy Step 8 of 8 Get your data into that table Now that you've got a table, you can drop a TableChart populated with data from the NRQL query you wrote at the very beginning of this guide. Put this code into the row div. ; Copy Go to New Relic One and click your app to see your data in the table. (You might need to serve your app to New Relic again.) Congratulations! You made your app! Continue on to make it interactive and show your data on a map. Make your app interactive with a text field Once you confirm that data is getting to New Relic from your app, you can start customizing it and making it interactive. To do this, you add a text field to filter your data. Later, you use a third-party library called Leaflet to show that data on a world map. Step 1 of 3 Import the TextField component Like you did with the TableChart component, you need to import a TextField component from New Relic One. import { TextField } from 'nr1'; Copy Step 2 of 3 Add a row for your text field To add a text field filter above the table, put this code above the TableChart div. The text field will have a default value of \"US\". { this.setState({ countryCode: event.target.value }); }} />
; Copy Step 3 of 3 Build the text field object Above the render() function, add a constructor to build the text field object. constructor(props) { super(props); this.state = { countryCode: null } } Copy Then, add a constructor to your render() function. Above return, add: const { countryCode } = this.state; Copy Now add countryCode to your table chart query. ; Copy Reload your app to try out the text field. Get your data on a map To create the map, you use npm to install Leaflet. Step 1 of 9 Install Leaflet In your terminal, type: npm install --save leaflet react-leaflet Copy In your nerdlets styles.scss file, import the Leaflet CSS: @import `~leaflet/dist/leaflet.css`; Copy While you're in styles.scss, fix the width and height of your map: .containerMap { width: 100%; z-index: 0; height: 70vh; } Copy Step 2 of 9 Add a webpack config file for Leaflet Add a webpack configuration file .extended-webpackrc.js to the top-level folder in your nerdpack. This supports your use of map tiling information data from Leaflet. module.exports = { module: { rules: [ { test: /\\.(png|jpe?g|gif)$/, use: [ { loader: 'file-loader', options: {}, }, { loader: 'url-loader', options: { limit: 25000 }, }, ], }, ], }, }; Copy Step 3 of 9 Import modules from Leaflet In index.js, import modules from Leaflet. import { Map, CircleMarker, TileLayer } from 'react-leaflet'; Copy Step 4 of 9 Import additional modules from New Relic One You need several more modules from New Relic One to make the Leaflet map work well. Import them with this code: import { NerdGraphQuery, Spinner, Button, BlockText } from 'nr1'; Copy NerdGraphQuery lets you make multiple NRQL queries at once and is what will populate the map with data. Spinner adds a loading spinner. Button gives you button components. BlockText give you block text components. Step 5 of 9 Get data for the map Using latitude and longitude with country codes, you can put New Relic data on a map. mapData() { const { countryCode } = this.state; const query = `{ actor { account(id: 1606862) { mapData: nrql(query: \"SELECT count(*) as x, average(duration) as y, sum(asnLatitude)/count(*) as lat, sum(asnLongitude)/count(*) as lng FROM PageView FACET regionCode, countryCode WHERE appName = 'WebPortal' ${countryCode ? ` WHERE countryCode like '%${countryCode}%' ` : ''} LIMIT 1000 \") { results nrql } } } }`; return query; }; Copy Step 6 of 9 Customize the map marker colors Above the mapData function, add this code to customize the map marker colors. getMarkerColor(measure, apdexTarget = 1.7) { if (measure <= apdexTarget) { return '#11A600'; } else if (measure >= apdexTarget && measure <= apdexTarget * 4) { return '#FFD966'; } else { return '#BF0016'; } }; Copy Feel free to change the HTML color code values to your taste. In this example, #11A600 is green, #FFD966 is sort of yellow, and #BF0016 is red. Step 7 of 9 Set your map's default center point Set a default center point for your map using latitude and longitude. const defaultMapCenter = [10.5731, -7.5898]; Copy Step 8 of 9 Add a row for your map Between the text field row and the table chart row, insert a new row for the map content using NerdGraphQuery. {({ loading, error, data }) => { if (loading) { return ; } if (error) { return 'Error'; } const { results } = data.actor.account.mapData; console.debug(results); return 'Hello'; }}
; Copy Reload your application in New Relic One to test that it works. Step 9 of 9 Replace \"Hello\" with the Leaflet code Replace return \"Hello\"; with: return ( ); Copy This code creates a world map centered on the latitude and longitude you chose using OpenStreetMap data and your marker colors. Reload your app to see the pageview data on the map!",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 129.2698,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Create and serve a new Nerdpack",
+ "tags": "nerdpack",
+ "body": " look like a series of interactive charts or a map of the world. Nerdpack: New Relic's standard collection of JavaScript, JSON, CSS, and other files that control the functionality and look of your application. For more information, see Nerdpack file structure. Launcher: The button on New Relic One"
+ },
+ "id": "5efa993c196a67066b766469"
+ },
+ {
+ "sections": [
+ "Permissions for managing applications",
+ "New Relic One pricing plan",
+ "Original product-based pricing"
+ ],
+ "title": "Permissions for managing applications",
+ "type": "developer",
+ "tags": [
+ "nerdpack manager",
+ "permissions",
+ "managing apps"
+ ],
+ "external_id": "c7f4c7fbd9d093d303c7f8268f8560ff9f435230",
+ "image": "",
+ "url": "https://developer.newrelic.com/build-apps/permission-manage-apps/",
+ "published_at": "2020-10-06T02:08:35Z",
+ "updated_at": "2020-09-02T02:04:41Z",
+ "document_type": "page",
+ "popularity": 1,
+ "info": "Learn about permissions for subscribing to apps",
+ "body": "Permissions for managing applications When you create an app, you'll likely want to share it. From New Relic One's Apps page, you can subscribe to apps you create, publish, and deploy, and to other publicly available apps. You must have the Nerdpack manager role to subcribe accounts to apps. Read on to learn about permissions and versions. Permissions for managing applications The Nerdpack manager role is a New Relic add-on role. When you create a Nerdpack, you have the Nerdpack manager role for handling that Nerdpack. New Relic account administrators have the Nerdpack manager role automatically, and can subscribe their accounts to available Nerdpacks. User permissions vary depending on which pricing plan you are on. New Relic One pricing plan For accounts with New Relic One pricing, there are permissions differences for basic users and full users: Full users have the Nerdpack manager role and have full capabilities for creating and managing New Relic One applications, as well as accessing all types of applications in the New Relic One catalog. A basic user can develop and view their own local New Relic One apps, but they cannot: Subscribe other users to apps they’ve created. Access or manage apps in the New Relic One catalog. Access apps in the entity explorer sidebar. Original product-based pricing For accounts on our original product-based pricing, here are access details: Subscribe to publicly available applications To subscribe to publicly available applications, you must have the Nerdpack manager role. Nerdpack manager permissions are automatically assigned to New Relic account owners and admins and can be assigned to individual users. If you aren’t an owner or admin, you can request Nerdpack manager permission, or ask your New Relic admin or owner to subscribe the apps to your account for you. You can add any of the publicly available applications to master accounts or separate sub-accounts on which you have the Nerdpack manager role, or to separate sub-accounts under a master account you own or administer. If you add the application to a master account, the access flows to all of its sub-accounts as well. Subscribe to applications that you create You also must have the Nerdpack manager role to subscribe the applications you create to accounts. Applications that you publish and deploy can only be subscribed to the master account that was used to publish them, or to its sub-accounts. This means you might want a New Relic admin to deploy your applications for you if they need to be available across the organization.",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 102.445526,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Permissions for managing applications",
+ "sections": "Permissions for managing applications",
+ "info": "Learn about permissions for subscribing to apps",
+ "tags": "nerdpack manager",
+ "body": "Permissions for managing applications When you create an app, you'll likely want to share it. From New Relic One's Apps page, you can subscribe to apps you create, publish, and deploy, and to other publicly available apps. You must have the Nerdpack manager role to subcribe accounts to apps. Read"
+ },
+ "id": "5f45bf2864441ffb4dfdcdbb"
+ }
+ ],
+ "/explore-docs/nr1-catalog": [
+ {
+ "sections": [
+ "New Relic One CLI reference",
+ "Installing the New Relic One CLI",
+ "Tip",
+ "New Relic One CLI Commands",
+ "Get started",
+ "Configure your CLI preferences",
+ "Set up your Nerdpacks",
+ "Manage your Nerdpack subscriptions",
+ "Install and manage plugins",
+ "Manage catalog information"
+ ],
+ "title": "New Relic One CLI reference",
+ "type": "developer",
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-10-06T02:13:01Z",
+ "updated_at": "2020-09-17T01:51:10Z",
+ "document_type": "page",
+ "popularity": 1,
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 283.81976,
+ "_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"
+ },
+ {
+ "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png",
+ "url": "https://developer.newrelic.com/",
+ "sections": [
+ "Mark your calendar for Nerd Days 1.0",
+ "Get coding",
+ "Create custom events",
+ "Add tags to apps",
+ "Build a Hello, World! app",
+ "Get inspired",
+ "Add a table to your app",
+ "Collect data - any source",
+ "Automate common tasks",
+ "Create a custom map view",
+ "Add a time picker to your app",
+ "Add custom attributes",
+ "New Relic developer champions",
+ "New Relic Podcasts"
+ ],
+ "published_at": "2020-10-06T01:57:17Z",
+ "title": "New Relic Developers",
+ "updated_at": "2020-10-06T01:49:17Z",
+ "type": "developer",
+ "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab",
+ "document_type": "page",
+ "popularity": 1,
+ "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 7 Days : 14 Hours : 50 Minutes : 46 Seconds Register Get coding Create a free account 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events Start the guide 7 min Add tags to apps Add tags to applications you instrument for easier filtering and organization Start the guide 12 min Build a Hello, World! app Build a Hello, World! app and publish it to your local New Relic One Catalog Start the guide Get inspired 30 min Add a table to your app Add a table to your New Relic One app 15 min Collect data - any source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add a time picker to your app Add a time picker to a sample application Add custom attributes Use custom attributes for deeper analysis Show 20 more guides Looking for more inspiration? Check out the open source projects built by the New Relic community. New Relic developer champions New Relic Champions are solving big problems using New Relic as their linchpin and are recognized as experts and leaders in the New Relic technical community. Nominate a developer champion Learn more about developer champions New Relic Podcasts We like to talk, especially to developers about developer things. Join us for conversations on open source, observability, software design and industry news. Listen",
+ "info": "",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 196.74231,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "New Relic Developers",
+ "sections": "New Relic developer champions",
+ "body": " 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"
+ },
+ "id": "5d6fe49a64441f8d6100a50f"
+ },
+ {
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-common/",
+ "sections": [
+ "New Relic One CLI common commands",
+ "Command details",
+ "nr1 help",
+ "See commands and get details",
+ "Usage",
+ "Arguments",
+ "Examples",
+ "nr1 update",
+ "Update your CLI",
+ "nr1 create",
+ "Create a new component",
+ "Options",
+ "nr1 profiles",
+ "Manage your profiles keychain",
+ "Commands",
+ "nr1 autocomplete",
+ "See autocomplete installation instructions",
+ "nr1 nrql",
+ "Query using NRQL"
+ ],
+ "published_at": "2020-10-06T02:14:19Z",
+ "title": "New Relic One CLI common commands",
+ "updated_at": "2020-08-14T01:48:10Z",
+ "type": "developer",
+ "external_id": "503e515e1095418f8d19329517344ab209d143a4",
+ "document_type": "page",
+ "popularity": 1,
+ "info": "An overview of common commands you can use with the New Relic One CLI.",
+ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 164.66307,
+ "_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"
+ },
+ {
+ "sections": [
+ "Serve, publish, and deploy your New Relic One app",
+ "Before you begin",
+ "Serve your app locally",
+ "Add images and metadata to your apps",
+ "screenshots folder",
+ "documentation.md",
+ "additionalInfo.md",
+ "config.json",
+ "Publish your app",
+ "Tip",
+ "Deploy your app",
+ "Subscribe or unsubsribe apps",
+ "Handle duplicate applications"
+ ],
+ "title": "Serve, publish, and deploy your New Relic One app",
+ "type": "developer",
+ "tags": [
+ "publish apps",
+ "deploy apps",
+ "subscribe apps",
+ "add metadata apps"
+ ],
+ "external_id": "63283ee8efdfa419b6a69cb8bd135d4bc2188d2c",
+ "image": "https://developer.newrelic.com/static/175cc6506f7161ebf121129fa87e0789/0086b/apps_catalog.png",
+ "url": "https://developer.newrelic.com/build-apps/publish-deploy/",
+ "published_at": "2020-10-06T02:17:18Z",
+ "updated_at": "2020-09-02T02:05:55Z",
"document_type": "page",
"popularity": 1,
- "body": "Legacy feature This document is for historical reference. Unity is no longer supported for new customers. Contents Monitor mobile app performance The New Relic Unity plugin allows Unity developers to embed a New Relic Mobile agent (iOS or Android) in a Unity app build for mobile devices to monitor your app's performance. The plugin is written in C#, but it includes the native iOS and Android agents that embed the appropriate files for your build. Features New Relic Mobile Features Comprehensive performance data View your mobile app's performance Overview page for summary information about active sessions, or drill down to detailed information, including (note limitations below): Interaction times and trace details Crash reporting Devices Operating systems Detailed network views Available by using the API to track custom network requests For iOS apps, receive automatic instrumentation for networking for any parts of the app that are native and non-Unity (using standard Apple networking components such as NSURLConnection) Examine HTTP errors and network failures (such as DNS lookups, timeouts, SSL errors, etc.) and server error traces. Usage details at a glance Compare performance between versions of your app with detailed information for memory, CPU (iOS only), interaction speed, network requests per minute, and network failures. View a monthly report with a bar chart tracking the number of devices running your app for each month over the last year. Mobile SDK API options Use the Unity API to: Create and complete interactions Record custom metrics Send custom events to Insights Track custom network requests Known limitations The New Relic Unity plugin does not automatically instrument interactions. You must use the Unity API to track specific interactions. The New Relic Unity plugin does not automatically instrument network requests. You must use the Unity API to track network calls. Android builds: Unity still generates an Eclipse project, but Android Studio can import the Eclipse project. Install and configure The Unity plugin includes iOS and Android agent files that will embed the appropriate files for your build. To instrument interactions and network requests, you must use the Unity API to manually instrument your code. Install the Unity plugin As part of the installation process, New Relic Mobile automatically generates an application token. This is a 40-character hexadecimal string for authenticating each mobile project you monitor in New Relic Mobile. For Admins with existing New Relic accounts, follow these steps to install and configure your Unity application. (If you do not have a New Relic account, see New Relic Mobile.) Go to rpm.newrelic.com/mobile. From the mobile apps index, select Add a new app. From the Get started page, select Unity as the platform for mobile monitoring. Type a name for your mobile project, then select Continue. Continue with the procedures to configure the Unity plugin. Configure the Unity plugin These procedures to configure your app also appear on the Get started page in the New Relic UI. Install NewRelic-Unity-Plugin.unitypackage into your project by going to Assets > Import package > Custom package... and selecting NewRelic-Unity-Plugin.unitypackage. Create a new GameObject in your project's initial scene by going to GameObject > Create empty and naming it NewRelicAgent. Add NewRelicAgent.cs script (located in Assets/Plugins) to the NewRelicAgent GameObject: Drag it on top of NewRelicAgent in the Hierarchy tab. OR Click Add Component button, then select New Relic Agent from the Scripts option. In the Inspector tab, set the iOS or Android application token from your New Relic Mobile apps. (Recommendation: Keep New Relic Mobile apps on separate platforms.) Build for your platform (iOS or Android), then open the resulting project (Xcode or Eclipse). For Eclipse, import the generated project into Android Studio. Android only: Ensure that your app requests the INTERNET permission through the Player Settings inspector window. In Other Settings, Configuration, ensure the Internet access dropdown is set to Required. This will result in the following permission added to the app's manifest: Run your app in an emulator or device to generate data. Check New Relic Mobile to ensure the data is reporting to your account. Configure crash reporting The New Relic Unity plugin cannot automatically upload dSYMs for iOS crash reporting. You must manually upload dSYMs once your iOS unity app is built for release. If the application is bitcode enabled, follow the procedures for bitcode enabled apps once the your iOS app is submitted to Apple. If you are building an Android app with ProGuard enabled, you must follow similar steps. The ProGuard mapping must be uploaded to New Relic so crash reports can be de-obfuscated. For more information, see Android agent crash reporting. Optional: Change the logging level Six logging levels are available for mobile apps monitoring: NONE ERROR WARNING INFO VERBOSE DEBUG Recommendation: Set the logging level from the Unity Inspector tab. Use Unity SDK API Use the New Relic Unity SDK API to further configure and extend the plugin's instrumentation. Create and complete interactions To start an interaction: string interactionIdentifier = NewRelicAgent.StartInteractionWithName(\"new interaction\"); To stop the current interaction: NewRelicAgent.StopCurrentInteraction(interactionIdentifier); Interactions work in conjuction with method tracing. To trace a method insert startTracingMethod, insert at the start of the method to trace, and insert endTracingMethodWithTimer at each exit point of the method. To start tracing a method: Timer methodTimer = new Timer(); NewRelicAgent.StartTracingMethod(\"MethodName\",\"ClassName\",methodTimer,NewRelicAgent.NRTraceType.None); To end tracing a method, use the same timer as the startTracingMethod:> NewRelicAgent.EndTracingMethodWithTimer(methodTimer); Set a custom build identifier Custom build identifiers are set as the Application Build property in the inspector pane for the NewRelicAgent game object, under the New Relic Agent (Script) settings. Execute a demo crash If you have trouble getting your project to crash, use the New Relic Unity plugin API to execute a demo crash. Recommendation: Add this line of code to a button click event handler as applicable: NewRelicAgent.CrashNow(\"message\")> Record custom metrics With the custom metric API, you can record arbitrary numerical data and named events. Custom metrics can help to track high level events specific to your application. You can use several API calls to record custom metrics that provide different levels of detail. To create a custom metric, use this method: NewRelicAgent.RecordMetricWithName(String name, String category) The name parameter is the textual name of the metric that will appear in the user interface for New Relic Mobile. Using clear, concise metric names will help you get the most out of the metrics. The guidelines for naming a custom metric include: Use case and white space characters appropriate for display in the user interface. Metric names are rendered as-is. Capitalize the metric name. Avoid using the characters / ] [ | * when naming things. Avoid multi-byte characters. If you want to specify more details about a custom metric, three other API methods are available: NewRelicAgent.RecordMetricWithName(String name, String category, double value) NewRelicAgent.RecordMetricWithName(string name, string category, double value, string valueUnits) NewRelicAgent.RecordMetricWithName(string name, string category, double value, string valueUnits, string countUnits) With these methods, you can record additional details: Parameter Description count The number of times the event has happened totalValue The total value of the recording exclusiveValue The exclusive value of the recording; for example, if the total value contains measurements accounted for elsewhere countUnit Unit of measurement for the metric count, including PERCENT, BYTES, SECONDS, BYTES_PER_SECOND, or OPERATIONS valueUnit Unit of measurement for the metric value, including PERCENT, BYTES, SECONDS, BYTES_PER_SECOND, or OPERATIONS To view the custom metrics you collect, follow standard procedures to create custom dashboards. Send custom events and attributes to Insights The SDK can store up to 64 user-defined attributes at a time. If you attempt to store more than 64 attributes, the SDK returns false. Use the following static methods in the NewRelicAgent namespace to send custom attributes and events to New Relic Insights. Methods that return boolean results return true if they succeed, or false if the operation did not complete. The following methods are available for custom attributes and events: RecordEvent (name, attributes) NewRelicAgent.RecordEvent (string name, string dictionary attributes) Records a custom Insights event. Includes a list of attributes specified as a map. SetAttribute (name, value) NewRelicAgent.SetAttribute (string name, string value) NewRelicAgent.SetAttribute (string name, double value) Creates an attribute with the specified text name and text/float value. SetAttribute overwrites its previous value and type each time it is called. Examples boolean attributeSet = NewRelicAgent.SetAttribute(\"username\", \"SampleUserName\"); boolean attributeSet = NewRelicAgent.SetAttribute(\"rate\", 9999.99); IncrementAttribute (name [, value]) public static boolean IncrementAttribute(String name); public static boolean incrementAttribute(String name, double value) If value is not specified, this method increments the count for the specified attribute by 1. If the attribute does not exist, it creates the attribute with a value of 1. If value is specified, the method will increment the attribute by the specified amount. Examples boolean incremented = NewRelicAgent.IncrementAttribute(\"rate\"); boolean incremented = NewRelicAgent.IncrementAttribute(\"rate\", 9999.99, false); RemoveAttribute (name) NewRelicAgent.RemoveAttribute(String name) Removes the specified attribute. Example boolean attributeRemoved = NewRelicAgent.RemoveAttribute(\"rate\"); removeAllAttributes NewRelicAgent.removeAllAttributes() Removes all attributes from the session. Example boolean attributesRemoved = NewRelicAgent.RemoveAllAttributes(); Track custom network requests New Relic Mobile's API provides several methods to track network requests and network failures. For example, use the noticeHttpTransaction family of methods to record HTTP transactions with several available levels of detail. If a network request fails, you can record details about the failure with noticeNetworkFailure. NoticeNetworkRequest NewRelicAgent.NoticeNetworkRequest (\"http://newrelic.com\", \"GET\", timer, null, 200, 1024, 8192, bytes, httpParameters); Parameter Description url The URL of the request httpMethod The HTTP method used, such as GET or POST statusCode The statusCode of the HTTP response, such as 200 for OK timer A timer created when the network request was started bytesSent The number of bytes sent in the request bytesReceived The number of bytes received in the response responseBody The response body of the HTTP response. The response body will be truncated and included in an HTTP Error metric if the HTTP transaction is an error. params Additional parameters included in an HTTP Error metric if the HTTP transaction is an error. NoticeNetworkFailure NewRelicAgent.NoticeNetworkFailure(String url, String httpMethod, Timer timer, NewRelicAgent.NetworkFailureCode failureCode, String message) Parameter Description url The URL of the request httpMethod The HTTP method used, such as GET or POST timer A timer created when the network request was started exception The exception that occurred. New Relic Mobile can automatically translate many common exceptions into network failure types. failure The type of network failure that occurred. If an exception cannot be resolved to a network failure automatically, this method can be used to categorize the failure accurately. The values are defined by the NetworkFailure enum. Valid values include Unknown, BadURL, TimedOut, CannotConnectToHost, DNSLookupFailed, BadServerResponse, and SecureConnectionFailed. Uninstall plugin To uninstall the Unity plugin, use the project console to remove all related files and resources that were installed with the Unity package: Delete NewRelicAgent object from the Hierarchy pane of the Unity project console. From All Scripts, delete all the scripts that start with newrelic. Then do the following as applicable: From Assets > Plugin > iOS, delete the NewRelicIos, NewRelicUnityPlugin, post-build, and restore-framework files. Then remove the mod_pbxproj and NewRelicAgent.framework directories. From Assets > Plugin > Android, delete the newrelic.android and NewRelicAndroid files. Then remove the LICENSE and README directories. Unity release notes These release notes are for historical reference. Unity is no longer supported for new customers. Unity plugin 1.2.0 Released on: Monday, March 13, 2017 - 13:00 Download URL: https://download.newrelic.com/unity/NewRelic-Unity-Plugin_1.2.0.zip Notes: Updated Unity plugin to iOS agent 5.9.0 and Android agent 5.9.0 Unity plugin 1.1.0 Released on: Tuesday, September 6, 2016 - 14:53 Download URL: https://download.newrelic.com/unity/NewRelic-Unity-Plugin_1.1.0.zip Notes: Updated Unity plugin to iOS agent 5.8.0 and Android agent 5.7.1 Unity plugin 1.0.1 Released on: Monday, August 8, 2016 - 14:00 Download URL: https://download.newrelic.com/unity/NewRelic-Unity-Plugin_1.0.1.zip Notes: Bundle Android class rewriter JAR file (version 5.6.1) into the Unity package. Unity plugin 1.0.0 Released on: Wednesday, May 25, 2016 - 14:00 Download URL: http://download.newrelic.com/unity/NewRelic-Unity-Plugin_1.0.0.zip Notes: This plugin provides New Relic Mobile agent support for iOS and Android applications built with Unity. It also gives Unity developers access to New Relic crash reporting. It provides information about app performance, sessions, devices, operating systems, and more. It also includes APIs for custom instrumentation to gain deeper insights into specific areas of your app. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
- "info": "",
+ "info": "Start sharing and using the custom New Relic One apps you build",
+ "body": "Serve, publish, and deploy your New Relic One app 30 min When you build a New Relic One app, chances are you'll want to share it with others in your organization. You might even want to share it broadly through our open source channel. But first, you probably want to try it out locally to make sure it's working properly. From the New Relic One Apps page, you can review available apps and subscribe to the ones you want for accounts you manage. The Your apps section shows launchers for New Relic apps, as well as any third-party apps that you subscribe to. The New Relic One catalog provides apps that you haven't subscribed to, some developed by New Relic engineers to provide visualizations we think you'll want, like Cloud Optimizer, which analyzes your cloud environment, or PageView Map, which uses Browser events to chart performance across geographies. Your apps in the catalog are created by third-party contributors and are submitted via opensource.newrelic.com. All are intended to help you visualize the data you need, the way you want it. Here, you learn to: Serve your app locally Add images and metadata to your app Publish it Subscribe and unsubscribe accounts you manage to the app Handle duplicate applications Before you begin This guide requires the following: A New Relic One app or Nerdpack New Relic One CLI A Nerdpack manager role for publishing, deploying, and subscribing apps. Serve your app locally You can locally serve the app you create to New Relic One to test it out. Step 1 of 1 In the parent root folder of your Nerdpack, run nr1 nerdpack:serve. Go to one.newrelic.com/?nerdpacks=local. The ?nerdpacks=local URL suffix will load any locally served Nerdpacks that are available. When you make a change to a locally served Nerdpack, New Relic One will automatically reload it. Add images and metadata to your apps Application creators can include a description of what their apps do and how they're best used when they build an app. They can also include screenshots, icons, and metadata that help to make them easy to spot amongst other applications. Some metadata is added automatically when an app is published: Related entities, listed if there are any. Origin label to indicate where the app comes from: local, custom, or public. The New Relic One CLI enables you to provide the information and images you want to include with your application. Then it's a matter of kicking off a catalog command that validates the information and saves it to the catalog. Step 1 of 3 Update the New Relic One CLI to ensure you're working with the latest version. nr1 update Copy Step 2 of 3 Add catalog metadata and screenshots. Run nr1 create and then select catalog to add a catalog folder to your New Relic One project. The folder contains the following empty files and folder. Add the information as described in the following sections for the process to succeed. screenshots folder A directory that must contain no more than 6 images and meet these criteria: 3:2 aspect ratio PNG format landscape orientation 1600 to 2400 pixels wide documentation.md A markdown file that presents usage information pulled into the Documentation tab for the application in the catalog. additionalInfo.md An optional markdown file for any additional information about using your application. config.json A JSON file that contains the following fields: tagline: A brief headline for the application. Must not exceed 30 characters. repository: The URL to the GitHub repo for the application. Must not exceed 1000 characters. details: Describes the purpose of the application and how to use it. Information must not exceed 1000. Use carriage returns for formatting. Do not include any markdown or HTML. support: An object that contains: issues: A valid URL to the GitHub repository's issues list, generally the GitHub Issues tab for the repo. email: A valid email address for the team supporting the application. community: URL to a support thread, forum, or website for troubleshooting and usage support. whatsNew: A bulleted list of changes in this version. Must not exceed 500 characters. Use carriage returns for formatting. Do not include markdown or HTML. Example: { \"tagline\": \"Map your workloads & entities\", \"repository\": \"https://github.com/newrelic/nr1-workload-geoops.git\", \"details\": \"Describe, consume, and manage Workloads and Entities in a geographic \\n model that supports location-specific KPI's, custom metadata, drill-down navigation into Entities \\n and Workloads, real-time configuration, and configuration via automation using the newrelic-cli.\", \"support\": { \"issues\": { \"url\": \"https://github.com/newrelic/nr1-workload-geoops/issues\" }, \"email\": { \"address\": \"opensource+nr1-workload-geoops@newrelic.com\" }, \"community\": { \"url\": \"https://discuss.newrelic.com/t/workload-geoops-nerdpack/99478\" } }, \"whatsNew\": \"\\n-Feat: Geographic mapping of Workloads and Entities\\n -Feat: Programmatic alerting rollup of underlying Entities\\n -Feat: Custom KPI measurement per location\\n -Feat: Empty-state edit workflow\\n -Feat: JSON file upload format\\n-Feat: Published (in open source docs) guide to automating configuration using the newrelic-cli\" } Copy Step 3 of 3 Save the metadata and screenshots to the catalog. This validates the information you added to the catalog directory against the criteria described in the previous step, and saves it to the catalog. nr1 catalog:submit Copy Publish your app Publishing places your Nerdpack in New Relic One. To publish or deploy, you must be a Nerdpack manager. New Relic One requires that only one version (following semantic versioning) of a Nerdpack can be published at a time. Tip If you know what channel you want to deploy to (as described in the Deploy your app section that follows), you can run nr1 nerdpack:publish --channel=STABLE or nr1 nerdpack:publish --channel=BETA. Step 1 of 2 Update the version attribute in the app's package.json file. This follows semantic versioning, and must be updated before you can successfully publish. Step 2 of 2 To publish your Nerdpack, run nr1 nerdpack:publish. Deploy your app Deploying is applying a Nerdpack version to a specific channel (for example, BETA, or STABLE). A channel can only have one Nerdpack version deployed to it at one time. If a channel has an existing Nerdpack associated with it, deploying a new Nerdpack version to that channel will undeploy the previous one. Channels are meant to be an easier way to control application version access than having to be concerned with specific version numbers. Step 1 of 1 To deploy an application, run nr1 nerdpack:deploy. Subscribe or unsubsribe apps Whether you want to subscribe accounts to an app you've created or to apps already available in the catalog, the process is the same. Note that if you subscribe to an app in the catalog, you'll automatically get any updates that are added to the app. To learn about the appropriate permissions for subscribing, see Permissions for managing applications. Step 1 of 2 Subscribe accounts to an application. Select an application you want to add to your New Relic account. Click Add this app. Note that this button says Manage access if the app has already been subscribed to an account you manage. On the Account access page listing the accounts you can subscribe to an application: Select the accounts you want to subscribe the app to. Choose the channel you want to subscribe the app to, Stable or Dev. This can only be Stable for the public apps created by New Relic. Click the update button. Now you and members of the accounts you have subscribed to the app can launch it from New Relic One. Step 2 of 2 Unsubsribe from an application. On the Apps page, open the app you want to unsubscribe. Click Manage access. Clear the check box for any accounts you want to unsubscribe, and then click the update button. The application is no longer listed in the Your apps section of the Apps page, and you have unsubscribed. Handle duplicate applications You might end up with duplicate applications on your New Relic One Apps page. This can happen when you subscribe to the same app using both the CLI and the catalog. Or if you clone an app, modify, and deploy it, but keep the original name. You can manage duplicates with the catalog. Good to know before you start: You need a user role with the ability to manage Nerdpacks for accounts that you want to unsubscribe and undeploy from applications. You can't remove the public apps. When a duplicate application has no accounts subscribed to it, you undeploy it. For applications that have accounts subscribed to them, you unscubscribe and undeploy. The unsubscribe and undeploy process happens in a batch. To remove an account from an application, but ensure that other accounts continue to be subscribed, select the checkbox, Resubscribe these accounts to the new application. Step 1 of 1 Remove duplicates. In the New Relic One catalog, click a public application that has one or more duplicates. (You can only manage duplicates from the public version of the application.) On the application information page, select Clean up applications. Review the information about the application that's open, as well as any duplicates. Click Manage app for duplicates you want to remove. If needed, select Resubscribe these accounts to the new application. Click Unsubscribe and undeploy, and agree to the terms and conditions.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 17.589743,
+ "_score": 135.71292,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "body": " The SDK can store up to 64 user-defined attributes at a time. If you attempt to store more than 64 attributes, the SDK returns false. Use the following static methods in the NewRelicAgent namespace to send custom attributes and events to New Relic Insights. Methods that return boolean results return"
+ "title": "Serve, publish, and deploy your New Relic One app",
+ "sections": "Serve, publish, and deploy your New Relic One app",
+ "info": "Start sharing and using the custom New Relic One apps you build",
+ "body": " a matter of kicking off a catalog command that validates the information and saves it to the catalog. Step 1 of 3 Update the New Relic One CLI to ensure you're working with the latest version. nr1 update Copy Step 2 of 3 Add catalog metadata and screenshots. Run nr1 create and then select catalog to add"
},
- "id": "5c52cbec8e9c0f0b286080ec"
- }
- ],
- "/build-apps/set-up-dev-env": [
+ "id": "5efa999de7b9d283e67bab8f"
+ },
{
"sections": [
- "New Relic One CLI reference",
- "Installing the New Relic One CLI",
+ "Create a \"Hello, World!\" application",
+ "Before you begin",
"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"
+ "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": "New Relic One CLI reference",
+ "title": "Create a \"Hello, World!\" application",
"type": "developer",
"tags": [
- "New Relic One app",
- "nerdpack commands"
+ "nr1 cli",
+ "Nerdpack file structure",
+ "NR One Catalog",
+ "Subscribe applications"
],
- "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-10-01T01:56:53Z",
- "updated_at": "2020-09-17T01:51:10Z",
+ "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-10-06T02:07:12Z",
+ "updated_at": "2020-08-21T01:45:19Z",
"document_type": "page",
"popularity": 1,
- "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
- "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
+ "info": "Build a \"Hello, World!\" app and publish it to New Relic One",
+ "body": "Create a \"Hello, World!\" application 15 min Here's how you can quickly build a \"Hello, World!\" application in New Relic One. In these steps, you create a local version of the New Relic One site where you can prototype your application. Then, when you're ready to share the application with others, you can publish it to New Relic One. See the video, which demonstrates the steps in this guide in five minutes. Before you begin To get started, make sure you have accounts in GitHub and New Relic. To develop projects, you need the New Relic One CLI (command line interface). If you haven't already installed it, do the following: Install Node.js. Complete all the steps in the CLI quick start. For additional details about setting up your environment, see Set up your development environment. Tip Use the NR1 VS Code extension to build your apps. Create a local version of the \"Hello, World!\" application The CLI allows you to run a local version of New Relic One. You can develop your application locally before you publish it in New Relic One. If you followed all the steps in the CLI quick start, you now have files under a new directory named after your nerdpack project. Here's how you edit those files to create a \"Hello, World!\" project: Step 1 of 9 Open a code editor and point it to the new directory named after your nerdpack project (for example, my-awesome-nerdpack). Your code editor displays two artifacts: launchers containing the homepage tile nerdlets containing your application code Step 2 of 9 Expand nerdlets in your code editor, and open index.js. Step 3 of 9 Change the default return message to \"Hello, World!\": import React from 'react'; // https://docs.newrelic.com/docs/new-relic-programmable-platform-introduction export default class MyAwesomeNerdpackNerdletNerdlet extends React.Component { render() { return \"Hello, World!\"
; } } Copy Step 4 of 9 As an optional step, you can add a custom launcher icon using any image file named icon.png. Replace the default icon.png file under launcher by dragging in your new image file: Step 5 of 9 To change the name of the launcher to something meaningful, in your code editor under launchers, open nr1.json. Step 6 of 9 Change the value for displayName to anything you want as the launcher label, and save the file: { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"INSERT_YOUR_TILE_LABEL_HERE\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy Step 7 of 9 To see your new changes locally, start the Node server with this command in your terminal: npm start Copy Step 8 of 9 Open a browser and go to https://one.newrelic.com/?nerdpacks=local (this url is also shown in the terminal). Step 9 of 9 When the browser opens, click Apps, and then in the Other apps section, click the new launcher for your application. Here's an example where we inserted a leaf icon: After you click the new launcher, your \"Hello, World!\" appears: Publish your application to New Relic Your colleagues can't see your local application, so when you are ready to share it, publish it to the New Relic One catalog. The catalog is where you can find any pre-existing custom applications, as well as any applications you create in your own organization. Step 1 of 4 Execute the following in your terminal: nr1 nerdpack:publish Copy Step 2 of 4 Close your local New Relic One development tab, and open New Relic One. Step 3 of 4 Click the Apps launcher. Step 4 of 4 Under New Relic One catalog, click the launcher for your new application. When your new application opens, notice that it doesn't display any helpful descriptive information. The next section shows you how to add descriptive metadata. Add details to describe your project Now that your new application is in the New Relic One catalog, you can add details that help users understand what your application does and how to use it. Step 1 of 5 Go to your project in the terminal and execute the following: nr1 create Copy Step 2 of 5 Select catalog, which creates a stub in your project under the catalog directory. Here's how the results might look in your code editor: Step 3 of 5 In the catalog directory of your project, add screenshots or various types of metadata to describe your project. For details about what you can add, see Add catalog metadata and screenshots. Step 4 of 5 After you add the screenshots and descriptions you want, execute the following to save your metadata to the catalog: nr1 catalog:submit Copy Step 5 of 5 Return to the catalog and refresh the page to see your new screenshots and metadata describing your project. Subscribe accounts to your application To make sure other users see your application in the catalog, you need to subscribe accounts to the application. Any user with the NerdPack manager or admin role can subscribe to an application from accounts that they have permission to manage. Step 1 of 3 If you're not already displaying your application's description page in the browser, click the launcher for the application in the catalog under Your company applications. Step 2 of 3 On your application's description page, click Add this app. Step 3 of 3 Select the accounts you want to subscribe to the application, and then click Update accounts to save your selections. When you return to the Apps page, you'll see the launcher for your new application. Summary Now that you've completed the steps in this example, you learned the basic steps to: Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can use it. Related information Create a local application. Publish the application to the New Relic One catalog so you can share it with your colleagues. Add details to the project in the catalog so users understand how to use it. Subscribe accounts to your application so other users can see it directly on their homepage.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 250.27719,
+ "_score": 133.56865,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "New Relic One CLI reference",
- "sections": "New Relic One CLI reference",
- "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
- "tags": "New Relic One app",
- "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use"
+ "sections": "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": "5efa989e28ccbc535a307dd0"
- },
+ "id": "5efa9973196a67d16d76645c"
+ }
+ ],
+ "/collect-data/query-data-nrql": [
{
- "category_2": "Trace API",
- "nodeid": 35381,
+ "category_2": "Alert conditions",
+ "nodeid": 9231,
"sections": [
- "Distributed tracing",
+ "New Relic Alerts",
"Get started",
- "Enable and configure",
- "Other requirements",
- "UI and data",
- "Trace API",
+ "Alert policies",
+ "Alert conditions",
+ "Alert violations",
+ "Alert Incidents",
+ "Alert notifications",
"Troubleshooting",
- "Report traces via the Trace API (New Relic format)",
- "Example: Use your tool’s native sampling",
- "Example: Use Infinite Tracing",
- "JSON requirements and recommendations",
- "Attributes",
- "Required attributes",
- "Highly recommended attributes",
- "Reserved attributes",
- "Other attributes",
- "Explore more about distributed tracing:",
+ "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)",
+ "Set the loss of signal threshold",
+ "Offset the query time window",
+ "NRQL alert threshold examples",
+ "Nested Aggregation NRQL Alerts",
+ "Create a description",
"For more help"
],
- "title": "Report traces via the Trace API (New Relic format)",
- "category_0": "Understand dependencies",
+ "title": "Create NRQL alert conditions",
+ "category_0": "Alerts and Applied Intelligence",
"type": "docs",
- "category_1": "Distributed tracing",
- "external_id": "ba16f3a71b78e24c23da821b64567398251bb217",
- "image": "",
- "url": "https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/trace-api/report-new-relic-format-traces-trace-api",
- "published_at": "2020-09-30T17:57:42Z",
- "updated_at": "2020-09-30T17:57:42Z",
- "breadcrumb": "Contents / Understand dependencies / Distributed tracing / Trace API",
+ "category_1": "New Relic Alerts",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions",
+ "external_id": "956a7a0b84d2afac5e6236df3143085ebc4f7459",
+ "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/signal-loss-ui.png",
+ "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions",
+ "published_at": "2020-10-04T08:33:54Z",
+ "updated_at": "2020-10-04T08:33:54Z",
+ "breadcrumb": "Contents / Alerts and Applied Intelligence / New Relic Alerts / Alert conditions",
"document_type": "page",
"popularity": 1,
- "info": "For New Relic's Trace API: how to report traces using the New Relic format. ",
- "body": "You can send traces in the New Relic format to our Trace API without using a New Relic agent or integration. This is useful if you want to integrate with sources that emit tracing data and require a backend for trace storage. Since distributed systems can generate a lot of trace data, telemetry tools rely on data sampling (filtering) to find the most useful subset of that data. When you send us your trace data, you have two options related to sampling: Use your tool’s native sampling: This approach sends the telemetry data directly to the Trace API and assumes you are relying on your telemetry tool to sample the data before the integration passes the data to New Relic. Even though your tool may be sampling data before the New Relic integration sends it, our Trace API may randomly sample out traces that exceed your rate limit. Use Infinite Tracing: This approach assumes you set sampling to 100% in your telemetry tool so you send all your data to a New Relic trace observer in AWS. The trace observer selects the most important and actionable traces using tail-based sampling and then sends your traces to our Trace API. To send Zipkin-formatted data to the Trace API, see our Zipkin instructions. We'll look at two examples for sending your telemetry data to New Relic, as well as how to structure your data: Example: Use your tool’s native sampling Example: Use Infinite Tracing JSON requirements and recommendations Attributes Example: Use your tool’s native sampling If you are using a telemetry tool that is sampling your trace data, you can send the data directly to New Relic. The following procedure explains how to send a test payload to the Trace API using the newrelic format. For details about how to structure your data, see JSON requirements and recommendations. Get an Insert API key: Go to: one.newrelic.com > account dropdown > Account settings > API keys, and select Insights API keys. If you don't have a key, create a new one by selecting Insert keys +. Insert your Insert API key into the following JSON and then send the JSON to our endpoint. curl -i -H \"Content-Type: application/json\" \\ -H \"Api-Key: YOUR_INSERT_API_KEY\" \\ -H 'Data-Format: newrelic' \\ -H 'Data-Format-Version: 1' \\ -X POST \\ -d '[ { \"common\": { \"attributes\": { \"service.name\": \"Test Service A\", \"host\": \"host123.test.com\" } }, \"spans\": [ { \"trace.id\": \"123456\", \"id\": \"ABC\", \"attributes\": { \"duration.ms\": 12.53, \"name\": \"/home\" } }, { \"trace.id\": \"123456\", \"id\": \"DEF\", \"attributes\": { \"service.name\": \"Test Service A\", \"host\": \"host456.test.com\", \"duration.ms\": 2.97, \"name\": \"/auth\", \"parent.id\": \"ABC\" } } ] } ]' 'https://trace-api.newrelic.com/trace/v1' If you're sending more than one POST, change the trace.id to a unique value. Sending the same payload or span id multiple times for the same trace.id may result in fragmented traces in the UI. If your test returned HTTP/1.1 202 Accepted, go to our UI to see a query of your test data using the span attribute service.name = Test Service A. Traces may take up to one minute to be processed by both the trace observer and the Trace API. Example: Use Infinite Tracing Infinite Tracing requires you to provision a trace observer that receives your spans. The trace observer examines the spans and keeps the actionable ones. You provision a trace observer in a cluster of services in AWS called New Relic Edge. If you send your data to a trace observer in one of our EU provider regions, you'll still need a US-based New Relic account because the tail-based sampling data is reported to data centers in the United States. If you have questions, contact your account representative. Use our Edge app to set up the trace observer. This app also includes some optional configurations: trace observer monitoring and span attribute trace filter. If you're not sure whether you want to configure these, you can set them up later. Complete the following: Step A. Set up the trace observer endpoint Go to one.newrelic.com. In the menu bar, click Apps, expand Your apps, and then click New Relic Edge. Select an account in the upper-left dropdown. If you have access to multiple account hierarchies, make sure you're in the hierarchy where you want a trace observer. If no trace observers are listed, click New trace observer to add one, insert a descriptive name, select a region, and then click Create. For the trace observer you want to use, go to the Endpoints dropdown and select For other integrations. Click the adjacent clipboard icon to copy and hold the endpoint to use later as YOUR_TRACE_OBSERVER_URL in Step B. Send test data to the trace observer. (Optional) If you want to start gathering trace observer metrics, click the toggle for Trace observer monitoring. For details, see trace observer monitoring. (Optional) If you want to customize the span attribute trace filter, click the gear icon below Trace filters to see the current rules. For details, see span attribute filter. Step B. Send test data to the trace observer This test includes a sample payload with one trace and two spans from the same service: Test Service A. Follow these steps to send a test request: Get or generate your Insert API key so you can use it later in the test. Copy the following curl request into a text editor: curl request curl -i -H \"Content-Type: application/json\" \\ -H \"Api-Key: YOUR_INSERT_API_KEY\" \\ -H 'Data-Format: newrelic' \\ -H 'Data-Format-Version: 1' \\ -X POST \\ -d '[ { \"common\": { \"attributes\": { \"environment\": \"staging\" } }, \"spans\": [ { \"trace.id\": \"123456\", \"id\": \"ABC\", \"attributes\": { \"duration.ms\": 12.53, \"host\": \"host123.test.com\", \"name\": \"/home\", \"service.name\": \"Test Service A\" } }, { \"trace.id\": \"123456\", \"id\": \"DEF\", \"attributes\": { \"duration.ms\": 2.97, \"host\": \"host456.test.com\", \"error.message\": \"Invalid credentials\", \"name\": \"/auth\", \"parent.id\": \"ABC\", \"service.name\": \"Test Service B\" } } ] } ]' \\ 'YOUR_TRACE_OBSERVER_URL' Insert your own values into the curl request: Value Description YOUR_INSERT_API_KEY Replace this with your Insert API key (not the same as your personal API key for NerdGraph API explorer) YOUR_TRACE_OBSERVER_URL Replace this with the value you copied in Step A. Set up the trace observer endpoint. Copy the content of the text editor into a terminal, and then execute the request. If the test does not return HTTP/1.1 202 Accepted indicating success, check the following and try again: Confirm that you used the Edge app value For other integrations as YOUR_TRACE_OBSERVER_URL. Confirm that you only have single quotes around the value you inserted for YOUR_TRACE_OBSERVER_URL. Check that you are using the Insert API Key (not a license). If your test returned HTTP/1.1 202 Accepted, go to New Relic One to see a query of your test data using the span attribute service.name = Test Service A. Because the sample payload contains an error attribute, the error sampler will mark it for keeping. If you modify the payload to remove the error attributes, the random sampler may not choose to keep this particular trace. Traces may take up to one minute to be processed by both the trace observer and the Trace API. JSON requirements and recommendations Requirements and guidelines for trace JSON using the newrelic format: Each JSON payload is an array of objects. Each object should contain a required spans key. Each object may contain an optional common key. Use this if you want share information across multiple spans in a object. Any keys on a span have precedence over the same key in the common block. The value for spans key is a list of span objects. Certain attributes are required, and must be included either in the optional common block, or in each span. Recommended and custom attributes may be optionally included in a list of key/value pairs under a key named attributes, in the optional common block and/or in each span. In the following example POST, there are two spans, both of which will have the trace.id 12345 and the custom attribute host: host123.test.com. The first span has no parent.id, so that is the root of the trace; the second span's parent.id points to the ID of the first. [ { \"common\": { \"attributes\": { \"host\": \"host123.test.com\" } }, \"spans\": [ { \"trace.id\": \"12345\", \"id\": \"abc\", \"attributes\": { \"user.email\": \"bob@newr.com\", \"service.name\": \"my-service\", \"duration.ms\": 750, \"name\": \"my-span\" } }, { \"trace.id\": \"12345\", \"id\": \"def\", \"attributes\": { \"parent.id\": \"abc\", \"service.name\": \"second-service\", \"duration.ms\": 750, \"name\": \"second-span\" } } ] } ] Attributes Review the sections below describing the attributes for the attributes block of a newrelic formatted JSON POST. Required attributes Requests without these attributes will be rejected, and an NrIntegrationError will be generated. These are the only attributes that don't belong under attributes. attribute description id string Unique identifier for this span. trace.id string Unique identifier shared by all spans within a single trace. Highly recommended attributes While not required, these attributes should be included for the best experience with your data. They are included in the attributes section. attribute default description duration.ms float none Duration of this span in milliseconds. name string none The name of this span. parent.id string none The id of the caller of this span. Value is null if this is the root span. Traces without a root span will not displayed. service.name string none The name of the entity that created this span. timestamp long Defaults to the current time in UTC timezone if not provided. The span's start time in Epoch milliseconds. Reserved attributes These attributes are currently reserved for internal New Relic usage. While they are not explicitly blocked, we recommend not using them. attribute default description entity.name string service.name This is derived from the service.name attribute. entity.type string service The entity type is assumed to be a service. entity.guid string None The entity.guid is a derived value that uniquely identifies the entity in New Relic's backend. Other attributes You can add any arbitrary attributes you want, with the exception of the restricted attributes. For example, you might want to add attributes like customer.id or user.id to help you analyze your trace data. To learn how to control how spans appear in New Relic (for example, adding errors or setting a span as a datastore span), see Decorate spans. Explore more about distributed tracing: Learn where Trace API data shows up in the UI. Learn how to decorate spans for a richer, more detailed UI experience. For example, you can have spans show up as datastore spans or display errors. Learn about general data limits, required metadata, and response validation. If you don't see your trace data, see Troubleshooting. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "info": "How to define thresholds that trigger alert notifications based on your NRQL queries.",
+ "body": "You can create alert conditions using NRQL queries. Create NRQL alert condition To create a NRQL alert condition: When you start to create a condition, where it prompts you to Select a product, click NRQL. Tips for creating and using a NRQL condition: Topic Tips Condition types NRQL condition types include static, baseline, and outlier. Create a description For some condition types, you can create a Description. Query results Queries must return a number. The condition works by evaluating that returned number against the thresholds you set. Time period As with all alert conditions, NRQL conditions evaluate one single minute at a time. The implicit SINCE ... UNTIL clause specifying which minute to evaluate is controlled by your Evaluation offset setting. Since very recent data may be incomplete, you may want to query data from 3 minutes ago or longer, especially for: Applications that run on multiple hosts. SyntheticCheck data: Timeouts can take 3 minutes, so 5 minutes or more is recommended. Also, if a query will generate intermittent data, consider using the sum of query results option. Loss of signal Use the signal loss settings to: Set the signal loss time limit Close all current open violations Open new violations To learn more about signal loss and how to request access to it, see this announcement. Condition settings Use the Condition settings to: Create a concise and descriptive condition name. Choose how long data is collected before it's aggregated. Adjust the evaluation offset. Select whether or not to fill gaps with data and what values to use. To learn more about gap filling and how to request access to it, see this announcement. Provide a text description for the condition that will be included in violations and notifications. Sometimes a signal will have an aggregation window that does not contain data. This creates a gap in the data that is evaluated. This feature allows you to fill gaps in data with either the last known or a custom value that you choose. It is common to use a zero as the custom value. The default behavior is to leave gaps empty, which will restart the evaluation duration timer. Troubleshooting procedures Optional: To include your organization's procedures for handling the incident, add the runbook URL to the condition. Limits on conditions See the maximum values. Health status NRQL alert conditions do not affect an entity's health status display. Examples For more information, see: Expected NRQL syntax Examples of NRQL condition queries Alert threshold types When you create a NRQL alert, you can choose from different types of thresholds: NRQL alert threshold types Description Static This is the simplest type of NRQL threshold. It allows you to create a condition based on a NRQL query that returns a numeric value. Optional: Include a FACET clause. Baseline Uses a self-adjusting condition based on the past behavior of the monitored values. Uses the same NRQL query form as the static type, except you cannot use a FACET clause. Outlier Looks for group behavior and values that are outliers from those groups. Uses the same NRQL query form as the static type, but requires a FACET clause. NRQL alert syntax Here is the basic syntax for creating all NRQL alert conditions. Depending on the threshold type, also include a FACET clause as applicable. SELECT function(attribute) FROM Event WHERE attribute [comparison] [AND|OR ...] Clause Notes SELECT function(attribute) Required Supported functions that return numbers include: apdex average count latest max min percentage percentile sum uniqueCount If you use the percentile aggregator in a faceted alert condition with many facets, this may cause the following error to appear: An error occurred while fetching chart data. If you see this error, use average instead. FROM data type Required Only one data type can be targeted. Supported data types: Event Metric (RAW data points will be returned) WHERE attribute [comparison] [AND|OR ...] Optional Use the WHERE clause to specify a series of one or more conditions. All the operators are supported. FACET attribute Static: Optional Baseline: Not allowed Outlier: Required Including a FACET clause in your NRQL syntax depends on the threshold type: static, baseline, or outlier. Use the FACET clause to separate your results by attribute and alert on each attribute independently. Faceted queries can return a maximum of 5000 values for static conditions and a maximum of 500 values for outlier conditions. If the query returns more than this number of values, the alert condition cannot be created. If you create the condition and the query returns more than this number later, the alert will fail. Sum of query results (limited or intermittent data) Available only for static (basic) threshold types. If a query returns intermittent or limited data, it may be difficult to set a meaningful threshold. Missing or limited data will sometimes generate false positives or false negatives. To avoid this problem when using the static threshold type, you can set the selector to sum of query results. This lets you set the alert on an aggregated sum instead of a value from a single harvest cycle. Up to two hours of the one-minute data checks can be aggregated. The duration you select determines the width of the rolling sum, and the preview chart will update accordingly. Set the loss of signal threshold Go to one.newrelic.com, click Alerts & AI, in the left sidebar click Policies, select a policy, then Create a condition. Loss of signal is only available for NRQL conditions. A loss of signal is a period of time when no data is received by New Relic. Sometimes, there's no data being sent and sometimes data is being lost. You can use loss of signal to customize whether and when you'll be notified after your last known signal. To create a NRQL alert that uses loss of signal: When creating a condition, under Select a product, click NRQL, then click Next, define thresholds. Create a NRQL query that returns the values you want to alert on. For Threshold type, select Static or Baseline. Click + Add lost signal threshold, then set the time in minutes or seconds after which the signal will be considered lost. When the signal is lost, check the boxes to Close all current open violations and Open new \"lost signal\" violation. Make sure you name your condition and then save it. You can use a signal loss to close all of your currently open violations, open a lost signal violation, or do both. 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%' Nested Aggregation NRQL Alerts Nested aggregation queries are a powerful way to query your data and open up new possibilities to alert on. However, they have a few restrictions that are important to note. Nested queries with a non-faceted innermost query are not currently supported Without a FACET, the inner query will produce a single result thus giving the outer query nothing to aggregate. Registering the inner query alone would be equivalent. SELECT max(cpu) FROM (FROM Event SELECT min(cpuTime) as cpu) Queries at all levels must have the same aggregation window Assuming the alert is registered with an aggregation window of 1 minute, this inner query would produce 2 smaller windows of width 30 seconds which could be aggregated by the outer query. However, this is not currently supported. SELECT max(cpu) FROM (FROM Event SELECT min(cpuTime) as cpu TIMESERIES 30 seconds) Signal loss is not yet supported for nested queries For more information on signal loss, see NerdGraph API: Loss of signal and gap filling. Create a description You can define a description that passes useful information downstream for better violation responses or for use by downstream systems. For details, see Description. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 146.7058,
+ "_score": 143.26324,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "Report traces via the Trace API (New Relic format)",
- "sections": "Report traces via the Trace API (New Relic format)",
- "info": "For New Relic's Trace API: how to report traces using the New Relic format. ",
- "category_2": "Trace API",
- "body": " an Insert API key: Go to: one.newrelic.com > account dropdown > Account settings > API keys, and select Insights API keys. If you don't have a key, create a new one by selecting Insert keys +. Insert your Insert API key into the following JSON and then send the JSON to our endpoint. curl -i -H "Content",
- "breadcrumb": "Contents / Understand dependencies / Distributed tracing / Trace API"
+ "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": "'s health status display. Examples For more information, see: Expected NRQL syntax Examples of NRQL condition queries Alert threshold types When you create a NRQL alert, you can choose from different types of thresholds: NRQL alert threshold types Description Static This is the simplest type of NRQL"
},
- "id": "5d89dc6028ccbc83ce9cb16f"
+ "id": "5f2d992528ccbc489d88dfc1"
},
{
- "category_2": "Enable and configure",
- "nodeid": 38171,
+ "category_2": "Get started",
+ "nodeid": 11431,
"sections": [
- "Distributed tracing",
+ "NRQL: New Relic Query Language",
"Get started",
- "Enable and configure",
- "Other requirements",
- "UI and data",
- "Trace API",
- "Troubleshooting",
- "Integrations: Enable distributed tracing",
- "Step 1. Install the integration",
- "Step 2. (Infinite Tracing) Set up a trace observer",
- "Step 3. (Infinite Tracing) Configure the integration",
- "Step 4. View traces",
+ "NRQL query tools",
+ "NRQL query tutorials",
+ "Introduction to NRQL, New Relic's query language",
+ "What is NRQL?",
+ "Where can you use NRQL?",
+ "What data can you query with NRQL?",
+ "Start using NRQL",
+ "NRQL query examples",
+ "NRQL syntax",
"For more help"
],
- "title": "Integrations: Enable distributed tracing",
- "category_0": "Understand dependencies",
+ "title": "Introduction to NRQL, New Relic's query language",
+ "category_0": "Query your data",
"type": "docs",
- "category_1": "Distributed tracing",
- "external_id": "6fd698d8077aa70b61b867bec09cac86be69214c",
- "image": "",
- "url": "https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/enable-configure/integrations-enable-distributed-tracing",
- "published_at": "2020-09-30T14:39:10Z",
- "updated_at": "2020-09-30T14:39:10Z",
- "breadcrumb": "Contents / Understand dependencies / Distributed tracing / Enable and configure",
+ "category_1": "NRQL: New Relic Query Language",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language",
+ "external_id": "d44be2c7df7addda8679b4c842015223cfcbd1a3",
+ "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-view-chart-nrql-query_0.png",
+ "url": "https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language",
+ "published_at": "2020-10-03T15:18:02Z",
+ "updated_at": "2020-09-24T08:40:20Z",
+ "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started",
"document_type": "page",
"popularity": 1,
- "info": "These are instructions for enabling distributed tracing for New Relic integrations with Istio, Open Census, and OpenTelemetry.",
- "body": "If you have telemetry data from Istio, Kamon, OpenCensus, and OpenTelemetry, you can view it in the New Relic UI by sending it through one of our telemetry integrations. To integrate your AWS X-Ray telemetry data, use the infrastructure integration. Since distributed systems can generate a lot of trace data, telemetry tools rely on data sampling (filtering) to find useful data. Our telemetry integrations offer you two sampling options: Use your tool’s native sampling (default): The default installation assumes you are relying on your telemetry tool to sample the data before the integration passes the data to our Trace API. Even though your tool may be sampling data, our Trace API may randomly sample out traces that exceed your rate limit. Use Infinite Tracing: This approach assumes you set sampling to 100% in your telemetry tool so you send all your data to a New Relic trace observer in AWS. The trace observer selects the most important and actionable traces using tail-based sampling and then sends your traces to our Trace API. To use this approach, complete the default installation but then configure a new endpoint for a trace observer. Here's an overview of the steps to enable distributed tracing: Install the integration (Infinite Tracing) Provision a trace observer on New Relic Edge (Infinite Tracing) Configure your open source integration View your traces in New Relic One Step 1. Install the integration If you haven't already installed one of these integrations in your services, follow the link for your integration and complete the installation. After the installation, if you are not enabling Infinite Tracing, skip to Step 4. View traces in New Relic One. Istio adapter Kamon reporter OpenCensus Go language exporter Python language exporter OpenTelemetry Go language exporter Java language exporter .NET language exporter Step 2. (Infinite Tracing) Set up a trace observer This section only applies to Infinite Tracing. If you're enabling standard distributed tracing, skip to Step 4. View traces in New Relic One. Infinite Tracing requires you to provision a trace observer that receives your spans. The trace observer examines the spans and keeps the actionable ones. You provision a trace observer in a cluster of services in AWS called New Relic Edge. If you send your data to a trace observer in one of our EU provider regions, you'll still need a US-based New Relic account because the tail-based sampling data is reported to data centers in the United States. If you have questions, contact your account representative. Use our Edge app to set up the trace observer. This app also includes some optional configurations: trace observer monitoring and span attribute trace filter. If you're not sure whether you want to configure these, you can set them up later. Complete the following: 2a. Set up the trace observer endpoint Go to one.newrelic.com. In the menu bar, click Apps, expand Your apps, and then click New Relic Edge. Select an account in the upper-left dropdown. If you have access to multiple account hierarchies, make sure you're in the hierarchy where you want a trace observer. If no trace observers are listed, click New trace observer to add one, insert a descriptive name, select a region, and then click Create. For the trace observer you want to use, go to the Endpoints dropdown and click the adjacent clipboard icon to copy these values: Users Endpoints dropdown value Description For all users (Including OpenCensus Python) For other integrations Copy and hold to use later as YOUR_TRACE_OBSERVER_URL in: 2b. Send test data to the trace observer Step 3. (Infinite Tracing) Configure the integration (not for OpenCensus Python) Only for OpenCensus Python For language agents Copy and hold to use later as YOUR_TRACE_OBSERVER_HOST in Step 3. (Infinite Tracing) Configure the integration. (Optional) If you want to start gathering trace observer metrics, click the toggle for Trace observer monitoring. For details, see trace observer monitoring. (Optional) If you want to customize the span attribute trace filter, click the gear icon below Trace filters to see the current rules. For details, see span attribute filter. 2b. (Optional) Send test data to the trace observer This test includes a sample payload with one trace and two spans from the same service: Test Service A. Follow these steps to send a test request: Get or generate your Insert API key so you can use it later in the test. Copy the following curl request into a text editor: curl request curl -i -H \"Content-Type: application/json\" \\ -H \"Api-Key: YOUR_INSERT_API_KEY\" \\ -H 'Data-Format: newrelic' \\ -H 'Data-Format-Version: 1' \\ -X POST \\ -d '[ { \"common\": { \"attributes\": { \"environment\": \"staging\" } }, \"spans\": [ { \"trace.id\": \"123456\", \"id\": \"ABC\", \"attributes\": { \"duration.ms\": 12.53, \"host\": \"host123.test.com\", \"name\": \"/home\", \"service.name\": \"Test Service A\" } }, { \"trace.id\": \"123456\", \"id\": \"DEF\", \"attributes\": { \"duration.ms\": 2.97, \"host\": \"host456.test.com\", \"error.message\": \"Invalid credentials\", \"name\": \"/auth\", \"parent.id\": \"ABC\", \"service.name\": \"Test Service B\" } } ] } ]' \\ 'YOUR_TRACE_OBSERVER_URL' Insert your own values into the curl request: Value Description YOUR_INSERT_API_KEY Replace this with your Insert API key (not the same as your personal API key for NerdGraph API explorer) YOUR_TRACE_OBSERVER_URL Replace this with the value you copied in 2a. Set up the trace observer endpoint. Copy the content of the text editor into a terminal, and then execute the request. If the test does not return HTTP/1.1 202 Accepted indicating success, check the following and try again: Confirm that you used the Edge app value For other integrations as YOUR_TRACE_OBSERVER_URL. Confirm that you only have single quotes around the value you inserted for YOUR_TRACE_OBSERVER_URL. Check that you are using the Insert API Key (not a license). If your test returned HTTP/1.1 202 Accepted, go to New Relic One to see a query of your test data using the span attribute service.name = Test Service A. Because the sample payload contains an error attribute, the error sampler will mark it for keeping. If you modify the payload to remove the error attributes, the random sampler may not choose to keep this particular trace. Traces may take up to one minute to be processed by both the trace observer and the Trace API. Step 3. (Infinite Tracing) Configure the integration To enable Infinite Tracing, configure your integration to send the telemetry data to the trace observer by using the results from Step 2. Find or create a trace observer endpoint. Find the section below describing these steps for your integration: Istio adapter Set the spansHost value with YOUR_TRACE_OBSERVER_URL when deploying the Helm chart. Kamon reporter Set the span-ingest-uri value with YOUR_TRACE_OBSERVER_URL in your kamon.newrelic configuration block. OpenCensus (Go language exporter) Set the SpansURLOverride field on the Config object with YOUR_TRACE_OBSERVER_URL when creating the Exporter. OpenCensus (Python language exporter) Pass the host parameter to the Trace Exporter using YOUR_TRACE_OBSERVER_HOST. OpenTelemetry (Go language exporter) Set the SpansURLOverride field on the Config object with YOUR_TRACE_OBSERVER_URL when creating the Exporter. OpenTelemetry (Java language exporter) Complete the following: Create a java.net.URI with YOUR_TRACE_OBSERVER_URL. Pass the URI to com.newrelic.telemetry.opentelemetry.export.NewRelicSpanExporter builder’s uriOverride method. See an example where a NewRelicSpanExporter is created. OpenTelemetry (.NET language exporter) Configure the TraceUrlOverride parameter with YOUR_TRACE_OBSERVER_URL. Step 4. View traces After you configure your integration to send data to New Relic, you are ready to view traces. Here are two alternatives: View traces that include a specific service The Entity explorer helps you navigate to a specific service so you can see traces that include that service. Go to one.newrelic.com. Click Entity explorer in the top menu bar. Filter to the service you enabled for Infinite Tracing by typing the service name, and then press Enter. In the left navigation's Monitor section, click Distributed tracing. View traces across accounts This option allows you to search all traces across all New Relic accounts in your organization that you have access to. Go to one.newrelic.com. Click Apps in the top menu bar. Under Favorites click Distributed tracing. In the Find traces... search, type a search clause to find the service. For example, to query service.name or trace.id: service.name = YOUR_SERVICE_NAME trace.id = YOUR_TRACE_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.",
+ "info": "An introduction to New Relic Query Language (NRQL) and how to use it.",
+ "body": "One way to query your New Relic data is with the New Relic Query Language (NRQL). This resource explains what NRQL is, when and how you can use it, and basic syntax rules. For more detailed information on querying, including a listing of clauses and functions and example queries, see NRQL syntax, clauses, and functions. What is NRQL? NRQL is New Relic's SQL-like query language. You can use NRQL to retrieve detailed New Relic data and get insight into your applications, hosts, and business-important activity. Reasons to use NRQL include: To answer a question for the purpose of troubleshooting or business analysis To create a new chart To make API queries of New Relic data (for example, using our NerdGraph API) NRQL is used behind the scenes to generate some New Relic charts: Some New Relic charts are built using NRQL. One way to start using NRQL is to view a chart's query and then edit it to make your own custom chart. Where can you use NRQL? You can use NRQL in these places: New Relic One query builder: Advanced mode is a NRQL query interface Basic mode provides a simplified query experience that doesn't require knowledge of NRQL but that uses NRQL to generate results New Relic Insights NerdGraph: our GraphQL-format API, which includes options for making NRQL queries one.newrelic.com > Query your data: You can run a NRQL query in both New Relic One and New Relic Insights. This NRQL query shows a count of distributed tracing spans faceted by their entity names. NRQL is one of several ways to query New Relic data. For more on all query options, see Query your data. What data can you query with NRQL? NRQL allows you to query these New Relic data types: Event data from all New Relic products, including: APM events, like Transaction New Relic Browser events, like PageView New Relic Mobile events, like Mobile Infrastructure events, like ProcessSample Synthetics events, like SyntheticCheck Custom events, like those reported by the Event API Metric timeslice data (metrics reported by New Relic APM, Browser, and Mobile) The Metric data type (metrics reported by the Metric API and data sources that use that API) The Span data type (distributed tracing data) The Log data type (data from New Relic Logs) Some data, like relationships between monitored entities, is not available via NRQL but is available using our NerdGraph API. Start using NRQL One way to start using NRQL and to understand what data you have available is to go to a NRQL interface (for example, the New Relic One query builder), type FROM, and press space. The interface will suggest available types of data: To see the attributes available for a specific data type, type FROM DATA_TYPE SELECT and press space. The interface will suggest available attributes. For example: To see the complete JSON associated with a data type, including all of its attributes, use the keyset() attribute. For example: FROM Transaction SELECT keyset() NRQL is used behind the scenes to build some New Relic charts and dashboards. One way to learn NRQL is to find one of these NRQL-generated charts and start playing with the NRQL to create new, customized queries and charts: Charts built with NRQL will have View query as an option. You can then edit and customize that query to see how your changes affect the resulting visualization. To explore your data without having to use NRQL, use the basic mode of New Relic One query builder. NRQL query examples Here's an example NRQL query of Transaction data, which is reported by New Relic APM. FROM Transaction SELECT average(duration) FACET appName TIMESERIES auto This would generate a chart that looks like: Here are some more query examples: Basic NRQL query of Browser data Here's a NRQL query of PageView data, which is reported by New Relic Browser. SELECT uniqueCount(user) FROM PageView WHERE userAgentOS = 'Mac' FACET countryCode SINCE 1 day ago LIMIT 20 Attribute name with a space in it If a custom attribute name has a space in it, use backticks around the attribute name: SELECT count(*) FROM Transaction FACET `Logged-in user` Querying multiple data sources To return data from two data sources, separate their data types with a comma. For example, this query returns a count of all APM transactions and Browser events over the last three days: SELECT count(*) FROM Transaction, PageView SINCE 3 days ago Query returning multiple columns To return multiple columns from a dataset, separate the aggregator arguments with a comma: SELECT function(attribute), function(attribute) ... FROM ... This query returns the minimum, average, and maximum duration for New Relic Browser PageView events over the last week: SELECT min(duration), max(duration), average(duration) FROM PageView SINCE 1 week ago See more NRQL query examples. NRQL syntax The syntax of a NRQL query is similar to standard SQL queries. Here is a breakdown of the structure of a NRQL query: SELECT function(attribute) [AS 'label'][, ...] FROM data type [WHERE attribute [comparison] [AND|OR ...]][AS 'label'][, ...] [FACET attribute | function(attribute)] [LIMIT number] [SINCE time] [UNTIL time] [WITH TIMEZONE timezone] [COMPARE WITH time] [TIMESERIES time] Basic rules include: NRQL condition Details Required values The SELECT statement and FROM clause are required. All other clauses are optional. You can start your query with either SELECT or FROM. Query string size The query string must be less than 4 KB. Case sensitivity The data type names and attribute names are case sensitive. NRQL clauses and functions are not case sensitive. Syntax for strings NRQL uses single quotes to designate strings. For example: ... where traceId = '030a573f0df02c57' Attribute names with spaces Use backticks `` to quote a custom attribute name that has a space in it. For example: ... FACET `Logged-in user` Data type coercion Insights does not support data type \"coercion.\" For more information, see Data type conversion. Use of math functions Basic and advanced math functions are supported in the SELECT statement. JOIN functions NRQL does not have the equivalent of the SQL JOIN function, but you can simulate a JOIN with custom attributes. Read more about NRQL syntax and functions. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 141.1422,
+ "_score": 112.41968,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "sections": "Trace API",
- "info": "These are instructions for enabling distributed tracing for New Relic integrations with Istio, Open Census, and OpenTelemetry.",
- "body": " integrations as YOUR_TRACE_OBSERVER_URL. Confirm that you only have single quotes around the value you inserted for YOUR_TRACE_OBSERVER_URL. Check that you are using the Insert API Key (not a license). If your test returned HTTP/1.1 202 Accepted, go to New Relic One to see a query of your test data using"
+ "title": "Introduction to NRQL, New Relic's query language",
+ "sections": "What data can you query with NRQL?",
+ "info": "An introduction to New Relic Query Language (NRQL) and how to use it.",
+ "category_0": "Query your data",
+ "category_1": "NRQL: New Relic Query Language",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language",
+ "body": "One way to query your New Relic data is with the New Relic Query Language (NRQL). This resource explains what NRQL is, when and how you can use it, and basic syntax rules. For more detailed information on querying, including a listing of clauses and functions and example queries, see NRQL syntax",
+ "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / Get started"
},
- "id": "5ea0617064441ff137912311"
+ "id": "5f2abd47196a67747343fbe1"
},
{
- "category_2": "Enable log monitoring",
- "nodeid": 34686,
+ "category_2": "Custom events",
+ "nodeid": 13661,
"sections": [
- "Enable log management",
- "New Relic Logs",
- "Enable log monitoring",
- "Configure logs in context",
- "Logs in context for Go",
- "Logs in context for Java",
- "Logs in context for .NET",
- "Logs in context for Node.js",
- "Logs in context for PHP",
- "Logs in context for Python",
- "Logs in context for Ruby",
- "Logs in context with agent APIs",
- "Fluent Bit plugin for log forwarding",
- "Compatibility and requirements",
- "Enable Fluent Bit for log management",
- "Recommended usage",
- "Install the Fluent Bit plugin",
- "Configure the Fluent Bit plugin",
- "Test the Fluent Bit plugin",
- "Optional: Configure plugin attributes",
- "Plugin configuration",
- "View log data",
- "What's next?",
+ "Event data sources",
+ "Default events",
+ "Custom events",
+ "Data requirements and limits for custom event data",
+ "General requirements",
+ "Reserved words",
+ "Additional Browser PageAction requirements",
+ "Additional Event API requirements",
+ "Event type limits",
"For more help"
],
- "title": "Fluent Bit plugin for log forwarding",
- "category_0": "Log management",
+ "title": "Data requirements and limits for custom event data",
+ "category_0": "Insights",
"type": "docs",
- "category_1": "Enable log management",
- "external_id": "b32bba2a148de0353e819ce82c14d16acfcab068",
+ "category_1": "Event data sources",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits",
+ "external_id": "f5beef0d09bb5918be3f8a1a3ece98c09947cd1e",
"image": "",
- "url": "https://docs.newrelic.com/docs/logs/enable-log-management-new-relic/enable-log-monitoring-new-relic/fluent-bit-plugin-log-forwarding",
- "published_at": "2020-09-30T18:47:06Z",
- "updated_at": "2020-09-27T21:53:23Z",
- "breadcrumb": "Contents / Log management / Enable log management / Enable log monitoring",
+ "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits",
+ "published_at": "2020-10-03T18:06:58Z",
+ "updated_at": "2020-09-27T17:50:31Z",
+ "breadcrumb": "Contents / Insights / Event data sources / Custom events",
"document_type": "page",
"popularity": 1,
- "info": "A description of New Relic's Fluent Bit logging plugin, and how to install it and configure it. ",
- "body": "New Relic offers a Fluent Bit output plugin to connect your Fluent Bit monitored log data to New Relic. Read on to learn how to enable this feature. Compatibility and requirements To use New Relic Logs with Fluent Bit, ensure your configuration meets the following requirements: New Relic license key (recommended) or Insert API key Fluent Bit 0.12 or higher is supported; however, version 1.0 or higher is recommended. Enable Fluent Bit for log management To forward your logs to New Relic using Fluent Bit: Install the Fluent Bit plugin. Configure the Fluent Bit plugin. Test the Fluent Bit plugin. Generate some traffic and wait a few minutes, then check your account for data. Recommended usage We have published a container with the plugin installed. It serves as a base image to be used by our Kubernetes integration. We recommend you use this base image and layer your own custom configuration files. Install the Fluent Bit plugin To install the Fluent Bit plugin: Navigate to New Relic's Fluent Bit plugin repository on GitHub. From the repository page, clone or download the repository. Run the following command to build your plugin: cd newrelic-fluent-bit-output && make all Configure the Fluent Bit plugin Fluent Bit needs to know the location of the New Relic plugin and the New Relic license key (recommended) or Insert API key to output data to New Relic. To configure your Fluent Bit plugin: Pay attention to white space when editing your config files. Be sure to use four spaces to indent and one space between keys and values. Locate or create a plugins.conf file in your plugins directory. In the plugins.conf file, add a reference to out_newrelic.so, adjacent to your fluent-bit.conf file: [PLUGINS] Path /PATH/TO/newrelic-fluent-bit-output/out_newrelic.so In the fluent-bit.conf file, add the following line under the service block: [SERVICE] # This is the main configuration block for fluent bit. # Ensure the follow line exists somewhere in the SERVICE block Plugins_File plugins.conf At the bottom of the fluent-bit.conf file, add the following to set up the input and output filters. Replace the placeholder text with your New Relic license key (recommended) or Insert API key: [INPUT] Name tail Path /PATH/TO/YOUR/LOG/FILE [OUTPUT] Name newrelic Match * licenseKey YOUR_LICENSE_KEY # Optional maxBufferSize 256000 maxRecords 1024 Restart your Fluent Bit instance with the following command: fluent-bit -c /PATH/TO/fluent-bit.conf Test the Fluent Bit plugin To test if your Fluent Bit plugin is receiving input from a log file: Run the following command to append a test log message to your log file: echo \"test message\" >> /PATH/TO/YOUR/LOG/FILE Search New Relic Logs UI for test message. Optional: Configure plugin attributes Plugin configuration Once you have installed and configured the Fluent Bit plugin, you can use the following attributes to configure how the plugin sends data to New Relic: Key Description licenseKey The New Relic license key. Use either licenseKey (recommended) or apiKey, not both. Default: none maxBufferSize The maximum size the payloads sent, in bytes. Default: 256000 maxRecords The maximum number of records to send at a time. Default: 1024 apiKey New Relic's Insert API key. Use either licenseKey (recommended) or apiKey, not both. View log data If everything is configured correctly and your data is being collected, you should see data logs in both of these places: New Relic Logs UI New Relic tools for running NRQL queries. For example, you can execute a query like this: SELECT * FROM Log What's next? Now that you've enabled Logs, here are some potential next steps: Explore your data using the Logs UI. Configure your agent to see contextual log data, such as distributed tracing, stack traces, application logs, and more. Query your data and create custom dashboards or alerts. If no data appears after you enable New Relic Logs, follow the troubleshooting procedures. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "info": "For New Relic, general limits and requirements for reporting custom events and attributes. ",
+ "body": "You can report custom events to New Relic in several ways, including the New Relic Event API, APM agent APIs, Browser agent APIs, and the Mobile SDK. This document contains general requirements and rules for inserting and using custom events and their associated attributes. Additional requirements may apply based on the method you use. General requirements How long custom data is retained depends on your Insights subscription and its associated data retention. When reporting custom events and attributes, follow these general requirements for supported data types, naming syntax, and size: Requirement Description Payload Total maximum size or length: 1 MB maximum per POST. We highly recommend using compression. The payload must be encoded as UTF-8. The Event API has additional HTTP rate limits. Attribute data types Attribute values can be either a string or a numeric integer or float. If your attribute values contain date information, define it as an unformatted Unix timestamp (in seconds or milliseconds) by using the Insights data formatter. Attribute size Maximum name size: 255 bytes. Maximum attribute value size: Custom attributes sent by the agent: 255 bytes Attributes attached to custom events sent using the Event API: 4096 characters Charts may only display the first 255 characters of attribute values. For complete attribute values, use the JSON chart type or Query API. Maximum total attributes per event: 254. Exception: If you use an APM agent API, the max is 64. Maximum total attributes per event type: 48,000. Naming syntax Attribute names can be a combination of alphanumeric characters, colons (:), periods (.), and underscores (_). Event types (using the eventType attribute) can be a combination of alphanumeric characters, colons (:), and underscores (_). Do not use words reserved for use by NRQL. Null values The database does not store any data with a null value. Reserved words Avoid using the following reserved words as names for events and attributes. Otherwise, unexpected results may occur. This is not a complete list. In general, it's a good practice to avoid using MySQL-reserved words to avoid collision with future New Relic functionality. Keyword Description accountId This is a reserved attribute name. If it's included, it will be dropped during ingest. appId Value must be an integer. If it is not an integer, the attribute name and value will be dropped during ingest. eventType The event type as stored in New Relic. New Relic agents and scripts normally report this as eventType. Can be a combination of alphanumeric characters, colons (:), and underscores (_). Be sure to review the prohibited eventType values and eventType limits. Prohibited eventType values For your eventType value, avoid using: Metric, MetricRaw, and strings prefixed with Metric[0-9] (such as Metric2 or Metric1Minute). Public_ and strings prefixed with Public_. These event types are reserved for use by New Relic. Events passed in with these eventType values will be dropped. timestamp Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds. It must be +/-1 day (24 hours) of the current time on the server. Log forwarding terms The following keys are reserved by the Infrastructure agent's log forwarding feature: entity.guid, log, hostname, plugin.type, fb.input. If used, they are dropped during ingest and a warning is added to the logs. NRQL syntax terms If you need to use NRQL syntax terms as attribute names, including dotted attributes, they must be enclosed in backticks; for example, `LIMIT` or `consumer.offset`. Otherwise, avoid using these reserved words: ago, and, as, auto, begin, begintime, compare, day, days, end, endtime, explain, facet, from, hour, hours, in, is, like, limit, minute, minutes, month, months, not, null, offset, or, raw, second, seconds, select, since, timeseries, until, week, weeks, where, with Additional Browser PageAction requirements For additional requirements for using New Relic Browser's custom PageAction event, see Insert custom data via New Relic Browser agent. Additional Event API requirements For more requirements and details for the Event API, see Event API. Event type limits The current limit for total number of eventType values is 250 per sub-account in a given 24-hour time period. If a user exceeds this limit, New Relic may filter or drop data. Event types include: Default events from New Relic agents Custom events from New Relic agents Custom events from Insights custom event inserter For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 131.49396,
+ "_score": 109.84808,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "sections": "New Relic Logs",
- "info": "A description of New Relic's Fluent Bit logging plugin, and how to install it and configure it. ",
- "body": " key (recommended) or Insert API key Fluent Bit 0.12 or higher is supported; however, version 1.0 or higher is recommended. Enable Fluent Bit for log management To forward your logs to New Relic using Fluent Bit: Install the Fluent Bit plugin. Configure the Fluent Bit plugin. Test the Fluent Bit plugin"
+ "title": "Data requirements and limits for custom event data",
+ "sections": "Event data sources",
+ "category_1": "Event data sources",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits",
+ "body": " may apply based on the method you use. General requirements How long custom data is retained depends on your Insights subscription and its associated data retention. When reporting custom events and attributes, follow these general requirements for supported data types, naming syntax, and size",
+ "breadcrumb": "Contents / Insights / Event data sources / Custom events"
},
- "id": "5f375ef4196a6743b655e634"
+ "id": "59f4354f4bb81c2ea8b80d0a"
},
{
+ "category_2": "Ingest APIs",
+ "nodeid": 35526,
"sections": [
- "Add tables to your New Relic One application",
- "Before you begin",
- "Clone and set up the example application",
- "Work with table components",
- "Next steps"
- ],
- "title": "Add tables to your New Relic One application",
- "type": "developer",
- "tags": [
- "table in app",
- "Table component",
- "TableHeaderc omponent",
- "TableHeaderCell component",
- "TableRow component",
- "TableRowCell component"
+ "Ingest and manage data",
+ "Get started",
+ "Understand data",
+ "Manage data",
+ "Ingest APIs",
+ "Metric API limits and restricted attributes",
+ "Endpoint requirements and maximum limits",
+ "Rate limit violations",
+ "Restricted attributes",
+ "For more help"
],
- "external_id": "7ff7a8426eb1758a08ec360835d9085fae829936",
- "image": "https://developer.newrelic.com/static/e637c7eb75a9dc01740db8fecc4d85bf/1d6ec/table-new-cells.png",
- "url": "https://developer.newrelic.com/build-apps/howto-use-nrone-table-components/",
- "published_at": "2020-10-01T01:55:36Z",
- "updated_at": "2020-09-17T01:48:42Z",
+ "title": "Metric API limits and restricted attributes",
+ "category_0": "Telemetry Data Platform",
+ "type": "docs",
+ "category_1": "Ingest and manage data",
+ "external_id": "32ae97feb47a5a92dc7bf9809d396ef133b8b5a7",
+ "image": "",
+ "url": "https://docs.newrelic.com/docs/telemetry-data-platform/get-data/apis/metric-api-limits-restricted-attributes",
+ "published_at": "2020-10-03T22:32:05Z",
+ "updated_at": "2020-10-03T22:32:04Z",
+ "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs",
"document_type": "page",
"popularity": 1,
- "info": "Add a table to your New Relic One app.",
- "body": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application. In this guide, you are going to build a sample table using various New Relic One components. Before you begin If you haven't already installed the New Relic One CLI, step through the quick start in New Relic One. This process also gets you an API key. In addition, to complete the steps in this guide, you need a GitHub account and Node.js installed on your machine. See Setting up your development environment for more info. Clone and set up the example application Step 1 of 4 Clone the nr1-how-to example application from GitHub to your local machine. Then, navigate to the app directory. The example app lets you experiment with tables. git clone https://github.com/newrelic/nr1-how-to.git` cd nr1-how-to/create-a-table/nerdlets/create-a-table-nerdlet` Copy Step 2 of 4 Edit the index.json file and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install dependencies nr1 nerdpack:serve # Serve the demo app locally Copy Step 4 of 4 Open one.newrelic.com/?nerdpacks=local in your browser. Click Apps, and then in the Your apps section, you should see a Create a table launcher. That's the demo application you're going to work on. Go ahead and select it. Have a good look at the demo app. There's a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You'll use Table components to add a new table in the second row. Work with table components Step 1 of 10 Navigate to the nerdlets/create-a-table-nerdlet subdirectory and open the index.js file. Add the following components to the import statement at the top of the file so that it looks like the example: Table TableHeader TableHeaderCell TableRow TableRowCell import { Table, TableHeader, TableHeaderCell, TableRow, TableRowCell, PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart, } from 'nr1'; Copy Step 2 of 10 Add a basic Table component Locate the empty GridItem in index.js: This is where you start building the table. Add the initial component. The items property collects the data by calling _getItems(), which contains sample values. ; Copy Step 3 of 10 Add the header and rows As the Table component renders a fixed number of header cells and rows, your next step is adding header components, as well as a function that returns the required table rows. Inside of the Table component, add the TableHeader and then a TableHeaderCell child for each heading. Since you don't know how many rows you'll need, your best bet is to call a function to build as many TableRows as items returned by _getItems(). Application Size Company Team Commit ; { ({ item }) => ( {item.name} {item.value} {item.company} {item.team} {item.commit} ); } Copy Step 4 of 10 Take a look at the application running in New Relic One: you should see something similar to the screenshot below. Step 5 of 10 Replace standard table cells with smart cells The New Relic One library includes cell components that can automatically format certain data types, like users, metrics, and entity names. The table you've just created contains columns that can benefit from those components: Application (an entity name) and Size (a metric). Before you can use EntityTitleTableRowCell and MetricTableRowCell, you have to add them to the import statement first. import { EntityTitleTableRowCell, MetricTableRowCell, ... /* All previous components */ } from 'nr1'; Copy Step 6 of 10 Update your table rows by replacing the first and second TableRowCells with entity and metric cells. Notice that EntityTitleTableRowCell and MetricTableRowCell are self-closing tags. { ({ item }) => ( {item.company} {item.team} {item.commit} ); } Copy Step 7 of 10 Time to give your table a second look: The cell components you've added take care of properly formatting the data. Step 8 of 10 Add some action to your table! Tables are great, but interactive tables can be better: As a last update, you are going to allow users to act on each data row. Add the _getActions() method to your index.js file, right before _getItems(). As you may have guessed from the code, _getActions() spawns an alert box when you click Team or Commit cells. _getActions() { return [ { label: 'Alert Team', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__ALERT, onClick: (evt, { item, index }) => { alert(`Alert Team: ${item.team}`); }, }, { label: 'Rollback Version', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__UNDO, onClick: (evt, { item, index }) => { alert(`Rollback from: ${item.commit}`); }, }, ]; } Copy Step 9 of 10 Find the TableRow component in your return statement and point the actions property to _getActions(). The TableRow actions property defines a set of actions that appear when the user hovers over a table row. Actions have a mandatory text and an onClick callback, but can also display an icon or be disabled if needed. Copy Step 10 of 10 Go back to your application and try hovering over any of the rows: Notice how the two available actions appear. When you click them, a function triggers with the selected row data as an argument, and an alert displays in your browser. Next steps You've built a table into a New Relic One application, using components to format data automatically and provide contextual actions. Well done! Keep exploring the Table components, their properties, and how to use them, in our SDK documentation.",
+ "info": "Rate limits and restricted keywords for the New Relic Metric API, and what to do if you reach their limits.",
+ "body": "This document describes data requirements for the Metric API, including: Data specifications and maximum limits Restricted attributes For instructions on sending metric data and formatting of the JSON payload, see Report metrics via the Metric API. Endpoint requirements and maximum limits All metric data is sent using a POST to: https://metric-api.newrelic.com/metric/v1 If your account hosts data in New Relic's European Union data center, ensure you're using the proper API endpoints for EU region accounts. The following default limits apply for all metric data: Condition Limit Age range for timestamp values Metrics reported with a timestamp older than 48 hours ago or newer than 24 hours from the time they are reported are dropped. Max data points per minute (DPM) See Additional account conditions. 1 million DPM Max unique timeseries (cardinality) per account per day See Additional account conditions. 1 million A timeseries is a single, unique combination of a metric name and any attributes. Max unique timeseries (cardinality) per metric name per day 100k Max payloads per minute 100k Max attributes per metric 100 Max metric attribute name length 255 characters Max characters for an attribute key 255 characters Max metric attribute value length 4096 characters Allowed HTTP protocols HTTPS only Numerical long values falling outside minimum or maximum Java long values Numerical long values that fall outside of the minimum or maximum Java long value will be rejected. If the number is in the common block, then the entire block will be dropped. If the number is in a metric data point, then the metric data point it resides in will be dropped. Numerical double values falling outside minimum or maximum Java double values Numeric double values that fall outside of a the minimum or maximum Java double value will be rejected. If the number is in the common block, then the entire block will be dropped. If the number is in a metric data point, then the metric data point it resides in will be dropped. Payload size Total maximum size or length: 1 MB maximum per POST. We highly recommend using compression. Payload format The payload must encoded as UTF-8. Attribute naming syntax Attribute names can be a combination of alphanumeric characters, colons (:), periods (.), and underscores (_). Additional account conditions: Metric API limits apply at the individual account level. Trial and paid accounts receive a 1M DPM and 1M cardinality limit for trial purposes, but you can request up to 15M DPM and 15M cardinality for your account. To request changes to your metric rate limits, contact your New Relic account representative, or visit our Support portal. Rate limit violations This section describes how the Metric API behaves when you exceed the rate limits, and how to respond if limits are exceeded. Max data points per minute (DPM) Data points per minute refers to the per minute rate at which individual metric values are sent to the Metric API. When the maximum DPM limit is exceeded for an account, the New Relic Metric API returns a 429 response for the remainder of the minute. The response will include a Retry-After header indicating how long to wait in seconds before resubmitting or sending new data. To resolve this issue, either reduce the number of data points you are sending, or request a rate limit change. Subsequent subscription changes do not impact modified rate limits. If an account change impacts your rate limit, you must notify us to adjust your rate limit. To request rate limit changes, contact your New Relic account representative, or visit our Support portal. Max unique timeseries per account per day A timeseries is a single, unique combination of a metric name and any attributes assigned to that metric. For example, if a CPU utilization metric with a single attribute hostname is sent from ten different hosts, this equals ten distinct values for the hostname attribute and ten unique metric timeseries. If the per-account, per-day unique metric timeseries (cardinality) limit is exceeded during a 24 hour period, the endpoint will continue to receive and store raw metric data. However, New Relic will stop creating additional aggregate rollups (1 minute, 5 minutes, etc.) for the remainder of the 24 hour period. (These rollups are used used by default to query time windows longer than 60 minutes.) You can continue to query your data when such a violation occurs by specifying a 60 minute or shorter time window or specifying the RAW keyword as described in view and query your metrics. This can be helpful in identifying potential causes for the violation. Max unique timeseries per metric name per day A timeseries is a single, unique combination of a metric name and any attributes assigned to that metric. For example, if a CPU utilization metric with a single attribute hostname is sent from ten different hosts, this equals ten distinct values for the hostname attribute and ten unique metric timeseries. If the per-metric name, per-day unique metric timeseries (cardinality) limit is exceeded during a 24 hour period, the endpoint will continue to receive and store raw metric data. However, New Relic will stop creating additional aggregate rollups (1 minute, 5 minutes, etc.) for the remainder of the 24 hour period. (These rollups are used used by default to query time windows longer than 60 minutes.) You can continue to query your data when such a violation occurs by specifying a 60 minute or shorter time window or specifying the RAW keyword as described in view and query your metrics. This can be helpful in identifying potential causes for the violation. Max payloads per minute If you make more than 100k POST requests to the Metric API endpoint within a minute, the endpoint will return a 429 response for the remainder of the minute. The response will include a Retry-After header indicating how long to wait in seconds before resubmitting or sending new data. In general, if you reach this limit, consider creating larger payloads. To do this, combine more data points into each request to reduce the number of POSTs that are necessary. If this is not an option, you can request a rate limit increase by contacting your New Relic account representative or visiting our Support portal. Restricted attributes These attributes are restricted by the New Relic platform. Any values submitted with these keys in the attributes section of a metric data point will cause the data point to be dropped, or the value to be omitted or overwritten: Attribute Description newrelic.source This resets to the value metricAPI. metricName This resets to the name value passed into each data point. This allows name to be an attribute key. endTimestamp timestamp and interval.ms will be converted to an endTimestamp for the data point. Additional restrictions include: Restriction Comments Metric and attribute names You cannot pass the same value for metric name and attribute name. In the following example, the metric is invalid because the metric is named service.errors.all and there is an attribute service.errors.all. Example: Metric value used as an attribute (invalid) [ { \"metrics\": [ { \"name\": \"service.errors.all\" , \"type\": \"count\", \"value\": 15, \"timestamp\": 1531414060739, \"interval.ms\": 10000, \"attributes\": { \"service.response.statuscode\": \"400\", \"service.errors.all\" : \"test\", \"service.name\": \"foo\" } } ] } ] Reserved words The Metric API inherits some reserved words from New Relic Insights, including accountID, appId, and eventType. Additionally, the syntax terms for NRQL are restricted unless you backtick (``) them. For a full list, see Reserved words: NRQL syntax terms. Keys within metric JSON All keys used within the metric JSON cannot be attribute keys. This includes interval.ms, timestamp, value, common, min, max, count, sum, and metrics. Exception: You can use name as an attribute key. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 126.41199,
+ "_score": 87.68855,
"_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": " 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"
+ "sections": "Ingest and manage data",
+ "category_0": "Telemetry Data Platform",
+ "category_1": "Ingest and manage data",
+ "body": ", appId, and eventType. Additionally, the syntax terms for NRQL are restricted unless you backtick (``) them. For a full list, see Reserved words: NRQL syntax terms. Keys within metric JSON All keys used within the metric JSON cannot be attribute keys. This includes interval.ms, timestamp, value",
+ "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs"
},
- "id": "5efa989ee7b9d2ad567bab51"
- }
- ],
- "/collect-data/get-started-nerdgraph-api-explorer": [
+ "id": "5f24e4ede7b9d28743c8231c"
+ },
{
- "category_2": "Examples",
- "nodeid": 39021,
+ "category_2": "NRQL query tutorials",
+ "nodeid": 36916,
"sections": [
- "NerdGraph",
+ "NRQL: New Relic Query Language",
"Get started",
- "Examples",
- "Use NerdGraph to manage license keys and personal API keys",
- "Feature description",
- "Create keys",
- "Update keys",
- "Delete keys",
- "Query keys",
+ "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?",
+ "Get available metrics",
+ "Facet on a wildcarded metric name segment",
+ "Recommended aggregator functions",
+ "Query examples",
"For more help"
],
- "title": "Use NerdGraph to manage license keys and personal API keys",
- "category_0": "APIs",
+ "title": "Query APM metric timeslice data with NRQL",
+ "category_0": "Query your data",
"type": "docs",
- "category_1": "NerdGraph",
- "external_id": "f4b228fbc3fdc408adc6d7e10a93edd0464b7762",
- "image": "",
- "url": "https://docs.newrelic.com/docs/apis/nerdgraph/examples/use-nerdgraph-manage-license-keys-personal-api-keys",
- "published_at": "2020-09-30T09:44:44Z",
- "updated_at": "2020-09-24T10:26:23Z",
- "breadcrumb": "Contents / APIs / NerdGraph / Examples",
+ "category_1": "NRQL: New Relic Query Language",
+ "external_id": "f536406572d7d2aafd2df6acd5da36a035ef82c3",
+ "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-10-03T23:04:50Z",
+ "updated_at": "2020-09-30T16:27:58Z",
+ "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / NRQL query tutorials",
"document_type": "page",
"popularity": 1,
- "info": "Use New Relic NerdGraph (our GraphQL API) to create and manage your New Relic license keys, browser license keys, and personal API keys. ",
- "body": "This document contains tutorials on how to use NerdGraph to programmatically create and manage several types of New Relic keys. To build queries and see responses, use our GraphiQL explorer. For more information on our API keys, see API keys. Feature description NerdGraph's ApiAccess field can be used to programmatically create and manage the following types of keys: Personal API keys License keys, including: General license key used for APM Browser license key One common use case for this feature is the ability to create and manage license keys to let you rotate keys for security purposes. Note that you can't use this NerdGraph functionality to manage or delete your original license keys; you can only create additional license keys and manage the ones you've created. General notes about this functionality: All mutations can accept multiple keys as arguments, and will return details about successful changes and errors. See examples below for details. All mutations (create, update and delete) will result in an NrAuditEvent that can be queried for auditing purposes. For details, see Audit events. Some notes about license keys: In the context of using NerdGraph, the license keys are referred to as ingest keys. This feature allows you to create up to 1,000 keys of each license key type, which allows for key rotation. You can't use this NerdGraph functionality to manage or delete your original license keys; you can only create additional license keys and manage the ones you've created. License keys created through NerdGraph can't be found in the New Relic UI. They're only queryable via the API. Some notes about personal API keys: In the context of using NerdGraph, personal API keys are referred to as user keys. User keys are displayed in various UI locations (for example: the User settings UI page). The examples below use license keys (ingest keys), but personal API keys (user keys) are queried in similar ways. We recommend you experiment with queries using the GraphiQL explorer. You can also create, view, and delete personal API keys using the UI. Create keys You can create multiple keys in a single mutation, for multiple accounts and key types. Note that the mutation can return successfully created keys as well as any errors encountered trying to create keys. Example of creating a key: mutation { apiAccessCreateKeys(keys: {ingest: {accountId: YOUR_ACCOUNT_ID, ingestType: BROWSER, name: \"Browser Key\", notes: \"A note.\"}}) { createdKeys { id key name accountId notes type ... on ApiAccessIngestKey { ingestType } } errors { message type ... on ApiAccessIngestKeyError { accountId errorType ingestType } } } } Results will vary depending on your data. Use the GraphiQL explorer to experiment with mutations and queries. Update keys The update mutation takes the key ID, not the key string, to identify keys. mutation { apiAccessUpdateKeys(keys: {ingest: {keyId: KEY_ID, name: \"Updated name\", notes: \"A new note!\"}}) { updatedKeys { id key type name notes } errors { message } } } Results will vary depending on your data. Use the GraphiQL explorer to experiment with mutations and queries. Delete keys The delete mutation takes the key ID, not the key string, to identify keys. Deleted keys will no longer grant access to New Relic systems and will no longer be returned by queries to the API access GraphQL API. mutation { apiAccessDeleteKeys(keys: {ingestKeyIds: INGEST_KEY_ID}) { deletedKeys { id } errors { message } } } Results will vary depending on your data. Use the GraphiQL explorer to experiment with mutations and queries. Query keys You can access ingest and user keys by querying a single key or all keys, scoped to the actor. If querying for a single key, you must provide the key ID and type (INGEST or USER). Querying for multiple keys is done via a key search, which uses a mandatory types list and an optional scope to filter results. User keys belonging to other users will be obfuscated in the results. Single key example query: query { actor { apiAccess { key(id: INGEST_KEY_ID, keyType: INGEST) { key name type ... on ApiAccessIngestKey { ingestType } } } } } Key search example query: query { actor { apiAccess { keySearch(query: {types: INGEST, scope: {ingestTypes: BROWSER}}) { keys { name key type ... on ApiAccessIngestKey { ingestType } } } } } } Results will vary depending on your data. Use the GraphiQL explorer to experiment with mutations and queries. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "info": "In New Relic, you can query metric timeslice data from APM using NRQL. ",
+ "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. To explore timeslice data in the data explorer, see Explore your metrics. 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 Learn how to see all metrics available to you. 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 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. Get available metrics To get a list of available metrics for an application, you can use a query like: SELECT uniques(metricTimesliceName) FROM Metric WHERE appName='YOUR_APP_NAME' AND newrelic.timeslice.value IS NOT NULL 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.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 238.20891,
+ "_score": 82.38547,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "Use NerdGraph to manage license keys and personal API keys",
- "sections": "NerdGraph",
- "info": "Use New Relic NerdGraph (our GraphQL API) to create and manage your New Relic license keys, browser license keys, and personal API keys. ",
- "category_1": "NerdGraph",
- "body": ". Note that you can't use this NerdGraph functionality to manage or delete your original license keys; you can only create additional license keys and manage the ones you've created. General notes about this functionality: All mutations can accept multiple keys as arguments, and will return details",
- "breadcrumb": "Contents / APIs / NerdGraph / Examples"
+ "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": " 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",
+ "breadcrumb": "Contents / Query your data / NRQL: New Relic Query Language / NRQL query tutorials"
},
- "id": "5efe0487196a6710b1766452"
- },
+ "id": "5f2b1349196a67379343fbcf"
+ }
+ ],
+ "/automate-workflows/get-started-new-relic-cli": [
{
- "nodeid": 37751,
+ "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png",
+ "url": "https://developer.newrelic.com/",
"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"
+ "Mark your calendar for Nerd Days 1.0",
+ "Get coding",
+ "Create custom events",
+ "Add tags to apps",
+ "Build a Hello, World! app",
+ "Get inspired",
+ "Add a table to your app",
+ "Collect data - any source",
+ "Automate common tasks",
+ "Create a custom map view",
+ "Add a time picker to your app",
+ "Add custom attributes",
+ "New Relic developer champions",
+ "New Relic Podcasts"
],
- "title": "NerdGraph API: Examples ",
- "category_0": "Alerts and Applied Intelligence",
- "type": "docs",
- "category_1": "New Relic Alerts",
- "external_id": "017d6c34d340b9bc035e91483d675915fa5252eb",
- "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/alerts_query_0.png",
- "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alerts-nerdgraph/nerdgraph-api-examples",
- "published_at": "2020-10-01T14:32:20Z",
- "updated_at": "2020-08-11T04:59:00Z",
- "breadcrumb": "Contents / Alerts and Applied Intelligence / New Relic Alerts / Alerts and Nerdgraph",
+ "published_at": "2020-10-06T01:57:17Z",
+ "title": "New Relic Developers",
+ "updated_at": "2020-10-06T01:49:17Z",
+ "type": "developer",
+ "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab",
"document_type": "page",
"popularity": 1,
- "info": "Read about how you can manage alerts conditions, policies, and muting rules using NerdGraph.",
- "body": "You can manage your policies, conditions, and muting rules programmatically using our GraphQL NerdGraph API. This is a powerful alternative to managing them in New Relic One or through the REST API. Alerts features you can manage with NerdGraph Here's what you can do in NerdGraph: Manage policies Use NRQL conditions Muting rules: suppress notifications The easiest way to discover alerts queries and mutations is through the NerdGraph API explorer. NerdGraph API explorer Our NerdGraph API explorer is a GraphiQL editor where you can prototype queries and mutations. Here are some examples showing how to find fields for queries and mutations. For general information about NerdGraph, see Introduction to NerdGraph. Queries To explore the various queries, look for the available queries under the actor.account.alerts namespace in NerdGraph API explorer: Mutations To explore various mutations, look in the alerts dropdown in the NerdGraph API explorer: For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 7 Days : 14 Hours : 50 Minutes : 46 Seconds Register Get coding Create a free account 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events Start the guide 7 min Add tags to apps Add tags to applications you instrument for easier filtering and organization Start the guide 12 min Build a Hello, World! app Build a Hello, World! app and publish it to your local New Relic One Catalog Start the guide Get inspired 30 min Add a table to your app Add a table to your New Relic One app 15 min Collect data - any source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add a time picker to your app Add a time picker to a sample application Add custom attributes Use custom attributes for deeper analysis Show 20 more guides Looking for more inspiration? Check out the open source projects built by the New Relic community. New Relic developer champions New Relic Champions are solving big problems using New Relic as their linchpin and are recognized as experts and leaders in the New Relic technical community. Nominate a developer champion Learn more about developer champions New Relic Podcasts We like to talk, especially to developers about developer things. Join us for conversations on open source, observability, software design and industry news. Listen",
+ "info": "",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 154.98285,
+ "_score": 326.81213,
"_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"
+ "title": "New Relic Developers",
+ "sections": "New Relic developer champions",
+ "body": " source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add a time picker to your app Add a time picker to a sample application Add"
},
- "id": "5f2dbad864441fd15456a9eb"
+ "id": "5d6fe49a64441f8d6100a50f"
},
{
"image": "",
- "url": "https://developer.newrelic.com/collect-data/",
+ "url": "https://developer.newrelic.com/automate-workflows/",
"sections": [
- "Collect data",
- "Guides to collect data",
- "Add custom attributes",
- "Build queries with NerdGraph",
- "Collect data - any source",
- "Create custom events",
- "Query data with NRQL"
+ "Automate workflows",
+ "Guides to automate workflows",
+ "Quickly tag resources",
+ "Set up New Relic using Helm charts",
+ "Automate common tasks",
+ "Set up New Relic using the Kubernetes operator",
+ "Automatically tag a simple \"Hello World\" Demo across the entire stack",
+ "Set up New Relic using Terraform"
],
- "published_at": "2020-10-01T01:55:37Z",
- "title": "Collect data",
- "updated_at": "2020-09-30T01:47:01Z",
+ "published_at": "2020-10-06T02:07:11Z",
+ "title": "Automate workflows",
+ "updated_at": "2020-10-06T02:07:11Z",
"type": "developer",
- "external_id": "fb5d6f75b61858b09e3e8c63f3b2af97813f47b6",
+ "external_id": "d4f408f077ed950dc359ad44829e9cfbd2ca4871",
"document_type": "page",
"popularity": 1,
- "body": "Collect data Through our opensource agents or APIs, New Relic makes it easy to collect data from any source. The guides in this section provide strategies for collecting and querying data for use in your existing implementation, or in apps you build. The opportunities are endless. Guides to collect data Add custom attributes Use custom attributes for deeper analysis 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 15 min Collect data - any source APIs, agents, OS emitters - get any data 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 10 min Query data with NRQL Query default data, custom events, and attributes",
+ "body": "Automate workflows When building today's complex systems, you want an easy, predictable way to verify that your configuration is defined as expected. This concept, Observability as Code, is brought to life through a collection of New Relic-supported orchestration tools, including Terraform, AWS CloudFormation, and a command-line interface. These tools enable you to integrate New Relic into your existing workflows, easing adoption, accelerating deployment, and returning focus to your main job — getting stuff done. In addition to our Terraform and CLI guides below, find more automation solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 20 min 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 30 min Automatically tag a simple \"Hello World\" Demo across the entire stack See how easy it is to leverage automation in your DevOps environment! 20 min Set up New Relic using Terraform Learn how to provision New Relic resources using Terraform",
"info": "",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 143.6011,
+ "_score": 306.973,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "sections": "Build queries with NerdGraph",
- "body": " data Add custom attributes Use custom attributes for deeper analysis 25 min Build queries with NerdGraph Try NerdGraph and build the queries you need 15 min Collect data - any source APIs, agents, OS emitters - get any data 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events 10 min Query data with NRQL Query default data, custom events, and attributes"
+ "sections": "Set up New Relic using Helm charts",
+ "body": " solutions in our Developer Toolkit. Guides to automate workflows 5 min Quickly tag resources Add tags to apps for easy filtering 20 min Set up New Relic using Helm charts Learn how to set up New Relic using Helm charts 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment"
},
- "id": "5efa997328ccbc768c307de2"
+ "id": "5efa999c196a67dfb4766445"
},
{
- "category_2": "Examples",
- "nodeid": 17141,
+ "category_2": "UI and data",
+ "nodeid": 34316,
"sections": [
- "NerdGraph",
+ "Use New Relic One",
"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",
+ "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": "NerdGraph cloud integrations API tutorial",
- "category_0": "APIs",
+ "title": "Entity explorer: View performance across apps, services, hosts",
+ "category_0": "New Relic One",
"type": "docs",
- "category_1": "NerdGraph",
- "external_id": "15caa0b35be84f2e6245826a5c9ac8e49cad6a89",
- "image": "",
- "url": "https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-cloud-integrations-api-tutorial",
- "published_at": "2020-09-30T07:03:23Z",
- "updated_at": "2020-08-10T23:22:01Z",
- "breadcrumb": "Contents / APIs / NerdGraph / Examples",
+ "category_1": "Use New Relic One",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/new-relic-one/use-new-relic-one/ui-data/entity-explorer-view-performance-across-apps-services-hosts",
+ "external_id": "70c4dd2b7c228d80145ed4e4c120412a652346d8",
+ "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/entity-explorer-view-performance-across-apps-services-hosts",
+ "published_at": "2020-10-06T04:58:32Z",
+ "updated_at": "2020-10-06T04:58:32Z",
+ "breadcrumb": "Contents / New Relic One / Use New Relic One / UI and data",
"document_type": "page",
"popularity": 1,
- "info": "Use New Relic's NerdGraph (our GraphQL API) to query your New Relic Infrastructure cloud integration data. ",
- "body": "This document provides examples of how to use New Relic NerdGraph to query and modify your cloud integration configuration data, including Amazon AWS, Microsoft Azure, and Google Cloud Platform (GCP). Using the NerdGraph GraphiQL explorer, you can also query NRQL data. These examples for querying cloud integration configuration data use GraphQL queries and mutations: Queries: requests that are intended to only fetch data Mutations: requests that create or update data on the server Requirements Before querying cloud integration data with NerdGraph, ensure you have: Followed the instructions to connect cloud integrations with New Relic. Created an API key. Access the NerdGraph GraphiQL explorer To access the NerdGraph GraphiQL explorer: Go to https://api.newrelic.com/graphiql. Add any of the following examples. Query examples Queries are requests that are intended to only fetch data (no side effects). Queries in NerdGraph are not static, meaning that you can ask for more or less data depending on your needs. For each query, you can specify exactly what data you want to retrieve, as long as it is supported by the schema. Available provider accounts This query returns a list of all provider accounts available in your infrastructure data. Depending on the provider, additional properties can be requested. For example, for GCP, you can also ask for the serviceAccountId property, which is needed when linking a new GCP project to New Relic. Anonymous: { actor { account(id: ) { cloud { providers { id name slug ... on CloudGcpProvider { serviceAccountId } } } } } } Named: query cloudProviders { actor { account(id: ) { cloud { providers { id name slug } } } } } Specific provider account information This query returns information about a specific provider account for your Amazon AWS integration. The properties id, name, slug are requested, along with a list of integrations available to be monitored. { actor { account(id: ) { cloud { provider(slug: \"aws\") { id slug name services { id slug name } } } } } } Specific integration data from a specific cloud provider This query returns information about a specific cloud service integration of a provider. In this example, the integration is the Amazon AWS ALB monitoring integration and the provider is AWS. The properties id, name, slug, and isAllowed are requested with the available configuration parameters. { actor { account(id: ) { cloud { provider(slug: \"aws\") { service(slug: \"alb\") { id name slug isEnabled } } } } } } List of enabled cloud accounts This query returns the list of cloud accounts enabled with your New Relic account. (Your cloud account associates your New Relic account and a specific provider account with your integration.) You can enable multiple cloud provider accounts in the same New Relic account, even with the same cloud provider. { actor { account(id: ) { cloud { linkedAccounts { id name createdAt provider { id name } } } } } } Specific linked account data This query returns information about a linked account, including the properties name, providerId, and a list of the cloud integrations enabled for monitoring. { actor { account(id: ) { cloud { linkedAccount(id: ) { name provider { id name } integrations { id name createdAt updatedAt } } } } } } Enabled cloud integrations for all linked accounts This query returns all monitored integrations for all the provider cloud accounts. { actor { account(id: ) { cloud { linkedAccounts { name provider { id name } integrations { id name service { id name } createdAt updatedAt } } } } } } Specific cloud integration data for a specific linked account This query returns information about a specific integration from a specific linked account. { actor { account(id: ) { cloud { linkedAccount(id: ) { name provider { id name } integration(id: ) { id name service { id name } createdAt updatedAt } } } } } } Mutation examples Mutations are requests that are intended to have side effects, such as creating or updating data on the server. Mutations require the keyword mutation and the name of the mutation. NerdGraph mutations are restricted to a subset of all possible mutations. Link an account This mutation allows linking cloud provider accounts to a New Relic account, creating one or more linked accounts. It can link one specific cloud provider account (for example aws) to the New Relic account or multiple cloud provider accounts to one New Relic account. Required: The parameter is required and cannot be empty. It must be unique in your New Relic account. Other parameters are specific to the provider (AWS, GCP, and Azure) and are also required. In the following sections, you can see which parameters are required for each provider account. After linking an account the createdAt and updatedAt values are equal. mutation { cloudLinkAccount( accounts: { accountId: , aws: [{ name: , }] azure: [{ name: , }] gcp: [{ name: , }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } } } } Link an Amazon AWS account This mutation links an Amazon AWS provider account to your New Relic account. mutation { cloudLinkAccount( accountId: , accounts: { aws: [{ name: , arn: }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } } } } Link a Microsoft Azure account This mutation links a Microsoft Azure cloud subscription to the New Relic account. mutation { cloudLinkAccount( accountId: , accounts: { azure: [{ name: , applicationId: , clientSecret: , tenantId: , subscriptionId: }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } } } Link a Google Cloud Platform (GCP) project This mutation links a GCP project to the New Relic account. mutation { cloudLinkAccount( accountId: , accounts: { gcp: [{ name: , projectId: }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } } } Rename one or more cloud accounts This mutation allows you to rename one or more linked provider accounts. The name parameter is required, cannot be empty, and must be unique within your New Relic account. mutation { cloudRenameAccount( accountId: , accounts: [ { id: , name: }, { id: , name: } ] ) { linkedAccounts { id name } } } Enable an integration in a cloud account This mutation allows you to enable the monitoring of one or more specific cloud integrations in an existing cloud account. With this mutation, New Relic records data for the enabled integration from the provider account. For each provider account you have access to different input parameters, matching each available service. mutation { cloudConfigureIntegration ( accountId: , integrations: { : { : [{ linkedAccountId: , }] } } ) { integrations { id name integration { id slug } ... on SqsIntegration { awsRegions } } } } Enable an integration in multiple cloud accounts If you have many provider accounts linked, you can enable the same integration in the many cloud accounts at the same time. For the output of the operation, you can use GraphQL fragments for integration specific configuration parameters. mutation { cloudConfigureIntegration ( accountId: , integrations: { : { : [ { linkedAccountId: }, { linkedAccountId: } ] } } ) { integrations { id name integration { id name } ... on SqsIntegration { awsRegions } } } } Enable multiple integrations in multiple cloud accounts If you have multiple cloud accounts linked, you can also enable multiple integrations in multiple linked cloud accounts at the same time. For the output of the operation, you can use GraphQL fragments to ask for integration specific configuration parameters. mutation { cloudConfigureIntegration ( accountId: , integrations: { : { : [ { linkedAccountId: } ] : [ { linkedAccountId: } ] }, : { : [ { linkedAccountId: }, { linkedAccountId: } ] } } ) { integrations { id name service { id name } ... on SqsIntegration { awsRegions } } } } Modify an integration's configuration (regions, polling intervals, etc.) This mutation also allows you to modify one or more cloud integrations and change one or more configuration parameters. Each service will have specific parameters that you can modify. For parameters of a type list (for example, awsRegion) supply the full list. For the output of the operation, you can use GraphQL fragments to ask for integration specific configuration parameters. mutation { cloudConfigureIntegration ( accountId: , integrations: { : { : [{ linkedAccountId: , metricsPollingInterval: , : , : , }] } } ) { integrations { id name service { id slug } ... on SqsIntegration { metricsPollingInterval, , } } errors { type message } } } Disable (remove) an integration This mutation allows you to disable an integration and stop data collection for the specific cloud integration. mutation { cloudDisableIntegration ( accountId: , integrations: { : { : [ { linkedAccountId: } ] } } ) { disabledIntegrations { id name authLabel provider { id } } errors { type message } } } Unlink account This mutation allows you to unlink cloud provider accounts from New Relic account. This action can not be undone. However, you can link the account again, but account history will still be lost. mutation { cloudUnlinkAccount ( accountId: , accounts: { { linkedAccountId: } } ) { unlinkedAccounts { id name } errors { type message } } } Enable an Amazon AWS integration This example uses an Amazon AWS SQS integration and assumes you have connected an AWS account to New Relic. To enable an Amazon AWS integration: Send query to fetch account data Send a query to fetch data about the account, specifically available providers and already created provider accounts: { actor { account(id: ) { cloud { providers { id name slug } linkedAccounts { name integrations { id name } } } } } } Link AWS provider account Link an AWS provider account, if there is not one already linked or if you want to link another AWS account: Use your New Relic account identifier in the parameter. Provide a name for the provider account in the . Include the ARN of the AWS role used to fetch data from your AWS account. mutation { cloudLinkAccount( accountId: , accounts: { aws: [{ name: , arn: }] } ) { linkedAccounts { id name authLabel createdAt updatedAt } errors { type message } } } Enable Amazon AWS SQS integration Use your New Relic account ID in the parameter and the ID of the provider account in the parameter value. mutation { cloudConfigureIntegration ( accountId: , integrations: { aws: { sqs: [ { linkedAccountId: } ] } } ) { integrations { id name service { id name } } errors { type message } } } Enable integration in multiple provider accounts If you have multiple accounts with the same provider account, you can enable the same integration in multiple provider accounts at the same time. Use your New Relic account ID in the parameter and the ID of the provider accounts in the parameter value. mutation { cloudConfigureIntegration ( accountId: , integrations: { aws: { sqs: [ { linkedAccountId: }, { linkedAccountId: , configuration_param_1: value_1, configuration_param_2: value_2 } ] } } }) { integrations { id name service { id name } } errors { type message } } } Change polling interval for Amazon AWS integration This example uses an Amazon AWS SQS integration and assumes you have connected an AWS account to New Relic. To change the polling interval of an AWS integration: Update the polling interval To update the polling interval for an Amazon AWS SQS integration, use your New Relic account ID in the parameter and the id of the linked provider account in the parameter value: mutation { cloudConfigureIntegration( accountId: , integrations: { aws : { sqs: [ { linkedAccountId: , metricsPollingInterval: 300 } ] } } ) { integrations { id name service { id slug } ... on SqsIntegration { metricsPollingInterval } } errors { type message } } } Disable Amazon AWS integration This example uses an Amazon AWS SQS integration and assumes you have connected an AWS account to New Relic. To disable an AWS integration: Disable the SQS integration Use your New Relic account identifier in the parameter and the ID of the linked cloud account the parameter value. mutation { cloudDisableIntegration ( accountId: , integrations: { aws: { sqs : [ { linkedAccountId: } ] } } ) { disabledIntegrations { id accountId name } errors { type message } } } For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "info": "Use New Relic's entity explorer to see all your monitored entities in one place and explore the reported data. ",
+ "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.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 121.81966,
+ "_score": 210.46011,
"_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"
+ "title": "Entity explorer: View performance across apps, services, hosts",
+ "sections": "Use New Relic One",
+ "info": "Use New Relic's entity explorer to see all your monitored entities in one place and explore the reported data. ",
+ "category_0": "New Relic One",
+ "category_1": "Use New Relic One",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/new-relic-one/use-new-relic-one/ui-data/entity-explorer-view-performance-across-apps-services-hosts",
+ "body": " 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",
+ "breadcrumb": "Contents / New Relic One / Use New Relic One / UI and data"
},
- "id": "5d83537b28ccbc263a1b7bf7"
+ "id": "5d244a5864441fe577a72a1b"
},
{
- "nodeid": 37711,
+ "nodeid": 6276,
"sections": [
"New Relic Alerts",
"Get started",
@@ -6210,283 +6325,318 @@
"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",
+ "REST API calls for alerts",
+ "Available data and functions via API",
+ "Conditions excluded from the REST API",
+ "Using a Personal API key with the REST API",
+ "Notification channels",
+ "Conditions for APM, Browser, Mobile",
+ "Conditions for NRQL",
+ "Conditions for external services",
+ "Conditions for Synthetic monitoring",
+ "Conditions for plugins",
+ "Alert activity: Events, violations, incidents",
+ "Alert entity conditions",
"For more help"
],
- "title": "NerdGraph API: NRQL condition alerts ",
+ "title": "REST API calls for alerts",
"category_0": "Alerts and Applied Intelligence",
"type": "docs",
"category_1": "New Relic Alerts",
- "external_id": "86591bd20017930f1e4eef1b1a76e3806298dbb9",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/rest-api-alerts/rest-api-calls-alerts",
+ "external_id": "f696d6446d171b8db8c84991bb88c9690b5d3f5b",
"image": "",
- "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alerts-nerdgraph/nerdgraph-api-nrql-condition-alerts",
- "published_at": "2020-09-30T12:24:16Z",
- "updated_at": "2020-08-11T04:56:49Z",
- "breadcrumb": "Contents / Alerts and Applied Intelligence / New Relic Alerts / Alerts and Nerdgraph",
+ "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/rest-api-alerts/rest-api-calls-alerts",
+ "published_at": "2020-10-06T02:37:17Z",
+ "updated_at": "2020-10-06T02:37:17Z",
+ "breadcrumb": "Contents / Alerts and Applied Intelligence / New Relic Alerts / REST API alerts",
"document_type": "page",
"popularity": 1,
- "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 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.",
+ "info": "Read about how to use the REST API Explorer with alerts.",
+ "body": "Our REST API (v2) allows you to configure settings for alerts. The API Explorer also includes the curl request format, available parameters, potential response status codes, and JSON response structure for each of the available API calls. You can also create alert conditions in the UI. For infrastructure alerting, see REST API for infrastructure monitoring alerts. Available data and functions via API REST API functions Comments View account data In general, any role can use the account's REST API key or a Personal API key with GET > List functions to view alerts data. The account Owner and Admins may use their API key. List output will be paginated. Available functions include: Alert policies Notification channels Conditions for APM, Browser, and Mobile (Some limitations apply.) Conditions for external services Conditions for Synthetic monitoring Conditions for Plugins Conditions for NRQL (Some limitations apply.) Events Violations Incidents Maintain account data You may have an Owner or Admin role in your account and an Admin user's API key or have a custom role that grants permissions to manage Alerts and a Personal API key in order to use any maintenance function, including POST > Create, PUT > Add, PUT > Update, and DELETE. Conditions excluded from the REST API These types of conditions do not have available endpoints in the API: APM: Web transaction percentiles, conditions targeting labels, and baselines NRQL: Baselines Using a Personal API key with the REST API To use a Personal API key in any of the examples below, replace 'X-Api-Key:{api_key}' with 'Api-Key:{personal_api_key}'. Alert policies These API functions include links to the API Explorer, where you can create, delete, or list policies. If your account hosts data in the EU data center, ensure you are using the proper API endpoints for EU region accounts. Create new policies To add new policies, use your Admin user's API key or Personal API key, and include these two values in the API call: Required values Definition Incident incident_preference Determines how Alerts will create incidents and group violations. This must be one of the following: PER_POLICY (default): Roll up by policy. PER_CONDITION: Roll up by condition. PER_CONDITION_AND_TARGET: Roll up by target and condition. Policy name The policy name is required. Leaving it unchanged will create a policy called string. API Explorer: Alerts Policies > POST > Create curl -X POST 'https://api.newrelic.com/v2/alerts_policies.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"policy\": { \"incident_preference\": \"string\", \"name\": \"string\" } }' Update policies Use this API to update an existing policy's name and incident_preference. You'll need your Admin user's API key or Personal API key. Required values Definition id Required. To find a policy's ID, use either of these options: From the UI: On a policy's UI page, find the ID under the policy name. With the API: Use the List policies API. Incident incident_preference Determines how alerts will create incidents and group violations. Must be one of the following: PER_POLICY (default): Roll up by policy. PER_CONDITION: Roll up by condition. PER_CONDITION_AND_TARGET: Roll up by target and condition. Policy name Required. If you do not change the name, it defaults to a policy called string. To find a policy's exact name, use the List policies API. API Explorer: Alerts Policies > PUT > Update curl -X PUT 'https://api.newrelic.com/v2/alerts_policies/{id}.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"policy\": { \"incident_preference\": \"string\", \"name\": \"string\" } }' Delete existing policies To delete an existing policy, use your Admin user's API key or Personal API key, and include the policy_id (available from API Explorer: Alerts Policies > GET > List) in the API call: API Explorer: Alerts Policies > DELETE > Delete curl -X DELETE 'https://api.newrelic.com/v2/alerts_policies/{policy_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i List existing policies To view a list of existing policies for your account, use your API key or Personal API key, and include these optional values in the API call: Optional policy name filter Optional pagination value API Explorer: Alerts Policies > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_policies.json' \\ -H 'X-Api-Key:{api_key}' -i Notification channels These API functions include links to the API Explorer, where you can create, delete, or list Alerts notification channels. If your account hosts data in the EU data center, ensure you are using the proper API endpoints for EU region accounts. Create new notification channels To add new notification channels, use your Admin user's API key or Personal API keyand include these values in the API call: New channel's name Type of channel Configuration values The API Explorer shows the format for required configuration values for each type of notification channel. API Explorer: Alerts Channels > POST > Create curl -X POST 'https://api.newrelic.com/v2/alerts_channels.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"channel\": { \"name\": \"string\", \"type\": \"string\", \"configuration\": \"hash\" } }' The \"hash\" place holder in this example must be replaced by one of the following JSON blocks with the appropriate values substituted: Email channel { \"recipients\" : \"test@google.com\", \"include_json_attachment\" : true } OpsGenie channel { \"api_key\": \"abc123\", \"teams\": \"team1\", \"tags\": \"tag1\", \"recipients\": \"me@me.com\" } Slack channel { \"url\": \"http://test.com\", \"channel\": \"channel1\" } VictorOps channel { \"key\": \"mykey\", \"route_key\": \"theroute\" } PagerDuty channel { \"service_key\": \"myservicekey\" } Webhook (json) channel This example shows the default payload inserted. (The payload attribute is optional.) The payload can be customized to have different keys than the ones shown and will be sent with the $ prefixed attributes interpolated prior to delivery. The condition_id is deprecated. Instead, use condition_family_id. { \"base_url\": \"http://test.com\", \"auth_username\": \"username\", \"auth_password\": \"password\", \"payload_type\": \"application/json\", \"headers\": { \"header1\": \"test\", \"header2\": \"test\" } \"payload\": { \"account_id\": \"$ACCOUNT_ID\", \"account_name\": \"$ACCOUNT_NAME\", \"closed_violations_count_critical\": \"$CLOSED_VIOLATIONS_COUNT_CRITICAL\", \"closed_violations_count_warning\": \"$CLOSED_VIOLATIONS_COUNT_WARNING\", \"condition_family_id\": \"$CONDITION_FAMILY_ID\", \"condition_id\": \"$CONDITION_ID\", \"condition_name\": \"$CONDITION_NAME\", \"current_state\": \"$EVENT_STATE\", \"details\": \"$EVENT_DETAILS\", \"duration\": \"$DURATION\", \"event_type\": \"$EVENT_TYPE\", \"incident_acknowledge_url\": \"$INCIDENT_ACKNOWLEDGE_URL\", \"incident_id\": \"$INCIDENT_ID\", \"incident_url\": \"$INCIDENT_URL\", \"open_violations_count_critical\": \"$OPEN_VIOLATIONS_COUNT_CRITICAL\", \"open_violations_count_warning\": \"$OPEN_VIOLATIONS_COUNT_WARNING\", \"owner\": \"$EVENT_OWNER\", \"policy_name\": \"$POLICY_NAME\", \"policy_url\": \"$POLICY_URL\", \"runbook_url\": \"$RUNBOOK_URL\", \"severity\": \"$SEVERITY\", \"targets\": \"$TARGETS\", \"timestamp\": \"$TIMESTAMP\", \"violation_callback_url\": \"$VIOLATION_CALLBACK_URL\", \"violation_chart_url\": \"$VIOLATION_CHART_URL\" } } Webhook (x-www-form-urlencoded) channel This example shows the default payload inserted. (The payload attribute is optional.) The payload can be customized to have different keys than the ones shown and will be sent with the $ prefixed attributes interpolated prior to delivery. The condition_id is deprecated. Instead, use condition_family_id. { \"base_url\": \"http://test.com\", \"auth_username\": \"username\", \"auth_password\": \"password\", \"payload_type\": \"application/x-www-form-urlencoded\", \"headers\": { \"header1\": \"test\", \"header2\": \"test\" }, \"payload\": { \"account_id\": \"$ACCOUNT_ID\", \"account_name\": \"$ACCOUNT_NAME\", \"closed_violations_count_critical\": \"$CLOSED_VIOLATIONS_COUNT_CRITICAL\", \"closed_violations_count_warning\": \"$CLOSED_VIOLATIONS_COUNT_WARNING\", \"condition_family_id\": \"$CONDITION_FAMILY_ID\", \"condition_id\": \"$CONDITION_ID\", \"condition_name\": \"$CONDITION_NAME\", \"current_state\": \"$EVENT_STATE\", \"details\": \"$EVENT_DETAILS\", \"duration\": \"$DURATION\", \"event_type\": \"$EVENT_TYPE\", \"incident_acknowledge_url\": \"$INCIDENT_ACKNOWLEDGE_URL\", \"incident_id\": \"$INCIDENT_ID\", \"incident_url\": \"$INCIDENT_URL\", \"open_violations_count_critical\": \"$OPEN_VIOLATIONS_COUNT_CRITICAL\", \"open_violations_count_warning\": \"$OPEN_VIOLATIONS_COUNT_WARNING\", \"owner\": \"$EVENT_OWNER\", \"policy_name\": \"$POLICY_NAME\", \"policy_url\": \"$POLICY_URL\", \"runbook_url\": \"$RUNBOOK_URL\", \"severity\": \"$SEVERITY\", \"targets\": \"$TARGETS\", \"timestamp\": \"$TIMESTAMP\", \"violation_callback_url\": \"$VIOLATION_CALLBACK_URL\", \"violation_chart_url\": \"$VIOLATION_CHART_URL\" } } Delete existing notification channels To delete an existing notification channels, use your Admin user's API key or Personal API key, and include the channel_id (available from API Explorer: Alerts Channels > GET > List) in the API call: API Explorer: Alerts Channels > DELETE > Delete curl -X DELETE 'https://api.newrelic.com/v2/alerts_channels/{channel_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i List existing notification channels To view a list of existing notification channels for your account, use your REST API key, Admin user's API key, or Personal API key and an optional pagination value in the API call. API Explorer: Alerts Channels > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_channels.json' \\ -H 'X-Api-Key:{api_key}' -i Update notification channels associated with policies You can associate a policy with one or more notification channels. You can also associate a notification channel with one or more policies. To add notification channels to policies, use your Admin user's API key or Personal API key and these values in the API call: A policy_id value (available from API Explorer: Alerts Policies > GET > List) One or more channel_id values in an array, separated by commas or a new line (available from API Explorer: Alerts Channels > GET > List) API Explorer: Alerts Policy Channels > PUT > Update curl -X PUT 'https://api.newrelic.com/v2/alerts_policy_channels.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -G -d 'policy_id=policy_id&channel_ids=channel_id' Delete notification channels associated with policies You can associate a policy with one or more notification channels. You can also associate a notification channel with one or more alert policies. To remove a policy from a channel, or to remove a channel from a policy, use your Admin user's API key or Personal API keyand these values in the API call: The policy_id (available from API Explorer: Alerts Policies > GET > List) The channel_id (available from API Explorer: Alerts Channels > GET > List) API Explorer: Alerts Policy Channels > DELETE > Delete curl -X DELETE 'https://api.newrelic.com/v2/alerts_policy_channels.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -d 'channel_id={channel_id}&policy_id={policy_id}' Conditions for APM, Browser, Mobile These API functions include links to the API Explorer, where you can create, update, delete, or list policy conditions. These calls are for conditions with these types of entities: APM: Apps and key transactions Browser: Apps and key transactions Mobile: Mobile apps Exception: The following APM conditions are not available from this API endpoint: Conditions targeting labels (dynamic targeting) Web transaction percentile conditions Baseline conditions The API Explorer provides information about other types of conditions using separate endpoints, including external services (APM and Mobile), plugins, and Synthetic monitoring. Consider all types of alert conditions when searching or updating. If your account hosts data in the EU data center, ensure you are using the proper API endpoints for EU region accounts. Create conditions for policies To add conditions to policies, include these values in the API call: Your Admin user's API key or Personal API key The policy_id (available from API Explorer: Alerts Policies > GET > List) The required condition values in the API call (described in the API Explorer page and in the Alerts conditions API glossary) API Explorer: Alerts Conditions > POST > Create curl -X POST 'https://api.newrelic.com/v2/alerts_conditions/policies/{policy_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"condition\": { \"type\": \"string\", \"name\": \"string\", \"enabled\": boolean, \"entities\": [ integer ], \"metric\": \"string\", \"gc_metric\": \"string\", \"condition_scope\": \"string\", \"violation_close_timer\": integer, \"runbook_url\": \"string\", \"terms\": [ { \"duration\": \"string\", \"operator\": \"string\", \"priority\": \"string\", \"threshold\": \"string\", \"time_function\": \"string\" } ], \"user_defined\": { \"metric\": \"string\", \"value_function\": \"string\" } } }' The JSON response returns a condition id, which you will need to update or delete the condition. You can also view the condition id from API Explorer: Alerts Conditions > GET > List. Update conditions for policies To update conditions for policies, include these values in the API call: Your Admin user's API key or Personal API key The condition's id (available from API Explorer: Alerts Conditions > GET > List) The required condition values in the API call (described in the API Explorer page and in the Alerts conditions API glossary) API Explorer: Alerts Conditions > PUT > Update curl -X PUT 'https://api.newrelic.com/v2/alerts_conditions/{id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"condition\": { \"type\": \"string\", \"name\": \"string\", \"enabled\": boolean, \"entities\": [ integer ], \"metric\": \"string\", \"metric\": \"string\", \"gc_metric\": \"string\", \"condition_scope\": \"string\", \"violation_close_timer\": integer, \"runbook_url\": \"string\", \"terms\": [ { \"duration\": \"string\", \"operator\": \"string\", \"priority\": \"string\", \"threshold\": \"string\", \"time_function\": \"string\" } ], \"user_defined\": { \"metric\": \"string\", \"value_function\": \"string\" } } }' Delete conditions from policies To delete conditions from policies, include these values in the API call: Your Admin user's API key or Personal API key The condition_id (available from API Explorer: Alerts Conditions > GET > List) API Explorer: Alerts Conditions > DELETE > Delete curl -X DELETE 'https://api.newrelic.com/v2/alerts_conditions/{condition_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i List existing conditions for policies To view a list of existing conditions for your policy, use your REST API key, Admin user's API key, or Personal API key and the associated policy_id in the API call. API Explorer: Alerts Conditions > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_conditions.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -d 'policy_id={policy_id}' Conditions for NRQL These API functions include links to the API Explorer, where you can create, update, delete, or list NRQL conditions for your policies. Exception: NRQL baseline conditions are not available from this endpoint. If your account hosts data in the EU data center, ensure you are using the proper API endpoints for EU region accounts. Create NRQL conditions for policies Recommendation: Due to the way NRQL data is aggregated, set the nrql[since_value] to 3 or higher to prevent false positives. This equates to the Evaluation Offset value in the Alerts Condition UI. API Explorer: Alerts Nrql Conditions > POST > Create To create NRQL conditions for policies: curl -X POST 'https://api.newrelic.com/v2/alerts_nrql_conditions/policies/{policy_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"nrql_condition\": { \"type\": \"string\", \"name\": \"string\", \"runbook_url\": \"string\", \"enabled\": boolean, \"terms\": [ { \"duration\": \"string\", \"operator\": \"string\", \"priority\": \"string\", \"threshold\": \"string\", \"time_function\": \"string\" } ], \"value_function\": \"string\", \"nrql\": { \"query\": \"string\", \"since_value\": \"string\" } } }' If you set nrql[since_value] to 3 and nrql[query] to SELECT count FROM myEvent, New Relic evaluates the following query against the terms[threshold] value once per minute: SELECT count FROM myEvent SINCE 3 minutes ago UNTIL 2 minutes ago If you set type as outlier, you can omit the value_function. However, two additional fields are required: expected_groups and ignore_overlap. For more information, see Alerts Conditions API field names. If you omit type or set it as static, it will default to standard NRQL alerting. Update NRQL conditions for policies Recommendation: Due to the way NRQL data is aggregated, set the nrql[since_value] to 3 or higher to prevent false positives. This allows three minutes to aggregate data, and equates to the Evaluation Offset value in the Alerts Condition UI. To update NRQL conditions for policies, include these values in the API call: Your Admin user's API key or Personal API key The condition's id (available from API Explorer: [external link] Alerts Nrql Conditions > GET > List) The required condition values in the API call (described in the API Explorer page and in the Alerts conditions API glossary) API Explorer: Alerts Nrql Conditions > PUT > Update curl -X PUT 'https://api.newrelic.com/v2/alerts_nrql_conditions/{id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"nrql_condition\": { \"name\": \"string\", \"runbook_url\": \"string\", \"enabled\": boolean, \"terms\": [ { \"duration\": \"string\", \"operator\": \"string\", \"priority\": \"string\", \"threshold\": \"string\", \"time_function\": \"string\" } ], \"value_function\": \"string\", \"nrql\": { \"query\": \"string\", \"since_value\": \"string\" } } }' Delete NRQL conditions for policies To delete NRQL conditions from policies, include these values in the API call: Your Admin user's API key or Personal API key The condition's id (available from API Explorer: [external link] Alerts Nrql Conditions > GET > List) API Explorer: Alerts Nrql Conditions > DELETE > Delete curl -X DELETE 'https://api.newrelic.com/v2/alerts_nrql_conditions/{condition_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i List existing NRQL conditions for policies To view a list of existing conditions for your alert policy, use your REST API key, Admin user's API key, or Personal API key and the associated policy_id in the API call. API Explorer: Alerts Nrql Conditions > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_nrql_conditions.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -d 'policy_id={policy_id}' Conditions for external services These API functions include links to the API Explorer, where you can create, update, delete, or list policy conditions. These calls are for conditions for external services. The API calls can be used with APM and Mobile apps. If your account hosts data in the EU data center, ensure you are using the proper API endpoints for EU region accounts. External services: Create conditions for policies To add conditions for external services to policies that have APM or Mobile apps, include these values in the API call: Your Admin user's API key or Personal API key The policy_id (available from API Explorer: Alerts Policies > GET > List) The required external_service_condition values in the API call (described in the API Explorer page and in the Alerts conditions API glossary) API Explorer: Alerts External Service Conditions > POST > Create curl -X POST 'https://api.newrelic.com/v2/alerts_external_service_conditions/policies/{policy_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"external_service_condition\": { \"type\": \"string\", \"name\": \"string\", \"enabled\": boolean, \"entities\": [ integer ], \"external_service_url\": \"string\", \"metric\": \"string\", \"runbook_url\": \"string\", \"terms\": [ { \"duration\": \"string\", \"operator\": \"string\", \"priority\": \"string\", \"threshold\": \"string\", \"time_function\": \"string\" } ] } }' The JSON response returns a condition id, which you will need to update or delete the condition. You can also view the condition id from API Explorer: Alerts External Service Conditions > GET > List. External services: Update conditions for policies To update conditions for external services to policies that have APM or Mobile apps, include these values in the API call: Your Admin user's API key or Personal API key The external service condition's id (available from API Explorer: Alerts External Service Conditions > GET > List) The required external_service_condition values in the API call (described in the API Explorer page and in the Alerts conditions API glossary) API Explorer: Alerts External Service Conditions > PUT > Update curl -X PUT 'https://api.newrelic.com/v2/alerts_external_service_conditions/{id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"external_service_condition\": { \"type\": \"string\", \"name\": \"string\", \"enabled\": boolean, \"entities\": [ integer ], \"external_service_url\": \"string\", \"metric\": \"string\", \"runbook_url\": \"string\", \"terms\": [ { \"duration\": \"string\", \"operator\": \"string\", \"priority\": \"string\", \"threshold\": \"string\", \"time_function\": \"string\" } ] } }' External services: Delete conditions from policies To delete conditions for external services from policies with APM or Mobile apps, include these values in the API call: Your Admin user's API key or Personal API key The condition_id (available from API Explorer: Alerts External Service Conditions > GET > List) API Explorer: Alerts External Service Conditions > DELETE > Delete curl -X DELETE 'https://api.newrelic.com/v2/alerts_external_service_conditions/{condition_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i External services: List existing conditions for policies To view a list of existing conditions for policies with external service apps (APM or Mobile), use your REST API key, Admin user's API key, or Personal API key and the associated policy_id in the API call. API Explorer: Alerts External Service Conditions > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_external_service_conditions.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -d 'policy_id={policy_id}' Conditions for Synthetic monitoring These API functions include links to the API Explorer, where you can create, update, delete, or list conditions for your alert policies. The API calls can be used with Synthetic monitoring. Synthetics: Create conditions for policies To add conditions to policies for Synthetic monitoring, include these values in the API call: Your Admin user's API key or Personal API key The policy_id (available from API Explorer: Alerts Policies > GET > List) The required synthetics_condition values in the API call (described in the API Explorer page and in the Alerts conditions API glossary) API Explorer: Alerts Synthetics Conditions > POST > Create curl -X POST 'https://api.newrelic.com/v2/alerts_synthetics_conditions/policies/{policy_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"synthetics_condition\": { \"name\": \"string\", \"monitor_id\": \"string\", \"runbook_url\": \"string\", \"enabled\": boolean } }' The JSON response returns a condition id, which you will need to update or delete the condition. You can also view the condition id from API Explorer: Alerts Synthetics Conditions > GET > List. Synthetic monitoring: Update conditions for policies To update policy conditions for Synthetic monitoring, include these values in the API call: Your Admin user's API key or Personal API key The condition id (available from API Explorer: Alerts Synthetics Conditions > GET > List) The required synthetics_condition values in the API call (described in the API Explorer page to create alert conditions for Synthetics and in the Alerts conditions API glossary) API Explorer: Alerts Synthetics Conditions > PUT > Update curl -X PUT 'https://api.newrelic.com/v2/alerts_synthetics_conditions/{id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"synthetics_condition\": { \"name\": \"string\", \"monitor_id\": \"string\", \"runbook_url\": \"string\", \"enabled\": boolean } }' Synthetic monitoring: Delete conditions from policies To delete policy conditions for Synthetic monitoring, include these values in the API call: Your Admin user's API key or Personal API key The condition_id (available from API Explorer: Alerts Synthetics Conditions > GET > List) API Explorer: Alerts Synthetics Conditions > DELETE > Delete curl -X DELETE 'https://api.newrelic.com/v2/alerts_synthetics_conditions/{condition_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i Synthetic monitoring: List existing conditions for policies To view a list of existing policy conditions for Synthetic monitoring, use your REST API key, Admin user's API key, or Personal API key and the associated policy_id in the API call. API Explorer: Alerts Synthetics Conditions > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_synthetics_conditions.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -d 'policy_id=policy_id' Conditions for plugins These API functions include links to the API Explorer, where you can create, update, delete, or list conditions for your alert policies. The API calls can be used with plugins from New Relic's Plugin Central. Plugins: Create conditions for policies To add conditions to policies for plugin components or instances, include these values in the API call: Your Admin user's API key or Personal API key The policy_id (available from API Explorer: Alerts Policies > GET > List) The required plugins_condition values in the API call (described in the API Explorer page and in the Alerts conditions API glossary) API Explorer: Alerts Plugins Conditions > POST > Create curl -X POST 'https://api.newrelic.com/v2/alerts_plugins_conditions/policies/{policy_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"plugins_condition\": { \"name\": \"string\", \"enabled\": boolean, \"entities\": [ integer ], \"metric_description\": \"string\", \"metric\": \"string\", \"value_function\": \"string\", \"runbook_url\": \"string\", \"terms\": [ { \"duration\": \"string\", \"operator\": \"string\", \"priority\": \"string\", \"threshold\": \"string\", \"time_function\": \"string\" } ], \"plugin\": { \"id\": \"string\", \"guid\": \"string\" } } }' The JSON response returns a condition id, which you will need to update or delete the condition. You can also view the condition id from API Explorer: Alerts Plugins Conditions > GET > List. Plugins: Update conditions for policies To update policy conditions for plugin components or instances, include these values in the API call: Your Admin user's API key or Personal API key The condition id (available from API Explorer: Alerts Plugins Conditions > GET > List) The required plugins_condition values in the API call (described in the API Explorer page to create alert conditions for plugins and in the Alerts conditions API glossary) API Explorer: Alerts Plugins Conditions > PUT > Update curl -X PUT 'https://api.newrelic.com/v2/alerts_plugins_conditions/{id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"plugins_condition\": { \"name\": \"string\", \"enabled\": boolean, \"entities\": [ integer ], \"metric_description\": \"string\", \"metric\": \"string\", \"value_function\": \"string\", \"runbook_url\": \"string\", \"terms\": [ { \"duration\": \"string\", \"operator\": \"string\", \"priority\": \"string\", \"threshold\": \"string\", \"time_function\": \"string\" } ], \"plugin\": { \"id\": \"string\", \"guid\": \"string\" } } }' Plugins: Delete conditions from policies To delete conditions from policies for plugin components or instances, include these values in the API call: Your Admin user's API key or Personal API key The condition id (available from API Explorer: Alerts Plugins Conditions > GET > List) API Explorer: Alerts Plugins Conditions > DELETE > Delete curl -X DELETE 'https://api.newrelic.com/v2/alerts_plugins_conditions/{condition_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i Plugins: List existing conditions for policies To view a list of existing conditions for policies with plugin components or instances, use your REST API key, Admin user's API key, or Personal API key and the associated policy_id in the API call. API Explorer: Alerts Plugins Conditions > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_plugins_conditions.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -d 'policy_id={policy_id}' Alert activity: Events, violations, incidents These API functions include links to the API Explorer, where you can view information about events, violations, and incidents for your alert policies. If your account hosts data in the EU data center, ensure you are using the proper API endpoints for EU region accounts. List Events To view events for entities monitored by APM, Browser, Mobile, Plugins, Synthetic monitoring, and Alerts, include these values in the API call: Your REST API key, Admin user's API key, or Personal API key Other optional values to use as filters (described in the API Explorer page) that depend on the type of product (browser monitoring, mobile monitoring, etc.), entity (as apps or key transactions for APM, synthetic monitoring, etc.), and type of event (notification, deployment, instrumentation, etc.) An optional pagination value API Explorer: Alerts Events > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_events.json' \\ -H 'X-Api-Key:{api_key}' -i List Violations To view violations for any entity monitored for your account, include these values in the API call: Your REST API key, Admin user's API key, or Personal API key An optional flag to show only those violations that are currently open An optional pagination value API Explorer: Alerts Violations > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_violations.json' \\ -H 'X-Api-Key:{api_key}' -i To find policy, condition, and incident information: take the IDs found in the links section in the violations property and place them into the URLs contained in the outer links property of the payload. List Incidents To view incidents for any entity monitored for your account, include these values in the API call: Your REST API key, Admin user's API key, or Personal API key An optional flag to show only those incidents that are currently open An optional flag to exclude violation data from response An optional pagination value API Explorer: Alerts Incidents > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_incidents.json' \\ -H 'X-Api-Key:{api_key}' -i Show Incident To show a single incident associated with your account, include these values in the API call: Your REST API key, Admin user's API key, or Personal API key An incident ID API Explorer: Alerts Incidents > GET > Show curl -X GET 'https://api.newrelic.com/v2/alerts_incidents/{id}.json' \\ -H 'X-Api-Key:{api_key}' -i Acknowledge Incident To acknowledge an incident associated with your account, include these values in the API call: Your Admin user's API key or Personal API key. An incident ID API Explorer: Alerts Incidents > PUT > Acknowledge curl -X PUT 'https://api.newrelic.com/v2/alerts_incidents/{id}/acknowledge.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -H 'Content-Type: application/json' Close Incident To close an incident associated with your account, include these values in the API call: Your Admin user's API key or Personal API key. An incident ID API Explorer: Alerts Incidents > PUT > Close curl -X PUT 'https://api.newrelic.com/v2/alerts_incidents/{id}/close.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -H 'Content-Type: application/json' Alert entity conditions These API functions include links to the API Explorer, where you can list, add and remove entities in the conditions for your alert policies. If your account hosts data in the EU data center, ensure you are using the proper API endpoints for EU region accounts. List condition by entity To view the conditions an entity is part of for APM, Browser, Mobile, key transactions, and Plugins, include these values in the API call: Your REST API key, Admin user's API key, or Personal API key The entity_id This is the specific entity (alert target) to be monitored. The entity_type, which must be one of the following: Application BrowserApplication MobileApplication KeyTransaction Plugin API Explorer: Alerts Entity Conditions > GET > list curl -X GET 'https://api.newrelic.com/v2/alerts_entity_conditions/{entity_id}.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -G -d 'entity_type={entity_type}' Add an entity to a condition To add an entity to a condition, include these values in the API call: Your Admin user's API key or Personal API key The entity_id This is the entity (alert target) to be monitored. It is the numeric ID for the APM application, browser app, plugin, key transaction, or mobile app. The condition_id (available from API Explorer: Alerts Conditions > GET > List) The entity_type, which must be one of the following: Application BrowserApplication MobileApplication KeyTransaction Plugin API Explorer: Alerts Entity Conditions > PUT > Add curl -X PUT 'https://api.newrelic.com/v2/alerts_entity_conditions/{entity_id}.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -H 'Content-Type: application/json' \\ -G -d 'entity_type={entity_type}&condition_id={condition_id}' Remove an entity from a condition To remove an entity being monitored from a condition, include these values in the API call: Your Admin user's API key or Personal API key The entity_id This is the specific monitored entity (alert target) to be removed. It is the numeric ID for the APM application, browser app, plugin, key transaction, or mobile app. The condition_id (available from API Explorer: Alerts Conditions > GET > List) The entity_type, which must be one of the following: Application BrowserApplication MobileApplication KeyTransaction Plugin API Explorer: Alerts Entity Conditions > DELETE > Remove curl -X DELETE 'https://api.newrelic.com/v2/alerts_entity_conditions/{entity_id}.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -G -d 'entity_type={entity_type}&condition_id={condition_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.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 120.50064,
+ "_score": 203.52234,
"_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"
+ "title": "REST API calls for alerts",
+ "sections": "New Relic Alerts",
+ "info": "Read about how to use the REST API Explorer with alerts.",
+ "category_1": "New Relic Alerts",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/rest-api-alerts/rest-api-calls-alerts",
+ "body": " { "recipients" : "test@google.com", "include_json_attachment" : true } OpsGenie channel { "api_key": "abc123", "teams": "team1", "tags": "tag1", "recipients": "me@me.com" } Slack channel { "url": "http://test.com", "channel": "channel1" } VictorOps channel { "key": "mykey", "route_key": "theroute",
+ "breadcrumb": "Contents / Alerts and Applied Intelligence / New Relic Alerts / REST API alerts"
},
- "id": "5f2dee1128ccbc562e88dfc1"
+ "id": "5f344a7c196a677172fbd6e5"
+ },
+ {
+ "sections": [
+ "Quickly tag a set of resources",
+ "Before you begin",
+ "Install the New Relic CLI",
+ "Linux",
+ "macOS",
+ "Windows",
+ "Create your New Relic CLI profile",
+ "Search for an entity",
+ "Add tags and tag lists to your entity",
+ "Note",
+ "Check that the tags are there",
+ "Tip",
+ "Next steps"
+ ],
+ "title": "Quickly tag a set of resources",
+ "type": "developer",
+ "tags": [
+ "tags",
+ "new relic CLI"
+ ],
+ "external_id": "c7c374812f8295e409a9b06d552de51ceefc666b",
+ "image": "",
+ "url": "https://developer.newrelic.com/automate-workflows/5-mins-tag-resources/",
+ "published_at": "2020-10-06T02:07:11Z",
+ "updated_at": "2020-08-14T01:45:08Z",
+ "document_type": "page",
+ "popularity": 1,
+ "info": "Add tags to applications you instrument for easier filtering and organization.",
+ "body": "Quickly tag a set of resources 5 min Tags help you group, search, filter, and focus the data about your entities, which can be anything from applications to hosts to services. Tagging entities using the New Relic CLI is a good candidate for automation. In this 5-minute guide, you use the New Relic CLI to add multiple tags to one of your entities. Before you begin For this guide you need your New Relic personal API Key: Create it at the Account settings screen for your account. Step 1 of 6 Install the New Relic CLI You can download the New Relic CLI via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 6 Create your New Relic CLI profile New Relic CLI profiles contain credentials and settings that you can apply to any CLI command. To create your first CLI profile, run the profiles add command. Don't forget to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey API_KEY -r us # Set the profile as default newrelic profiles default -n tutorial Copy Step 3 of 6 Search for an entity Your New Relic account might have hundreds of entities: Have a quick look by opening the Entity explorer. In the terminal, run entity search to retrieve a list of entities from your account as JSON. In the example, you're searching for all entities with \"test\" in their name. # Change the `name` to match any of your existing entities newrelic entity search --name \"test\" Copy Step 4 of 6 If there are matching entities in your account, the query yields data in JSON format, similar to this workload example. Select an entity from the results and look for its guid value; the guid is the unique identifier of the entity. Write it down. { \"accountId\": 123456789, \"domain\": \"NR1\", \"entityType\": \"WORKLOAD_ENTITY\", \"guid\": \"F7B7AE59FDED4204B846FB08423DB18E\", \"name\": \"Test workload\", \"reporting\": true, \"type\": \"WORKLOAD\" }, Copy Step 5 of 6 Add tags and tag lists to your entity With your entity guid, you can add tags right away. You can do so by invoking the entities tags create command. What if you want to add multiple tags? You can use tag sets for that: While tags are key-value pairs separated by colons, tag sets are comma-separated lists of tags. For example: tag1:value1,tag2:value2 Note Adding tags is an asynchronous operation: it could take a little while for the tags to get created. # Adding a single tag newrelic entity tags create --guid GUID --tag key:value # Adding multiple tags newrelic entity tags create --guid GUID --tag tag1:test,tag2:test Copy Step 6 of 6 Check that the tags are there To make sure that the tags have been added to your entities, retrieve them using the entity tags get command. All tags associated with your entity are retrieved as a JSON array. newrelic entity tags get --guid GUID Tip Tags can be deleted at any time by invoking the entity tags delete command followed by the same arguments you used to create them. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Next steps Have a look at all the New Relic CLI commands. For example, you could create a New Relic workflow using workload create. If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 177.14964,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "title": "Quickly tag a set of resources",
+ "sections": "Install the New Relic CLI",
+ "info": "Add tags to applications you instrument for easier filtering and organization.",
+ "tags": "new relic CLI",
+ "body": " by invoking the entity tags delete command followed by the same arguments you used to create them. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Next steps Have a look at all the New Relic CLI commands. For example"
+ },
+ "id": "5efa999d64441fa74a5f7e2d"
}
],
- "/collect-data/collect-data-from-any-source": [
+ "/explore-docs/nr1-subscription": [
{
- "category_2": "Ingest APIs",
- "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"
+ "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": "Telemetry SDKs: Report custom telemetry data",
- "category_0": "Telemetry Data Platform",
- "type": "docs",
- "category_1": "Ingest and manage data",
- "external_id": "47a4c8f38c1b1674504ea302d865fd499e90ea39",
- "image": "",
- "url": "https://docs.newrelic.com/docs/telemetry-data-platform/get-started/capabilities/telemetry-sdks-send-custom-telemetry-data-new-relic",
- "published_at": "2020-09-30T19:06:43Z",
- "updated_at": "2020-09-17T14:37:52Z",
- "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs",
+ "title": "New Relic One CLI reference",
+ "type": "developer",
+ "tags": [
+ "New Relic One app",
+ "nerdpack commands"
+ ],
+ "external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
+ "image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
+ "published_at": "2020-10-06T02:13:01Z",
+ "updated_at": "2020-09-17T01:51:10Z",
"document_type": "page",
"popularity": 1,
- "info": "Report custom telemetry data with New Relic's open-source Telemetry SDKs.",
- "body": "Our Telemetry SDKs are an open source set of API client libraries that send metrics and trace data to the New Relic platform. We offer open-source integrations for telemetry tools like Prometheus, Istio, and OpenCensus that were created using our Telemetry SDKs. If those solutions (or our other integrations) don't meet your needs, you can use the Telemetry SDKs to create your own telemetry data solutions. Requirements and compatibility To build with the Telemetry SDKs, you will need an Event API insert key. New Relic has contributed the Telemetry SDK to the open source community under an Apache 2.0 license. Available libraries The Telemetry SDKs are open source software on GitHub. Use the language-specific GitHub links below to get library details, coding examples, and procedures for how to use the SDKs. We currently support the following libraries, with more to be created in the future: Language Library Supported data types Java Java library on GitHub New Relic Metrics New Relic Traces Node/TypeScript NodeJS library on GitHub New Relic Metrics New Relic Traces Python Python library on GitHub New Relic Metrics New Relic Events New Relic Traces Go Go library on Github New Relic Metrics New Relic Traces .NET .NET library on GitHub .NET package in NuGet New Relic Metrics New Relic Traces C C library on Github New Relic Traces Rust Rust library on Github New Relic Traces For more on the supported data types: Metrics: see the Metric API Traces: see the Trace API Write your own Telemetry SDK or contribute to an existing one If you need a Telemetry SDK in a language that does not currently exist or want to contribute to an existing library, please see the Telemetry SDK specifications. Integrations built with the Telemetry SDKs To see the integrations built using our Telemetry SDKs, see Open source telemetry integrations. For all monitoring solutions, see our integrations page. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
+ "body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 171.89987,
+ "_score": 240.92737,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "Telemetry SDKs: Report custom telemetry data",
- "sections": "Telemetry SDKs: Report custom telemetry data",
- "info": "Report custom telemetry data with New Relic's open-source Telemetry SDKs.",
- "category_0": "Telemetry Data Platform",
- "category_2": "Ingest APIs",
- "body": " integrations) don't meet your needs, you can use the Telemetry SDKs to create your own telemetry data solutions. Requirements and compatibility To build with the Telemetry SDKs, you will need an Event API insert key. New Relic has contributed the Telemetry SDK to the open source community under",
- "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Ingest APIs"
+ "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": "5d89fefbe7b9d2537ed30dc1"
+ "id": "5efa989e28ccbc535a307dd0"
},
{
- "category_2": "Custom events",
- "nodeid": 13806,
+ "nodeid": 27692,
"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",
+ "AWS Lambda monitoring",
+ "Get started",
+ "Enable Lambda monitoring",
+ "UI and data",
+ "Troubleshooting",
+ "Enable serverless monitoring for AWS Lambda",
+ "How Lambda monitoring works",
+ "Enable procedure overview",
+ "Step 1. Install the newrelic-lambda-cli tool",
+ "CLI requirements",
+ "CLI installation",
+ "Step 2. Connect AWS to New Relic",
+ "Use CLI tool",
+ "Manual procedures",
+ "Step 3. Enable Lambda instrumentation",
+ "Step 4. Configure CloudWatch logs to stream to New Relic Lambda",
+ "What's next?",
+ "Optional: Stream all logs to New Relic",
"For more help"
],
- "title": "Report custom event data",
- "category_0": "Insights",
+ "title": "Enable serverless monitoring for AWS Lambda",
+ "category_0": "Serverless function monitoring",
"type": "docs",
- "category_1": "Event data sources",
- "external_id": "afb5f5a81ae06b22935d98c470ed9cabd7c9da6b",
- "image": "",
- "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/report-custom-event-data",
- "published_at": "2020-09-30T06:47:46Z",
- "updated_at": "2020-07-26T05:52:23Z",
- "breadcrumb": "Contents / Insights / Event data sources / Custom events",
+ "category_1": "AWS Lambda monitoring",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/enable-serverless-monitoring-aws-lambda",
+ "external_id": "7992b896d4c35ca29aba34698aedd621dfe0b572",
+ "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-lambda-monitoring-architecture.png",
+ "url": "https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/enable-serverless-monitoring-aws-lambda",
+ "published_at": "2020-10-04T01:13:08Z",
+ "updated_at": "2020-10-04T01:13:08Z",
+ "breadcrumb": "Contents / Serverless function monitoring / AWS Lambda monitoring / Enable Lambda monitoring",
"document_type": "page",
"popularity": 1,
- "info": "An overview of the options for sending custom event data to New Relic. ",
- "body": "New Relic products report a variety of default event data to your account. This document will explain how to report your own custom events and attributes. Overview of reporting custom events and attributes Event data is one of the fundamental New Relic data types. Events are reported by most New Relic products, and we give you several options for reporting your own custom events. Reporting custom events allows you to create more useful and customized queries and charts of your data, and is a key part of optimizing how New Relic works for you. Before beginning, it's important to know that reporting a large number of custom events and/or attributes can cause degraded query performance, or cause you to approach or pass data collection rate limits. For optimal performance, first think about what data you want to analyze, and then create only the events and/or attributes necessary to meet these specific goals. Be aware of the following data and subscription requirements for inserting and accessing custom data: Ensure you follow limits and requirements around event/attribute data types, naming syntax, and size. The amount of data you have access to over time depends on your data retention policy. Send custom events and attributes Methods for sending custom events and attributes include: Source How to send custom data APM agent Use APM agent APIs to report custom events and custom attributes. Browser agent Add custom attributes to the PageView event via the Browser API call addCustomAttribute. Send PageAction event and attributes via Browser API. Forward APM agent custom attributes to PageView event. Event API To report custom events not associated with other New Relic products, use the Event API. Infrastructure Add custom attributes to default Infrastructure events. Use the Flex integration tool to report your own custom event data. Mobile agent Use the mobile agent API to send custom events and attributes. Synthetics Add custom attributes to the SyntheticCheck event via the $util.insights tools. For ways to report other types of custom data, see: Metric API Logs Trace API Extend data retention To learn about how to extend how long events are retained in your account, see Event data retention. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "info": "Read about how to install and enable New Relic monitoring for Amazon AWS Lambda. ",
+ "body": "Serverless monitoring for AWS Lambda offers in-depth performance monitoring for your Lambda functions. Read on to learn how to enable this feature and get started using it. Using this feature may result in AWS charges. For more information, see the Lambda monitoring requirements. How Lambda monitoring works Before enabling Lambda monitoring, understanding how data flows from your Lambda functions to New Relic may be helpful: Diagram showing how data flows from a Lambda function to New Relic. When our Lambda monitoring is enabled, this is how data moves from your Lambda function to New Relic: The Lambda function is instrumented with our code. CloudWatch collects Lambda log data and sends it to our log-ingestion Lambda. The log-ingestion Lambda sends that data to New Relic. Enable procedure overview If you already have a New Relic account and use Node.js or Python, we recommend you use our automated installer. If you do not use the automated installer, complete these steps to set up monitoring: Install our CLI tool (recommended) Connect AWS and New Relic (required) Enable instrumentation of your Lambda (required) Stream CloudWatch logs to New Relic (required) Step 1. Install the newrelic-lambda-cli tool We provide a command line interface (CLI) tool that's used in steps 2 through 4. We recommend the CLI because it simplifies some of the work, but you can also perform those steps manually. If you want to understand what it does before you install it, see the manual procedures that the CLI tool performs in Step 2, Step 3 (option 2), and Step 4. You can also see the CLI documentation on GitHub. If you prefer a manual install, skip to Step 2. Connect AWS to New Relic. CLI requirements To use the CLI too, you need: Python 3.3 or higher The AWS CLI You must be a user or admin with an infrastructure manager Add-on role. Your AWS account needs permissions for creating IAM resources (Role and Policy) and Lambda functions. These resources are created using CloudFormation stacks, so you'll need permissions to create those. For more on permissions, including setting custom policies, expand this collapser: AWS permissions details Resource: * Actions: \"cloudformation:CreateChangeSet\", \"cloudformation:CreateStack\", \"cloudformation:DescribeStacks\", \"cloudformation:ExecuteChangeSets\", \"iam:AttachRolePolicy\", \"iam:CreateRole\", \"iam:GetRole\", \"iam:PassRole\", \"lambda:AddPermission\", \"lambda:CreateFunction\", \"lambda:GetFunction\", \"logs:DeleteSubscriptionFilter\", \"logs:DescribeSubscriptionFilters\", \"logs:PutSubscriptionFilter\" \"s3:GetObject\" \"serverlessrepo:CreateCloudFormationChangeSet\" Resource: \"arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion\" Actions: \"serverlessrepo:CreateCloudFormationTemplate\" \"serverlessrepo:GetCloudFormationTemplate\" Be sure that the AWS account you use to execute the CLI has all of these permissions. If your AWS account permissions are restrictive and you're unable to use the CLI, you can optionally use a manually managed custom IAM policy. This policy would require, at minimum, the following permissions: Resource: \"*\" Action: \"cloudwatch:GetMetricStatistics\" \"cloudwatch:ListMetrics\" \"cloudwatch:GetMetricData\" \"lambda:GetAccountSettings\" \"lambda:ListFunctions\" \"lambda:ListAliases\" \"lambda:ListTags\" \"lambda:ListEventSourceMappings\" These permissions are the minimum required. We recommend granting a managed ReadOnlyAccess policy as described in Connect AWS to infrastructure monitoring. CLI installation To install the CLI tool: Ensure you have the required permissions for both your New Relic and AWS account. From the command line, run: pip install newrelic-lambda-cli You may need to use pip3 in the command above if you have Python 2.7 installed. The CLI requires Python >=3.3. Step 2. Connect AWS to New Relic You must complete this step, and steps 3 and 4, to enable our Lambda monitoring. This step connects AWS to New Relic and creates a newrelic-log-ingestion Lambda function that sends your instrumented data to New Relic. You can either use the CLI tool or do the steps manually. Use CLI tool When you use the CLI, you have one optional step and one required step: Optional: If you're using multiple AWS profiles or multiple regions, you may want to configure the AWS environment variables: AWS environment variable instructions Setting the region To configure your region, use this environment variable to override the default region: export AWS_DEFAULT_REGION=MY_REGION # us-west-2, for example The CLI tool also allows passing this per-command using --aws-region. Setting profiles If you have multiple AWS profiles and don't want to use the default, use AWS_PROFILE environment variable to set another profile name. Ensure the profile is properly configured (including the default region). Example: export AWS_PROFILE=MY_PROFILE Run the following command using the CLI tool: newrelic-lambda integrations install --nr-account-id YOUR_ACCOUNT_ID \\ --linked-account-name YOUR_LINKED_ACCOUNT_NAME \\ --nr-api-key YOUR_NR_API_KEY This command: Connects your AWS account to New Relic. Installs a newrelic-log-ingestion Lambda that will send your instrumented data to New Relic. More details: This defaults to U.S. region. If your account is in the EU region, add this argument: --nr-region \"eu\". If you're instrumenting functions in multiple AWS regions, this command must be run for each region using the --aws-region argument. YOUR_LINKED_ACCOUNT_NAME is either a new AWS account you want to link to New Relic, or it's the name of the AWS account that you linked to when setting up the AWS Lambda monitoring integration. YOUR_NR_API_KEY refers to your personal API key (not your REST API key). For more on the API key and other arguments, see our Lambda monitoring GitHub repo. Manual procedures Here are the manual procedures performed by the CLI tool: Connect AWS to New Relic The newrelic-lambda integration command connects the AWS account containing your Lambdas to New Relic. If you've already installed one of our AWS integrations, your accounts should be linked to New Relic and you can skip this section. To manually establish this connection, follow the instructions for connecting AWS to Infrastructure monitoring. Configure our log-ingestion Lambda The newrelic-lambda integration command sets up a newrelic-log-ingestion Lambda. This Lambda takes the logs generated by your Lambda functions and pushes those logs to New Relic. If you're configuring this manually, you must configure our Lambda for the regions you want. The CLI, by default, establishes our Lambda in all regions. To manually configure our Lambda, go to the AWS Serverless Application Repository, which is where the newrelic-log-ingestion Lambda is stored. This repo is a collection of serverless applications published by developers, companies, and partners in the serverless community. It allows developers to share their Lambda functions code with customers, who can then find and deploy the corresponding application Lambda function. Each application is packaged with an AWS Serverless Application Model (SAM) template that defines the AWS resources used. To manually configure our Lambda with the AWS Serverless Application Repository: From the AWS console, go to the Lambda section, select Create function, and select Serverless Application Repository. Search for newrelic and find the newrelic-log-ingestion Lambda. Follow the instructions in the Lambda's documentation to deploy it. A SAM template will build the Lambda. In the environment variable section in AWS console, set the LICENSE_KEY environment variable to your New Relic license key. Note: If you have multiple accounts or a master and sub-account hierarchy, make sure the license key you're using matches the same account connected to AWS. Optional: If you want to stream all your logs to New Relic, set the LOGGING_ENABLED environment variable to true. For more on this, see Stream all logs. Step 3. Enable Lambda instrumentation This step enables instrumentation of your Lambda function, which allows detailed monitoring and alerting functionality. Our instrumentation is designed to have minimal impact on your Lambda performance. If you're using Node.js or Python, we recommend the first two options. Option #1: Use Serverless Framework plugin (Node.js and Python) Requirements Available only for Node.js and Python. For other languages, see Manual instrumentation. Serverless Framework version 1.34.0 or higher. Features If you meet the requirements (above), you can use our Serverless Framework plugin, which allows you to add our AWS Lambda Layer to your functions without requiring a code change. Supports Node.js and Python runtimes No code change required to enable Lambda instrumentation Enables our APM agent functionality using a single layer Configures CloudWatch subscription filters automatically Gets the layer into your code base which is useful for redeploys Install To install our Serverless Framework plugin: Choose an install option: NPM: npm install --save-dev serverless-newrelic-lambda-layers yarn: yarn add --dev serverless-newrelic-lambda-layers Add the plugin to your serverless.yml: plugins: - serverless-newrelic-lambda-layers Get your account ID and put it in the serverless.yml: custom: newRelic: accountId: YOUR_ACCOUNT_ID Deploy it: sls deploy You can skip Step 4. Setting up CloudWatch Logs. This is automatically completed on deploy by our Serverless Framework plugin. For the next step, go to What's next? Option #2: Add Lambda Layer with our CLI (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework and don't intend to redeploy your function frequently, you can use the CLI to add our Lambda Layer: If you haven't already done so, install the CLI: pip install newrelic-lambda-cli List available functions: newrelic-lambda functions list Pass the option -f not-installed to see which functions have not yet been instrumented. Add the layer to your function: newrelic-lambda layers install --function FUNCTION_NAME --nr-account-id NEW_RELIC_ACCOUNT_ID Next, you will configure CloudWatch to send logs to New Relic. Option #3: Manually add our Lambda Layer (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework, you can manually add our Lambda Layer: Find the layer that matches your runtime and region. Copy the Amazon Resource Name (ARN) of the most recent version and add it in the AWS Lambda console for your function. Update your functions handler to point to the newly attached layer in the console for your function: Python: newrelic_lambda_wrapper.handler Node: newrelic-lambda-wrapper.handler Add these environment variables to your Lambda console: NEW_RELIC_ACCOUNT_ID: Your account ID NEW_RELIC_LAMBDA_HANDLER: Path to your initial handler. If you have Node 8 and get a Lambda can't find file error message, expand this collapser: Node 8 \"can't find file\" error troubleshooting If you have Node 8 and receive a Lambda can't find the file newrelic-lambda-wrapper.js message, it's likely that the Node runtime isn't resolving NPM_PATH for the newrelic-lambda module in /opt/nodejs/node_modules. These steps should fix this problem: Create a newrelic-wrapper-helper.js script in your project's root. The script's contents should be module.exports = require('newrelic-lambda-wrapper');. (That is all that needs to be in that script.) Update the handler for your layer declaration to newrelic-lambda-wrapper.handler. Next, you will configure CloudWatch to send logs to New Relic. Option #4: Manually instrument Lambda code for Go, Java, .NET Core, Node.js, and Python If none of the previous options work for you, you can manually instrument your Lambda code. Choose your language: Go To instrument your Go-language Lambda: Download our Go agent package and place it in the same directory as your function. Install the agent: go get -u github.com/newrelic/go-agent. In your Lambda code, import our components, create an application, and update how you start your Lambda. See our GitHub repo for an example of an instrumented Lambda. Optional: Add custom events that will be associated with your Lambda invocation by using the RecordCustomEvent API. For example: func handler(ctx context.Context) { if txn := newrelic.FromContext(ctx); nil != txn { txn.Application().RecordCustomEvent(\"MyEvent\", map[string]interface{}{ \"zip\": \"zap\", }) } fmt.Println(\"hello world!\") } Build and zip your Lambda function and upload it to AWS. Zip and upload recommendations Here are suggestions for zipping and uploading the Lambda: Build the binary for execution on Linux. This produces a binary file called main. You can use: $ GOOS=linux go build -o main Zip the binary into a deployment package using: $ zip deployment.zip main Upload the zip file to AWS using either the AWS Lambda console or the AWS CLI. Name the handler main (to match the name given during the binary build). The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this is the account ID for the root/parent account. Optional: To configure logging, see Go agent logging. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Java Monitoring for AWS Lambda in Java doesn't use our APM Java agent. Instead, it uses these two OpenTracing dependencies: AWS Lambda OpenTracing Java SDK: OpenTracing instrumentation for AWS Lambda RequestHandler and RequestStreamHandler. Our AWS Lambda OpenTracing Tracer: An OpenTracing Tracer implementation designed to monitor AWS Lambda. It generates spans, error events, transaction events, error traces, and provides distributed tracing support. Supported OpenTracing Versions OpenTracing 0.31.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:1.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:1.0.0 OpenTracing 0.32.0, 0.33.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:2.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:2.1.0 To instrument your Java Lambda: In your project’s build.gradle file, include our OpenTracing AWS Lambda Tracer and the AWS Lambda OpenTracing SDK dependencies: dependencies { compile(\"com.newrelic.opentracing:java-aws-lambda:2.1.0\") compile(\"com.newrelic.opentracing:newrelic-java-lambda:2.1.1\") compile(\"io.opentracing:opentracing-util:0.33.0\") } Implement the AWS Lambda RequestHandler interface as shown in the Java Lambda example and override the doHandleRequest method. In the doHandleRequest method, call the LambdaTracing.instrument(...) API to create a root span to trace the lambda function's execution. This is also where you will define your business logic for the lambda function. Register a LambdaTracer.INSTANCE as the OpenTracing Global tracer, as shown in the Java Lambda example. Create a ZIP deployment package and upload it to AWS Lambda. Or deploy it via other means. In the AWS Lambda console, set the handler. For the example Java Lambda, the handler would be com.handler.example.MyLambdaHandler::handleRequest. Because handleRequest is assumed, you could also use com.handler.example.MyLambdaHandler. The following AWS console environment variables are required if you want your Lambda function to be included in distributed tracing. This is recommended. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_PRIMARY_APPLICATION_ID. This is also your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this must be the account ID for the root/parent account. Optional: In the Lambda console, enable debug logging by adding this environment variable: NEW_RELIC_DEBUG is true. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Please see the AWS Lambda distributed tracing example for a complete project that illustrates common use cases such as: Distributed tracing between Lambda functions Manual span creation (aka custom instrumentation) Tracing external calls Adding custom attributes (aka Tags) to spans .NET Core Our monitoring of .NET Core-based AWS Lambda functions doesn't use our standard .NET Core APM agent. Instead, it uses a NuGet package. To instrument your .NET Core Lambda: In your Lambda Functions project, install the NewRelic.OpenTracing.AmazonLambda.Tracer NuGet package. Note: NewRelic.OpenTracing.AmazonLambda.Tracer depends on version 1.2.0+ of the Amazon.Lambda.APIGatewayEvent NuGet package. If the environment already uses a lower version of Amazon.Lambda.APIGatewayEvent, the New Relic package may produce errors such as System.MissingMethodException. Import the NuGet package and OpenTracing utils: using OpenTracing.Util; using NewRelic.OpenTracing.AmazonLambda; Instrument your function, as shown in this example: public class Function { static Function() { // Register The NewRelic Lambda Tracer Instance GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public object FunctionWrapper(ILambdaContext context) { // Instantiate NewRelic TracingWrapper and pass your FunctionHandler as // an argument return new TracingRequestHandler().LambdaWrapper(FunctionHandler, context); } /// /// A simple function that takes a string and does a ToUpper /// /// /// /// public object FunctionHandler(ILambdaContext context) { ... } } The arguments passed to FunctionWrapper must match the signature of FunctionHandler. If your handler function returns a Task, the Lambda wrapper will block on the return task until it completes, so that it can measure the duration and capture exceptions, if any are present. In addition, you may also inherit from the APIGatewayProxyFunction. For an example, see below: Async handler function public override Task FunctionHandlerAsync(ILambdaContext lambdaContext) { // This call will block by calling task.Result Task task = new TracingRequestHandler().LambdaWrapper( ActualFunctionHandlerAsync, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(ILambdaContext lambdaContext) { // Function can make other async operations here ... } Inheriting from APIGatewayProxyFunction public class LambdaFunction : APIGatewayProxyFunction { static LambdaFunction() { // Register The NewRelic Lambda Tracer Instance OpenTracing.Util.GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public override Task FunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { Task task = new TracingRequestHandler().LambdaWrapper(ActualFunctionHandlerAsync, request, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { return base.FunctionHandlerAsync(request, lambdaContext); } } Optional for SQS and SNS: Starting in version 1.0 of our .NET Lambda Tracer, distributed tracing support has been added for SQS and SNS. To enable distributed tracing for SQS or SNS you will need to complete the items in this step as well as setup the environment variables in the step that follows this one. Enabling distributed tracing support for SQS and SNS will disable automatic instrumentation for both of SQS and SNS and require the use of these wrappers to instrument them. Set the NEW_RELIC_USE_DT_WRAPPER environment variable to true. To instrument SQS and SNS calls you will need to use the provided wrappers. Using the SQS Wrapper The SQS wrapper supports wrapping the following methods: Amazon.SQS.AmazonSQSClient.SendMessageAsync(...) Amazon.SQS.AmazonSQSClient.SendMessageBatchAsync(...) Examples // SQS Client AmazonSQSClient client = new AmazonSQSClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // SendMessageRequest SendMessageRequest sendRequest = new SendMessageRequest(\"QUEUE_URI_STRING\", \"An SQS Message\"); Task responseOne = SQSWrapper.WrapRequest(client.SendMessageAsync, sendRequest); // String-based Task responseTwo = SQSWrapper.WrapRequest(client.SendMessageAsync, \"QUEUE_URI_STRING\", \"Another SQS Message\"); // SendMessageBatchRequest List batchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id1\", \"First SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id2\", \"Second SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id3\", \"Third SQS Message\")); SendMessageBatchRequest sendBatchRequest = new SendMessageBatchRequest(QUEUE_URI, batchEntries); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, sendBatchRequest); // SendMessageBatchRequestEntry List List moreBatchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id4\", \"Fourth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id5\", \"Fifth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id6\", \"Sixth SQS Message\")); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, moreBatchEntries); Using the SNS Wrapper The SNS wrapper supports wrapping the following methods: Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient.PublishAsync(...) Examples // SNS Client AmazonSimpleNotificationServiceClient client = new Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // PublishRequest - Phone Number PublishRequest phonePublishRequest = new PublishRequest(); phonePublishRequest.PhoneNumber = +1XXX5555100; phonePublishRequest.Message = \"An SNS Message for phones\"; Task phoneResponse = SNSWrapper.WrapRequest(client.PublishAsync, phonePublishRequest); // PublishRequest - ARN PublishRequest publishRequest = new PublishRequest(\"TOPIC_ARN\", \"An SNS Message\"); Task publishResponse = SNSWrapper.WrapRequest(client.PublishAsync, publishRequest); // String-based without subject Task ResponseOne = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Another SNS Message\"); // String-based with subject Task ResponseTwo = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Yet Another SNS Message\", \"A Subject\"); The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS Lambda console: NEW_RELIC_ACCOUNT_ID: The account ID the Lambda is reporting to. NEW_RELIC_TRUSTED_ACCOUNT_KEY: This is also the account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Ensure that the wrapper function (FunctionWrapper in above example) is set up as the function handler. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Node.js To instrument your Node.js Lambda: Download our Node.js agent package and place it in the same directory as your function, ensuring the agent is installed as a dependency in the node_modules directory. Use the Node Package Manager: npm install newrelic --save Install our AWS SDK module alongside the Node.js agent: npm install @newrelic/aws-sdk --save In your Lambda code, require the agent module and the AWS SDK at the top of the file, and wrap the handler function. For example: const newrelic = require('newrelic'); require('@newrelic/aws-sdk'); module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { // This is your handler function code console.log('Lambda executed'); callback(); }); Optional: You can also add custom events to your Lambda using the recordCustomEvent API. For example: module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { newrelic.recordCustomEvent(‘MyEventType’, {foo: ‘bar’}); console.log('Lambda executed'); callback(); }); Zip your Lambda function and the Node.js agent folder together. Requirements and recommendations: The New Relic files outside the New Relic agent folder don't need to be included. If your Lambda function file name is, for example, lambda_function.node, we recommend naming your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set these environment variables: NEW_RELIC_NO_CONFIG_FILE. Set to true if not using a configuration file. NEW_RELIC_APP_NAME: Your application name. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To run the agent in serverless mode outside of AWS in a local environment, set the environment variable NEW_RELIC_SERVERLESS_MODE_ENABLED to true. (When executing this in an AWS Lambda environment, the agent will automatically run in serverless mode. Do not use this variable if you're running in AWS.) Optional: To enable logging in serverless mode, set these environment variables: Set NEW_RELIC_LOG_ENABLED to true. Set NEW_RELIC_LOG to stdout for output to CloudWatch, or set to any writeable file location. The log level is set to info by default. See other log levels. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Python To instrument your Python Lambda: Download our Python agent package and place it in the same directory as your function. To do this, use pip: pip install -t . newrelic If you use Homebrew, you may get this error: DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both. For details, see the Homebrew GitHub post. In your Lambda code, import the Python agent module and decorate the handler function using the New Relic decorator. The New Relic package must be imported first in your code. Here's an example: import newrelic.agent newrelic.agent.initialize() @newrelic.agent.lambda_handler() def handler(event, context): ... Optional: You can also add custom events to your Lambda using the record_custom_event API. Here's an example: @newrelic.agent.lambda_handler() def handler(event, context): newrelic.agent.record_custom_event('CustomEvent', {'foo': 'bar'}) … Zip your lambda_function.py and newrelic/ folder together using these guidelines: The New Relic files outside the newrelic/ folder don't need to be included. If your Lambda function file name is, for example, lambda_function.py, name your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set this environment variable: NEW_RELIC_SERVERLESS_MODE_ENABLED. Set to true The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_DISTRIBUTED_TRACING_ENABLED. Set to true. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To configure logging, use the NEW_RELIC_LOG and NEW_RELIC_LOG_LEVEL environment variables in the AWS Console. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. The New Relic decorator gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, configure CloudWatch to send those logs to New Relic. Step 4. Configure CloudWatch logs to stream to New Relic Lambda In this step, you'll link your Lambda function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda that was configured in Step 2. For Node.js and Python: This step isn't necessary if you used the Serverless Framework plugin option in Step 3. This step can be done using the CLI tool or using manual procedures. Use CLI tool Run this command for every Lambda function you want to monitor: newrelic-lambda subscriptions install --function FUNCTION_NAME_#1 Or to set subscription filters for all supported functions run this command:: newrelic-lambda subscriptions install --function all Notes on this command: You should only need one newrelic-log-ingestion Lambda per AWS account and region. You can subscribe as many functions to it as you like. To see more detail about the arguments, including a region-specifying argument, see our GitHub documentation. You may receive a CloudWatch validation error. This doesn't affect data reporting. If you see data reporting in New Relic, disregard that error message. If you have our Logs and want to send all your log data to us (not just Lambda logs), see Stream all logs. Manual procedures Here are the manual procedures performed by the CLI tool: Manual process: Stream CloudWatch logs to New Relic Lambda In Step 2, you set up a newrelic-log-ingestion Lambda function. After you've instrumented your Lambda function (Step 3), the newrelic-lambda subscriptions command links that function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda. To do this manually: Open CloudWatch and select Logs in the left-hand menu, and then select the log group for the function you are monitoring. Select Actions and choose Stream to AWS Lambda. Under Lambda function, select the newrelic-log-ingestion function. Set the Log format to JSON. Set the Subscription filter pattern to ?REPORT ?NR_LAMBDA_MONITORING ?\"Task timed out\". Alternatively, if you are using the LOGGING_ENABLED environment variable stream all your logs to our Logs, leave this field blank. See notes and caveats about this procedure. Make sure the newrelic-log-ingestion Lambda function you select in the method above is in the same AWS region as your Lambda function. What's next? After you complete these steps, here's what you can do next: See data reporting in the Lambda monitoring UI. If you're having trouble finding your data, see Lambda enable troubleshooting. Use configuration settings to fine-tune your data. Our newrelic-log-ingestion function is not updated automatically. For best results and access to latest features, we recommend you occasionally update our Lambda monitoring. Optional: Stream all logs to New Relic If you have log management enabled and want to report all your logs to New Relic, follow these instructions: Go to our newrelic-log-ingestion Lambda and set the LOGGING_ENABLED environment variable to true. It isn't possible to edit existing filter patterns, so they must be removed and re-added: Set the Subscription filter pattern to \"\". Go to the Log group for each monitored Lambda, and remove the newrelic-log-ingestion subscription. Add the subscription filter back, leaving the Subscription filter pattern field blank. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 101.207886,
+ "_score": 148.51971,
"_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"
+ "sections": "Step 1. Install the newrelic-lambda-cli tool",
+ "info": "Read about how to install and enable New Relic monitoring for Amazon AWS Lambda. ",
+ "body": " and AWS account. From the command line, run: pip install newrelic-lambda-cli You may need to use pip3 in the command above if you have Python 2.7 installed. The CLI requires Python >=3.3. Step 2. Connect AWS to New Relic You must complete this step, and steps 3 and 4, to enable our Lambda monitoring"
},
- "id": "5e8e7f9de7b9d2aa122cf0f6"
+ "id": "5f6c67a464441f3a75eb72d3"
},
{
- "category_2": "Custom events",
- "nodeid": 13661,
"sections": [
- "Event data sources",
- "Default events",
- "Custom events",
- "Data requirements and limits for custom event data",
- "General requirements",
- "Reserved words",
- "Additional Browser PageAction requirements",
- "Additional Event API requirements",
- "Event type limits",
- "For more help"
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
],
- "title": "Data requirements and limits for custom event data",
- "category_0": "Insights",
- "type": "docs",
- "category_1": "Event data sources",
- "translation_ja_url": "https://docs.newrelic.co.jp/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits",
- "external_id": "f5beef0d09bb5918be3f8a1a3ece98c09947cd1e",
+ "title": "New Relic CLI Reference",
+ "type": "developer",
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
"image": "",
- "url": "https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits",
- "published_at": "2020-09-30T07:36:03Z",
- "updated_at": "2020-09-27T17:50:31Z",
- "breadcrumb": "Contents / Insights / Event data sources / Custom events",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-10-06T02:13:01Z",
+ "updated_at": "2020-08-14T01:47:12Z",
"document_type": "page",
"popularity": 1,
- "info": "For New Relic, general limits and requirements for reporting custom events and attributes. ",
- "body": "You can report custom events to New Relic in several ways, including the New Relic Event API, APM agent APIs, Browser agent APIs, and the Mobile SDK. This document contains general requirements and rules for inserting and using custom events and their associated attributes. Additional requirements may apply based on the method you use. General requirements How long custom data is retained depends on your Insights subscription and its associated data retention. When reporting custom events and attributes, follow these general requirements for supported data types, naming syntax, and size: Requirement Description Payload Total maximum size or length: 1 MB maximum per POST. We highly recommend using compression. The payload must be encoded as UTF-8. The Event API has additional HTTP rate limits. Attribute data types Attribute values can be either a string or a numeric integer or float. If your attribute values contain date information, define it as an unformatted Unix timestamp (in seconds or milliseconds) by using the Insights data formatter. Attribute size Maximum name size: 255 bytes. Maximum attribute value size: Custom attributes sent by the agent: 255 bytes Attributes attached to custom events sent using the Event API: 4096 characters Charts may only display the first 255 characters of attribute values. For complete attribute values, use the JSON chart type or Query API. Maximum total attributes per event: 254. Exception: If you use an APM agent API, the max is 64. Maximum total attributes per event type: 48,000. Naming syntax Attribute names can be a combination of alphanumeric characters, colons (:), periods (.), and underscores (_). Event types (using the eventType attribute) can be a combination of alphanumeric characters, colons (:), and underscores (_). Do not use words reserved for use by NRQL. Null values The database does not store any data with a null value. Reserved words Avoid using the following reserved words as names for events and attributes. Otherwise, unexpected results may occur. This is not a complete list. In general, it's a good practice to avoid using MySQL-reserved words to avoid collision with future New Relic functionality. Keyword Description accountId This is a reserved attribute name. If it's included, it will be dropped during ingest. appId Value must be an integer. If it is not an integer, the attribute name and value will be dropped during ingest. eventType The event type as stored in New Relic. New Relic agents and scripts normally report this as eventType. Can be a combination of alphanumeric characters, colons (:), and underscores (_). Be sure to review the prohibited eventType values and eventType limits. Prohibited eventType values For your eventType value, avoid using: Metric, MetricRaw, and strings prefixed with Metric[0-9] (such as Metric2 or Metric1Minute). Public_ and strings prefixed with Public_. These event types are reserved for use by New Relic. Events passed in with these eventType values will be dropped. timestamp Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds. It must be +/-1 day (24 hours) of the current time on the server. Log forwarding terms The following keys are reserved by the Infrastructure agent's log forwarding feature: entity.guid, log, hostname, plugin.type, fb.input. If used, they are dropped during ingest and a warning is added to the logs. NRQL syntax terms If you need to use NRQL syntax terms as attribute names, including dotted attributes, they must be enclosed in backticks; for example, `LIMIT` or `consumer.offset`. Otherwise, avoid using these reserved words: ago, and, as, auto, begin, begintime, compare, day, days, end, endtime, explain, facet, from, hour, hours, in, is, like, limit, minute, minutes, month, months, not, null, offset, or, raw, second, seconds, select, since, timeseries, until, week, weeks, where, with Additional Browser PageAction requirements For additional requirements for using New Relic Browser's custom PageAction event, see Insert custom data via New Relic Browser agent. Additional Event API requirements For more requirements and details for the Event API, see Event API. Event type limits The current limit for total number of eventType values is 250 per sub-account in a given 24-hour time period. If a user exceeds this limit, New Relic may filter or drop data. Event types include: Default events from New Relic agents Custom events from New Relic agents Custom events from Insights custom event inserter For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 101.04441,
+ "_score": 130.98296,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "Data requirements and limits for custom event data",
- "sections": "Additional Event API requirements",
- "info": "For New Relic, general limits and requirements for reporting custom events and attributes. ",
- "category_1": "Event data sources",
- "category_2": "Custom events",
- "body": "You can report custom events to New Relic in several ways, including the New Relic Event API, APM agent APIs, Browser agent APIs, and the Mobile SDK. This document contains general requirements and rules for inserting and using custom events and their associated attributes. Additional requirements",
- "breadcrumb": "Contents / Insights / Event data sources / Custom events"
+ "title": "New Relic 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": "59f4354f4bb81c2ea8b80d0a"
+ "id": "5efa989ee7b9d2024b7bab97"
},
{
- "category_2": "Get started",
- "nodeid": 36051,
+ "nodeid": 37686,
"sections": [
- "Ingest and manage data",
+ "AWS Lambda monitoring",
"Get started",
- "Understand data",
- "Manage data",
- "Ingest APIs",
- "Get data into New Relic",
- "New Relic-built agents and integrations",
- "Agent APIs",
- "Telemetry SDKs",
- "APIs for sending metrics, traces, logs, and events",
- "New Relic One applications",
+ "Enable Lambda monitoring",
+ "UI and data",
+ "Troubleshooting",
+ "Update serverless monitoring for AWS Lambda",
+ "Update our Lambda integration via CLI",
+ "Update Layers via CLI",
+ "Update a manual Serverless Application Repository install",
+ "Enabling log management",
"For more help"
],
- "title": "Get data into New Relic",
- "category_0": "Telemetry Data Platform",
+ "title": "Update serverless monitoring for AWS Lambda",
+ "category_0": "Serverless function monitoring",
"type": "docs",
- "category_1": "Ingest and manage data",
- "external_id": "7a413b4d7e5bd81088a08507ae4bad64c7e24b2d",
+ "category_1": "AWS Lambda monitoring",
+ "external_id": "9241e43c2db3e0298407449d530fa8fe601c1833",
"image": "",
- "url": "https://docs.newrelic.com/docs/telemetry-data-platform/get-data-new-relic/getting-started/introduction-new-relic-data-ingest-apis-sdks",
- "published_at": "2020-09-30T16:13:27Z",
- "updated_at": "2020-08-10T23:16:39Z",
- "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Get started",
+ "url": "https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/update-serverless-monitoring-aws-lambda",
+ "published_at": "2020-10-03T16:24:33Z",
+ "updated_at": "2020-09-24T13:54:59Z",
+ "breadcrumb": "Contents / Serverless function monitoring / AWS Lambda monitoring / Enable Lambda monitoring",
"document_type": "page",
"popularity": 1,
- "info": "An introduction to how to get data into New Relic. ",
- "body": "There are many ways to get data into your New Relic account. Any New Relic user can use any of our data ingest methods to report data to our Telemetry Data Platform. New Relic-built agents and integrations When you enable New Relic solutions like APM, browser monitoring, mobile monitoring, infrastructure monitoring, or any of our wide array of integrations, by default you'll receive data from your monitored applications, hosts, services, or other entities. To browse all New Relic-built tools and solutions, see New Relic integrations. Agent APIs Some of our monitoring solutions come with APIs and/or SDKs that allow you to customize the data reported and how it reports. For more information, see the relevant product: APM agent APIs Browser API Mobile API Infrastructure monitoring: the Flex integration tool Telemetry SDKs If our more curated solutions don't work for you, our open source Telemetry SDKs let you build your own solution. These SDKs are language wrappers for our data-ingest APIs (below) that let you send telemetry data to New Relic without requiring install of an agent. APIs for sending metrics, traces, logs, and events If our more curated solutions don't work for you, we also have data-ingest APIs: Trace API Event API Metric API Log API To learn about the differences between these data types, see Data types. New Relic One applications You can build entirely custom applications that reside in New Relic One and make use of any data you want. You can use existing open source New Relic One apps, or share your own with the open source community. For details, see New Relic One applications. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "info": "How to update our Serverless monitoring for AWS Lambda. ",
+ "body": "After enabling our monitoring for AWS Lambda, you should occasionally update our Lambda function that's used to report AWS log data: newrelic-log-ingestion. There are two ways to do this: Update via CLI: Use this if you enabled our Lambda monitoring using our CLI tool. Update via AWS Serverless Application Repository: Use this if you enabled using the manual procedure. These update procedures apply to our serverless monitoring for AWS Lambda, and not to our infrastructure monitoring for AWS Lambda integration. Update our Lambda integration via CLI This section describes how to update if your Lambda monitoring was enabled using our recommended CLI tool. Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following command, replacing YOUR_REGION with your region identifier (for example, us-west-2). newrelic-lambda integrations update \\ --aws-region YOUR_REGION If you do not have our logs enabled, you'll also need to update your AWS CloudWatch log subscription filters with the following command: newrelic-lambda subscriptions install \\ --function installed \\ --aws-region YOUR_REGION Update Layers via CLI This section describes how to update your function's Layer if you installed it with our CLI tool. Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli Pass the --upgrade flag to the install command: newrelic-lambda layers install \\ --function installed \\ --nr-account-id NR_ACCOUNT_ID \\ --upgrade Update a manual Serverless Application Repository install If you manually installed the ingest function from the AWS Serverless Application Repository (and didn't use the CLI), update using this procedure: Run the following, replacing YOUR_REGION with your region (for example, us-west-2). aws serverlessrepo create-cloud-formation-change-set \\ --application-id arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion \\ --stack-name NewRelic-log-ingestion \\ --capabilities CAPABILITY_RESOURCE_POLICY \\ --region YOUR_REGION This command outputs several fields, one of which is the ChangeSetId: an ARN for the change set that you just created. Copy that ARN. Use the ARN in this command, which executes the change set: aws cloudformation execute-change-set --change-set-name YOUR_CHANGE_SET_ARN Enabling log management If you currently don't have New Relic's log management enabled, but would like to: Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following command, replacing YOUR_REGION with your region (for example, us-west-2). newrelic-lambda integrations update \\ --enable-logs \\ --aws-region YOUR_REGION Then update your AWS CloudWatch log subscription filters for each region with the following command: newrelic-lambda subscriptions install \\ --function installed \\ --filter-pattern \"\" \\ --aws-region YOUR_REGION For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 100.91658,
+ "_score": 126.34271,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "sections": "APIs for sending metrics, traces, logs, and events",
- "category_0": "Telemetry Data Platform",
- "body": " also have data-ingest APIs: Trace API Event API Metric API Log API To learn about the differences between these data types, see Data types. New Relic One applications You can build entirely custom applications that reside in New Relic One and make use of any data you want. You can use existing open",
- "breadcrumb": "Contents / Telemetry Data Platform / Ingest and manage data / Get started"
+ "sections": "Update our Lambda integration via CLI",
+ "body": " YOUR_CHANGE_SET_ARN Enabling log management If you currently don't have New Relic's log management enabled, but would like to: Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following"
},
- "id": "5f24aa60196a67ede394f5f3"
+ "id": "5f6ca534196a67b08750423e"
},
{
- "category_2": "Java agent release notes",
- "nodeid": 36271,
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nr1-common/",
"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 5.8.0",
- "New features",
- "New OSS SDK",
- "Fixes"
+ "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": "Java Agent 5.8.0",
- "category_0": "Release notes",
- "type": "docs",
- "category_1": "APM agent release notes",
- "external_id": "bc3a41e5e576ff66be3ecfe7085f2d3c8bbd796d",
- "image": "",
- "url": "https://docs.newrelic.com/docs/release-notes/agent-release-notes/java-release-notes/java-agent-580",
- "published_at": "2020-09-30T16:19:57Z",
- "updated_at": "2019-10-31T15:19:35Z",
- "breadcrumb": "Contents / Release notes / APM agent release notes / Java agent release notes",
- "document_type": "release_notes",
- "popularity": -2,
- "body": "[RSS] Released on: Tuesday, October 29, 2019 - 12:00 Download New features gRPC gRPC error reporting is now configurable Response codes, component type, and method type are now recorded as attributes. The agent now reports the gRPC status code rather than \"translating\" to HTTP status codes. Vert.x The Java agent now provides visibility into your applications built using the Vert.x 3.8. The agent instruments Vert.x Web, Vert.x Core, and Vert.x HTTP client. With this instrumentation, the agent will identify and name your transactions based on Vert.x web routing paths. The agent will also time web handlers, track async handlers, and external calls made with Vert.x HTTP client. XML custom instrumentation The custom XML instrumentation XSD has been enhanced to support now include support for specifying leaf tracers. Class Histogram A new Class Histogram extension is now available to report heap memory details as events. Jedis Added support for Jedis 3.0.0 and higher. You can now see your Jedis calls in breakdowns in the overview chart, entries in the Databases tab, and segments in transaction traces. Lettuce Instrumentation modules for Lettuce 4 and 5 are now available via the Java agent incubator. New OSS SDK We now have an open source Telemetry SDK for Java for sending telemetry data to New Relic. The current SDK supports sending dimensional metrics to the Metric API and spans to the Trace API. Fixes The Solr 7 instrumentation would not report Update JMX metrics. HttpURLConnection instrumentation produced External metrics only when network methods (getInputStream, getResponseCode) are called. MongoDB instrumentation would report duplicate metrics when applications invoked MongoClientOptions.build() more than once.",
- "info": "",
+ "published_at": "2020-10-06T02:14:19Z",
+ "title": "New Relic One CLI common commands",
+ "updated_at": "2020-08-14T01:48:10Z",
+ "type": "developer",
+ "external_id": "503e515e1095418f8d19329517344ab209d143a4",
+ "document_type": "page",
+ "popularity": 1,
+ "info": "An overview of common commands you can use with the New Relic One CLI.",
+ "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 75.06235,
+ "_score": 118.41706,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "Java Agent 5.8.0",
- "sections": "APM agent release notes",
- "category_1": "APM agent release notes",
- "category_2": "Java agent release notes",
- "body": " agent incubator. New OSS SDK We now have an open source Telemetry SDK for Java for sending telemetry data to New Relic. The current SDK supports sending dimensional metrics to the Metric API and spans to the Trace API. Fixes The Solr 7 instrumentation would not report Update JMX metrics",
- "breadcrumb": "Contents / Release notes / APM agent release notes / Java agent release notes"
+ "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": "5dbafb88196a67d9b59aa23d"
+ "id": "5f28bd6ae7b9d267996ade94"
}
],
- "/explore-docs/nr1-catalog": [
+ "/explore-docs/nr1-plugins": [
{
"sections": [
"New Relic One CLI reference",
@@ -6509,7 +6659,7 @@
"external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
"image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
"url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
- "published_at": "2020-10-01T01:56:53Z",
+ "published_at": "2020-10-06T02:13:01Z",
"updated_at": "2020-09-17T01:51:10Z",
"document_type": "page",
"popularity": 1,
@@ -6517,7 +6667,7 @@
"body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 309.85535,
+ "_score": 227.0228,
"_version": null,
"_explanation": null,
"sort": null,
@@ -6526,50 +6676,94 @@
"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"
+ "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"
},
{
- "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png",
- "url": "https://developer.newrelic.com/",
"sections": [
- "Mark your calendar for Nerd Days 1.0",
- "Get coding",
- "Create custom events",
- "Add tags to apps",
- "Build a Hello, World! app",
- "Get inspired",
- "Add a table to your app",
- "Collect data - any source",
- "Automate common tasks",
- "Create a custom map view",
- "Add a time picker to your app",
- "Add custom attributes",
- "New Relic developer champions",
- "New Relic Podcasts"
+ "New Relic CLI Reference",
+ "New Relic CLI commands",
+ "Options",
+ "Commands"
],
- "published_at": "2020-10-01T01:45:23Z",
- "title": "New Relic Developers",
- "updated_at": "2020-09-30T01:36:50Z",
+ "title": "New Relic CLI Reference",
"type": "developer",
- "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab",
+ "tags": "new relic cli",
+ "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
+ "published_at": "2020-10-06T02:13:01Z",
+ "updated_at": "2020-08-14T01:47:12Z",
"document_type": "page",
"popularity": 1,
- "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 13 Days : 21 Hours : 58 Minutes : 23 Seconds Register Get coding Create a free account 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events Start the guide 7 min Add tags to apps Add tags to applications you instrument for easier filtering and organization Start the guide 12 min Build a Hello, World! app Build a Hello, World! app and publish it to your local New Relic One Catalog Start the guide Get inspired 30 min Add a table to your app Add a table to your New Relic One app 15 min Collect data - any source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add a time picker to your app Add a time picker to a sample application Add custom attributes Use custom attributes for deeper analysis Show 20 more guides Looking for more inspiration? Check out the open source projects built by the New Relic community. New Relic developer champions New Relic Champions are solving big problems using New Relic as their linchpin and are recognized as experts and leaders in the New Relic technical community. Nominate a developer champion Learn more about developer champions New Relic Podcasts We like to talk, especially to developers about developer things. Join us for conversations on open source, observability, software design and industry news. Listen",
- "info": "",
+ "info": "The command line tools for performing tasks against New Relic APIs",
+ "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 185.20657,
+ "_score": 130.16217,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "New Relic Developers",
- "sections": "New Relic developer champions",
- "body": " 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"
+ "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": "5d6fe49a64441f8d6100a50f"
+ "id": "5efa989ee7b9d2024b7bab97"
+ },
+ {
+ "nodeid": 27692,
+ "sections": [
+ "AWS Lambda monitoring",
+ "Get started",
+ "Enable Lambda monitoring",
+ "UI and data",
+ "Troubleshooting",
+ "Enable serverless monitoring for AWS Lambda",
+ "How Lambda monitoring works",
+ "Enable procedure overview",
+ "Step 1. Install the newrelic-lambda-cli tool",
+ "CLI requirements",
+ "CLI installation",
+ "Step 2. Connect AWS to New Relic",
+ "Use CLI tool",
+ "Manual procedures",
+ "Step 3. Enable Lambda instrumentation",
+ "Step 4. Configure CloudWatch logs to stream to New Relic Lambda",
+ "What's next?",
+ "Optional: Stream all logs to New Relic",
+ "For more help"
+ ],
+ "title": "Enable serverless monitoring for AWS Lambda",
+ "category_0": "Serverless function monitoring",
+ "type": "docs",
+ "category_1": "AWS Lambda monitoring",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/enable-serverless-monitoring-aws-lambda",
+ "external_id": "7992b896d4c35ca29aba34698aedd621dfe0b572",
+ "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-lambda-monitoring-architecture.png",
+ "url": "https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/enable-serverless-monitoring-aws-lambda",
+ "published_at": "2020-10-04T01:13:08Z",
+ "updated_at": "2020-10-04T01:13:08Z",
+ "breadcrumb": "Contents / Serverless function monitoring / AWS Lambda monitoring / Enable Lambda monitoring",
+ "document_type": "page",
+ "popularity": 1,
+ "info": "Read about how to install and enable New Relic monitoring for Amazon AWS Lambda. ",
+ "body": "Serverless monitoring for AWS Lambda offers in-depth performance monitoring for your Lambda functions. Read on to learn how to enable this feature and get started using it. Using this feature may result in AWS charges. For more information, see the Lambda monitoring requirements. How Lambda monitoring works Before enabling Lambda monitoring, understanding how data flows from your Lambda functions to New Relic may be helpful: Diagram showing how data flows from a Lambda function to New Relic. When our Lambda monitoring is enabled, this is how data moves from your Lambda function to New Relic: The Lambda function is instrumented with our code. CloudWatch collects Lambda log data and sends it to our log-ingestion Lambda. The log-ingestion Lambda sends that data to New Relic. Enable procedure overview If you already have a New Relic account and use Node.js or Python, we recommend you use our automated installer. If you do not use the automated installer, complete these steps to set up monitoring: Install our CLI tool (recommended) Connect AWS and New Relic (required) Enable instrumentation of your Lambda (required) Stream CloudWatch logs to New Relic (required) Step 1. Install the newrelic-lambda-cli tool We provide a command line interface (CLI) tool that's used in steps 2 through 4. We recommend the CLI because it simplifies some of the work, but you can also perform those steps manually. If you want to understand what it does before you install it, see the manual procedures that the CLI tool performs in Step 2, Step 3 (option 2), and Step 4. You can also see the CLI documentation on GitHub. If you prefer a manual install, skip to Step 2. Connect AWS to New Relic. CLI requirements To use the CLI too, you need: Python 3.3 or higher The AWS CLI You must be a user or admin with an infrastructure manager Add-on role. Your AWS account needs permissions for creating IAM resources (Role and Policy) and Lambda functions. These resources are created using CloudFormation stacks, so you'll need permissions to create those. For more on permissions, including setting custom policies, expand this collapser: AWS permissions details Resource: * Actions: \"cloudformation:CreateChangeSet\", \"cloudformation:CreateStack\", \"cloudformation:DescribeStacks\", \"cloudformation:ExecuteChangeSets\", \"iam:AttachRolePolicy\", \"iam:CreateRole\", \"iam:GetRole\", \"iam:PassRole\", \"lambda:AddPermission\", \"lambda:CreateFunction\", \"lambda:GetFunction\", \"logs:DeleteSubscriptionFilter\", \"logs:DescribeSubscriptionFilters\", \"logs:PutSubscriptionFilter\" \"s3:GetObject\" \"serverlessrepo:CreateCloudFormationChangeSet\" Resource: \"arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion\" Actions: \"serverlessrepo:CreateCloudFormationTemplate\" \"serverlessrepo:GetCloudFormationTemplate\" Be sure that the AWS account you use to execute the CLI has all of these permissions. If your AWS account permissions are restrictive and you're unable to use the CLI, you can optionally use a manually managed custom IAM policy. This policy would require, at minimum, the following permissions: Resource: \"*\" Action: \"cloudwatch:GetMetricStatistics\" \"cloudwatch:ListMetrics\" \"cloudwatch:GetMetricData\" \"lambda:GetAccountSettings\" \"lambda:ListFunctions\" \"lambda:ListAliases\" \"lambda:ListTags\" \"lambda:ListEventSourceMappings\" These permissions are the minimum required. We recommend granting a managed ReadOnlyAccess policy as described in Connect AWS to infrastructure monitoring. CLI installation To install the CLI tool: Ensure you have the required permissions for both your New Relic and AWS account. From the command line, run: pip install newrelic-lambda-cli You may need to use pip3 in the command above if you have Python 2.7 installed. The CLI requires Python >=3.3. Step 2. Connect AWS to New Relic You must complete this step, and steps 3 and 4, to enable our Lambda monitoring. This step connects AWS to New Relic and creates a newrelic-log-ingestion Lambda function that sends your instrumented data to New Relic. You can either use the CLI tool or do the steps manually. Use CLI tool When you use the CLI, you have one optional step and one required step: Optional: If you're using multiple AWS profiles or multiple regions, you may want to configure the AWS environment variables: AWS environment variable instructions Setting the region To configure your region, use this environment variable to override the default region: export AWS_DEFAULT_REGION=MY_REGION # us-west-2, for example The CLI tool also allows passing this per-command using --aws-region. Setting profiles If you have multiple AWS profiles and don't want to use the default, use AWS_PROFILE environment variable to set another profile name. Ensure the profile is properly configured (including the default region). Example: export AWS_PROFILE=MY_PROFILE Run the following command using the CLI tool: newrelic-lambda integrations install --nr-account-id YOUR_ACCOUNT_ID \\ --linked-account-name YOUR_LINKED_ACCOUNT_NAME \\ --nr-api-key YOUR_NR_API_KEY This command: Connects your AWS account to New Relic. Installs a newrelic-log-ingestion Lambda that will send your instrumented data to New Relic. More details: This defaults to U.S. region. If your account is in the EU region, add this argument: --nr-region \"eu\". If you're instrumenting functions in multiple AWS regions, this command must be run for each region using the --aws-region argument. YOUR_LINKED_ACCOUNT_NAME is either a new AWS account you want to link to New Relic, or it's the name of the AWS account that you linked to when setting up the AWS Lambda monitoring integration. YOUR_NR_API_KEY refers to your personal API key (not your REST API key). For more on the API key and other arguments, see our Lambda monitoring GitHub repo. Manual procedures Here are the manual procedures performed by the CLI tool: Connect AWS to New Relic The newrelic-lambda integration command connects the AWS account containing your Lambdas to New Relic. If you've already installed one of our AWS integrations, your accounts should be linked to New Relic and you can skip this section. To manually establish this connection, follow the instructions for connecting AWS to Infrastructure monitoring. Configure our log-ingestion Lambda The newrelic-lambda integration command sets up a newrelic-log-ingestion Lambda. This Lambda takes the logs generated by your Lambda functions and pushes those logs to New Relic. If you're configuring this manually, you must configure our Lambda for the regions you want. The CLI, by default, establishes our Lambda in all regions. To manually configure our Lambda, go to the AWS Serverless Application Repository, which is where the newrelic-log-ingestion Lambda is stored. This repo is a collection of serverless applications published by developers, companies, and partners in the serverless community. It allows developers to share their Lambda functions code with customers, who can then find and deploy the corresponding application Lambda function. Each application is packaged with an AWS Serverless Application Model (SAM) template that defines the AWS resources used. To manually configure our Lambda with the AWS Serverless Application Repository: From the AWS console, go to the Lambda section, select Create function, and select Serverless Application Repository. Search for newrelic and find the newrelic-log-ingestion Lambda. Follow the instructions in the Lambda's documentation to deploy it. A SAM template will build the Lambda. In the environment variable section in AWS console, set the LICENSE_KEY environment variable to your New Relic license key. Note: If you have multiple accounts or a master and sub-account hierarchy, make sure the license key you're using matches the same account connected to AWS. Optional: If you want to stream all your logs to New Relic, set the LOGGING_ENABLED environment variable to true. For more on this, see Stream all logs. Step 3. Enable Lambda instrumentation This step enables instrumentation of your Lambda function, which allows detailed monitoring and alerting functionality. Our instrumentation is designed to have minimal impact on your Lambda performance. If you're using Node.js or Python, we recommend the first two options. Option #1: Use Serverless Framework plugin (Node.js and Python) Requirements Available only for Node.js and Python. For other languages, see Manual instrumentation. Serverless Framework version 1.34.0 or higher. Features If you meet the requirements (above), you can use our Serverless Framework plugin, which allows you to add our AWS Lambda Layer to your functions without requiring a code change. Supports Node.js and Python runtimes No code change required to enable Lambda instrumentation Enables our APM agent functionality using a single layer Configures CloudWatch subscription filters automatically Gets the layer into your code base which is useful for redeploys Install To install our Serverless Framework plugin: Choose an install option: NPM: npm install --save-dev serverless-newrelic-lambda-layers yarn: yarn add --dev serverless-newrelic-lambda-layers Add the plugin to your serverless.yml: plugins: - serverless-newrelic-lambda-layers Get your account ID and put it in the serverless.yml: custom: newRelic: accountId: YOUR_ACCOUNT_ID Deploy it: sls deploy You can skip Step 4. Setting up CloudWatch Logs. This is automatically completed on deploy by our Serverless Framework plugin. For the next step, go to What's next? Option #2: Add Lambda Layer with our CLI (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework and don't intend to redeploy your function frequently, you can use the CLI to add our Lambda Layer: If you haven't already done so, install the CLI: pip install newrelic-lambda-cli List available functions: newrelic-lambda functions list Pass the option -f not-installed to see which functions have not yet been instrumented. Add the layer to your function: newrelic-lambda layers install --function FUNCTION_NAME --nr-account-id NEW_RELIC_ACCOUNT_ID Next, you will configure CloudWatch to send logs to New Relic. Option #3: Manually add our Lambda Layer (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework, you can manually add our Lambda Layer: Find the layer that matches your runtime and region. Copy the Amazon Resource Name (ARN) of the most recent version and add it in the AWS Lambda console for your function. Update your functions handler to point to the newly attached layer in the console for your function: Python: newrelic_lambda_wrapper.handler Node: newrelic-lambda-wrapper.handler Add these environment variables to your Lambda console: NEW_RELIC_ACCOUNT_ID: Your account ID NEW_RELIC_LAMBDA_HANDLER: Path to your initial handler. If you have Node 8 and get a Lambda can't find file error message, expand this collapser: Node 8 \"can't find file\" error troubleshooting If you have Node 8 and receive a Lambda can't find the file newrelic-lambda-wrapper.js message, it's likely that the Node runtime isn't resolving NPM_PATH for the newrelic-lambda module in /opt/nodejs/node_modules. These steps should fix this problem: Create a newrelic-wrapper-helper.js script in your project's root. The script's contents should be module.exports = require('newrelic-lambda-wrapper');. (That is all that needs to be in that script.) Update the handler for your layer declaration to newrelic-lambda-wrapper.handler. Next, you will configure CloudWatch to send logs to New Relic. Option #4: Manually instrument Lambda code for Go, Java, .NET Core, Node.js, and Python If none of the previous options work for you, you can manually instrument your Lambda code. Choose your language: Go To instrument your Go-language Lambda: Download our Go agent package and place it in the same directory as your function. Install the agent: go get -u github.com/newrelic/go-agent. In your Lambda code, import our components, create an application, and update how you start your Lambda. See our GitHub repo for an example of an instrumented Lambda. Optional: Add custom events that will be associated with your Lambda invocation by using the RecordCustomEvent API. For example: func handler(ctx context.Context) { if txn := newrelic.FromContext(ctx); nil != txn { txn.Application().RecordCustomEvent(\"MyEvent\", map[string]interface{}{ \"zip\": \"zap\", }) } fmt.Println(\"hello world!\") } Build and zip your Lambda function and upload it to AWS. Zip and upload recommendations Here are suggestions for zipping and uploading the Lambda: Build the binary for execution on Linux. This produces a binary file called main. You can use: $ GOOS=linux go build -o main Zip the binary into a deployment package using: $ zip deployment.zip main Upload the zip file to AWS using either the AWS Lambda console or the AWS CLI. Name the handler main (to match the name given during the binary build). The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this is the account ID for the root/parent account. Optional: To configure logging, see Go agent logging. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Java Monitoring for AWS Lambda in Java doesn't use our APM Java agent. Instead, it uses these two OpenTracing dependencies: AWS Lambda OpenTracing Java SDK: OpenTracing instrumentation for AWS Lambda RequestHandler and RequestStreamHandler. Our AWS Lambda OpenTracing Tracer: An OpenTracing Tracer implementation designed to monitor AWS Lambda. It generates spans, error events, transaction events, error traces, and provides distributed tracing support. Supported OpenTracing Versions OpenTracing 0.31.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:1.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:1.0.0 OpenTracing 0.32.0, 0.33.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:2.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:2.1.0 To instrument your Java Lambda: In your project’s build.gradle file, include our OpenTracing AWS Lambda Tracer and the AWS Lambda OpenTracing SDK dependencies: dependencies { compile(\"com.newrelic.opentracing:java-aws-lambda:2.1.0\") compile(\"com.newrelic.opentracing:newrelic-java-lambda:2.1.1\") compile(\"io.opentracing:opentracing-util:0.33.0\") } Implement the AWS Lambda RequestHandler interface as shown in the Java Lambda example and override the doHandleRequest method. In the doHandleRequest method, call the LambdaTracing.instrument(...) API to create a root span to trace the lambda function's execution. This is also where you will define your business logic for the lambda function. Register a LambdaTracer.INSTANCE as the OpenTracing Global tracer, as shown in the Java Lambda example. Create a ZIP deployment package and upload it to AWS Lambda. Or deploy it via other means. In the AWS Lambda console, set the handler. For the example Java Lambda, the handler would be com.handler.example.MyLambdaHandler::handleRequest. Because handleRequest is assumed, you could also use com.handler.example.MyLambdaHandler. The following AWS console environment variables are required if you want your Lambda function to be included in distributed tracing. This is recommended. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_PRIMARY_APPLICATION_ID. This is also your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this must be the account ID for the root/parent account. Optional: In the Lambda console, enable debug logging by adding this environment variable: NEW_RELIC_DEBUG is true. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Please see the AWS Lambda distributed tracing example for a complete project that illustrates common use cases such as: Distributed tracing between Lambda functions Manual span creation (aka custom instrumentation) Tracing external calls Adding custom attributes (aka Tags) to spans .NET Core Our monitoring of .NET Core-based AWS Lambda functions doesn't use our standard .NET Core APM agent. Instead, it uses a NuGet package. To instrument your .NET Core Lambda: In your Lambda Functions project, install the NewRelic.OpenTracing.AmazonLambda.Tracer NuGet package. Note: NewRelic.OpenTracing.AmazonLambda.Tracer depends on version 1.2.0+ of the Amazon.Lambda.APIGatewayEvent NuGet package. If the environment already uses a lower version of Amazon.Lambda.APIGatewayEvent, the New Relic package may produce errors such as System.MissingMethodException. Import the NuGet package and OpenTracing utils: using OpenTracing.Util; using NewRelic.OpenTracing.AmazonLambda; Instrument your function, as shown in this example: public class Function { static Function() { // Register The NewRelic Lambda Tracer Instance GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public object FunctionWrapper(ILambdaContext context) { // Instantiate NewRelic TracingWrapper and pass your FunctionHandler as // an argument return new TracingRequestHandler().LambdaWrapper(FunctionHandler, context); } /// /// A simple function that takes a string and does a ToUpper /// /// /// /// public object FunctionHandler(ILambdaContext context) { ... } } The arguments passed to FunctionWrapper must match the signature of FunctionHandler. If your handler function returns a Task, the Lambda wrapper will block on the return task until it completes, so that it can measure the duration and capture exceptions, if any are present. In addition, you may also inherit from the APIGatewayProxyFunction. For an example, see below: Async handler function public override Task FunctionHandlerAsync(ILambdaContext lambdaContext) { // This call will block by calling task.Result Task task = new TracingRequestHandler().LambdaWrapper( ActualFunctionHandlerAsync, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(ILambdaContext lambdaContext) { // Function can make other async operations here ... } Inheriting from APIGatewayProxyFunction public class LambdaFunction : APIGatewayProxyFunction { static LambdaFunction() { // Register The NewRelic Lambda Tracer Instance OpenTracing.Util.GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public override Task FunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { Task task = new TracingRequestHandler().LambdaWrapper(ActualFunctionHandlerAsync, request, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { return base.FunctionHandlerAsync(request, lambdaContext); } } Optional for SQS and SNS: Starting in version 1.0 of our .NET Lambda Tracer, distributed tracing support has been added for SQS and SNS. To enable distributed tracing for SQS or SNS you will need to complete the items in this step as well as setup the environment variables in the step that follows this one. Enabling distributed tracing support for SQS and SNS will disable automatic instrumentation for both of SQS and SNS and require the use of these wrappers to instrument them. Set the NEW_RELIC_USE_DT_WRAPPER environment variable to true. To instrument SQS and SNS calls you will need to use the provided wrappers. Using the SQS Wrapper The SQS wrapper supports wrapping the following methods: Amazon.SQS.AmazonSQSClient.SendMessageAsync(...) Amazon.SQS.AmazonSQSClient.SendMessageBatchAsync(...) Examples // SQS Client AmazonSQSClient client = new AmazonSQSClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // SendMessageRequest SendMessageRequest sendRequest = new SendMessageRequest(\"QUEUE_URI_STRING\", \"An SQS Message\"); Task responseOne = SQSWrapper.WrapRequest(client.SendMessageAsync, sendRequest); // String-based Task responseTwo = SQSWrapper.WrapRequest(client.SendMessageAsync, \"QUEUE_URI_STRING\", \"Another SQS Message\"); // SendMessageBatchRequest List batchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id1\", \"First SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id2\", \"Second SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id3\", \"Third SQS Message\")); SendMessageBatchRequest sendBatchRequest = new SendMessageBatchRequest(QUEUE_URI, batchEntries); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, sendBatchRequest); // SendMessageBatchRequestEntry List List moreBatchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id4\", \"Fourth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id5\", \"Fifth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id6\", \"Sixth SQS Message\")); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, moreBatchEntries); Using the SNS Wrapper The SNS wrapper supports wrapping the following methods: Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient.PublishAsync(...) Examples // SNS Client AmazonSimpleNotificationServiceClient client = new Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // PublishRequest - Phone Number PublishRequest phonePublishRequest = new PublishRequest(); phonePublishRequest.PhoneNumber = +1XXX5555100; phonePublishRequest.Message = \"An SNS Message for phones\"; Task phoneResponse = SNSWrapper.WrapRequest(client.PublishAsync, phonePublishRequest); // PublishRequest - ARN PublishRequest publishRequest = new PublishRequest(\"TOPIC_ARN\", \"An SNS Message\"); Task publishResponse = SNSWrapper.WrapRequest(client.PublishAsync, publishRequest); // String-based without subject Task ResponseOne = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Another SNS Message\"); // String-based with subject Task ResponseTwo = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Yet Another SNS Message\", \"A Subject\"); The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS Lambda console: NEW_RELIC_ACCOUNT_ID: The account ID the Lambda is reporting to. NEW_RELIC_TRUSTED_ACCOUNT_KEY: This is also the account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Ensure that the wrapper function (FunctionWrapper in above example) is set up as the function handler. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Node.js To instrument your Node.js Lambda: Download our Node.js agent package and place it in the same directory as your function, ensuring the agent is installed as a dependency in the node_modules directory. Use the Node Package Manager: npm install newrelic --save Install our AWS SDK module alongside the Node.js agent: npm install @newrelic/aws-sdk --save In your Lambda code, require the agent module and the AWS SDK at the top of the file, and wrap the handler function. For example: const newrelic = require('newrelic'); require('@newrelic/aws-sdk'); module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { // This is your handler function code console.log('Lambda executed'); callback(); }); Optional: You can also add custom events to your Lambda using the recordCustomEvent API. For example: module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { newrelic.recordCustomEvent(‘MyEventType’, {foo: ‘bar’}); console.log('Lambda executed'); callback(); }); Zip your Lambda function and the Node.js agent folder together. Requirements and recommendations: The New Relic files outside the New Relic agent folder don't need to be included. If your Lambda function file name is, for example, lambda_function.node, we recommend naming your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set these environment variables: NEW_RELIC_NO_CONFIG_FILE. Set to true if not using a configuration file. NEW_RELIC_APP_NAME: Your application name. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To run the agent in serverless mode outside of AWS in a local environment, set the environment variable NEW_RELIC_SERVERLESS_MODE_ENABLED to true. (When executing this in an AWS Lambda environment, the agent will automatically run in serverless mode. Do not use this variable if you're running in AWS.) Optional: To enable logging in serverless mode, set these environment variables: Set NEW_RELIC_LOG_ENABLED to true. Set NEW_RELIC_LOG to stdout for output to CloudWatch, or set to any writeable file location. The log level is set to info by default. See other log levels. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Python To instrument your Python Lambda: Download our Python agent package and place it in the same directory as your function. To do this, use pip: pip install -t . newrelic If you use Homebrew, you may get this error: DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both. For details, see the Homebrew GitHub post. In your Lambda code, import the Python agent module and decorate the handler function using the New Relic decorator. The New Relic package must be imported first in your code. Here's an example: import newrelic.agent newrelic.agent.initialize() @newrelic.agent.lambda_handler() def handler(event, context): ... Optional: You can also add custom events to your Lambda using the record_custom_event API. Here's an example: @newrelic.agent.lambda_handler() def handler(event, context): newrelic.agent.record_custom_event('CustomEvent', {'foo': 'bar'}) … Zip your lambda_function.py and newrelic/ folder together using these guidelines: The New Relic files outside the newrelic/ folder don't need to be included. If your Lambda function file name is, for example, lambda_function.py, name your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set this environment variable: NEW_RELIC_SERVERLESS_MODE_ENABLED. Set to true The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_DISTRIBUTED_TRACING_ENABLED. Set to true. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To configure logging, use the NEW_RELIC_LOG and NEW_RELIC_LOG_LEVEL environment variables in the AWS Console. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. The New Relic decorator gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, configure CloudWatch to send those logs to New Relic. Step 4. Configure CloudWatch logs to stream to New Relic Lambda In this step, you'll link your Lambda function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda that was configured in Step 2. For Node.js and Python: This step isn't necessary if you used the Serverless Framework plugin option in Step 3. This step can be done using the CLI tool or using manual procedures. Use CLI tool Run this command for every Lambda function you want to monitor: newrelic-lambda subscriptions install --function FUNCTION_NAME_#1 Or to set subscription filters for all supported functions run this command:: newrelic-lambda subscriptions install --function all Notes on this command: You should only need one newrelic-log-ingestion Lambda per AWS account and region. You can subscribe as many functions to it as you like. To see more detail about the arguments, including a region-specifying argument, see our GitHub documentation. You may receive a CloudWatch validation error. This doesn't affect data reporting. If you see data reporting in New Relic, disregard that error message. If you have our Logs and want to send all your log data to us (not just Lambda logs), see Stream all logs. Manual procedures Here are the manual procedures performed by the CLI tool: Manual process: Stream CloudWatch logs to New Relic Lambda In Step 2, you set up a newrelic-log-ingestion Lambda function. After you've instrumented your Lambda function (Step 3), the newrelic-lambda subscriptions command links that function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda. To do this manually: Open CloudWatch and select Logs in the left-hand menu, and then select the log group for the function you are monitoring. Select Actions and choose Stream to AWS Lambda. Under Lambda function, select the newrelic-log-ingestion function. Set the Log format to JSON. Set the Subscription filter pattern to ?REPORT ?NR_LAMBDA_MONITORING ?\"Task timed out\". Alternatively, if you are using the LOGGING_ENABLED environment variable stream all your logs to our Logs, leave this field blank. See notes and caveats about this procedure. Make sure the newrelic-log-ingestion Lambda function you select in the method above is in the same AWS region as your Lambda function. What's next? After you complete these steps, here's what you can do next: See data reporting in the Lambda monitoring UI. If you're having trouble finding your data, see Lambda enable troubleshooting. Use configuration settings to fine-tune your data. Our newrelic-log-ingestion function is not updated automatically. For best results and access to latest features, we recommend you occasionally update our Lambda monitoring. Optional: Stream all logs to New Relic If you have log management enabled and want to report all your logs to New Relic, follow these instructions: Go to our newrelic-log-ingestion Lambda and set the LOGGING_ENABLED environment variable to true. It isn't possible to edit existing filter patterns, so they must be removed and re-added: Set the Subscription filter pattern to \"\". Go to the Log group for each monitored Lambda, and remove the newrelic-log-ingestion subscription. Add the subscription filter back, leaving the Subscription filter pattern field blank. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 125.96347,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "sections": "Step 1. Install the newrelic-lambda-cli tool",
+ "info": "Read about how to install and enable New Relic monitoring for Amazon AWS Lambda. ",
+ "body": " and AWS account. From the command line, run: pip install newrelic-lambda-cli You may need to use pip3 in the command above if you have Python 2.7 installed. The CLI requires Python >=3.3. Step 2. Connect AWS to New Relic You must complete this step, and steps 3 and 4, to enable our Lambda monitoring"
+ },
+ "id": "5f6c67a464441f3a75eb72d3"
},
{
"image": "",
@@ -6595,7 +6789,7 @@
"nr1 nrql",
"Query using NRQL"
],
- "published_at": "2020-10-01T01:56:53Z",
+ "published_at": "2020-10-06T02:14:19Z",
"title": "New Relic One CLI common commands",
"updated_at": "2020-08-14T01:48:10Z",
"type": "developer",
@@ -6606,7 +6800,7 @@
"body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 171.31636,
+ "_score": 118.52101,
"_version": null,
"_explanation": null,
"sort": null,
@@ -6618,272 +6812,85 @@
},
"id": "5f28bd6ae7b9d267996ade94"
},
- {
- "image": "https://developer.newrelic.com/static/AaronSoto-d72d9bb5f5e6165751e67367612525f4.jpg",
- "url": "https://developer.newrelic.com/nerd-days/",
- "sections": [
- "Nerd Days is a free 1-day event focused on building more perfect software",
- "Register for Nerd Days 1.0",
- "What’s is Nerd Days exactly…",
- "Save the date & join us online",
- "Additional Nerd Days Events",
- "REGISTER FOR NERD DAYS | AMERICAS",
- "Speaker line up",
- "Aaron Soto",
- "Caitlin Halla",
- "David Shanker",
- "Jeremy Cooper",
- "Joel Worrall",
- "John Vajda",
- "Jon Thurman",
- "Justin Eveland",
- "Leon Chapman",
- "Lindsy Farina",
- "Talia Nassi",
- "Thomas Martin",
- "Tracks",
- "Observability",
- "Cloud migration",
- "Open source",
- "Devops journey",
- "Fundamentals",
- "Nerd Days AMER Agenda",
- "DevOps journey",
- "Keynote: Jemiah Sius, Lew Cirne, and Special Guest Announcements",
- "Instrumenting your service using agents",
- "Increased Maturity with Full Stack Observability",
- "Deploying an app on Kubernetes",
- "Delivering SRE as a Service",
- "Building applications on New Relic One",
- "Exploring your data using NRQL",
- "New Relic AI",
- "Going Serverless: Chipping at the monolith",
- "Logging for Modern Organizations",
- "Grafana and Prometheus with TDP",
- "Lunch with Lew",
- "Custom Instrumentation",
- "Exploring Data with NerdGraph",
- "Tool Consolidation",
- "Flex Integration - Build Your First Linux Configuration",
- "Open Source powers the New Relic One Catalog",
- "Alerts Best Practices",
- "The Art & Science of Deciphering Perceived Performance: A look at how user behavior affects your data",
- "Kubernetes Observability",
- "Measuring code pipelines",
- "New Relic CLI Wizardry/ Reducing toil with Terraform",
- "True availability using Synthetics",
- "How Observability-Driven Development accelerates DevOps transformations",
- "CFP Customer Session: Cloud fundamentals",
- "Testing in Production",
- "NerdStorageVault: ThirdParty Secrets",
- "Closing + Swag",
- "Engage with the developer community"
- ],
- "published_at": "2020-10-01T02:03:39Z",
- "title": "New Relic Developers",
- "updated_at": "2020-09-30T01:45:03Z",
- "type": "developer",
- "external_id": "0b8374051901a77e242ce296c00eeb3c760439d1",
- "document_type": "page",
- "popularity": 1,
- "body": "Nerd Days is a free 1-day event focused on building more perfect software Register for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region) What’s is Nerd Days exactly… A FREE developer focused live digital conference covering a broad range of topics at varying levels for all skill sets. Including: Live workshops Live coding and demos Customer examples Panel / Q&A sessions Presented by Relics, partners, Developer Champions, and customers Save the date & join us online Whether you’re new or a data nerd, there’s an interactive session for you. Choose the sessions you're interested in and add Nerd Days to your calendar. Date: October 13, 2020 Time: 9AM PST - 3PM PST We look forward to building with you during Nerd Days! If you have any questions about Nerd Days please emails deco@newrelic.com. Additional Nerd Days Events EMEA RegistrationNov 10, 2020 APJ RegistrationOct 22, 2020 REGISTER FOR NERD DAYS | AMERICAS Speaker line up Get hands on with sessions presented by the following Relics, partners, Developer Champions, and customers. Aaron Soto Sr. Partner Solutions Architect AWS Caitlin Halla Software Engineer New Relic David Shanker Director, Platform Engineering Kinect Consulting Jeremy Cooper Sr. TechOps Strategy Consultant New Relic Joel Worrall Director, Open Source and Developer Advocacy New Relic John Vajda Senior Product Manager New Relic Jon Thurman Senior Solutions Consultant New Relic Justin Eveland Software Engineer New Relic Leon Chapman Senior TechOps Strategy Consultant New Relic Lindsy Farina Senior Product Manager New Relic Talia Nassi Developer Advocate Split Software Thomas Martin Director, Site Reliability 27 Global Tracks Tracks will vary by region. All sessions will be recorded and distributed after the event. Observability Cloud migration Open source Devops journey Fundamentals Nerd Days AMER Agenda We’ve got a packed schedule with thought-leaders of their respective industries Fundamentals Observability Cloud migration DevOps journey Open source 9:00 AM Keynote: Jemiah Sius, Lew Cirne, and Special Guest Announcements Lew Cirne 10:00 AM Instrumenting your service using agents Increased Maturity with Full Stack Observability Deploying an app on Kubernetes Delivering SRE as a Service Building applications on New Relic One 11:00 AM Exploring your data using NRQL New Relic AI Going Serverless: Chipping at the monolith Logging for Modern Organizations Grafana and Prometheus with TDP 12:00 PM Lunch with Lew Lew Cirne and Jemiah Sius 1:00 PM Custom Instrumentation Exploring Data with NerdGraph Tool Consolidation Flex Integration - Build Your First Linux Configuration Open Source powers the New Relic One Catalog 2:00 PM Alerts Best Practices The Art & Science of Deciphering Perceived Performance: A look at how user behavior affects your data Kubernetes Observability Measuring code pipelines New Relic CLI Wizardry/ Reducing toil with Terraform 3:00 PM True availability using Synthetics How Observability-Driven Development accelerates DevOps transformations CFP Customer Session: Cloud fundamentals Testing in Production NerdStorageVault: ThirdParty Secrets 4:00 PM Closing + Swag Jemiah Sius and Team Engage with the developer community @newrelic New Relic Forum Developers Hopin logo Event powered by Hopin",
- "info": "",
- "_index": "520d1d5d14cc8a32e600034b",
- "_type": "520d1d5d14cc8a32e600034c",
- "_score": 156.72662,
- "_version": null,
- "_explanation": null,
- "sort": null,
- "highlight": {
- "title": "New Relic Developers",
- "sections": "Open Source powers the New Relic One Catalog",
- "body": " the New Relic One Catalog 2:00 PM Alerts Best Practices The Art & Science of Deciphering Perceived Performance: A look at how user behavior affects your data Kubernetes Observability Measuring code pipelines New Relic CLI Wizardry/ Reducing toil with Terraform 3:00 PM True availability using"
- },
- "id": "5f3dd5bf28ccbc2349f56e4e"
- },
{
"sections": [
- "Serve, publish, and deploy your New Relic One app",
+ "Set up your development environment",
"Before you begin",
- "Serve your app locally",
- "Add images and metadata to your apps",
- "screenshots folder",
- "documentation.md",
- "additionalInfo.md",
- "config.json",
- "Publish your app",
+ "A note on support",
"Tip",
- "Deploy your app",
- "Subscribe or unsubsribe apps",
- "Handle duplicate applications"
- ],
- "title": "Serve, publish, and deploy your New Relic One app",
- "type": "developer",
- "tags": [
- "publish apps",
- "deploy apps",
- "subscribe apps",
- "add metadata apps"
- ],
- "external_id": "63283ee8efdfa419b6a69cb8bd135d4bc2188d2c",
- "image": "https://developer.newrelic.com/static/175cc6506f7161ebf121129fa87e0789/0086b/apps_catalog.png",
- "url": "https://developer.newrelic.com/build-apps/publish-deploy/",
- "published_at": "2020-10-01T01:56:53Z",
- "updated_at": "2020-09-02T02:05:55Z",
- "document_type": "page",
- "popularity": 1,
- "info": "Start sharing and using the custom New Relic One apps you build",
- "body": "Serve, publish, and deploy your New Relic One app 30 min When you build a New Relic One app, chances are you'll want to share it with others in your organization. You might even want to share it broadly through our open source channel. But first, you probably want to try it out locally to make sure it's working properly. From the New Relic One Apps page, you can review available apps and subscribe to the ones you want for accounts you manage. The Your apps section shows launchers for New Relic apps, as well as any third-party apps that you subscribe to. The New Relic One catalog provides apps that you haven't subscribed to, some developed by New Relic engineers to provide visualizations we think you'll want, like Cloud Optimizer, which analyzes your cloud environment, or PageView Map, which uses Browser events to chart performance across geographies. Your apps in the catalog are created by third-party contributors and are submitted via opensource.newrelic.com. All are intended to help you visualize the data you need, the way you want it. Here, you learn to: Serve your app locally Add images and metadata to your app Publish it Subscribe and unsubscribe accounts you manage to the app Handle duplicate applications Before you begin This guide requires the following: A New Relic One app or Nerdpack New Relic One CLI A Nerdpack manager role for publishing, deploying, and subscribing apps. Serve your app locally You can locally serve the app you create to New Relic One to test it out. Step 1 of 1 In the parent root folder of your Nerdpack, run nr1 nerdpack:serve. Go to one.newrelic.com/?nerdpacks=local. The ?nerdpacks=local URL suffix will load any locally served Nerdpacks that are available. When you make a change to a locally served Nerdpack, New Relic One will automatically reload it. Add images and metadata to your apps Application creators can include a description of what their apps do and how they're best used when they build an app. They can also include screenshots, icons, and metadata that help to make them easy to spot amongst other applications. Some metadata is added automatically when an app is published: Related entities, listed if there are any. Origin label to indicate where the app comes from: local, custom, or public. The New Relic One CLI enables you to provide the information and images you want to include with your application. Then it's a matter of kicking off a catalog command that validates the information and saves it to the catalog. Step 1 of 3 Update the New Relic One CLI to ensure you're working with the latest version. nr1 update Copy Step 2 of 3 Add catalog metadata and screenshots. Run nr1 create and then select catalog to add a catalog folder to your New Relic One project. The folder contains the following empty files and folder. Add the information as described in the following sections for the process to succeed. screenshots folder A directory that must contain no more than 6 images and meet these criteria: 3:2 aspect ratio PNG format landscape orientation 1600 to 2400 pixels wide documentation.md A markdown file that presents usage information pulled into the Documentation tab for the application in the catalog. additionalInfo.md An optional markdown file for any additional information about using your application. config.json A JSON file that contains the following fields: tagline: A brief headline for the application. Must not exceed 30 characters. repository: The URL to the GitHub repo for the application. Must not exceed 1000 characters. details: Describes the purpose of the application and how to use it. Information must not exceed 1000. Use carriage returns for formatting. Do not include any markdown or HTML. support: An object that contains: issues: A valid URL to the GitHub repository's issues list, generally the GitHub Issues tab for the repo. email: A valid email address for the team supporting the application. community: URL to a support thread, forum, or website for troubleshooting and usage support. whatsNew: A bulleted list of changes in this version. Must not exceed 500 characters. Use carriage returns for formatting. Do not include markdown or HTML. Example: { \"tagline\": \"Map your workloads & entities\", \"repository\": \"https://github.com/newrelic/nr1-workload-geoops.git\", \"details\": \"Describe, consume, and manage Workloads and Entities in a geographic \\n model that supports location-specific KPI's, custom metadata, drill-down navigation into Entities \\n and Workloads, real-time configuration, and configuration via automation using the newrelic-cli.\", \"support\": { \"issues\": { \"url\": \"https://github.com/newrelic/nr1-workload-geoops/issues\" }, \"email\": { \"address\": \"opensource+nr1-workload-geoops@newrelic.com\" }, \"community\": { \"url\": \"https://discuss.newrelic.com/t/workload-geoops-nerdpack/99478\" } }, \"whatsNew\": \"\\n-Feat: Geographic mapping of Workloads and Entities\\n -Feat: Programmatic alerting rollup of underlying Entities\\n -Feat: Custom KPI measurement per location\\n -Feat: Empty-state edit workflow\\n -Feat: JSON file upload format\\n-Feat: Published (in open source docs) guide to automating configuration using the newrelic-cli\" } Copy Step 3 of 3 Save the metadata and screenshots to the catalog. This validates the information you added to the catalog directory against the criteria described in the previous step, and saves it to the catalog. nr1 catalog:submit Copy Publish your app Publishing places your Nerdpack in New Relic One. To publish or deploy, you must be a Nerdpack manager. New Relic One requires that only one version (following semantic versioning) of a Nerdpack can be published at a time. Tip If you know what channel you want to deploy to (as described in the Deploy your app section that follows), you can run nr1 nerdpack:publish --channel=STABLE or nr1 nerdpack:publish --channel=BETA. Step 1 of 2 Update the version attribute in the app's package.json file. This follows semantic versioning, and must be updated before you can successfully publish. Step 2 of 2 To publish your Nerdpack, run nr1 nerdpack:publish. Deploy your app Deploying is applying a Nerdpack version to a specific channel (for example, BETA, or STABLE). A channel can only have one Nerdpack version deployed to it at one time. If a channel has an existing Nerdpack associated with it, deploying a new Nerdpack version to that channel will undeploy the previous one. Channels are meant to be an easier way to control application version access than having to be concerned with specific version numbers. Step 1 of 1 To deploy an application, run nr1 nerdpack:deploy. Subscribe or unsubsribe apps Whether you want to subscribe accounts to an app you've created or to apps already available in the catalog, the process is the same. Note that if you subscribe to an app in the catalog, you'll automatically get any updates that are added to the app. To learn about the appropriate permissions for subscribing, see Permissions for managing applications. Step 1 of 2 Subscribe accounts to an application. Select an application you want to add to your New Relic account. Click Add this app. Note that this button says Manage access if the app has already been subscribed to an account you manage. On the Account access page listing the accounts you can subscribe to an application: Select the accounts you want to subscribe the app to. Choose the channel you want to subscribe the app to, Stable or Dev. This can only be Stable for the public apps created by New Relic. Click the update button. Now you and members of the accounts you have subscribed to the app can launch it from New Relic One. Step 2 of 2 Unsubsribe from an application. On the Apps page, open the app you want to unsubscribe. Click Manage access. Clear the check box for any accounts you want to unsubscribe, and then click the update button. The application is no longer listed in the Your apps section of the Apps page, and you have unsubscribed. Handle duplicate applications You might end up with duplicate applications on your New Relic One Apps page. This can happen when you subscribe to the same app using both the CLI and the catalog. Or if you clone an app, modify, and deploy it, but keep the original name. You can manage duplicates with the catalog. Good to know before you start: You need a user role with the ability to manage Nerdpacks for accounts that you want to unsubscribe and undeploy from applications. You can't remove the public apps. When a duplicate application has no accounts subscribed to it, you undeploy it. For applications that have accounts subscribed to them, you unscubscribe and undeploy. The unsubscribe and undeploy process happens in a batch. To remove an account from an application, but ensure that other accounts continue to be subscribed, select the checkbox, Resubscribe these accounts to the new application. Step 1 of 1 Remove duplicates. In the New Relic One catalog, click a public application that has one or more duplicates. (You can only manage duplicates from the public version of the application.) On the application information page, select Clean up applications. Review the information about the application that's open, as well as any duplicates. Click Manage app for duplicates you want to remove. If needed, select Resubscribe these accounts to the new application. Click Unsubscribe and undeploy, and agree to the terms and conditions.",
- "_index": "520d1d5d14cc8a32e600034b",
- "_type": "520d1d5d14cc8a32e600034c",
- "_score": 143.10922,
- "_version": null,
- "_explanation": null,
- "sort": null,
- "highlight": {
- "title": "Serve, publish, and deploy your New Relic One app",
- "sections": "Serve, publish, and deploy your New Relic One app",
- "info": "Start sharing and using the custom New Relic One apps you build",
- "body": " a matter of kicking off a catalog command that validates the information and saves it to the catalog. Step 1 of 3 Update the New Relic One CLI to ensure you're working with the latest version. nr1 update Copy Step 2 of 3 Add catalog metadata and screenshots. Run nr1 create and then select catalog to add"
- },
- "id": "5efa999de7b9d283e67bab8f"
- }
- ],
- "/explore-docs/nr1-cli": [
- {
- "image": "",
- "url": "https://developer.newrelic.com/explore-docs/nr1-nerdpack/",
- "sections": [
- "New Relic One CLI Nerdpack commands",
- "Command details",
- "nr1 nerdpack:build",
- "Builds a Nerdpack",
- "Usage",
- "Options",
- "nr1 nerdpack:clone",
- "Clone an existing Nerdpack",
- "nr1 nerdpack:serve",
- "Serve your Nerdpack locally",
- "nr1 nerdpack:uuid",
- "Get your Nerdpack's UUID",
- "nr1 nerdpack:publish",
- "Publish your Nerdpack",
- "nr1 nerdpack:deploy",
- "Deploy your Nerdpack to a channel",
- "nr1 nerdpack:undeploy",
- "Undeploy your Nerdpack",
- "nr1 nerdpack:clean",
- "Removes all built artifacts",
- "nr1 nerdpack:validate",
- "Validates artifacts inside your Nerdpack",
- "nr1 nerdpack:Info",
- "Shows the state of your Nerdpack in the New Relic's registry"
- ],
- "published_at": "2020-10-01T01:56:53Z",
- "title": "New Relic One CLI Nerdpack commands",
- "updated_at": "2020-09-17T01:49:55Z",
- "type": "developer",
- "external_id": "7c1050a6a8624664b90c15111f7c72e96b2fbe17",
- "document_type": "page",
- "popularity": 1,
- "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.",
- "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:build Assembles your Nerdpack into bundles nr1 nerdpack:clone Clones a Nerdpack from a git repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. nr1 nerdpack:clean Cleans your development folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. Command details nr1 nerdpack:build Builds a Nerdpack Runs a webpack process to assemble your Nerdpack into javascript and CSS bundles. As many other CLI commands, it should be run at the package.json level of your Nerdpack. Usage $ nr1 nerdpack:build OPTION Options --extra-metadata-path=extra-metadata-path Specify a json file path with extra metadata. [default: extra-metadata.json] --prerelease=prerelease If specififed, the value will be appended to the current version of generated files. ie: --prerelease=abc. Then the version will be \"1.2.3-abc\". --profile=profile The authencation profile you want to use. --verbose Adds extra information to the output. nr1 nerdpack:clone Clone an existing Nerdpack Duplicates an existing Nerdpack onto your local computer. You can clone an open source Nerdpack from our Open Source GitHub repositories. After choosing a git repository, this command performs the following actions so that you can start using the Nerdpack: Clones the repository. Sets the repository as remote upstream. Installs all of its dependencies (using npm). Generates a new UUID using your profile, and commits it. Usage $ nr1 nerdpack:clone OPTION Options -r, --repo=REPO Repository location (either an HTTPS or SSH path). (Required) -p, --path=PATH Determines the directory to clone to (defaults to the repository name). -f, --force Replaces destination folder if it exists. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 nerdpack:serve Serve your Nerdpack locally Launches a server with your Nerdpack locally on the New Relic One platform, where it can be tested live. To learn more about working with apps locally, see our guide on how to serve, publish, and deploy documentation. Usage $ nr1 nerdpack:serve Options --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 nerdpack:uuid Get your Nerdpack's UUID Prints the UUID (Universal Unique ID) of your Nerdpack, by default. The UUID determines what data the Nerdpack can access and who can subscribe to the Nerdpack. To deploy a Nerdpack you didn't make, you'll have to assign it a new UUID by using the -g or --generate option. For more details, see our GitHub workshop on GitHub. Usage $ nr1 nerdpack:uuid Options --profile=PROFILE The authentication profile you want to use. -f, --force If present, it will override the existing UUID without asking. -g, --generate Generates a new UUID if not available. --verbose Adds extra information to the output. nr1 nerdpack:publish Publish your Nerdpack Publishes your Nerdpack to New Relic. Please note: If no additional parameters are passed in, this command will automatically deploy the Nerdpack onto the DEV channel. If you want to specify your own list of deploy channels, add the --channel option. For example, $ nr1 nerdpack:publish --channel BETA --channel STABLE. If you want to disable this behavior, add -D or --skip-deploy to the command. Then, you can use nr1 nerdpack:deploy to perform a deploy manually. For more on publishing and deploying, see Deploy to New Relic One. Usage $ nr1 nerdpack:publish Options -B, --skip-build Skips the previous build process. -D, --skip-deploy Skips the following deploy process. -c, --channel=DEV/BETA/STABLE Specifies the channel to deploys to. [default: STABLE] -f, --force Forces the publish, overriding any existing version in the registry. --dry-run Undergoes publishing process without actually publishing anything. --extra-metadata-path=extra-metadata-path Specifies a json file .path with extra metadata. [default: extra-metadata.json] --prerelease=STRING The value you enter will be appended to the current version of generated files. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 nerdpack:deploy Deploy your Nerdpack to a channel Deploys a Nerdpack version to a specific channel (DEV, BETA, or STABLE). A channel can only have one Nerdpack version deployed to it at one time. If a channel has an existing Nerdpack associated with it, deploying a new Nerdpack version to that channel will undeploy the previous one. For more on publishing and deploying, see Deploy to New Relic One. Usage $ nr1 nerdpack:deploy OPTION Options -c, --channel=DEV/BETA/STABLE Specifies the channel to deploy to. (required) -i, --nerdpack-id=NERDPACK_ID Specifies the Nerdpack to deploy. By default, the command will use the one in package.json. --from-version=VERSION Specifies which version to deploy. By default, the command will use the one in package.json. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 nerdpack:undeploy Undeploy your Nerdpack Undeploys a Nerdpack version from a specific channel (for example, DEV, BETA, or STABLE). Usage $ nr1 nerdpack:undeploy OPTION Options -c, --channel=DEV/BETA/STABLE Specifies the channel to undeploy from. (required) -i, --nerdpack-id=NERDPACK_ID Specifies the Nerdpack to deploy. By default, the command will use the one in package.json. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 nerdpack:clean Removes all built artifacts Cleans and removes the content and the developtment folders (dist/, tmp/). Usage $ nr1 nerdpack:clean OPTION Options --profile=profile The authentication profile you want to use --verbose Adds extra information to the output. nr1 nerdpack:validate Validates artifacts inside your Nerdpack Validates artifacts inside your Nerdpack. Usage $ nr1 nerdpack:validate OPTION Options -l, --force-local The authentication profile you want to use. -r, --force-remote Force download of new schema files. --profile=profile The authentication profile you want to uset. --verbose Adds extra information to the output. nr1 nerdpack:Info Shows the state of your Nerdpack in the New Relic's registry Shows the state of your Nerdpack in the New Relic's registry. The default amount of versions shown is 10 but all versions can be shown if the --all (or -a) flag is used Usage $ nr1 nerdpack:info OPTION Options -a, --all Show all versions. -i, --nerdpack-id=nerdpack-id Get info from the specified Nerdpack instead of local one. --profile=profile The authentication profile you want to use. --verbose Adds extra information to the output.",
- "_index": "520d1d5d14cc8a32e600034b",
- "_type": "520d1d5d14cc8a32e600034c",
- "_score": 118.2695,
- "_version": null,
- "_explanation": null,
- "sort": null,
- "highlight": {
- "title": "New Relic One CLI Nerdpack commands",
- "sections": "New Relic One CLI Nerdpack commands",
- "info": "An overview of the CLI commands you can use to set up your New Relic One Nerdpacks.",
- "body": "New Relic One CLI Nerdpack commands To set up your Nerdpacks, use the commands below. You can click any command to see its usage options and additional details about the command. Command Description nr1 nerdpack:build Assembles your Nerdpack into bundles nr1 nerdpack:clone Clones a Nerdpack from"
- },
- "id": "5f28bd6a64441f9817b11a38"
- },
- {
- "sections": [
- "Intro to NerdStorage",
- "Use NerdStorage in your apps",
- "Data model",
- "Limits",
- "Data access",
- "Permissions for working with NerdStorage"
+ "Prepare to build or modify apps",
+ "Start building",
+ "Contribute to developer.newrelic.com"
],
- "title": "Intro to NerdStorage",
+ "title": "Set up your development environment",
"type": "developer",
"tags": [
- "nerdstorage",
- "nerdstorage components",
- "new relic one apps",
- "data access"
+ "developer account",
+ "API key",
+ "New Relic One CLI"
],
- "external_id": "709e06c25376d98b2191ca369b4d139e5084bd62",
+ "external_id": "c45638a9cd548d1ffffc9f1c7708f115a92ae04a",
"image": "",
- "url": "https://developer.newrelic.com/explore-docs/nerdstorage/",
- "published_at": "2020-10-01T01:55:37Z",
- "updated_at": "2020-09-08T01:50:19Z",
+ "url": "https://developer.newrelic.com/build-apps/set-up-dev-env/",
+ "published_at": "2020-10-06T02:08:36Z",
+ "updated_at": "2020-08-26T01:47:20Z",
"document_type": "page",
"popularity": 1,
- "info": "Intro to NerdStorage on New Relic One",
- "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,500 documents, plus storage type. Each document can have a maximum length of 1024 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.",
+ "info": "Prepare to build apps and contribute to this site",
+ "body": "Set up your development environment 20 min If you've decided to build a custom app or modify one of our open source apps, you need a few essential tools: The New Relic One command line interface (CLI) An API key, which you get when you download the CLI Depending on what you want to do with your app, you might have some additional setup and configuration. This guide covers: Downloading the New Relic One CLI to build or modify apps Contribute content to this website Before you begin You must have: A github account account - While not strictly necessary for building apps, a GitHub account enables you to download and customize our open source apps, and contribute an open source project. A New Relic developer account - if you don't already have one, you can get a free trial account for developing New Relic applications. npm - If you've installed Node.js, then you already have npm, which is used to share, reuse, and update JavaScript code, and is necessary for working with React components that are the framework for New Relic apps and this website. A note on support Building a New Relic One application is the same as building any JavaScript/React application. We offer support to help with our building tools (our CLI and SDK library). However, we don't offer support for basic JavaScript or React coding questions or issues. For common questions and answers about building, see the Explorers Hub page on building on New Relic One. Tip Use the New Relic One VSCode extension to build your apps. Prepare to build or modify apps Step 1 of 1 Download the CLI and API key. On the Build New Relic One applications page, complete the Quick start steps. These six Quick start steps get you an API key for use with developing apps, and the New Relic One CLI, for building and deploying apps. At the end of the Quick start, you have a project consisting of the following: A Nerdpack - The package containing all the files required by your application. It contains two types of files that you customize to build your app: Nerdlets, and the launcher. One or more Nerdlet files - A specific UI view or window. A Nerdlet is a React JavaScript package that includes an index.js file, a stylesheet, and a JSON-format config file. It can contain any JS functionality (charts, interactive fields, tooltips, etc.). A launcher file: This is the basis for the launcher, which is used to open your application from New Relic One after you publish your app. Start building Step 1 of 1 If you're ready to code, cd to your Nerdpack and get started. If you want to learn more about building applications, try these step-by-step guides: Build a \"Hello, World!\" application shows how to create a little application, publish it to New Relic One, and share it with others by subscribing accounts to it. Map pageviews by region takes you through the steps to create one of our popular open source apps. You learn to add a custom query to an app and view it in a table, then add that data to a map. Contribute to developer.newrelic.com This site is open source, and we want your input. Create a pull request if you see a mistake you know how to fix. Drop us a GitHub issue if you see some content gaps you want us to work on. Or write up a whole new guide if you have one you'd like to share. Read on to learn how. Step 1 of 3 Fork the developer-website GithHub repo. Forking the repo enables you to work on your own copy of the developer.newrelic.com files, and build the site locally. It also enables us to more easily manage incomimg pull requests. On the developer-website page in GitHub, select the Fork button on the top right of the page, choose the account you want to fork to, and wait a few seconds while the fork is created. Sync regularly to keep your fork up to date with changes and additions to the main branch upstream. Step 2 of 3 Make a feature or documentation request. On any page, select the GitHub button at the top of the page, and then select the kind of change you want, and fill out the GitHub form. Step 3 of 3 Contribute a new guide. Check out our contributors guidelines, which will walk you through the process.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 103.58642,
+ "_score": 106.91165,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "sections": "Use NerdStorage in your apps",
- "info": "Intro to NerdStorage on New Relic One",
- "tags": "new relic one apps",
- "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users"
+ "tags": "New Relic One CLI",
+ "body": "Set up your development environment 20 min If you've decided to build a custom app or modify one of our open source apps, you need a few essential tools: The New Relic One command line interface (CLI) An API key, which you get when you download the CLI Depending on what you want to do with your app"
},
- "id": "5efa989ee7b9d2048e7bab92"
- },
+ "id": "5efa9973e7b9d242237bab39"
+ }
+ ],
+ "/build-apps/map-pageviews-by-region": [
{
+ "image": "https://developer.newrelic.com/static/dev-champion-badge-0d8ad9c2e9bbfb32349ac4939de1151c.png",
+ "url": "https://developer.newrelic.com/",
"sections": [
- "Intro to New Relic One API components",
- "Components of the SDK",
- "UI components",
- "Chart components",
- "Query and storage components",
- "Platform APIs"
+ "Mark your calendar for Nerd Days 1.0",
+ "Get coding",
+ "Create custom events",
+ "Add tags to apps",
+ "Build a Hello, World! app",
+ "Get inspired",
+ "Add a table to your app",
+ "Collect data - any source",
+ "Automate common tasks",
+ "Create a custom map view",
+ "Add a time picker to your app",
+ "Add custom attributes",
+ "New Relic developer champions",
+ "New Relic Podcasts"
],
- "title": "Intro to New Relic One API components",
+ "published_at": "2020-10-06T01:57:17Z",
+ "title": "New Relic Developers",
+ "updated_at": "2020-10-06T01:49:17Z",
"type": "developer",
- "tags": [
- "SDK components",
- "New Relic One apps",
- "UI components",
- "chart components",
- "query and storage components",
- "Platform APIs"
- ],
- "external_id": "3620920c26bcd66c59c810dccb1200931b23b8c2",
- "image": "",
- "url": "https://developer.newrelic.com/explore-docs/intro-to-sdk/",
- "published_at": "2020-10-01T01:55:36Z",
- "updated_at": "2020-08-14T01:47:12Z",
+ "external_id": "214583cf664ff2645436a1810be3da7a5ab76fab",
"document_type": "page",
"popularity": 1,
- "info": "Intro to New Relic One API components",
- "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data. Components of the SDK SDK components are located in the Node module package named nr1, which you get when you install the NR1 CLI. The nr1 components can be divided into several categories: UI components Chart components Query and storage components Platform APIs UI components The UI components category of the SDK contains React UI components, including: Text components: These components provide basic font and heading elements. These include HeadingText and BlockText. Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include: Grid and GridItem: for organizing more complex, larger scale page content in rows and columns Stack and StackItem: for organizing simpler, smaller scale page content (in column or row) Tabs and TabsItem: group various related pieces of content into separate hideable sections List and ListItem: for providing a basic skeleton of virtualized lists Card, CardHeader and CardBody : used to group similar concepts and tasks together Form components: These components provide the basic building blocks to interact with the UI. These include Button, TextField, Dropdown and DropdownItem, Checkbox, RadioGroup, Radio, and Checkbox. Feedback components: These components are used to provide feedback to users about actions they have taken. These include: Spinnerand Toast. Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include: Modal and Tooltip. Components suffixed with Item can only operate as direct children of that name without the suffix. For example: GridItem should only be found as a child of Grid. Chart components The Charts category of the SDK contains components representing different types of charts. The ChartGroup component helps a group of related charts share data and be aligned. Some chart components can perform NRQL queries on their own; some accept a customized set of data. Query and storage components The Query components category contains components for fetching and storing New Relic data. The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations. We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage. Platform APIs The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories: PlatformStateContext: provides read access to the platform URL state variables. Example: timeRange in the time picker. navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet. NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an entityGuid in the entity explorer. nerdlet: an object that provides write access to the Nerdlet URL state.",
+ "body": "Mark your calendar for Nerd Days 1.0 Nerd Days is a FREE engineering conference that kicks off October 13 (Dates vary by region). Focused on building more perfect software, our goal is to spend less time looking at slides that tell you what software can do and more time on getting your hands on the software to solve problems efficiently. 7 Days : 14 Hours : 50 Minutes : 46 Seconds Register Get coding Create a free account 5 min Create custom events Define, visualize, and get alerts on the data you want using custom events Start the guide 7 min Add tags to apps Add tags to applications you instrument for easier filtering and organization Start the guide 12 min Build a Hello, World! app Build a Hello, World! app and publish it to your local New Relic One Catalog Start the guide Get inspired 30 min Add a table to your app Add a table to your New Relic One app 15 min Collect data - any source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add a time picker to your app Add a time picker to a sample application Add custom attributes Use custom attributes for deeper analysis Show 20 more guides Looking for more inspiration? Check out the open source projects built by the New Relic community. New Relic developer champions New Relic Champions are solving big problems using New Relic as their linchpin and are recognized as experts and leaders in the New Relic technical community. Nominate a developer champion Learn more about developer champions New Relic Podcasts We like to talk, especially to developers about developer things. Join us for conversations on open source, observability, software design and industry news. Listen",
+ "info": "",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 68.79929,
+ "_score": 160.29231,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "Intro to New Relic One API components",
- "sections": "Intro to New Relic One API components",
- "info": "Intro to New Relic One API components",
- "tags": "New Relic One apps",
- "body": "Intro to New Relic One API components To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations"
+ "sections": "Create a custom map view",
+ "body": " source APIs, agents, OS emitters - get any data 20 min Automate common tasks Use the New Relic CLI to tag apps and create deployment markers 30 min Create a custom map view Build an app to show page view data on a map 20 min Add a time picker to your app Add a time picker to a sample application Add"
},
- "id": "5efa989e28ccbc4071307de5"
+ "id": "5d6fe49a64441f8d6100a50f"
},
{
"sections": [
@@ -6905,7 +6912,7 @@
"external_id": "c45638a9cd548d1ffffc9f1c7708f115a92ae04a",
"image": "",
"url": "https://developer.newrelic.com/build-apps/set-up-dev-env/",
- "published_at": "2020-10-01T01:54:33Z",
+ "published_at": "2020-10-06T02:08:36Z",
"updated_at": "2020-08-26T01:47:20Z",
"document_type": "page",
"popularity": 1,
@@ -6913,64 +6920,66 @@
"body": "Set up your development environment 20 min If you've decided to build a custom app or modify one of our open source apps, you need a few essential tools: The New Relic One command line interface (CLI) An API key, which you get when you download the CLI Depending on what you want to do with your app, you might have some additional setup and configuration. This guide covers: Downloading the New Relic One CLI to build or modify apps Contribute content to this website Before you begin You must have: A github account account - While not strictly necessary for building apps, a GitHub account enables you to download and customize our open source apps, and contribute an open source project. A New Relic developer account - if you don't already have one, you can get a free trial account for developing New Relic applications. npm - If you've installed Node.js, then you already have npm, which is used to share, reuse, and update JavaScript code, and is necessary for working with React components that are the framework for New Relic apps and this website. A note on support Building a New Relic One application is the same as building any JavaScript/React application. We offer support to help with our building tools (our CLI and SDK library). However, we don't offer support for basic JavaScript or React coding questions or issues. For common questions and answers about building, see the Explorers Hub page on building on New Relic One. Tip Use the New Relic One VSCode extension to build your apps. Prepare to build or modify apps Step 1 of 1 Download the CLI and API key. On the Build New Relic One applications page, complete the Quick start steps. These six Quick start steps get you an API key for use with developing apps, and the New Relic One CLI, for building and deploying apps. At the end of the Quick start, you have a project consisting of the following: A Nerdpack - The package containing all the files required by your application. It contains two types of files that you customize to build your app: Nerdlets, and the launcher. One or more Nerdlet files - A specific UI view or window. A Nerdlet is a React JavaScript package that includes an index.js file, a stylesheet, and a JSON-format config file. It can contain any JS functionality (charts, interactive fields, tooltips, etc.). A launcher file: This is the basis for the launcher, which is used to open your application from New Relic One after you publish your app. Start building Step 1 of 1 If you're ready to code, cd to your Nerdpack and get started. If you want to learn more about building applications, try these step-by-step guides: Build a \"Hello, World!\" application shows how to create a little application, publish it to New Relic One, and share it with others by subscribing accounts to it. Map pageviews by region takes you through the steps to create one of our popular open source apps. You learn to add a custom query to an app and view it in a table, then add that data to a map. Contribute to developer.newrelic.com This site is open source, and we want your input. Create a pull request if you see a mistake you know how to fix. Drop us a GitHub issue if you see some content gaps you want us to work on. Or write up a whole new guide if you have one you'd like to share. Read on to learn how. Step 1 of 3 Fork the developer-website GithHub repo. Forking the repo enables you to work on your own copy of the developer.newrelic.com files, and build the site locally. It also enables us to more easily manage incomimg pull requests. On the developer-website page in GitHub, select the Fork button on the top right of the page, choose the account you want to fork to, and wait a few seconds while the fork is created. Sync regularly to keep your fork up to date with changes and additions to the main branch upstream. Step 2 of 3 Make a feature or documentation request. On any page, select the GitHub button at the top of the page, and then select the kind of change you want, and fill out the GitHub form. Step 3 of 3 Contribute a new guide. Check out our contributors guidelines, which will walk you through the process.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 52.317112,
+ "_score": 109.814575,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
"sections": "Prepare to build or modify apps",
"info": "Prepare to build apps and contribute to this site",
- "tags": "New Relic One CLI",
- "body": "Set up your development environment 20 min If you've decided to build a custom app or modify one of our open source apps, you need a few essential tools: The New Relic One command line interface (CLI) An API key, which you get when you download the CLI Depending on what you want to do with your app"
+ "body": ", publish it to New Relic One, and share it with others by subscribing accounts to it. Map pageviews by region takes you through the steps to create one of our popular open source apps. You learn to add a custom query to an app and view it in a table, then add that data to a map. Contribute"
},
"id": "5efa9973e7b9d242237bab39"
},
{
+ "category_2": "Additional standard features",
+ "nodeid": 1921,
"sections": [
- "Nerdpack file structure",
- "Generate Nerdpack components",
- "Nerdlet file structure",
- "index.js",
- "nr1.json",
- "styles.scss",
- "icon.png",
- "Launcher file structure"
- ],
- "title": "Nerdpack file structure",
- "type": "developer",
- "tags": [
- "New Relic One CLI",
- "nerdpack",
- "file structure",
- "nerdlets",
- "launchers"
+ "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"
],
- "external_id": "c97bcbb0a2b3d32ac93b5b379a1933e7b4e00161",
- "image": "",
- "url": "https://developer.newrelic.com/explore-docs/nerdpack-file-structure/",
- "published_at": "2020-10-01T01:55:36Z",
- "updated_at": "2020-08-14T01:49:25Z",
+ "title": "Browser Geography: Webpage performance by location",
+ "category_0": "Browser monitoring",
+ "type": "docs",
+ "category_1": "Browser monitoring",
+ "external_id": "ccbfe8376f2aee5d35b31dbcee84ff1cbff5b094",
+ "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-10-03T23:25:25Z",
+ "updated_at": "2020-08-15T09:25:45Z",
+ "breadcrumb": "Contents / Browser monitoring / Browser monitoring / Additional standard features",
"document_type": "page",
"popularity": 1,
- "info": "An overview of the Nerdpack File Structure",
- "body": "Nerdpack file structure A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. Here we explain: The file structure for a Nerdpack, a Nerdlet, and a launcher How to link a launcher file to a Nerdlet How to link your application with a monitored entity For basic component definitions, see our component reference. Generate Nerdpack components There are two ways to generate a Nerdpack template: Generate a Nerdpack: Use the New Relic One CLI command nr1 create and select Nerdpack to create a Nerdpack template that includes a Nerdlet and a launcher. Generate Nerdlet or launcher individually: Use the New Relic One CLI command nr1 create and choose either Nerdlet or launcher. This can be useful when adding Nerdlets to an existing Nerdpack. For documentation on generating and connecting Nerdpack components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │ └── my-nerdlet-launcher │ ├── icon.png │ └── nr1.json ├── nerdlets │ └── my-nerdlet-nerdlet │ ├── index.js │ ├── nr1.json │ └── styles.scss ├── node_modules │ ├── js-tokens │ ├── loose-envify │ ├── object-assign │ ├── prop-types │ ├── react │ ├── react-dom │ ├── react-is │ └── scheduler ├── nr1.json ├── package-lock.json └── package.json Copy Nerdlet file structure A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files, index.js, nr1.json, and styles.scss. Here is what the default files look like after being generated using the nr1 create command: index.js The JavaScript code of the Nerdlet. import React from 'react'; export default class MyAwesomeNerdpack extends React.Component { render() { return Hello, my-awesome-nerdpack Nerdlet!
; } } Copy nr1.json The Nerdlet configuration file. { \"schemaType\": \"NERDLET\", \"id\": \"my-awesome-nerdpack-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\" } Copy Besides using the launcher as the access point for your application, you can also associate the application with a monitored entity to get it to appear in the entity explorer. To do this, add two additional fields to the config file of the first-launched Nerdlet: entities and actionCategory. In the following example, the Nerdlet has been associated with all Browser-monitored applications and will appear under the Monitor UI category : { \"schemaType\": \"NERDLET\", \"id\": \"my-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"Custom Data\", \"entities\": [{ \"domain\": \"BROWSER\", \"type\": \"APPLICATION\" }], \"actionCategory\": \"monitor\" } Copy To see this application in the UI, you would go to the entity explorer, select Browser applications, and select a monitored application. styles.scss An empty SCSS file for styling your application. icon.png The launcher icon that appears on the Apps page in New Relic One when an application is deployed. Launcher file structure Launchers have their own file structure. Note that: A launcher is not required; as an alternative to using a launcher, you can associate your application with a monitored entity. An application can have more than one launcher, which might be desired for an application with multiple Nerdlets. After generating a launcher using the nr1 create command, its folder contains two files: nr1.json The configuration file. { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy To connect a launcher to a Nerdlet, the rootNerdletId must match the id in the launched Nerdlet's nr1.json config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet. icon.png The icon displayed on the launcher for the app on the Apps page.",
+ "info": "Browser's Geography feature shows color-coded Apdex scores and page load performance for your end users' experience around the world.",
+ "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.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 48.02943,
+ "_score": 89.145615,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "Nerdpack file structure",
- "sections": "Nerdpack file structure",
- "info": "An overview of the Nerdpack File Structure",
- "tags": "New Relic One CLI",
- "body": " components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │ └── my-nerdlet-launcher │ ├── icon.png"
+ "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": "5efa989e196a671300766404"
- }
- ],
- "/explore-docs/intro-to-sdk": [
+ "id": "561c8bbc827a6617ad000172"
+ },
{
"sections": [
"Intro to NerdStorage",
@@ -6991,7 +7000,7 @@
"external_id": "709e06c25376d98b2191ca369b4d139e5084bd62",
"image": "",
"url": "https://developer.newrelic.com/explore-docs/nerdstorage/",
- "published_at": "2020-10-01T01:55:37Z",
+ "published_at": "2020-10-06T02:13:00Z",
"updated_at": "2020-09-08T01:50:19Z",
"document_type": "page",
"popularity": 1,
@@ -6999,198 +7008,68 @@
"body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users's configuration settings and preferences (like favorites), or any other small data sets. This storage is unique per Nerdpack, and can't be shared with any other Nerdpack. NerdStorage can be classified into three categories: User storage: Data that is attached to a particular user. If you’re authenticated as the user the data is attached to, you can read it and write it. Account storage: Data that is attached to a particular account. If you’re authenticated and can access the account, you can read and write to account scoped NerdStorage. Visibility of account data is also determined by master/subaccount rules: If a user has access to the master account, then they also have access to data in all subaccounts. Entity storage: Data that is attached to a particular entity. If you can see the corresponding entity, you can read and write data on that entity. Data model You can imagine NerdStorage as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{\"lastNumber\": 42, \"another\": [1]}', 'document-2-of-collection-1': '\"userToken\"', // ... }, 'another-collection': { 'fruits': '[\"pear\", \"apple\"]', // ... }, // ... }, } Copy Each NerdStorage level has different properties and purpose: Collections: From a Nerdpack, you can create multiple collections by naming each of them. Inside a collection you can put one or more documents. Think of a collection as key-value storage, where each document is a key-value pair. Documents: A document is formed by an identifier (documentId) and a set of data associated with it. Data associated with a document: NerdStorage accepts any sort of data associated to a documentId. Query and mutation components that are provided work by serializing and deserializing JSON. Limits A Nerdpack can hold up to 1,000 collections and 10,000 documents, plus storage type. A collection can hold up to 1,500 documents, plus storage type. Each document can have a maximum length of 1024 KiB when serialized. Data access To access NerdStorage, you can run NerdGraph queries, or use the provided storage queries. Depending on which storage you want to access, you can use a different set of SDK components: User access: UserStorageQuery and UserStorageMutation Account access: AccountStorageQuery and AccountStorageMutation Entity access: EntityStorageQuery and EntityStorageMutation Each of these components can operate declaratively (for example, as part of your React rendering methods) or imperatively (by using the static methods for query and mutation). For more information on this, see Data querying and mutations. Permissions for working with NerdStorage In order to persist changes on NerdStorage, such as creating, updating, and deleting account and entity storage, you must have a user role with permission to persist changes.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 694.40894,
+ "_score": 89.07765,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
"sections": "Use NerdStorage in your apps",
- "info": "Intro to NerdStorage on New Relic One",
- "tags": "new relic one apps",
- "body": "Intro to NerdStorage 30 min To help you build a New Relic One application, we provide you with the New Relic One SDK. On this page, you’ll learn how to use NerdStorage SDK components. Use NerdStorage in your apps NerdStorage is used to store and retrieve simple sets of data, including users"
+ "tags": "new relic one apps",
+ "body": " as a nested key-value map. Data is inside documents, which are nested inside collections: { 'YourNerdpackUuid': { 'collection-1': { 'document-1-of-collection-1': '{"lastNumber": 42, "another": [1]}', 'document-2-of-collection-1': '"userToken"', // ... }, 'another-collection': { 'fruits': '["pear", "apple"
},
"id": "5efa989ee7b9d2048e7bab92"
},
{
- "category_2": "Optimize your cloud native environment",
- "nodeid": 32786,
- "sections": [
- "New Relic solutions",
- "Measure DevOps success",
- "Cloud adoption",
- "Optimize your cloud native environment",
- "Migrate to microservices",
- "1. Deploy instrumentation on all application tiers and components",
- "2. Use key metrics to identify components that you can migrate to microservices",
- "3. Use deployment markers to establish app performance baselines",
- "4. Implement the new microservice-based architecture, and measure the success of your application development processes",
- "5. Create a dashboard to monitor KPIs",
- "6. Create a new baseline to use for comparisons",
- "For more help"
- ],
- "title": "Migrate to microservices ",
- "category_0": "New Relic solutions",
- "type": "docs",
- "category_1": "New Relic solutions",
- "external_id": "b8b8cd8f4c66a7b2d0af83e118b5c43bccfbd4a4",
- "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new_processes.png",
- "url": "https://docs.newrelic.com/docs/new-relic-solutions/new-relic-solutions/optimize-your-cloud-native-environment/migrate-microservices",
- "published_at": "2020-09-30T16:52:11Z",
- "updated_at": "2020-09-27T20:33:59Z",
- "breadcrumb": "Contents / New Relic solutions / New Relic solutions / Optimize your cloud native environment",
- "document_type": "page",
- "popularity": 1,
- "info": "Use microservices to optimize applications. With microservices, app developers can resolve issues faster and deliver an enhanced end-user experience.",
- "body": "As IT departments seek to optimize their cloud applications, they are decomposing application monoliths into microservices. A microservice architecture is an approach that delivers a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms. Following a service-oriented architecture (SOA) model, each service should offer public API interfaces to any other service in the environment. Fragmenting applications into their most basic services enables the continuous delivery/deployment of large, complex applications by removing barriers and silos that previously lengthened the application release cycle. It also enables an organization to evolve its technology stack for modern cloud environments and to operate at internet-scale. With microservices, app developers can build, manage, scale, and reuse services independently, resolve issues faster, increase the rate of deployments, and ultimately deliver an enhanced end-user experience. This quest to use microservices to optimize applications is an iterative process. We recommend the following six steps, using the New Relic platform, to ensure an effective migration path to microservices. 1. Deploy instrumentation on all application tiers and components In order to determine which components of an application can be broken into microservices, you need to deploy instrumentation on all tiers and components of the target application. This will allow you to determine baseline application performance, quantify transaction volumes, and gather other key metrics that will determine where you begin your microservice journey. Specifically, you should: Monitor your web apps with APM. See Compatibility and requirements for New Relic agents and products to learn precise compatibility details for each supported language, and then install the APM agent on your application stack. Steps for installing APM agents vary based on language. Monitor your compute resources with Infrastructure. See Compatibility and requirements for Infrastructure for supported operating systems and environments. You can also instrument other products and services with on-host integrations. In some cases, it may be helpful to use custom instrumentation to gather detailed performance metrics that aren’t necessarily required in the course of normal application monitoring. For example, you may want to add custom instrumentation to key controllers that are candidates for decomposition to gather very granular response time and throughput information. 2. Use key metrics to identify components that you can migrate to microservices Once you have instrumented your application, you can begin to identify which components are strong candidates to migrate to microservices. It is important to consult with colleagues who have written, designed, and/or maintained the application, to supplement the context that your baseline data provides. Their experience and recommendations will help to guide the decomposition effort. In addition, you should analyze objective metrics such as transaction call volume and response time. These metrics will point to components in your monolithic application that are heavily called and/or are responding slowly, which means that they are adding disproportionate load to the monolith, possibly degrading application performance and end-user experience. As microservices, it will be easier to regularly improve and optimize these components. As a result, you will be able to break away and eliminate the most pressing bottlenecks from your monolithic application. one.newrelic.com > APM > Transactions: Identify which components are slowing you down. 3. Use deployment markers to establish app performance baselines Breaking down monolithic applications into a microservice architecture is typically an iterative project. You will be continually identifying monolithic components that can be decomposed into microservices, and then optimizing them as business and technology requirements dictate. Deployment tracking lets you quickly see, in a side-by-side comparative view, how architectural and code changes impact your application’s performance. You can then use this information to direct future development efforts and to demonstrate return on investment to the business. You should make deployment markers an integral part of the development process by adding them into your build/deployment process automation. You can view instructions on setting up deployment markers on the Deployments page in APM. one.newrelic.com > APM > Events > Deployments: Understand how deployments affect your performance. 4. Implement the new microservice-based architecture, and measure the success of your application development processes Your developers should now have marching orders for which application components to migrate to microservices. It’s important for these teams to embrace modern software development practices to support your overarching business and technology initiatives. Measuring process improvements is vital to driving alignment and velocity. You should instrument your build/test pipeline using custom events. This will allow you to gather data about: The rate at which new code is moving through the pipeline Quality metrics (for example, what percent of the code is passing tests, if there is automated testing involved) The rate of new deployments via deployment markers These quantitative data points will allow development and operations teams to visualize the adoption of new processes, measure development team productivity, and assess whether these new processes are moving the needle positively or negatively. one.newrelic.com > Dashboards: Visualize the adoption of new processes with dashboards. 5. Create a dashboard to monitor KPIs Once you have determined that the application and its microservices components are (somewhat) production-ready, compare the performance of your new, modern application to the monolithic application (either today or how it performed pre-migration). This will allow you to demonstrate success and to highlight areas for improvement. Key KPIs to monitor and compare include Response Time, Error Rate, Transaction Call Volume, Operational Cost, Availability, and Apdex. one.newrelic.com > Dashboards: Build KPI dashboards to view all your indicators in one place. 6. Create a new baseline to use for comparisons At this point, you have migrated components of your monolithic application to microservices, and you are now empowered with up-to-date data on how your new application is performing compared to your legacy application. Now you have a new launching point for evaluating which other components of your application can be decomposed into microservices, or which microservice components require more performance tuning. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
- "_index": "520d1d5d14cc8a32e600034b",
- "_type": "520d1d5d14cc8a32e600034c",
- "_score": 666.2645,
- "_version": null,
- "_explanation": null,
- "sort": null,
- "highlight": {
- "sections": "1. Deploy instrumentation on all application tiers and components",
- "info": "Use microservices to optimize applications. With microservices, app developers can resolve issues faster and deliver an enhanced end-user experience.",
- "category_0": "New Relic solutions",
- "category_1": "New Relic solutions",
- "body": ", resolve issues faster, increase the rate of deployments, and ultimately deliver an enhanced end-user experience. This quest to use microservices to optimize applications is an iterative process. We recommend the following six steps, using the New Relic platform, to ensure an effective migration path",
- "breadcrumb": "Contents / New Relic solutions / New Relic solutions / Optimize your cloud native environment"
- },
- "id": "5f58347e64441f8c45e0684c"
- },
- {
- "category_2": "Measure DevOps success",
- "nodeid": 16416,
- "sections": [
- "New Relic solutions",
- "Measure DevOps success",
- "Cloud adoption",
- "Optimize your cloud native environment",
- "Establish objectives and baselines: define team SLOs",
- "Service level components",
- "Resources",
- "1. Build an inventory of services requiring SLOs",
- "2. Research customer expectations for SLOs",
- "3. Define SLOs",
- "4. Determine what can be instrumented",
- "5. Review the default metrics",
- "6. Set up custom instrumentation",
- "7. Create Insights dashboards to track SLIs",
- "For more help"
- ],
- "title": "Establish objectives and baselines: define team SLOs",
- "category_0": "New Relic solutions",
- "type": "docs",
- "category_1": "New Relic solutions",
- "external_id": "c51fb6972a0e1d7cd72eaea21310026ec5ddb6a4",
- "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/catalyst-establish-objectives-2.png",
- "url": "https://docs.newrelic.com/docs/new-relic-solutions/new-relic-solutions/measure-devops-success/establish-objectives-baselines-define-team-slos",
- "published_at": "2020-09-30T05:46:14Z",
- "updated_at": "2020-09-28T00:26:46Z",
- "breadcrumb": "Contents / New Relic solutions / New Relic solutions / Measure DevOps success",
- "document_type": "page",
- "popularity": 1,
- "info": "Service level objectives (SLOs) provide a powerful mechanism to codify the goals of a DevOps team in a way that can be measured and shared.",
- "body": "A DevOps transformation requires a cultural shift so that teams can build new skills and motivations for the type of cross-team work required in a true DevOps practice. The transformation can be difficult when the people involved do not see the benefits of change as a clear objective. Service level objectives (SLOs) provide a powerful mechanism to codify the goals of a DevOps team in a way that can be measured and shared. They also provide clear boundaries on service expectations that help teams achieve greater velocity and freedom in experimenting with new approaches. This tutorial defines SLOs for successful service delivery objectives and utilize New Relic instrumentation to surface the current performance metrics relative to those objectives. Measurable SLOs and visibility into your current progress against those SLOs ensure that you will be able to properly assess future optimization efforts. Service level components An SLO is an agreed upon means of measuring the performance of your service. The SLO defines a target value of a specified quantitative measure, which is called a service level indicator (SLI); for example: Average response time Response time percentile Application availability SLOs clarify a target value for SLIs; for example: Average response time should be less than 200 ms 95% of requests should be completed within 250 ms Availability of the service should be 99.99% Logically group SLOs together to provide an overall boolean indicator of whether or not the service is meeting expectations. For example, a helpful SLO for alerting purposes could be: 95% of requests completed within 250 ms AND availability is 99.99% Service level components Example values SLI (Indicator) HTTP status codes SLO (Objective) < 1% HTTP 500s over 30 days SLA (Agreement) For every additional .1% of HTTP 500s, 5% refund of total contract Resources Value stream mapping can be a useful exercise to work through before setting SLOs. Work with your teams to clarify key components of your service and the appropriate metrics. Use these inputs as starting points for this tutorial. In addition: Learn about SLOs, SLIs, and SLAs from the Google Cloud Platform blog. Learn how New Relic has applied SLOs and SLIs into its reliability practices form this SREcon18 Americas presentation (approximately 21 minutes). 1. Build an inventory of services requiring SLOs Start defining SLOs for your application by first taking an inventory of the services that your application provides to both your internal and external customers. Draft a list of services. Make the scope of services you consider as comprehensive as possible. Engage your team members and other stakeholders to validate the list for completeness. Segment your application stack to understand the potential components that might require SLOs. For example, most applications can be segmented as: Application (backend/microservices) Dependency services (such as the message queue) Database Website Underlying servers This example lists components that would benefit from SLOs: Customer type Component name Owner Language stack Operating system External Service 1 John D. Java RHEL 6 Internal Service 2 Jane A. .NET Win2003 R2 Internal ActiveMQ John D. Java AIX External Website Jane A. Classic ASP Win2000 Internal MS SQL Dave Z. n/a Win2003 R2 Building a definitive list of services that require an SLO can be challenging, because an application often consists of many endpoints with complex interdependencies. Begin your SLO journey with pragmatism. Start by defining a broader, simpler set of SLOs that are driven by what your customers care about most and what your team can control. As your teams better align around SLOs, you can then begin to fine-tune and add more complexity. 2. Research customer expectations for SLOs Once you have an inventory of services, begin to gather the information you need to define the SLOs for those services. Interviews with customers that depend on your services are often valuable for understanding service expectations. For example, to define SLOs for internal teams, New Relic, ask questions such as: If possible, can you broadly categorize the types of requests we can expect from you and your service? To what extent do you or your service depend on timely responses to requests? Are there requests for which response time is not critical? How does your service handle unavailable dependencies or data? What is the maximum amount of unavailable data that your service can handle? At what threshold does your service fail if a request takes too long? What are acceptable rates of errors? What would a SLA look like between our product and yours? Existing usage data can also be a helpful research input. 3. Define SLOs Using the research on customer expectations that you gathered, draft a focused set of SLOs. New Relic recommends setting SLOs against one or more of the following SLIs: Application availability percentage Average response time Response percentile Error rate Apdex value Also, consider instrumenting and tracking the following SLIs: Throughput (peak and trough) Database call count and duration DNS and SSL timing DOM processing and page rendering Mean-time-to-detection (MTTD) For a more comprehensive list of potential areas to measure, see Measuring DevOps. Recommendation: To determine if your application is performing to customer expectations: Consider combining multiple SLIs (for example, availability and response time) into one SLO. Aim to define a consistent set of conditions across all of the services in your list. Consult your team and stakeholders to validate that the SLOs you set are reasonable, consistently attainable (even if you are not currently meeting them), and aligned to customer expectations. After you finish this step, you should have a set of well-defined SLOs and SLIs. 4. Determine what can be instrumented Now you are ready to deploy agents or monitors to establish a performance baseline for the SLIs you created. With proper instrumentation in place, you will have visibility into the performance indicators that matter for your team and your customers. In addition, you will also have a clear understanding of how to meet your SLOs. Identify the service components your team will optimize. Verify which application tiers meet New Relic monitoring requirements. To ensure you have robust baselines from which to work, determine the level of instrumentation that is possible (or allowed) within your organization. There may be situations where instrumentation of the current on-premise environment is not viable. For example, firewalls with certain settings may not permit New Relic agents to transmit data. Recommendation: If the application has a web front end in these situations, use New Relic Synthetics. Synthetics offers non-agent monitoring while still providing the ability to establish a baseline. To instrument the example applications and components in this tutorial, use these New Relic products: New Relic products Customer type Component name Tier owner Language stack Server OS New Relic products External Service 1 John D. Java RHEL 6 APM, Infrastructure, Synthetics Internal Service 2 Jane A. .Net Win2003 R2 APM, Infrastructure Internal ActiveMQ John D. Java AIX APM, Plugins External Website Jane A. Classic ASP Win2000 Synthetics Internal MS SQL Dave Z. NA Win2003 R2 Infrastructure, On-host integration APM installation After reviewing the compatibility and requirements for New Relic APM, install the APM agent on your application stack. Steps for installing APM agents vary based on language agent type. Follow the installation procedures for specific APM agents. Infrastructure installation After reviewing the requirements for New Relic Infrastructure, follow the installation procedures to install the Infrastructure agent on instances that host your applications. The New Relic Infrastructure agent requires the following host permissions: Linux: To install and run the agent, you must have root privileges. Windows: To install and run the agent, you must have Administrator privileges. Infrastructure on-host integrations To gain extended visibility into applications that your code depends on, deploy on-host integrations based on their availability. New Relic supports several commonly used application components, including MySQL, Apache, NGINX, and more. For more information, see New Relic's on-host integrations documentation. Synthetics New Relic Synthetics is a suite of automated, scriptable tools to monitor your websites, critical business transactions, and API endpoints. Follow the procedures to create a simple browser check. Be sure to verify that your website URL is accessible from the Synthetics public network locations. Browser New Relic Browser provides deep insights into how your users are interacting with your application or website. Browser complements Synthetics with data based on actual user experiences, which is useful in discerning how DevOps efforts are ultimately improving the experience for the customer. For more information, see the compatibility and requirements, then install the New Relic Browser agent. Mobile The growing role of mobile apps in customer experience often spurs new performance data needs. Installation of New Relic Mobile lets DevOps teams instrument iOS and Android applications to gain a fuller understanding of service delivery quality. Plugins Developers can use the New Relic Plugins product to create plugins that monitor numerical metrics provided by external services, hosts, or equipment. You can install existing plugins from Plugin Central, or plan, develop, test, and create your own plugins. 5. Review the default metrics After you deploy the agents and monitors, use service maps to review the default metrics that New Relic captures. For example, a typical service map show many of the common SLIs that application teams rely on, including response time, Apdex, throughput, and error rate metrics from APM. It also shows page load time, Ajax response, throughput, and error rate from Browser. rpm.newrelic.com > Service maps: To explore detailed granularity for any area, use the service map's nodes. 6. Set up custom instrumentation To close any remaining gaps in visibility for your SLIs, use custom instrumentation. New Relic provides several avenues for adding custom instrumentation, including: Making API calls to agents from inside your source code Packaging XML-based custom instrumentation modules with deployed applications Adding UI-based instrumentation without a code deploy In addition, you can add custom attributes to each transaction event that match application performance factors to critical business information. Then you can track those attributes in Insights dashboards. For more information, see the custom instrumentation documentation for your application: APM Browser Infrastructure Insights Mobile Synthetics 7. Create Insights dashboards to track SLIs Once you implement the appropriate instrumentation, it is easy to visualize your service level indicators with New Relic Insights dashboards. Insights provides a single location to query and view all the data that New Relic products gather. For example, Insights helps visualize the following data gathered from New Relic products: Infrastructure: Use default Infrastructure events and attributes for your systems, processes, events, storage, and network; Infrastructure integrations; and custom attributes. APM: Use Transaction and TransactionError event types. Browser: Use PageView and PageAction event types. Mobile: Use several Mobile event types. Synthetics: Use SyntheticCheck, SyntheticRequest, and SyntheticPrivateMinion event types. Each event has an event type, a timestamp, and one or more key attributes. For more information about the data that New Relic receives from your app, see Data collection. To query and view the data from the SLIs you selected for baselining: Use the Insights Data explorer to create widgets for your dashboards. Create dashboards that include widgets for the SLI baseline data. Use these widgets and dashboards to establish team dashboards that you can share and use to conduct operations reviews. insights.newrelic.com > (select a dashboard): Query your SLI baseline data, create dashboards with widgets to visualize the data, then share with your team and stakeholders. The metrics you capture will become your application's baseline. Share your Insights dashboard with your application team and stakeholders to provide visibility into what is happening with your application and to monitor future performance. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
- "_index": "520d1d5d14cc8a32e600034b",
- "_type": "520d1d5d14cc8a32e600034c",
- "_score": 650.72076,
- "_version": null,
- "_explanation": null,
- "sort": null,
- "highlight": {
- "title": "Establish objectives and baselines: define team SLOs",
- "sections": "New Relic solutions",
- "info": "Service level objectives (SLOs) provide a powerful mechanism to codify the goals of a DevOps team in a way that can be measured and shared.",
- "category_0": "New Relic solutions",
- "category_1": "New Relic solutions",
- "body": ". Each event has an event type, a timestamp, and one or more key attributes. For more information about the data that New Relic receives from your app, see Data collection. To query and view the data from the SLIs you selected for baselining: Use the Insights Data explorer to create widgets for your",
- "breadcrumb": "Contents / New Relic solutions / New Relic solutions / Measure DevOps success"
- },
- "id": "5f5b215064441f4c48e06825"
- },
- {
- "image": "",
- "url": "https://developer.newrelic.com/build-apps/",
- "sections": [
- "Build apps",
- "Guides to build apps",
- "Create a \"Hello, World!\" application",
- "Permissions for managing applications",
- "Set up your development environment",
- "Add, query, and mutate data using NerdStorage",
- "Add the NerdGraphQuery component to an application",
- "Add a time picker to your app",
- "Add a table to your app",
- "Create a custom map view",
- "Publish and deploy apps"
- ],
- "published_at": "2020-10-01T01:54:33Z",
- "title": "Build apps",
- "updated_at": "2020-09-25T01:49:59Z",
- "type": "developer",
- "external_id": "abafbb8457d02084a1ca06f3bc68f7ca823edf1d",
- "document_type": "page",
- "popularity": 1,
- "body": "Build apps You know better than anyone what information is crucial to your business, and how best to visualize it. Sometimes, this means going beyond dashboards to creating your own app. With React and GraphQL, you can create custom views tailored to your business. These guides are designed to help you start building apps, and dive into our library of components. We also have a growing number of open source apps that you can use to get started. The rest is up to you. Guides to build apps 15 min Create a \"Hello, World!\" application Build a \"Hello, World!\" app and publish it to New Relic One Permissions for managing applications Learn about permissions for subscribing to apps 20 min Set up your development environment Prepare to build apps and contribute to this site 45 min Add, query, and mutate data using NerdStorage NerdStorage is a document database accessible within New Relic One. It allows you to modify, save, and retrieve documents from one session to the next. 20 minutes Add the NerdGraphQuery component to an application The NerdGraphQuery component allows you to query data from your account and add it to a dropdown menu in an application 20 min Add a time picker to your app Add a time picker to a sample application 30 min Add a table to your app Add a table to your New Relic One app 30 min Create a custom map view Build an app to show page view data on a map 30 min Publish and deploy apps Start sharing the apps you build",
- "info": "",
- "_index": "520d1d5d14cc8a32e600034b",
- "_type": "520d1d5d14cc8a32e600034c",
- "_score": 638.272,
- "_version": null,
- "_explanation": null,
- "sort": null,
- "highlight": {
- "title": "Build apps",
- "sections": "Publish and deploy apps",
- "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"
- },
- "id": "5efa999d64441fc0f75f7e21"
- },
- {
+ "nodeid": 27692,
"sections": [
- "Add tables to your New Relic One application",
- "Before you begin",
- "Clone and set up the example application",
- "Work with table components",
- "Next steps"
- ],
- "title": "Add tables to your New Relic One application",
- "type": "developer",
- "tags": [
- "table in app",
- "Table component",
- "TableHeaderc omponent",
- "TableHeaderCell component",
- "TableRow component",
- "TableRowCell component"
+ "AWS Lambda monitoring",
+ "Get started",
+ "Enable Lambda monitoring",
+ "UI and data",
+ "Troubleshooting",
+ "Enable serverless monitoring for AWS Lambda",
+ "How Lambda monitoring works",
+ "Enable procedure overview",
+ "Step 1. Install the newrelic-lambda-cli tool",
+ "CLI requirements",
+ "CLI installation",
+ "Step 2. Connect AWS to New Relic",
+ "Use CLI tool",
+ "Manual procedures",
+ "Step 3. Enable Lambda instrumentation",
+ "Step 4. Configure CloudWatch logs to stream to New Relic Lambda",
+ "What's next?",
+ "Optional: Stream all logs to New Relic",
+ "For more help"
],
- "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-10-01T01:55:36Z",
- "updated_at": "2020-09-17T01:48:42Z",
+ "title": "Enable serverless monitoring for AWS Lambda",
+ "category_0": "Serverless function monitoring",
+ "type": "docs",
+ "category_1": "AWS Lambda monitoring",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/enable-serverless-monitoring-aws-lambda",
+ "external_id": "7992b896d4c35ca29aba34698aedd621dfe0b572",
+ "image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-lambda-monitoring-architecture.png",
+ "url": "https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/enable-serverless-monitoring-aws-lambda",
+ "published_at": "2020-10-04T01:13:08Z",
+ "updated_at": "2020-10-04T01:13:08Z",
+ "breadcrumb": "Contents / Serverless function monitoring / AWS Lambda monitoring / Enable Lambda monitoring",
"document_type": "page",
"popularity": 1,
- "info": "Add a table to your New Relic One app.",
- "body": "Add tables to your New Relic One application 30 min Tables are a popular way of displaying data in New Relic applications. For example, with the query builder you can create tables from NRQL queries. Whether you need to have more control over tables or you're importing third-party data, you can build your own tables into your New Relic One application. In this guide, you are going to build a sample table using various New Relic One components. Before you begin If you haven't already installed the New Relic One CLI, step through the quick start in New Relic One. This process also gets you an API key. In addition, to complete the steps in this guide, you need a GitHub account and Node.js installed on your machine. See Setting up your development environment for more info. Clone and set up the example application Step 1 of 4 Clone the nr1-how-to example application from GitHub to your local machine. Then, navigate to the app directory. The example app lets you experiment with tables. git clone https://github.com/newrelic/nr1-how-to.git` cd nr1-how-to/create-a-table/nerdlets/create-a-table-nerdlet` Copy Step 2 of 4 Edit the index.json file and set this.accountId to your Account ID as shown in the example. export default class Nr1HowtoAddTimePicker extends React.Component { constructor(props){ super(props) this.accountId = YOUR_ACCOUNT_ID; } ... } Copy Step 3 of 4 Run the demo application Change the directory back to nr1-how-to/create-a-table. Before you can load the demo application, you need to update its unique id by invoking the New Relic One CLI. Once you've assigned a new UUID to the app, install the dependencies and serve the demo app locally, so that you can test any change live in your browser. nr1 nerdpack:uuid -gf # Update the app unique ID npm install # Install dependencies nr1 nerdpack:serve # Serve the demo app locally Copy Step 4 of 4 Open one.newrelic.com/?nerdpacks=local in your browser. Click Apps, and then in the Your apps section, you should see a Create a table launcher. That's the demo application you're going to work on. Go ahead and select it. Have a good look at the demo app. There's a TableChart on the left side named Transaction Overview, with an AreaChart next to it. You'll use Table components to add a new table in the second row. Work with table components Step 1 of 10 Navigate to the nerdlets/create-a-table-nerdlet subdirectory and open the index.js file. Add the following components to the import statement at the top of the file so that it looks like the example: Table TableHeader TableHeaderCell TableRow TableRowCell import { Table, TableHeader, TableHeaderCell, TableRow, TableRowCell, PlatformStateContext, Grid, GridItem, HeadingText, AreaChart, TableChart, } from 'nr1'; Copy Step 2 of 10 Add a basic Table component Locate the empty GridItem in index.js: This is where you start building the table. Add the initial component. The items property collects the data by calling _getItems(), which contains sample values. ; Copy Step 3 of 10 Add the header and rows As the Table component renders a fixed number of header cells and rows, your next step is adding header components, as well as a function that returns the required table rows. Inside of the Table component, add the TableHeader and then a TableHeaderCell child for each heading. Since you don't know how many rows you'll need, your best bet is to call a function to build as many TableRows as items returned by _getItems(). Application Size Company Team Commit ; { ({ item }) => ( {item.name} {item.value} {item.company} {item.team} {item.commit} ); } Copy Step 4 of 10 Take a look at the application running in New Relic One: you should see something similar to the screenshot below. Step 5 of 10 Replace standard table cells with smart cells The New Relic One library includes cell components that can automatically format certain data types, like users, metrics, and entity names. The table you've just created contains columns that can benefit from those components: Application (an entity name) and Size (a metric). Before you can use EntityTitleTableRowCell and MetricTableRowCell, you have to add them to the import statement first. import { EntityTitleTableRowCell, MetricTableRowCell, ... /* All previous components */ } from 'nr1'; Copy Step 6 of 10 Update your table rows by replacing the first and second TableRowCells with entity and metric cells. Notice that EntityTitleTableRowCell and MetricTableRowCell are self-closing tags. { ({ item }) => ( {item.company} {item.team} {item.commit} ); } Copy Step 7 of 10 Time to give your table a second look: The cell components you've added take care of properly formatting the data. Step 8 of 10 Add some action to your table! Tables are great, but interactive tables can be better: As a last update, you are going to allow users to act on each data row. Add the _getActions() method to your index.js file, right before _getItems(). As you may have guessed from the code, _getActions() spawns an alert box when you click Team or Commit cells. _getActions() { return [ { label: 'Alert Team', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__ALERT, onClick: (evt, { item, index }) => { alert(`Alert Team: ${item.team}`); }, }, { label: 'Rollback Version', iconType: TableRow.ACTIONS_ICON_TYPE.INTERFACE__OPERATIONS__UNDO, onClick: (evt, { item, index }) => { alert(`Rollback from: ${item.commit}`); }, }, ]; } Copy Step 9 of 10 Find the TableRow component in your return statement and point the actions property to _getActions(). The TableRow actions property defines a set of actions that appear when the user hovers over a table row. Actions have a mandatory text and an onClick callback, but can also display an icon or be disabled if needed. Copy Step 10 of 10 Go back to your application and try hovering over any of the rows: Notice how the two available actions appear. When you click them, a function triggers with the selected row data as an argument, and an alert displays in your browser. Next steps You've built a table into a New Relic One application, using components to format data automatically and provide contextual actions. Well done! Keep exploring the Table components, their properties, and how to use them, in our SDK documentation.",
+ "info": "Read about how to install and enable New Relic monitoring for Amazon AWS Lambda. ",
+ "body": "Serverless monitoring for AWS Lambda offers in-depth performance monitoring for your Lambda functions. Read on to learn how to enable this feature and get started using it. Using this feature may result in AWS charges. For more information, see the Lambda monitoring requirements. How Lambda monitoring works Before enabling Lambda monitoring, understanding how data flows from your Lambda functions to New Relic may be helpful: Diagram showing how data flows from a Lambda function to New Relic. When our Lambda monitoring is enabled, this is how data moves from your Lambda function to New Relic: The Lambda function is instrumented with our code. CloudWatch collects Lambda log data and sends it to our log-ingestion Lambda. The log-ingestion Lambda sends that data to New Relic. Enable procedure overview If you already have a New Relic account and use Node.js or Python, we recommend you use our automated installer. If you do not use the automated installer, complete these steps to set up monitoring: Install our CLI tool (recommended) Connect AWS and New Relic (required) Enable instrumentation of your Lambda (required) Stream CloudWatch logs to New Relic (required) Step 1. Install the newrelic-lambda-cli tool We provide a command line interface (CLI) tool that's used in steps 2 through 4. We recommend the CLI because it simplifies some of the work, but you can also perform those steps manually. If you want to understand what it does before you install it, see the manual procedures that the CLI tool performs in Step 2, Step 3 (option 2), and Step 4. You can also see the CLI documentation on GitHub. If you prefer a manual install, skip to Step 2. Connect AWS to New Relic. CLI requirements To use the CLI too, you need: Python 3.3 or higher The AWS CLI You must be a user or admin with an infrastructure manager Add-on role. Your AWS account needs permissions for creating IAM resources (Role and Policy) and Lambda functions. These resources are created using CloudFormation stacks, so you'll need permissions to create those. For more on permissions, including setting custom policies, expand this collapser: AWS permissions details Resource: * Actions: \"cloudformation:CreateChangeSet\", \"cloudformation:CreateStack\", \"cloudformation:DescribeStacks\", \"cloudformation:ExecuteChangeSets\", \"iam:AttachRolePolicy\", \"iam:CreateRole\", \"iam:GetRole\", \"iam:PassRole\", \"lambda:AddPermission\", \"lambda:CreateFunction\", \"lambda:GetFunction\", \"logs:DeleteSubscriptionFilter\", \"logs:DescribeSubscriptionFilters\", \"logs:PutSubscriptionFilter\" \"s3:GetObject\" \"serverlessrepo:CreateCloudFormationChangeSet\" Resource: \"arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion\" Actions: \"serverlessrepo:CreateCloudFormationTemplate\" \"serverlessrepo:GetCloudFormationTemplate\" Be sure that the AWS account you use to execute the CLI has all of these permissions. If your AWS account permissions are restrictive and you're unable to use the CLI, you can optionally use a manually managed custom IAM policy. This policy would require, at minimum, the following permissions: Resource: \"*\" Action: \"cloudwatch:GetMetricStatistics\" \"cloudwatch:ListMetrics\" \"cloudwatch:GetMetricData\" \"lambda:GetAccountSettings\" \"lambda:ListFunctions\" \"lambda:ListAliases\" \"lambda:ListTags\" \"lambda:ListEventSourceMappings\" These permissions are the minimum required. We recommend granting a managed ReadOnlyAccess policy as described in Connect AWS to infrastructure monitoring. CLI installation To install the CLI tool: Ensure you have the required permissions for both your New Relic and AWS account. From the command line, run: pip install newrelic-lambda-cli You may need to use pip3 in the command above if you have Python 2.7 installed. The CLI requires Python >=3.3. Step 2. Connect AWS to New Relic You must complete this step, and steps 3 and 4, to enable our Lambda monitoring. This step connects AWS to New Relic and creates a newrelic-log-ingestion Lambda function that sends your instrumented data to New Relic. You can either use the CLI tool or do the steps manually. Use CLI tool When you use the CLI, you have one optional step and one required step: Optional: If you're using multiple AWS profiles or multiple regions, you may want to configure the AWS environment variables: AWS environment variable instructions Setting the region To configure your region, use this environment variable to override the default region: export AWS_DEFAULT_REGION=MY_REGION # us-west-2, for example The CLI tool also allows passing this per-command using --aws-region. Setting profiles If you have multiple AWS profiles and don't want to use the default, use AWS_PROFILE environment variable to set another profile name. Ensure the profile is properly configured (including the default region). Example: export AWS_PROFILE=MY_PROFILE Run the following command using the CLI tool: newrelic-lambda integrations install --nr-account-id YOUR_ACCOUNT_ID \\ --linked-account-name YOUR_LINKED_ACCOUNT_NAME \\ --nr-api-key YOUR_NR_API_KEY This command: Connects your AWS account to New Relic. Installs a newrelic-log-ingestion Lambda that will send your instrumented data to New Relic. More details: This defaults to U.S. region. If your account is in the EU region, add this argument: --nr-region \"eu\". If you're instrumenting functions in multiple AWS regions, this command must be run for each region using the --aws-region argument. YOUR_LINKED_ACCOUNT_NAME is either a new AWS account you want to link to New Relic, or it's the name of the AWS account that you linked to when setting up the AWS Lambda monitoring integration. YOUR_NR_API_KEY refers to your personal API key (not your REST API key). For more on the API key and other arguments, see our Lambda monitoring GitHub repo. Manual procedures Here are the manual procedures performed by the CLI tool: Connect AWS to New Relic The newrelic-lambda integration command connects the AWS account containing your Lambdas to New Relic. If you've already installed one of our AWS integrations, your accounts should be linked to New Relic and you can skip this section. To manually establish this connection, follow the instructions for connecting AWS to Infrastructure monitoring. Configure our log-ingestion Lambda The newrelic-lambda integration command sets up a newrelic-log-ingestion Lambda. This Lambda takes the logs generated by your Lambda functions and pushes those logs to New Relic. If you're configuring this manually, you must configure our Lambda for the regions you want. The CLI, by default, establishes our Lambda in all regions. To manually configure our Lambda, go to the AWS Serverless Application Repository, which is where the newrelic-log-ingestion Lambda is stored. This repo is a collection of serverless applications published by developers, companies, and partners in the serverless community. It allows developers to share their Lambda functions code with customers, who can then find and deploy the corresponding application Lambda function. Each application is packaged with an AWS Serverless Application Model (SAM) template that defines the AWS resources used. To manually configure our Lambda with the AWS Serverless Application Repository: From the AWS console, go to the Lambda section, select Create function, and select Serverless Application Repository. Search for newrelic and find the newrelic-log-ingestion Lambda. Follow the instructions in the Lambda's documentation to deploy it. A SAM template will build the Lambda. In the environment variable section in AWS console, set the LICENSE_KEY environment variable to your New Relic license key. Note: If you have multiple accounts or a master and sub-account hierarchy, make sure the license key you're using matches the same account connected to AWS. Optional: If you want to stream all your logs to New Relic, set the LOGGING_ENABLED environment variable to true. For more on this, see Stream all logs. Step 3. Enable Lambda instrumentation This step enables instrumentation of your Lambda function, which allows detailed monitoring and alerting functionality. Our instrumentation is designed to have minimal impact on your Lambda performance. If you're using Node.js or Python, we recommend the first two options. Option #1: Use Serverless Framework plugin (Node.js and Python) Requirements Available only for Node.js and Python. For other languages, see Manual instrumentation. Serverless Framework version 1.34.0 or higher. Features If you meet the requirements (above), you can use our Serverless Framework plugin, which allows you to add our AWS Lambda Layer to your functions without requiring a code change. Supports Node.js and Python runtimes No code change required to enable Lambda instrumentation Enables our APM agent functionality using a single layer Configures CloudWatch subscription filters automatically Gets the layer into your code base which is useful for redeploys Install To install our Serverless Framework plugin: Choose an install option: NPM: npm install --save-dev serverless-newrelic-lambda-layers yarn: yarn add --dev serverless-newrelic-lambda-layers Add the plugin to your serverless.yml: plugins: - serverless-newrelic-lambda-layers Get your account ID and put it in the serverless.yml: custom: newRelic: accountId: YOUR_ACCOUNT_ID Deploy it: sls deploy You can skip Step 4. Setting up CloudWatch Logs. This is automatically completed on deploy by our Serverless Framework plugin. For the next step, go to What's next? Option #2: Add Lambda Layer with our CLI (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework and don't intend to redeploy your function frequently, you can use the CLI to add our Lambda Layer: If you haven't already done so, install the CLI: pip install newrelic-lambda-cli List available functions: newrelic-lambda functions list Pass the option -f not-installed to see which functions have not yet been instrumented. Add the layer to your function: newrelic-lambda layers install --function FUNCTION_NAME --nr-account-id NEW_RELIC_ACCOUNT_ID Next, you will configure CloudWatch to send logs to New Relic. Option #3: Manually add our Lambda Layer (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework, you can manually add our Lambda Layer: Find the layer that matches your runtime and region. Copy the Amazon Resource Name (ARN) of the most recent version and add it in the AWS Lambda console for your function. Update your functions handler to point to the newly attached layer in the console for your function: Python: newrelic_lambda_wrapper.handler Node: newrelic-lambda-wrapper.handler Add these environment variables to your Lambda console: NEW_RELIC_ACCOUNT_ID: Your account ID NEW_RELIC_LAMBDA_HANDLER: Path to your initial handler. If you have Node 8 and get a Lambda can't find file error message, expand this collapser: Node 8 \"can't find file\" error troubleshooting If you have Node 8 and receive a Lambda can't find the file newrelic-lambda-wrapper.js message, it's likely that the Node runtime isn't resolving NPM_PATH for the newrelic-lambda module in /opt/nodejs/node_modules. These steps should fix this problem: Create a newrelic-wrapper-helper.js script in your project's root. The script's contents should be module.exports = require('newrelic-lambda-wrapper');. (That is all that needs to be in that script.) Update the handler for your layer declaration to newrelic-lambda-wrapper.handler. Next, you will configure CloudWatch to send logs to New Relic. Option #4: Manually instrument Lambda code for Go, Java, .NET Core, Node.js, and Python If none of the previous options work for you, you can manually instrument your Lambda code. Choose your language: Go To instrument your Go-language Lambda: Download our Go agent package and place it in the same directory as your function. Install the agent: go get -u github.com/newrelic/go-agent. In your Lambda code, import our components, create an application, and update how you start your Lambda. See our GitHub repo for an example of an instrumented Lambda. Optional: Add custom events that will be associated with your Lambda invocation by using the RecordCustomEvent API. For example: func handler(ctx context.Context) { if txn := newrelic.FromContext(ctx); nil != txn { txn.Application().RecordCustomEvent(\"MyEvent\", map[string]interface{}{ \"zip\": \"zap\", }) } fmt.Println(\"hello world!\") } Build and zip your Lambda function and upload it to AWS. Zip and upload recommendations Here are suggestions for zipping and uploading the Lambda: Build the binary for execution on Linux. This produces a binary file called main. You can use: $ GOOS=linux go build -o main Zip the binary into a deployment package using: $ zip deployment.zip main Upload the zip file to AWS using either the AWS Lambda console or the AWS CLI. Name the handler main (to match the name given during the binary build). The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this is the account ID for the root/parent account. Optional: To configure logging, see Go agent logging. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Java Monitoring for AWS Lambda in Java doesn't use our APM Java agent. Instead, it uses these two OpenTracing dependencies: AWS Lambda OpenTracing Java SDK: OpenTracing instrumentation for AWS Lambda RequestHandler and RequestStreamHandler. Our AWS Lambda OpenTracing Tracer: An OpenTracing Tracer implementation designed to monitor AWS Lambda. It generates spans, error events, transaction events, error traces, and provides distributed tracing support. Supported OpenTracing Versions OpenTracing 0.31.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:1.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:1.0.0 OpenTracing 0.32.0, 0.33.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:2.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:2.1.0 To instrument your Java Lambda: In your project’s build.gradle file, include our OpenTracing AWS Lambda Tracer and the AWS Lambda OpenTracing SDK dependencies: dependencies { compile(\"com.newrelic.opentracing:java-aws-lambda:2.1.0\") compile(\"com.newrelic.opentracing:newrelic-java-lambda:2.1.1\") compile(\"io.opentracing:opentracing-util:0.33.0\") } Implement the AWS Lambda RequestHandler interface as shown in the Java Lambda example and override the doHandleRequest method. In the doHandleRequest method, call the LambdaTracing.instrument(...) API to create a root span to trace the lambda function's execution. This is also where you will define your business logic for the lambda function. Register a LambdaTracer.INSTANCE as the OpenTracing Global tracer, as shown in the Java Lambda example. Create a ZIP deployment package and upload it to AWS Lambda. Or deploy it via other means. In the AWS Lambda console, set the handler. For the example Java Lambda, the handler would be com.handler.example.MyLambdaHandler::handleRequest. Because handleRequest is assumed, you could also use com.handler.example.MyLambdaHandler. The following AWS console environment variables are required if you want your Lambda function to be included in distributed tracing. This is recommended. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_PRIMARY_APPLICATION_ID. This is also your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this must be the account ID for the root/parent account. Optional: In the Lambda console, enable debug logging by adding this environment variable: NEW_RELIC_DEBUG is true. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Please see the AWS Lambda distributed tracing example for a complete project that illustrates common use cases such as: Distributed tracing between Lambda functions Manual span creation (aka custom instrumentation) Tracing external calls Adding custom attributes (aka Tags) to spans .NET Core Our monitoring of .NET Core-based AWS Lambda functions doesn't use our standard .NET Core APM agent. Instead, it uses a NuGet package. To instrument your .NET Core Lambda: In your Lambda Functions project, install the NewRelic.OpenTracing.AmazonLambda.Tracer NuGet package. Note: NewRelic.OpenTracing.AmazonLambda.Tracer depends on version 1.2.0+ of the Amazon.Lambda.APIGatewayEvent NuGet package. If the environment already uses a lower version of Amazon.Lambda.APIGatewayEvent, the New Relic package may produce errors such as System.MissingMethodException. Import the NuGet package and OpenTracing utils: using OpenTracing.Util; using NewRelic.OpenTracing.AmazonLambda; Instrument your function, as shown in this example: public class Function { static Function() { // Register The NewRelic Lambda Tracer Instance GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public object FunctionWrapper(ILambdaContext context) { // Instantiate NewRelic TracingWrapper and pass your FunctionHandler as // an argument return new TracingRequestHandler().LambdaWrapper(FunctionHandler, context); } /// /// A simple function that takes a string and does a ToUpper /// /// /// /// public object FunctionHandler(ILambdaContext context) { ... } } The arguments passed to FunctionWrapper must match the signature of FunctionHandler. If your handler function returns a Task, the Lambda wrapper will block on the return task until it completes, so that it can measure the duration and capture exceptions, if any are present. In addition, you may also inherit from the APIGatewayProxyFunction. For an example, see below: Async handler function public override Task FunctionHandlerAsync(ILambdaContext lambdaContext) { // This call will block by calling task.Result Task task = new TracingRequestHandler().LambdaWrapper( ActualFunctionHandlerAsync, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(ILambdaContext lambdaContext) { // Function can make other async operations here ... } Inheriting from APIGatewayProxyFunction public class LambdaFunction : APIGatewayProxyFunction { static LambdaFunction() { // Register The NewRelic Lambda Tracer Instance OpenTracing.Util.GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public override Task FunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { Task task = new TracingRequestHandler().LambdaWrapper(ActualFunctionHandlerAsync, request, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { return base.FunctionHandlerAsync(request, lambdaContext); } } Optional for SQS and SNS: Starting in version 1.0 of our .NET Lambda Tracer, distributed tracing support has been added for SQS and SNS. To enable distributed tracing for SQS or SNS you will need to complete the items in this step as well as setup the environment variables in the step that follows this one. Enabling distributed tracing support for SQS and SNS will disable automatic instrumentation for both of SQS and SNS and require the use of these wrappers to instrument them. Set the NEW_RELIC_USE_DT_WRAPPER environment variable to true. To instrument SQS and SNS calls you will need to use the provided wrappers. Using the SQS Wrapper The SQS wrapper supports wrapping the following methods: Amazon.SQS.AmazonSQSClient.SendMessageAsync(...) Amazon.SQS.AmazonSQSClient.SendMessageBatchAsync(...) Examples // SQS Client AmazonSQSClient client = new AmazonSQSClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // SendMessageRequest SendMessageRequest sendRequest = new SendMessageRequest(\"QUEUE_URI_STRING\", \"An SQS Message\"); Task responseOne = SQSWrapper.WrapRequest(client.SendMessageAsync, sendRequest); // String-based Task responseTwo = SQSWrapper.WrapRequest(client.SendMessageAsync, \"QUEUE_URI_STRING\", \"Another SQS Message\"); // SendMessageBatchRequest List batchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id1\", \"First SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id2\", \"Second SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id3\", \"Third SQS Message\")); SendMessageBatchRequest sendBatchRequest = new SendMessageBatchRequest(QUEUE_URI, batchEntries); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, sendBatchRequest); // SendMessageBatchRequestEntry List List moreBatchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id4\", \"Fourth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id5\", \"Fifth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id6\", \"Sixth SQS Message\")); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, moreBatchEntries); Using the SNS Wrapper The SNS wrapper supports wrapping the following methods: Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient.PublishAsync(...) Examples // SNS Client AmazonSimpleNotificationServiceClient client = new Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // PublishRequest - Phone Number PublishRequest phonePublishRequest = new PublishRequest(); phonePublishRequest.PhoneNumber = +1XXX5555100; phonePublishRequest.Message = \"An SNS Message for phones\"; Task phoneResponse = SNSWrapper.WrapRequest(client.PublishAsync, phonePublishRequest); // PublishRequest - ARN PublishRequest publishRequest = new PublishRequest(\"TOPIC_ARN\", \"An SNS Message\"); Task publishResponse = SNSWrapper.WrapRequest(client.PublishAsync, publishRequest); // String-based without subject Task ResponseOne = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Another SNS Message\"); // String-based with subject Task ResponseTwo = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Yet Another SNS Message\", \"A Subject\"); The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS Lambda console: NEW_RELIC_ACCOUNT_ID: The account ID the Lambda is reporting to. NEW_RELIC_TRUSTED_ACCOUNT_KEY: This is also the account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Ensure that the wrapper function (FunctionWrapper in above example) is set up as the function handler. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Node.js To instrument your Node.js Lambda: Download our Node.js agent package and place it in the same directory as your function, ensuring the agent is installed as a dependency in the node_modules directory. Use the Node Package Manager: npm install newrelic --save Install our AWS SDK module alongside the Node.js agent: npm install @newrelic/aws-sdk --save In your Lambda code, require the agent module and the AWS SDK at the top of the file, and wrap the handler function. For example: const newrelic = require('newrelic'); require('@newrelic/aws-sdk'); module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { // This is your handler function code console.log('Lambda executed'); callback(); }); Optional: You can also add custom events to your Lambda using the recordCustomEvent API. For example: module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { newrelic.recordCustomEvent(‘MyEventType’, {foo: ‘bar’}); console.log('Lambda executed'); callback(); }); Zip your Lambda function and the Node.js agent folder together. Requirements and recommendations: The New Relic files outside the New Relic agent folder don't need to be included. If your Lambda function file name is, for example, lambda_function.node, we recommend naming your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set these environment variables: NEW_RELIC_NO_CONFIG_FILE. Set to true if not using a configuration file. NEW_RELIC_APP_NAME: Your application name. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To run the agent in serverless mode outside of AWS in a local environment, set the environment variable NEW_RELIC_SERVERLESS_MODE_ENABLED to true. (When executing this in an AWS Lambda environment, the agent will automatically run in serverless mode. Do not use this variable if you're running in AWS.) Optional: To enable logging in serverless mode, set these environment variables: Set NEW_RELIC_LOG_ENABLED to true. Set NEW_RELIC_LOG to stdout for output to CloudWatch, or set to any writeable file location. The log level is set to info by default. See other log levels. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Python To instrument your Python Lambda: Download our Python agent package and place it in the same directory as your function. To do this, use pip: pip install -t . newrelic If you use Homebrew, you may get this error: DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both. For details, see the Homebrew GitHub post. In your Lambda code, import the Python agent module and decorate the handler function using the New Relic decorator. The New Relic package must be imported first in your code. Here's an example: import newrelic.agent newrelic.agent.initialize() @newrelic.agent.lambda_handler() def handler(event, context): ... Optional: You can also add custom events to your Lambda using the record_custom_event API. Here's an example: @newrelic.agent.lambda_handler() def handler(event, context): newrelic.agent.record_custom_event('CustomEvent', {'foo': 'bar'}) … Zip your lambda_function.py and newrelic/ folder together using these guidelines: The New Relic files outside the newrelic/ folder don't need to be included. If your Lambda function file name is, for example, lambda_function.py, name your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set this environment variable: NEW_RELIC_SERVERLESS_MODE_ENABLED. Set to true The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_DISTRIBUTED_TRACING_ENABLED. Set to true. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To configure logging, use the NEW_RELIC_LOG and NEW_RELIC_LOG_LEVEL environment variables in the AWS Console. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. The New Relic decorator gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, configure CloudWatch to send those logs to New Relic. Step 4. Configure CloudWatch logs to stream to New Relic Lambda In this step, you'll link your Lambda function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda that was configured in Step 2. For Node.js and Python: This step isn't necessary if you used the Serverless Framework plugin option in Step 3. This step can be done using the CLI tool or using manual procedures. Use CLI tool Run this command for every Lambda function you want to monitor: newrelic-lambda subscriptions install --function FUNCTION_NAME_#1 Or to set subscription filters for all supported functions run this command:: newrelic-lambda subscriptions install --function all Notes on this command: You should only need one newrelic-log-ingestion Lambda per AWS account and region. You can subscribe as many functions to it as you like. To see more detail about the arguments, including a region-specifying argument, see our GitHub documentation. You may receive a CloudWatch validation error. This doesn't affect data reporting. If you see data reporting in New Relic, disregard that error message. If you have our Logs and want to send all your log data to us (not just Lambda logs), see Stream all logs. Manual procedures Here are the manual procedures performed by the CLI tool: Manual process: Stream CloudWatch logs to New Relic Lambda In Step 2, you set up a newrelic-log-ingestion Lambda function. After you've instrumented your Lambda function (Step 3), the newrelic-lambda subscriptions command links that function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda. To do this manually: Open CloudWatch and select Logs in the left-hand menu, and then select the log group for the function you are monitoring. Select Actions and choose Stream to AWS Lambda. Under Lambda function, select the newrelic-log-ingestion function. Set the Log format to JSON. Set the Subscription filter pattern to ?REPORT ?NR_LAMBDA_MONITORING ?\"Task timed out\". Alternatively, if you are using the LOGGING_ENABLED environment variable stream all your logs to our Logs, leave this field blank. See notes and caveats about this procedure. Make sure the newrelic-log-ingestion Lambda function you select in the method above is in the same AWS region as your Lambda function. What's next? After you complete these steps, here's what you can do next: See data reporting in the Lambda monitoring UI. If you're having trouble finding your data, see Lambda enable troubleshooting. Use configuration settings to fine-tune your data. Our newrelic-log-ingestion function is not updated automatically. For best results and access to latest features, we recommend you occasionally update our Lambda monitoring. Optional: Stream all logs to New Relic If you have log management enabled and want to report all your logs to New Relic, follow these instructions: Go to our newrelic-log-ingestion Lambda and set the LOGGING_ENABLED environment variable to true. It isn't possible to edit existing filter patterns, so they must be removed and re-added: Set the Subscription filter pattern to \"\". Go to the Log group for each monitored Lambda, and remove the newrelic-log-ingestion subscription. Add the subscription filter back, leaving the Subscription filter pattern field blank. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 612.83484,
+ "_score": 88.058716,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "Add tables to your New Relic One application",
- "sections": "Add tables to your New Relic One application",
- "info": "Add a table to your New Relic One app.",
- "tags": "table in app",
- "body": " of the rows: Notice how the two available actions appear. When you click them, a function triggers with the selected row data as an argument, and an alert displays in your browser. Next steps You've built a table into a New Relic One application, using components to format data automatically and provide contextual actions. Well done! Keep exploring the Table components, their properties, and how to use them, in our SDK documentation."
+ "body": " invocation by using the RecordCustomEvent API. For example: func handler(ctx context.Context) { if txn := newrelic.FromContext(ctx); nil != txn { txn.Application().RecordCustomEvent("MyEvent", map[string]interface{}{ "zip": "zap", }) } fmt.Println("hello world!") } Build and zip your Lambda function"
},
- "id": "5efa989ee7b9d2ad567bab51"
+ "id": "5f6c67a464441f3a75eb72d3"
}
],
- "/explore-docs/nr1-subscription": [
+ "/build-apps/set-up-dev-env": [
{
"sections": [
"New Relic One CLI reference",
@@ -7213,7 +7092,7 @@
"external_id": "858339a44ead21c83257778ce60b4c352cd30d3b",
"image": "https://developer.newrelic.com/static/2c6d337608b38a3312b4fc740afe6167/7272b/developercenter.png",
"url": "https://developer.newrelic.com/explore-docs/nr1-cli/",
- "published_at": "2020-10-01T01:56:53Z",
+ "published_at": "2020-10-06T02:13:01Z",
"updated_at": "2020-09-17T01:51:10Z",
"document_type": "page",
"popularity": 1,
@@ -7221,140 +7100,78 @@
"body": "New Relic One CLI reference To build a New Relic One app, you must install the New Relic One CLI. The CLI helps you build, publish, and manage your New Relic app. We provide a variety of tools for building apps, including the New Relic One CLI (command line interface). This page explains how to use CLI commands to: Generate Nerdpack/Nerdlet templates Locally serve Nerdpacks (when developing) Publish and deploy Subscribe to Nerdpacks Add screenshots and metadata to the catalog Installing the New Relic One CLI In New Relic, click Apps and then in the New Relic One catalog area, click the Build your own application launcher and follow the quick start instructions. The quick start automatically generates an API key for the account you select, and gives you the pre-populated commands to create a profile, generate your first \"Hello World\" app, and serve it locally. Tip Use the NR1 VS Code extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions. For more on how to serve and publish your application, see our guide on Deploying your New Relic One app. Get started nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). Configure your CLI preferences nr1 config:set Sets a specific configuration value. nr1 config:get Shows a specific configuration. nr1 config:list Lists your configuration choices. nr1 config:delete Removes the value of a specific configuration. Set up your Nerdpacks nr1 nerdpack:build Assembles your Nerdpack into bundles. nr1 nerdpack:clone Clones an open source Nerdpack from our GitHub repository. nr1 nerdpack:serve Serves your Nerdpack for testing and development purposes. nr1 nerdpack:uuid Shows or regenerates the UUID of a Nerdpack. nr1 nerdpack:publish Publishes your Nerdpack to New Relic. nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel. nr1 nerdpack:undeploy Undeploys a Nerdpack version from a specific channel. nr1 nerdpack:clean Cleans your developtment folders. nr1 nerdpack:validate Validates the contents of your Nerdpack. nr1 nerdpack:info Shows the state of your Nerdpack in the New Relic's registry. Manage your Nerdpack subscriptions nr1 subscription:set Subscribes your account to a Nerdpack and channel. nr1 subscription:list Lists all the Nerdpacks your account is subscribed to. nr1 subscription:unset Unsubscribes your account from a Nerdpack. Install and manage plugins nr1 plugins:install Installs a plugin into the CLI. nr1 plugins:link Links a plugin into the CLI for development. nr1 plugins:update Updates your installed plugins. nr1 plugins:uninstall Removes a plugin from the CLI. Manage catalog information nr1 catalog:info Shows the Nerdpack info stored in the catalog. nr1 catalog:submit Gathers and submits the catalog info on the current folder.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 262.57266,
+ "_score": 229.41441,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
"title": "New Relic One CLI reference",
- "sections": "New Relic One CLI Commands",
+ "sections": "New Relic One CLI reference",
"info": "An overview of the CLI to help you build, deploy, and manage New Relic apps.",
"tags": "New Relic One app",
- "body": " extension to build your apps. New Relic One CLI Commands This table provides descriptions for the New Relic One commands. For more context, including usage and option details, click any individual command or the command category. For details on user permissions, see Authentication and permissions"
+ "body": "New Relic 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"
},
{
- "nodeid": 37686,
+ "nodeid": 6276,
"sections": [
- "AWS Lambda monitoring",
+ "New Relic Alerts",
"Get started",
- "Enable Lambda monitoring",
- "UI and data",
+ "Alert policies",
+ "Alert conditions",
+ "Alert violations",
+ "Alert Incidents",
+ "Alert notifications",
"Troubleshooting",
- "Update serverless monitoring for AWS Lambda",
- "Update our Lambda integration via CLI",
- "Update Layers via CLI",
- "Update a manual Serverless Application Repository install",
- "Enabling log management",
+ "Rules, limits, and glossary",
+ "Alerts and Nerdgraph",
+ "REST API alerts",
+ "REST API calls for alerts",
+ "Available data and functions via API",
+ "Conditions excluded from the REST API",
+ "Using a Personal API key with the REST API",
+ "Notification channels",
+ "Conditions for APM, Browser, Mobile",
+ "Conditions for NRQL",
+ "Conditions for external services",
+ "Conditions for Synthetic monitoring",
+ "Conditions for plugins",
+ "Alert activity: Events, violations, incidents",
+ "Alert entity conditions",
"For more help"
],
- "title": "Update serverless monitoring for AWS Lambda",
- "category_0": "Serverless function monitoring",
+ "title": "REST API calls for alerts",
+ "category_0": "Alerts and Applied Intelligence",
"type": "docs",
- "category_1": "AWS Lambda monitoring",
- "external_id": "9241e43c2db3e0298407449d530fa8fe601c1833",
- "image": "",
- "url": "https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/update-serverless-monitoring-aws-lambda",
- "published_at": "2020-09-30T14:25:39Z",
- "updated_at": "2020-09-24T13:54:59Z",
- "breadcrumb": "Contents / Serverless function monitoring / AWS Lambda monitoring / Enable Lambda monitoring",
- "document_type": "page",
- "popularity": 1,
- "info": "How to update our Serverless monitoring for AWS Lambda. ",
- "body": "After enabling our monitoring for AWS Lambda, you should occasionally update our Lambda function that's used to report AWS log data: newrelic-log-ingestion. There are two ways to do this: Update via CLI: Use this if you enabled our Lambda monitoring using our CLI tool. Update via AWS Serverless Application Repository: Use this if you enabled using the manual procedure. These update procedures apply to our serverless monitoring for AWS Lambda, and not to our infrastructure monitoring for AWS Lambda integration. Update our Lambda integration via CLI This section describes how to update if your Lambda monitoring was enabled using our recommended CLI tool. Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following command, replacing YOUR_REGION with your region identifier (for example, us-west-2). newrelic-lambda integrations update \\ --aws-region YOUR_REGION If you do not have our logs enabled, you'll also need to update your AWS CloudWatch log subscription filters with the following command: newrelic-lambda subscriptions install \\ --function installed \\ --aws-region YOUR_REGION Update Layers via CLI This section describes how to update your function's Layer if you installed it with our CLI tool. Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli Pass the --upgrade flag to the install command: newrelic-lambda layers install \\ --function installed \\ --nr-account-id NR_ACCOUNT_ID \\ --upgrade Update a manual Serverless Application Repository install If you manually installed the ingest function from the AWS Serverless Application Repository (and didn't use the CLI), update using this procedure: Run the following, replacing YOUR_REGION with your region (for example, us-west-2). aws serverlessrepo create-cloud-formation-change-set \\ --application-id arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion \\ --stack-name NewRelic-log-ingestion \\ --capabilities CAPABILITY_RESOURCE_POLICY \\ --region YOUR_REGION This command outputs several fields, one of which is the ChangeSetId: an ARN for the change set that you just created. Copy that ARN. Use the ARN in this command, which executes the change set: aws cloudformation execute-change-set --change-set-name YOUR_CHANGE_SET_ARN Enabling log management If you currently don't have New Relic's log management enabled, but would like to: Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following command, replacing YOUR_REGION with your region (for example, us-west-2). newrelic-lambda integrations update \\ --enable-logs \\ --aws-region YOUR_REGION Then update your AWS CloudWatch log subscription filters for each region with the following command: newrelic-lambda subscriptions install \\ --function installed \\ --filter-pattern \"\" \\ --aws-region YOUR_REGION For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
- "_index": "520d1d5d14cc8a32e600034b",
- "_type": "520d1d5d14cc8a32e600034c",
- "_score": 148.79468,
- "_version": null,
- "_explanation": null,
- "sort": null,
- "highlight": {
- "sections": "Update our Lambda integration via CLI",
- "body": " YOUR_CHANGE_SET_ARN Enabling log management If you currently don't have New Relic's log management enabled, but would like to: Make sure you have the latest version of the CLI: pip install --upgrade newrelic-lambda-cli For each region in which you've installed the newrelic-log-ingestion function, run the following"
- },
- "id": "5f6ca534196a67b08750423e"
- },
- {
- "sections": [
- "New Relic CLI Reference",
- "New Relic CLI commands",
- "Options",
- "Commands"
- ],
- "title": "New Relic CLI Reference",
- "type": "developer",
- "tags": "new relic cli",
- "external_id": "471ed214caaf80c70e14903ec71411e2a1c03888",
- "image": "",
- "url": "https://developer.newrelic.com/explore-docs/newrelic-cli/",
- "published_at": "2020-10-01T01:54:35Z",
- "updated_at": "2020-08-14T01:47:12Z",
- "document_type": "page",
- "popularity": 1,
- "info": "The command line tools for performing tasks against New Relic APIs",
- "body": "New Relic CLI Reference The New Relic CLI enables the integration of New Relic into your existing workflows. Be it fetching data from your laptop while troubleshooting an issue, or adding New Relic into your CI/CD pipeline. New Relic CLI commands Find details for the New Relic CLI command docs in GitHub. Options --format string output text format [YAML, JSON, Text] (default \"JSON\") -h, --help help for newrelic --plain output compact text Copy Commands newrelic apm - Interact with New Relic APM newrelic completion - Generates shell completion functions newrelic config - Manage the configuration of the New Relic CLI newrelic documentation - Generate CLI documentation newrelic entity - Interact with New Relic entities newrelic nerdgraph - Execute GraphQL requests to the NerdGraph API newrelic nerdstorage - Read, write, and delete NerdStorage documents and collections. newrelic nrql - Commands for interacting with the New Relic Database newrelic profile - Manage the authentication profiles for this tool newrelic version - Show the version of the New Relic CLI newrelic workload - Interact with New Relic One workloads",
- "_index": "520d1d5d14cc8a32e600034b",
- "_type": "520d1d5d14cc8a32e600034c",
- "_score": 134.74843,
- "_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"
- },
- {
+ "category_1": "New Relic Alerts",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/rest-api-alerts/rest-api-calls-alerts",
+ "external_id": "f696d6446d171b8db8c84991bb88c9690b5d3f5b",
"image": "",
- "url": "https://developer.newrelic.com/explore-docs/nr1-common/",
- "sections": [
- "New Relic One CLI common commands",
- "Command details",
- "nr1 help",
- "See commands and get details",
- "Usage",
- "Arguments",
- "Examples",
- "nr1 update",
- "Update your CLI",
- "nr1 create",
- "Create a new component",
- "Options",
- "nr1 profiles",
- "Manage your profiles keychain",
- "Commands",
- "nr1 autocomplete",
- "See autocomplete installation instructions",
- "nr1 nrql",
- "Query using NRQL"
- ],
- "published_at": "2020-10-01T01:56:53Z",
- "title": "New Relic One CLI common commands",
- "updated_at": "2020-08-14T01:48:10Z",
- "type": "developer",
- "external_id": "503e515e1095418f8d19329517344ab209d143a4",
+ "url": "https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/rest-api-alerts/rest-api-calls-alerts",
+ "published_at": "2020-10-06T02:37:17Z",
+ "updated_at": "2020-10-06T02:37:17Z",
+ "breadcrumb": "Contents / Alerts and Applied Intelligence / New Relic Alerts / REST API alerts",
"document_type": "page",
"popularity": 1,
- "info": "An overview of common commands you can use with the New Relic One CLI.",
- "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1 update Updates to the latest version of the CLI. nr1 create Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). nr1 profiles Manages the profiles you use to run CLI commands. nr1 autocomplete Displays autocomplete installation instructions. nr1 nrql Fetches data using NRQL (New Relic query language). See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs. Command details nr1 help See commands and get details Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME. Usage $ nr1 help Arguments COMMAND_NAME The name of a particular command. Examples $ nr1 help $ nr1 help nerdpack $ nr1 help nerdpack:deploy nr1 update Update your CLI Updates to latest version of the CLI. You can specify which channel to update if you'd like. Usage $ nr1 update Arguments CHANNEL The name of a particular channel. Examples $ nr1 update $ nr1 update somechannel nr1 create Create a new component Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process. To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands. Usage $ nr1 create Options -f, --force If present, overrides existing files without asking. -n, --name=NAME Names the component. -t, --type=TYPE Specifies the component type. --path=PATH The route to the component. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output. nr1 profiles Manage your profiles keychain Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. To learn more about setting up profiles, see our Github workshop. Usage $ nr1 profiles:COMMAND Commands profiles:add Adds a new profile to your profiles keychain. profiles:default Chooses which profile should be default. profiles:list Lists the profiles on your keychain. profiles:remove Removes a profile from your keychain. nr1 autocomplete See autocomplete installation instructions Displays the autocomplete installation instructions. By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash. Usage $ nr1 autocomplete Arguments SHELL The shell type you want instructions for. Options -r, --refresh-cache Refreshes cache (ignores displaying instructions). Examples $ nr1 autocomplete $ nr1 autocomplete zsh $ nr1 autocomplete bash $ nr1 autocomplete --refresh-cache nr1 nrql Query using NRQL Fetches data from databases using a NRQL query. To learn more about NRQL and how to use it, see our NRQL docs. Usage $ nr1 nrql OPTION ... Options -a, --account=ACCOUNT The user account ID. required -q, --query=QUERY The NRQL query to run. required -u, --ugly Displays the content without tabs or spaces. --profile=PROFILE The authentication profile you want to use. --verbose Adds extra information to the output.",
+ "info": "Read about how to use the REST API Explorer with alerts.",
+ "body": "Our REST API (v2) allows you to configure settings for alerts. The API Explorer also includes the curl request format, available parameters, potential response status codes, and JSON response structure for each of the available API calls. You can also create alert conditions in the UI. For infrastructure alerting, see REST API for infrastructure monitoring alerts. Available data and functions via API REST API functions Comments View account data In general, any role can use the account's REST API key or a Personal API key with GET > List functions to view alerts data. The account Owner and Admins may use their API key. List output will be paginated. Available functions include: Alert policies Notification channels Conditions for APM, Browser, and Mobile (Some limitations apply.) Conditions for external services Conditions for Synthetic monitoring Conditions for Plugins Conditions for NRQL (Some limitations apply.) Events Violations Incidents Maintain account data You may have an Owner or Admin role in your account and an Admin user's API key or have a custom role that grants permissions to manage Alerts and a Personal API key in order to use any maintenance function, including POST > Create, PUT > Add, PUT > Update, and DELETE. Conditions excluded from the REST API These types of conditions do not have available endpoints in the API: APM: Web transaction percentiles, conditions targeting labels, and baselines NRQL: Baselines Using a Personal API key with the REST API To use a Personal API key in any of the examples below, replace 'X-Api-Key:{api_key}' with 'Api-Key:{personal_api_key}'. Alert policies These API functions include links to the API Explorer, where you can create, delete, or list policies. If your account hosts data in the EU data center, ensure you are using the proper API endpoints for EU region accounts. Create new policies To add new policies, use your Admin user's API key or Personal API key, and include these two values in the API call: Required values Definition Incident incident_preference Determines how Alerts will create incidents and group violations. This must be one of the following: PER_POLICY (default): Roll up by policy. PER_CONDITION: Roll up by condition. PER_CONDITION_AND_TARGET: Roll up by target and condition. Policy name The policy name is required. Leaving it unchanged will create a policy called string. API Explorer: Alerts Policies > POST > Create curl -X POST 'https://api.newrelic.com/v2/alerts_policies.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"policy\": { \"incident_preference\": \"string\", \"name\": \"string\" } }' Update policies Use this API to update an existing policy's name and incident_preference. You'll need your Admin user's API key or Personal API key. Required values Definition id Required. To find a policy's ID, use either of these options: From the UI: On a policy's UI page, find the ID under the policy name. With the API: Use the List policies API. Incident incident_preference Determines how alerts will create incidents and group violations. Must be one of the following: PER_POLICY (default): Roll up by policy. PER_CONDITION: Roll up by condition. PER_CONDITION_AND_TARGET: Roll up by target and condition. Policy name Required. If you do not change the name, it defaults to a policy called string. To find a policy's exact name, use the List policies API. API Explorer: Alerts Policies > PUT > Update curl -X PUT 'https://api.newrelic.com/v2/alerts_policies/{id}.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"policy\": { \"incident_preference\": \"string\", \"name\": \"string\" } }' Delete existing policies To delete an existing policy, use your Admin user's API key or Personal API key, and include the policy_id (available from API Explorer: Alerts Policies > GET > List) in the API call: API Explorer: Alerts Policies > DELETE > Delete curl -X DELETE 'https://api.newrelic.com/v2/alerts_policies/{policy_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i List existing policies To view a list of existing policies for your account, use your API key or Personal API key, and include these optional values in the API call: Optional policy name filter Optional pagination value API Explorer: Alerts Policies > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_policies.json' \\ -H 'X-Api-Key:{api_key}' -i Notification channels These API functions include links to the API Explorer, where you can create, delete, or list Alerts notification channels. If your account hosts data in the EU data center, ensure you are using the proper API endpoints for EU region accounts. Create new notification channels To add new notification channels, use your Admin user's API key or Personal API keyand include these values in the API call: New channel's name Type of channel Configuration values The API Explorer shows the format for required configuration values for each type of notification channel. API Explorer: Alerts Channels > POST > Create curl -X POST 'https://api.newrelic.com/v2/alerts_channels.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"channel\": { \"name\": \"string\", \"type\": \"string\", \"configuration\": \"hash\" } }' The \"hash\" place holder in this example must be replaced by one of the following JSON blocks with the appropriate values substituted: Email channel { \"recipients\" : \"test@google.com\", \"include_json_attachment\" : true } OpsGenie channel { \"api_key\": \"abc123\", \"teams\": \"team1\", \"tags\": \"tag1\", \"recipients\": \"me@me.com\" } Slack channel { \"url\": \"http://test.com\", \"channel\": \"channel1\" } VictorOps channel { \"key\": \"mykey\", \"route_key\": \"theroute\" } PagerDuty channel { \"service_key\": \"myservicekey\" } Webhook (json) channel This example shows the default payload inserted. (The payload attribute is optional.) The payload can be customized to have different keys than the ones shown and will be sent with the $ prefixed attributes interpolated prior to delivery. The condition_id is deprecated. Instead, use condition_family_id. { \"base_url\": \"http://test.com\", \"auth_username\": \"username\", \"auth_password\": \"password\", \"payload_type\": \"application/json\", \"headers\": { \"header1\": \"test\", \"header2\": \"test\" } \"payload\": { \"account_id\": \"$ACCOUNT_ID\", \"account_name\": \"$ACCOUNT_NAME\", \"closed_violations_count_critical\": \"$CLOSED_VIOLATIONS_COUNT_CRITICAL\", \"closed_violations_count_warning\": \"$CLOSED_VIOLATIONS_COUNT_WARNING\", \"condition_family_id\": \"$CONDITION_FAMILY_ID\", \"condition_id\": \"$CONDITION_ID\", \"condition_name\": \"$CONDITION_NAME\", \"current_state\": \"$EVENT_STATE\", \"details\": \"$EVENT_DETAILS\", \"duration\": \"$DURATION\", \"event_type\": \"$EVENT_TYPE\", \"incident_acknowledge_url\": \"$INCIDENT_ACKNOWLEDGE_URL\", \"incident_id\": \"$INCIDENT_ID\", \"incident_url\": \"$INCIDENT_URL\", \"open_violations_count_critical\": \"$OPEN_VIOLATIONS_COUNT_CRITICAL\", \"open_violations_count_warning\": \"$OPEN_VIOLATIONS_COUNT_WARNING\", \"owner\": \"$EVENT_OWNER\", \"policy_name\": \"$POLICY_NAME\", \"policy_url\": \"$POLICY_URL\", \"runbook_url\": \"$RUNBOOK_URL\", \"severity\": \"$SEVERITY\", \"targets\": \"$TARGETS\", \"timestamp\": \"$TIMESTAMP\", \"violation_callback_url\": \"$VIOLATION_CALLBACK_URL\", \"violation_chart_url\": \"$VIOLATION_CHART_URL\" } } Webhook (x-www-form-urlencoded) channel This example shows the default payload inserted. (The payload attribute is optional.) The payload can be customized to have different keys than the ones shown and will be sent with the $ prefixed attributes interpolated prior to delivery. The condition_id is deprecated. Instead, use condition_family_id. { \"base_url\": \"http://test.com\", \"auth_username\": \"username\", \"auth_password\": \"password\", \"payload_type\": \"application/x-www-form-urlencoded\", \"headers\": { \"header1\": \"test\", \"header2\": \"test\" }, \"payload\": { \"account_id\": \"$ACCOUNT_ID\", \"account_name\": \"$ACCOUNT_NAME\", \"closed_violations_count_critical\": \"$CLOSED_VIOLATIONS_COUNT_CRITICAL\", \"closed_violations_count_warning\": \"$CLOSED_VIOLATIONS_COUNT_WARNING\", \"condition_family_id\": \"$CONDITION_FAMILY_ID\", \"condition_id\": \"$CONDITION_ID\", \"condition_name\": \"$CONDITION_NAME\", \"current_state\": \"$EVENT_STATE\", \"details\": \"$EVENT_DETAILS\", \"duration\": \"$DURATION\", \"event_type\": \"$EVENT_TYPE\", \"incident_acknowledge_url\": \"$INCIDENT_ACKNOWLEDGE_URL\", \"incident_id\": \"$INCIDENT_ID\", \"incident_url\": \"$INCIDENT_URL\", \"open_violations_count_critical\": \"$OPEN_VIOLATIONS_COUNT_CRITICAL\", \"open_violations_count_warning\": \"$OPEN_VIOLATIONS_COUNT_WARNING\", \"owner\": \"$EVENT_OWNER\", \"policy_name\": \"$POLICY_NAME\", \"policy_url\": \"$POLICY_URL\", \"runbook_url\": \"$RUNBOOK_URL\", \"severity\": \"$SEVERITY\", \"targets\": \"$TARGETS\", \"timestamp\": \"$TIMESTAMP\", \"violation_callback_url\": \"$VIOLATION_CALLBACK_URL\", \"violation_chart_url\": \"$VIOLATION_CHART_URL\" } } Delete existing notification channels To delete an existing notification channels, use your Admin user's API key or Personal API key, and include the channel_id (available from API Explorer: Alerts Channels > GET > List) in the API call: API Explorer: Alerts Channels > DELETE > Delete curl -X DELETE 'https://api.newrelic.com/v2/alerts_channels/{channel_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i List existing notification channels To view a list of existing notification channels for your account, use your REST API key, Admin user's API key, or Personal API key and an optional pagination value in the API call. API Explorer: Alerts Channels > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_channels.json' \\ -H 'X-Api-Key:{api_key}' -i Update notification channels associated with policies You can associate a policy with one or more notification channels. You can also associate a notification channel with one or more policies. To add notification channels to policies, use your Admin user's API key or Personal API key and these values in the API call: A policy_id value (available from API Explorer: Alerts Policies > GET > List) One or more channel_id values in an array, separated by commas or a new line (available from API Explorer: Alerts Channels > GET > List) API Explorer: Alerts Policy Channels > PUT > Update curl -X PUT 'https://api.newrelic.com/v2/alerts_policy_channels.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -G -d 'policy_id=policy_id&channel_ids=channel_id' Delete notification channels associated with policies You can associate a policy with one or more notification channels. You can also associate a notification channel with one or more alert policies. To remove a policy from a channel, or to remove a channel from a policy, use your Admin user's API key or Personal API keyand these values in the API call: The policy_id (available from API Explorer: Alerts Policies > GET > List) The channel_id (available from API Explorer: Alerts Channels > GET > List) API Explorer: Alerts Policy Channels > DELETE > Delete curl -X DELETE 'https://api.newrelic.com/v2/alerts_policy_channels.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -d 'channel_id={channel_id}&policy_id={policy_id}' Conditions for APM, Browser, Mobile These API functions include links to the API Explorer, where you can create, update, delete, or list policy conditions. These calls are for conditions with these types of entities: APM: Apps and key transactions Browser: Apps and key transactions Mobile: Mobile apps Exception: The following APM conditions are not available from this API endpoint: Conditions targeting labels (dynamic targeting) Web transaction percentile conditions Baseline conditions The API Explorer provides information about other types of conditions using separate endpoints, including external services (APM and Mobile), plugins, and Synthetic monitoring. Consider all types of alert conditions when searching or updating. If your account hosts data in the EU data center, ensure you are using the proper API endpoints for EU region accounts. Create conditions for policies To add conditions to policies, include these values in the API call: Your Admin user's API key or Personal API key The policy_id (available from API Explorer: Alerts Policies > GET > List) The required condition values in the API call (described in the API Explorer page and in the Alerts conditions API glossary) API Explorer: Alerts Conditions > POST > Create curl -X POST 'https://api.newrelic.com/v2/alerts_conditions/policies/{policy_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"condition\": { \"type\": \"string\", \"name\": \"string\", \"enabled\": boolean, \"entities\": [ integer ], \"metric\": \"string\", \"gc_metric\": \"string\", \"condition_scope\": \"string\", \"violation_close_timer\": integer, \"runbook_url\": \"string\", \"terms\": [ { \"duration\": \"string\", \"operator\": \"string\", \"priority\": \"string\", \"threshold\": \"string\", \"time_function\": \"string\" } ], \"user_defined\": { \"metric\": \"string\", \"value_function\": \"string\" } } }' The JSON response returns a condition id, which you will need to update or delete the condition. You can also view the condition id from API Explorer: Alerts Conditions > GET > List. Update conditions for policies To update conditions for policies, include these values in the API call: Your Admin user's API key or Personal API key The condition's id (available from API Explorer: Alerts Conditions > GET > List) The required condition values in the API call (described in the API Explorer page and in the Alerts conditions API glossary) API Explorer: Alerts Conditions > PUT > Update curl -X PUT 'https://api.newrelic.com/v2/alerts_conditions/{id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"condition\": { \"type\": \"string\", \"name\": \"string\", \"enabled\": boolean, \"entities\": [ integer ], \"metric\": \"string\", \"metric\": \"string\", \"gc_metric\": \"string\", \"condition_scope\": \"string\", \"violation_close_timer\": integer, \"runbook_url\": \"string\", \"terms\": [ { \"duration\": \"string\", \"operator\": \"string\", \"priority\": \"string\", \"threshold\": \"string\", \"time_function\": \"string\" } ], \"user_defined\": { \"metric\": \"string\", \"value_function\": \"string\" } } }' Delete conditions from policies To delete conditions from policies, include these values in the API call: Your Admin user's API key or Personal API key The condition_id (available from API Explorer: Alerts Conditions > GET > List) API Explorer: Alerts Conditions > DELETE > Delete curl -X DELETE 'https://api.newrelic.com/v2/alerts_conditions/{condition_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i List existing conditions for policies To view a list of existing conditions for your policy, use your REST API key, Admin user's API key, or Personal API key and the associated policy_id in the API call. API Explorer: Alerts Conditions > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_conditions.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -d 'policy_id={policy_id}' Conditions for NRQL These API functions include links to the API Explorer, where you can create, update, delete, or list NRQL conditions for your policies. Exception: NRQL baseline conditions are not available from this endpoint. If your account hosts data in the EU data center, ensure you are using the proper API endpoints for EU region accounts. Create NRQL conditions for policies Recommendation: Due to the way NRQL data is aggregated, set the nrql[since_value] to 3 or higher to prevent false positives. This equates to the Evaluation Offset value in the Alerts Condition UI. API Explorer: Alerts Nrql Conditions > POST > Create To create NRQL conditions for policies: curl -X POST 'https://api.newrelic.com/v2/alerts_nrql_conditions/policies/{policy_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"nrql_condition\": { \"type\": \"string\", \"name\": \"string\", \"runbook_url\": \"string\", \"enabled\": boolean, \"terms\": [ { \"duration\": \"string\", \"operator\": \"string\", \"priority\": \"string\", \"threshold\": \"string\", \"time_function\": \"string\" } ], \"value_function\": \"string\", \"nrql\": { \"query\": \"string\", \"since_value\": \"string\" } } }' If you set nrql[since_value] to 3 and nrql[query] to SELECT count FROM myEvent, New Relic evaluates the following query against the terms[threshold] value once per minute: SELECT count FROM myEvent SINCE 3 minutes ago UNTIL 2 minutes ago If you set type as outlier, you can omit the value_function. However, two additional fields are required: expected_groups and ignore_overlap. For more information, see Alerts Conditions API field names. If you omit type or set it as static, it will default to standard NRQL alerting. Update NRQL conditions for policies Recommendation: Due to the way NRQL data is aggregated, set the nrql[since_value] to 3 or higher to prevent false positives. This allows three minutes to aggregate data, and equates to the Evaluation Offset value in the Alerts Condition UI. To update NRQL conditions for policies, include these values in the API call: Your Admin user's API key or Personal API key The condition's id (available from API Explorer: [external link] Alerts Nrql Conditions > GET > List) The required condition values in the API call (described in the API Explorer page and in the Alerts conditions API glossary) API Explorer: Alerts Nrql Conditions > PUT > Update curl -X PUT 'https://api.newrelic.com/v2/alerts_nrql_conditions/{id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"nrql_condition\": { \"name\": \"string\", \"runbook_url\": \"string\", \"enabled\": boolean, \"terms\": [ { \"duration\": \"string\", \"operator\": \"string\", \"priority\": \"string\", \"threshold\": \"string\", \"time_function\": \"string\" } ], \"value_function\": \"string\", \"nrql\": { \"query\": \"string\", \"since_value\": \"string\" } } }' Delete NRQL conditions for policies To delete NRQL conditions from policies, include these values in the API call: Your Admin user's API key or Personal API key The condition's id (available from API Explorer: [external link] Alerts Nrql Conditions > GET > List) API Explorer: Alerts Nrql Conditions > DELETE > Delete curl -X DELETE 'https://api.newrelic.com/v2/alerts_nrql_conditions/{condition_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i List existing NRQL conditions for policies To view a list of existing conditions for your alert policy, use your REST API key, Admin user's API key, or Personal API key and the associated policy_id in the API call. API Explorer: Alerts Nrql Conditions > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_nrql_conditions.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -d 'policy_id={policy_id}' Conditions for external services These API functions include links to the API Explorer, where you can create, update, delete, or list policy conditions. These calls are for conditions for external services. The API calls can be used with APM and Mobile apps. If your account hosts data in the EU data center, ensure you are using the proper API endpoints for EU region accounts. External services: Create conditions for policies To add conditions for external services to policies that have APM or Mobile apps, include these values in the API call: Your Admin user's API key or Personal API key The policy_id (available from API Explorer: Alerts Policies > GET > List) The required external_service_condition values in the API call (described in the API Explorer page and in the Alerts conditions API glossary) API Explorer: Alerts External Service Conditions > POST > Create curl -X POST 'https://api.newrelic.com/v2/alerts_external_service_conditions/policies/{policy_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"external_service_condition\": { \"type\": \"string\", \"name\": \"string\", \"enabled\": boolean, \"entities\": [ integer ], \"external_service_url\": \"string\", \"metric\": \"string\", \"runbook_url\": \"string\", \"terms\": [ { \"duration\": \"string\", \"operator\": \"string\", \"priority\": \"string\", \"threshold\": \"string\", \"time_function\": \"string\" } ] } }' The JSON response returns a condition id, which you will need to update or delete the condition. You can also view the condition id from API Explorer: Alerts External Service Conditions > GET > List. External services: Update conditions for policies To update conditions for external services to policies that have APM or Mobile apps, include these values in the API call: Your Admin user's API key or Personal API key The external service condition's id (available from API Explorer: Alerts External Service Conditions > GET > List) The required external_service_condition values in the API call (described in the API Explorer page and in the Alerts conditions API glossary) API Explorer: Alerts External Service Conditions > PUT > Update curl -X PUT 'https://api.newrelic.com/v2/alerts_external_service_conditions/{id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"external_service_condition\": { \"type\": \"string\", \"name\": \"string\", \"enabled\": boolean, \"entities\": [ integer ], \"external_service_url\": \"string\", \"metric\": \"string\", \"runbook_url\": \"string\", \"terms\": [ { \"duration\": \"string\", \"operator\": \"string\", \"priority\": \"string\", \"threshold\": \"string\", \"time_function\": \"string\" } ] } }' External services: Delete conditions from policies To delete conditions for external services from policies with APM or Mobile apps, include these values in the API call: Your Admin user's API key or Personal API key The condition_id (available from API Explorer: Alerts External Service Conditions > GET > List) API Explorer: Alerts External Service Conditions > DELETE > Delete curl -X DELETE 'https://api.newrelic.com/v2/alerts_external_service_conditions/{condition_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i External services: List existing conditions for policies To view a list of existing conditions for policies with external service apps (APM or Mobile), use your REST API key, Admin user's API key, or Personal API key and the associated policy_id in the API call. API Explorer: Alerts External Service Conditions > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_external_service_conditions.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -d 'policy_id={policy_id}' Conditions for Synthetic monitoring These API functions include links to the API Explorer, where you can create, update, delete, or list conditions for your alert policies. The API calls can be used with Synthetic monitoring. Synthetics: Create conditions for policies To add conditions to policies for Synthetic monitoring, include these values in the API call: Your Admin user's API key or Personal API key The policy_id (available from API Explorer: Alerts Policies > GET > List) The required synthetics_condition values in the API call (described in the API Explorer page and in the Alerts conditions API glossary) API Explorer: Alerts Synthetics Conditions > POST > Create curl -X POST 'https://api.newrelic.com/v2/alerts_synthetics_conditions/policies/{policy_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"synthetics_condition\": { \"name\": \"string\", \"monitor_id\": \"string\", \"runbook_url\": \"string\", \"enabled\": boolean } }' The JSON response returns a condition id, which you will need to update or delete the condition. You can also view the condition id from API Explorer: Alerts Synthetics Conditions > GET > List. Synthetic monitoring: Update conditions for policies To update policy conditions for Synthetic monitoring, include these values in the API call: Your Admin user's API key or Personal API key The condition id (available from API Explorer: Alerts Synthetics Conditions > GET > List) The required synthetics_condition values in the API call (described in the API Explorer page to create alert conditions for Synthetics and in the Alerts conditions API glossary) API Explorer: Alerts Synthetics Conditions > PUT > Update curl -X PUT 'https://api.newrelic.com/v2/alerts_synthetics_conditions/{id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"synthetics_condition\": { \"name\": \"string\", \"monitor_id\": \"string\", \"runbook_url\": \"string\", \"enabled\": boolean } }' Synthetic monitoring: Delete conditions from policies To delete policy conditions for Synthetic monitoring, include these values in the API call: Your Admin user's API key or Personal API key The condition_id (available from API Explorer: Alerts Synthetics Conditions > GET > List) API Explorer: Alerts Synthetics Conditions > DELETE > Delete curl -X DELETE 'https://api.newrelic.com/v2/alerts_synthetics_conditions/{condition_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i Synthetic monitoring: List existing conditions for policies To view a list of existing policy conditions for Synthetic monitoring, use your REST API key, Admin user's API key, or Personal API key and the associated policy_id in the API call. API Explorer: Alerts Synthetics Conditions > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_synthetics_conditions.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -d 'policy_id=policy_id' Conditions for plugins These API functions include links to the API Explorer, where you can create, update, delete, or list conditions for your alert policies. The API calls can be used with plugins from New Relic's Plugin Central. Plugins: Create conditions for policies To add conditions to policies for plugin components or instances, include these values in the API call: Your Admin user's API key or Personal API key The policy_id (available from API Explorer: Alerts Policies > GET > List) The required plugins_condition values in the API call (described in the API Explorer page and in the Alerts conditions API glossary) API Explorer: Alerts Plugins Conditions > POST > Create curl -X POST 'https://api.newrelic.com/v2/alerts_plugins_conditions/policies/{policy_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"plugins_condition\": { \"name\": \"string\", \"enabled\": boolean, \"entities\": [ integer ], \"metric_description\": \"string\", \"metric\": \"string\", \"value_function\": \"string\", \"runbook_url\": \"string\", \"terms\": [ { \"duration\": \"string\", \"operator\": \"string\", \"priority\": \"string\", \"threshold\": \"string\", \"time_function\": \"string\" } ], \"plugin\": { \"id\": \"string\", \"guid\": \"string\" } } }' The JSON response returns a condition id, which you will need to update or delete the condition. You can also view the condition id from API Explorer: Alerts Plugins Conditions > GET > List. Plugins: Update conditions for policies To update policy conditions for plugin components or instances, include these values in the API call: Your Admin user's API key or Personal API key The condition id (available from API Explorer: Alerts Plugins Conditions > GET > List) The required plugins_condition values in the API call (described in the API Explorer page to create alert conditions for plugins and in the Alerts conditions API glossary) API Explorer: Alerts Plugins Conditions > PUT > Update curl -X PUT 'https://api.newrelic.com/v2/alerts_plugins_conditions/{id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i \\ -H 'Content-Type: application/json' \\ -d \\ '{ \"plugins_condition\": { \"name\": \"string\", \"enabled\": boolean, \"entities\": [ integer ], \"metric_description\": \"string\", \"metric\": \"string\", \"value_function\": \"string\", \"runbook_url\": \"string\", \"terms\": [ { \"duration\": \"string\", \"operator\": \"string\", \"priority\": \"string\", \"threshold\": \"string\", \"time_function\": \"string\" } ], \"plugin\": { \"id\": \"string\", \"guid\": \"string\" } } }' Plugins: Delete conditions from policies To delete conditions from policies for plugin components or instances, include these values in the API call: Your Admin user's API key or Personal API key The condition id (available from API Explorer: Alerts Plugins Conditions > GET > List) API Explorer: Alerts Plugins Conditions > DELETE > Delete curl -X DELETE 'https://api.newrelic.com/v2/alerts_plugins_conditions/{condition_id}.json' \\ -H 'X-Api-Key:{admin_api_key}' -i Plugins: List existing conditions for policies To view a list of existing conditions for policies with plugin components or instances, use your REST API key, Admin user's API key, or Personal API key and the associated policy_id in the API call. API Explorer: Alerts Plugins Conditions > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_plugins_conditions.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -d 'policy_id={policy_id}' Alert activity: Events, violations, incidents These API functions include links to the API Explorer, where you can view information about events, violations, and incidents for your alert policies. If your account hosts data in the EU data center, ensure you are using the proper API endpoints for EU region accounts. List Events To view events for entities monitored by APM, Browser, Mobile, Plugins, Synthetic monitoring, and Alerts, include these values in the API call: Your REST API key, Admin user's API key, or Personal API key Other optional values to use as filters (described in the API Explorer page) that depend on the type of product (browser monitoring, mobile monitoring, etc.), entity (as apps or key transactions for APM, synthetic monitoring, etc.), and type of event (notification, deployment, instrumentation, etc.) An optional pagination value API Explorer: Alerts Events > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_events.json' \\ -H 'X-Api-Key:{api_key}' -i List Violations To view violations for any entity monitored for your account, include these values in the API call: Your REST API key, Admin user's API key, or Personal API key An optional flag to show only those violations that are currently open An optional pagination value API Explorer: Alerts Violations > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_violations.json' \\ -H 'X-Api-Key:{api_key}' -i To find policy, condition, and incident information: take the IDs found in the links section in the violations property and place them into the URLs contained in the outer links property of the payload. List Incidents To view incidents for any entity monitored for your account, include these values in the API call: Your REST API key, Admin user's API key, or Personal API key An optional flag to show only those incidents that are currently open An optional flag to exclude violation data from response An optional pagination value API Explorer: Alerts Incidents > GET > List curl -X GET 'https://api.newrelic.com/v2/alerts_incidents.json' \\ -H 'X-Api-Key:{api_key}' -i Show Incident To show a single incident associated with your account, include these values in the API call: Your REST API key, Admin user's API key, or Personal API key An incident ID API Explorer: Alerts Incidents > GET > Show curl -X GET 'https://api.newrelic.com/v2/alerts_incidents/{id}.json' \\ -H 'X-Api-Key:{api_key}' -i Acknowledge Incident To acknowledge an incident associated with your account, include these values in the API call: Your Admin user's API key or Personal API key. An incident ID API Explorer: Alerts Incidents > PUT > Acknowledge curl -X PUT 'https://api.newrelic.com/v2/alerts_incidents/{id}/acknowledge.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -H 'Content-Type: application/json' Close Incident To close an incident associated with your account, include these values in the API call: Your Admin user's API key or Personal API key. An incident ID API Explorer: Alerts Incidents > PUT > Close curl -X PUT 'https://api.newrelic.com/v2/alerts_incidents/{id}/close.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -H 'Content-Type: application/json' Alert entity conditions These API functions include links to the API Explorer, where you can list, add and remove entities in the conditions for your alert policies. If your account hosts data in the EU data center, ensure you are using the proper API endpoints for EU region accounts. List condition by entity To view the conditions an entity is part of for APM, Browser, Mobile, key transactions, and Plugins, include these values in the API call: Your REST API key, Admin user's API key, or Personal API key The entity_id This is the specific entity (alert target) to be monitored. The entity_type, which must be one of the following: Application BrowserApplication MobileApplication KeyTransaction Plugin API Explorer: Alerts Entity Conditions > GET > list curl -X GET 'https://api.newrelic.com/v2/alerts_entity_conditions/{entity_id}.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -G -d 'entity_type={entity_type}' Add an entity to a condition To add an entity to a condition, include these values in the API call: Your Admin user's API key or Personal API key The entity_id This is the entity (alert target) to be monitored. It is the numeric ID for the APM application, browser app, plugin, key transaction, or mobile app. The condition_id (available from API Explorer: Alerts Conditions > GET > List) The entity_type, which must be one of the following: Application BrowserApplication MobileApplication KeyTransaction Plugin API Explorer: Alerts Entity Conditions > PUT > Add curl -X PUT 'https://api.newrelic.com/v2/alerts_entity_conditions/{entity_id}.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -H 'Content-Type: application/json' \\ -G -d 'entity_type={entity_type}&condition_id={condition_id}' Remove an entity from a condition To remove an entity being monitored from a condition, include these values in the API call: Your Admin user's API key or Personal API key The entity_id This is the specific monitored entity (alert target) to be removed. It is the numeric ID for the APM application, browser app, plugin, key transaction, or mobile app. The condition_id (available from API Explorer: Alerts Conditions > GET > List) The entity_type, which must be one of the following: Application BrowserApplication MobileApplication KeyTransaction Plugin API Explorer: Alerts Entity Conditions > DELETE > Remove curl -X DELETE 'https://api.newrelic.com/v2/alerts_entity_conditions/{entity_id}.json' \\ -H 'X-Api-Key:{api_key}' -i \\ -G -d 'entity_type={entity_type}&condition_id={condition_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.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 123.66484,
+ "_score": 173.20406,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
- "title": "New Relic One CLI common commands",
- "sections": "New Relic One CLI common commands",
- "info": "An overview of common commands you can use with the New Relic One CLI.",
- "body": "New Relic One CLI common commands Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command. Command Description nr1 help Shows all nr1 commands or details about each command. nr1"
+ "title": "REST API calls for alerts",
+ "sections": "New Relic Alerts",
+ "info": "Read about how to use the REST API Explorer with alerts.",
+ "category_1": "New Relic Alerts",
+ "translation_ja_url": "https://docs.newrelic.co.jp/docs/alerts-applied-intelligence/new-relic-alerts/rest-api-alerts/rest-api-calls-alerts",
+ "body": ", or list Alerts notification channels. If your account hosts data in the EU data center, ensure you are using the proper API endpoints for EU region accounts. Create new notification channels To add new notification channels, use your Admin user's API key or Personal API keyand include these values",
+ "breadcrumb": "Contents / Alerts and Applied Intelligence / New Relic Alerts / REST API alerts"
},
- "id": "5f28bd6ae7b9d267996ade94"
+ "id": "5f344a7c196a677172fbd6e5"
},
{
"nodeid": 27692,
@@ -7387,25 +7204,113 @@
"external_id": "7992b896d4c35ca29aba34698aedd621dfe0b572",
"image": "https://docs.newrelic.com/sites/default/files/thumbnails/image/new-relic-lambda-monitoring-architecture.png",
"url": "https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/enable-lambda-monitoring/enable-serverless-monitoring-aws-lambda",
- "published_at": "2020-09-30T17:18:05Z",
- "updated_at": "2020-09-24T09:32:20Z",
+ "published_at": "2020-10-04T01:13:08Z",
+ "updated_at": "2020-10-04T01:13:08Z",
"breadcrumb": "Contents / Serverless function monitoring / AWS Lambda monitoring / Enable Lambda monitoring",
"document_type": "page",
"popularity": 1,
"info": "Read about how to install and enable New Relic monitoring for Amazon AWS Lambda. ",
- "body": "Serverless monitoring for AWS Lambda offers in-depth performance monitoring for your Lambda functions. Read on to learn how to enable this feature and get started using it. Using this feature may result in AWS charges. For more information, see the Lambda monitoring requirements. How Lambda monitoring works Before enabling Lambda monitoring, understanding how data flows from your Lambda functions to New Relic may be helpful: Diagram showing how data flows from a Lambda function to New Relic. When our Lambda monitoring is enabled, this is how data moves from your Lambda function to New Relic: The Lambda function is instrumented with our code. When the Lambda is invoked, log data is sent to CloudWatch. CloudWatch collects Lambda log data and sends it to our log-ingestion Lambda. The log-ingestion Lambda sends that data to New Relic. Enable procedure overview If you already have a New Relic account and use Node.js or Python, we recommend you use our automated installer. If you do not use the automated installer, complete these steps to set up monitoring: Install our CLI tool (recommended) Connect AWS and New Relic (required) Enable instrumentation of your Lambda (required) Stream CloudWatch logs to New Relic (required) Step 1. Install the newrelic-lambda-cli tool We provide a command line interface (CLI) tool that's used in steps 2 through 4. We recommend the CLI because it simplifies some of the work, but you can also perform those steps manually. If you want to understand what it does before you install it, see the manual procedures that the CLI tool performs in Step 2, Step 3 (option 2), and Step 4. You can also see the CLI documentation on GitHub. If you prefer a manual install, skip to Step 2. Connect AWS to New Relic. CLI requirements To use the CLI too, you need: Python 3.3 or higher The AWS CLI You must be a user or admin with an infrastructure manager Add-on role. Your AWS account needs permissions for creating IAM resources (Role and Policy) and Lambda functions. These resources are created using CloudFormation stacks, so you'll need permissions to create those. For more on permissions, including setting custom policies, expand this collapser: AWS permissions details Resource: * Actions: \"cloudformation:CreateChangeSet\", \"cloudformation:CreateStack\", \"cloudformation:DescribeStacks\", \"cloudformation:ExecuteChangeSets\", \"iam:AttachRolePolicy\", \"iam:CreateRole\", \"iam:GetRole\", \"iam:PassRole\", \"lambda:AddPermission\", \"lambda:CreateFunction\", \"lambda:GetFunction\", \"logs:DeleteSubscriptionFilter\", \"logs:DescribeSubscriptionFilters\", \"logs:PutSubscriptionFilter\" \"s3:GetObject\" \"serverlessrepo:CreateCloudFormationChangeSet\" Resource: \"arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion\" Actions: \"serverlessrepo:CreateCloudFormationTemplate\" \"serverlessrepo:GetCloudFormationTemplate\" Be sure that the AWS account you use to execute the CLI has all of these permissions. If your AWS account permissions are restrictive and you're unable to use the CLI, you can optionally use a manually managed custom IAM policy. This policy would require, at minimum, the following permissions: Resource: \"*\" Action: \"cloudwatch:GetMetricStatistics\" \"cloudwatch:ListMetrics\" \"cloudwatch:GetMetricData\" \"lambda:GetAccountSettings\" \"lambda:ListFunctions\" \"lambda:ListAliases\" \"lambda:ListTags\" \"lambda:ListEventSourceMappings\" These permissions are the minimum required. We recommend granting a managed ReadOnlyAccess policy as described in Connect AWS to infrastructure monitoring. CLI installation To install the CLI tool: Ensure you have the required permissions for both your New Relic and AWS account. From the command line, run: pip install newrelic-lambda-cli You may need to use pip3 in the command above if you have Python 2.7 installed. The CLI requires Python >=3.3. Step 2. Connect AWS to New Relic You must complete this step, and steps 3 and 4, to enable our Lambda monitoring. This step connects AWS to New Relic and creates a newrelic-log-ingestion Lambda function that sends your instrumented data to New Relic. You can either use the CLI tool or do the steps manually. Use CLI tool When you use the CLI, you have one optional step and one required step: Optional: If you're using multiple AWS profiles or multiple regions, you may want to configure the AWS environment variables: AWS environment variable instructions Setting the region To configure your region, use this environment variable to override the default region: export AWS_DEFAULT_REGION=MY_REGION # us-west-2, for example The CLI tool also allows passing this per-command using --aws-region. Setting profiles If you have multiple AWS profiles and don't want to use the default, use AWS_PROFILE environment variable to set another profile name. Ensure the profile is properly configured (including the default region). Example: export AWS_PROFILE=MY_PROFILE Run the following command using the CLI tool: newrelic-lambda integrations install --nr-account-id YOUR_ACCOUNT_ID \\ --linked-account-name YOUR_LINKED_ACCOUNT_NAME \\ --nr-api-key YOUR_NR_API_KEY This command: Connects your AWS account to New Relic. Installs a newrelic-log-ingestion Lambda that will send your instrumented data to New Relic. More details: This defaults to U.S. region. If your account is in the EU region, add this argument: --nr-region \"eu\". If you're instrumenting functions in multiple AWS regions, this command must be run for each region using the --aws-region argument. YOUR_LINKED_ACCOUNT_NAME is either a new AWS account you want to link to New Relic, or it's the name of the AWS account that you linked to when setting up the AWS Lambda monitoring integration. YOUR_NR_API_KEY refers to your personal API key (not your REST API key). For more on the API key and other arguments, see our Lambda monitoring GitHub repo. Manual procedures Here are the manual procedures performed by the CLI tool: Connect AWS to New Relic The newrelic-lambda integration command connects the AWS account containing your Lambdas to New Relic. If you've already installed one of our AWS integrations, your accounts should be linked to New Relic and you can skip this section. To manually establish this connection, follow the instructions for connecting AWS to Infrastructure monitoring. Configure our log-ingestion Lambda The newrelic-lambda integration command sets up a newrelic-log-ingestion Lambda. This Lambda takes the logs generated by your Lambda functions and pushes those logs to New Relic. If you're configuring this manually, you must configure our Lambda for the regions you want. The CLI, by default, establishes our Lambda in all regions. To manually configure our Lambda, go to the AWS Serverless Application Repository, which is where the newrelic-log-ingestion Lambda is stored. This repo is a collection of serverless applications published by developers, companies, and partners in the serverless community. It allows developers to share their Lambda functions code with customers, who can then find and deploy the corresponding application Lambda function. Each application is packaged with an AWS Serverless Application Model (SAM) template that defines the AWS resources used. To manually configure our Lambda with the AWS Serverless Application Repository: From the AWS console, go to the Lambda section, select Create function, and select Serverless Application Repository. Search for newrelic and find the newrelic-log-ingestion Lambda. Follow the instructions in the Lambda's documentation to deploy it. A SAM template will build the Lambda. In the environment variable section in AWS console, set the LICENSE_KEY environment variable to your New Relic license key. Note: If you have multiple accounts or a master and sub-account hierarchy, make sure the license key you're using matches the same account connected to AWS. Optional: If you want to stream all your logs to New Relic, set the LOGGING_ENABLED environment variable to true. For more on this, see Stream all logs. Step 3. Enable Lambda instrumentation This step enables instrumentation of your Lambda function, which allows detailed monitoring and alerting functionality. Our instrumentation is designed to have minimal impact on your Lambda performance. If you're using Node.js or Python, we recommend the first two options. Option #1: Use Serverless Framework plugin (Node.js and Python) Requirements Available only for Node.js and Python. For other languages, see Manual instrumentation. Serverless Framework version 1.34.0 or higher. Features If you meet the requirements (above), you can use our Serverless Framework plugin, which allows you to add our AWS Lambda Layer to your functions without requiring a code change. Supports Node.js and Python runtimes No code change required to enable Lambda instrumentation Enables our APM agent functionality using a single layer Configures CloudWatch subscription filters automatically Gets the layer into your code base which is useful for redeploys Install To install our Serverless Framework plugin: Choose an install option: NPM: npm install --save-dev serverless-newrelic-lambda-layers yarn: yarn add --dev serverless-newrelic-lambda-layers Add the plugin to your serverless.yml: plugins: - serverless-newrelic-lambda-layers Get your account ID and put it in the serverless.yml: custom: newRelic: accountId: YOUR_ACCOUNT_ID Deploy it: sls deploy You can skip Step 4. Setting up CloudWatch Logs. This is automatically completed on deploy by our Serverless Framework plugin. For the next step, go to What's next? Option #2: Add Lambda Layer with our CLI (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework and don't intend to redeploy your function frequently, you can use the CLI to add our Lambda Layer: If you haven't already done so, install the CLI: pip install newrelic-lambda-cli List available functions: newrelic-lambda functions list Pass the option -f not-installed to see which functions have not yet been instrumented. Add the layer to your function: newrelic-lambda layers install --function FUNCTION_NAME --nr-account-id NEW_RELIC_ACCOUNT_ID Next, you will configure CloudWatch to send logs to New Relic. Option #3: Manually add our Lambda Layer (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework, you can manually add our Lambda Layer: Find the layer that matches your runtime and region. Copy the Amazon Resource Name (ARN) of the most recent version and add it in the AWS Lambda console for your function. Update your functions handler to point to the newly attached layer in the console for your function: Python: newrelic_lambda_wrapper.handler Node: newrelic-lambda-wrapper.handler Add these environment variables to your Lambda console: NEW_RELIC_ACCOUNT_ID: Your account ID NEW_RELIC_LAMBDA_HANDLER: Path to your initial handler. If you have Node 8 and get a Lambda can't find file error message, expand this collapser: Node 8 \"can't find file\" error troubleshooting If you have Node 8 and receive a Lambda can't find the file newrelic-lambda-wrapper.js message, it's likely that the Node runtime isn't resolving NPM_PATH for the newrelic-lambda module in /opt/nodejs/node_modules. These steps should fix this problem: Create a newrelic-wrapper-helper.js script in your project's root. The script's contents should be module.exports = require('newrelic-lambda-wrapper');. (That is all that needs to be in that script.) Update the handler for your layer declaration to newrelic-lambda-wrapper.handler. Next, you will configure CloudWatch to send logs to New Relic. Option #4: Manually instrument Lambda code for Go, Java, .NET Core, Node.js, and Python If none of the previous options work for you, you can manually instrument your Lambda code. Choose your language: Go To instrument your Go-language Lambda: Download our Go agent package and place it in the same directory as your function. Install the agent: go get -u github.com/newrelic/go-agent. In your Lambda code, import our components, create an application, and update how you start your Lambda. See our GitHub repo for an example of an instrumented Lambda. Optional: Add custom events that will be associated with your Lambda invocation by using the RecordCustomEvent API. For example: func handler(ctx context.Context) { if txn := newrelic.FromContext(ctx); nil != txn { txn.Application().RecordCustomEvent(\"MyEvent\", map[string]interface{}{ \"zip\": \"zap\", }) } fmt.Println(\"hello world!\") } Build and zip your Lambda function and upload it to AWS. Zip and upload recommendations Here are suggestions for zipping and uploading the Lambda: Build the binary for execution on Linux. This produces a binary file called main. You can use: $ GOOS=linux go build -o main Zip the binary into a deployment package using: $ zip deployment.zip main Upload the zip file to AWS using either the AWS Lambda console or the AWS CLI. Name the handler main (to match the name given during the binary build). The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this is the account ID for the root/parent account. Optional: To configure logging, see Go agent logging. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Java Monitoring for AWS Lambda in Java doesn't use our APM Java agent. Instead, it uses these two OpenTracing dependencies: AWS Lambda OpenTracing Java SDK: OpenTracing instrumentation for AWS Lambda RequestHandler and RequestStreamHandler. Our AWS Lambda OpenTracing Tracer: An OpenTracing Tracer implementation designed to monitor AWS Lambda. It generates spans, error events, transaction events, error traces, and provides distributed tracing support. Supported OpenTracing Versions OpenTracing 0.31.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:1.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:1.0.0 OpenTracing 0.32.0, 0.33.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:2.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:2.1.0 To instrument your Java Lambda: In your project’s build.gradle file, include our OpenTracing AWS Lambda Tracer and the AWS Lambda OpenTracing SDK dependencies: dependencies { compile(\"com.newrelic.opentracing:java-aws-lambda:2.1.0\") compile(\"com.newrelic.opentracing:newrelic-java-lambda:2.1.1\") compile(\"io.opentracing:opentracing-util:0.33.0\") } Implement the AWS Lambda RequestHandler interface as shown in the Java Lambda example and override the doHandleRequest method. In the doHandleRequest method, call the LambdaTracing.instrument(...) API to create a root span to trace the lambda function's execution. This is also where you will define your business logic for the lambda function. Register a LambdaTracer.INSTANCE as the OpenTracing Global tracer, as shown in the Java Lambda example. Create a ZIP deployment package and upload it to AWS Lambda. Or deploy it via other means. In the AWS Lambda console, set the handler. For the example Java Lambda, the handler would be com.handler.example.MyLambdaHandler::handleRequest. Because handleRequest is assumed, you could also use com.handler.example.MyLambdaHandler. The following AWS console environment variables are required if you want your Lambda function to be included in distributed tracing. This is recommended. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_PRIMARY_APPLICATION_ID. This is also your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this must be the account ID for the root/parent account. Optional: In the Lambda console, enable debug logging by adding this environment variable: NEW_RELIC_DEBUG is true. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Please see the AWS Lambda distributed tracing example for a complete project that illustrates common use cases such as: Distributed tracing between Lambda functions Manual span creation (aka custom instrumentation) Tracing external calls Adding custom attributes (aka Tags) to spans .NET Core Our monitoring of .NET Core-based AWS Lambda functions doesn't use our standard .NET Core APM agent. Instead, it uses a NuGet package. To instrument your .NET Core Lambda: In your Lambda Functions project, install the NewRelic.OpenTracing.AmazonLambda.Tracer NuGet package. Import the NuGet package and OpenTracing utils: using OpenTracing.Util; using NewRelic.OpenTracing.AmazonLambda; Instrument your function, as shown in this example: public class Function { static Function() { // Register The NewRelic Lambda Tracer Instance GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public object FunctionWrapper(ILambdaContext context) { // Instantiate NewRelic TracingWrapper and pass your FunctionHandler as // an argument return new TracingRequestHandler().LambdaWrapper(FunctionHandler, context); } /// /// A simple function that takes a string and does a ToUpper /// /// /// /// public object FunctionHandler(ILambdaContext context) { ... } } The arguments passed to FunctionWrapper must match the signature of FunctionHandler. If your handler function returns a Task, the Lambda wrapper will block on the return task until it completes, so that it can measure the duration and capture exceptions, if any are present. In addition, you may also inherit from the APIGatewayProxyFunction. For an example, see below: Async handler function public override Task FunctionHandlerAsync(ILambdaContext lambdaContext) { // This call will block by calling task.Result Task task = new TracingRequestHandler().LambdaWrapper( ActualFunctionHandlerAsync, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(ILambdaContext lambdaContext) { // Function can make other async operations here ... } Inheriting from APIGatewayProxyFunction public class LambdaFunction : APIGatewayProxyFunction { static LambdaFunction() { // Register The NewRelic Lambda Tracer Instance OpenTracing.Util.GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public override Task FunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { Task task = new TracingRequestHandler().LambdaWrapper(ActualFunctionHandlerAsync, request, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { return base.FunctionHandlerAsync(request, lambdaContext); } } Optional for SQS and SNS: Starting in version 1.0 of our .NET Lambda Tracer, distributed tracing support has been added for SQS and SNS. To enable distributed tracing for SQS or SNS you will need to complete the items in this step as well as setup the environment variables in the step that follows this one. Enabling distributed tracing support for SQS and SNS will disable automatic instrumentation for both of SQS and SNS and require the use of these wrappers to instrument them. Set the NEW_RELIC_USE_DT_WRAPPER environment variable to true. To instrument SQS and SNS calls you will need to use the provided wrappers. Using the SQS Wrapper The SQS wrapper supports wrapping the following methods: Amazon.SQS.AmazonSQSClient.SendMessageAsync(...) Amazon.SQS.AmazonSQSClient.SendMessageBatchAsync(...) Examples // SQS Client AmazonSQSClient client = new AmazonSQSClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // SendMessageRequest SendMessageRequest sendRequest = new SendMessageRequest(\"QUEUE_URI_STRING\", \"An SQS Message\"); Task responseOne = SQSWrapper.WrapRequest(client.SendMessageAsync, sendRequest); // String-based Task responseTwo = SQSWrapper.WrapRequest(client.SendMessageAsync, \"QUEUE_URI_STRING\", \"Another SQS Message\"); // SendMessageBatchRequest List batchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id1\", \"First SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id2\", \"Second SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id3\", \"Third SQS Message\")); SendMessageBatchRequest sendBatchRequest = new SendMessageBatchRequest(QUEUE_URI, batchEntries); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, sendBatchRequest); // SendMessageBatchRequestEntry List List moreBatchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id4\", \"Fourth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id5\", \"Fifth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id6\", \"Sixth SQS Message\")); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, moreBatchEntries); Using the SNS Wrapper The SNS wrapper supports wrapping the following methods: Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient.PublishAsync(...) Examples // SNS Client AmazonSimpleNotificationServiceClient client = new Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // PublishRequest - Phone Number PublishRequest phonePublishRequest = new PublishRequest(); phonePublishRequest.PhoneNumber = +1XXX5555100; phonePublishRequest.Message = \"An SNS Message for phones\"; Task phoneResponse = SNSWrapper.WrapRequest(client.PublishAsync, phonePublishRequest); // PublishRequest - ARN PublishRequest publishRequest = new PublishRequest(\"TOPIC_ARN\", \"An SNS Message\"); Task publishResponse = SNSWrapper.WrapRequest(client.PublishAsync, publishRequest); // String-based without subject Task ResponseOne = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Another SNS Message\"); // String-based with subject Task ResponseTwo = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Yet Another SNS Message\", \"A Subject\"); The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS Lambda console: NEW_RELIC_ACCOUNT_ID: The account ID the Lambda is reporting to. NEW_RELIC_TRUSTED_ACCOUNT_KEY: This is also the account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Ensure that the wrapper function (FunctionWrapper in above example) is set up as the function handler. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Node.js To instrument your Node.js Lambda: Download our Node.js agent package and place it in the same directory as your function, ensuring the agent is installed as a dependency in the node_modules directory. Use the Node Package Manager: npm install newrelic --save Install our AWS SDK module alongside the Node.js agent: npm install @newrelic/aws-sdk --save In your Lambda code, require the agent module and the AWS SDK at the top of the file, and wrap the handler function. For example: const newrelic = require('newrelic'); require('@newrelic/aws-sdk'); module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { // This is your handler function code console.log('Lambda executed'); callback(); }); Optional: You can also add custom events to your Lambda using the recordCustomEvent API. For example: module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { newrelic.recordCustomEvent(‘MyEventType’, {foo: ‘bar’}); console.log('Lambda executed'); callback(); }); Zip your Lambda function and the Node.js agent folder together. Requirements and recommendations: The New Relic files outside the New Relic agent folder don't need to be included. If your Lambda function file name is, for example, lambda_function.node, we recommend naming your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set these environment variables: NEW_RELIC_NO_CONFIG_FILE. Set to true if not using a configuration file. NEW_RELIC_APP_NAME: Your application name. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To run the agent in serverless mode outside of AWS in a local environment, set the environment variable NEW_RELIC_SERVERLESS_MODE_ENABLED to true. (When executing this in an AWS Lambda environment, the agent will automatically run in serverless mode. Do not use this variable if you're running in AWS.) Optional: To enable logging in serverless mode, set these environment variables: Set NEW_RELIC_LOG_ENABLED to true. Set NEW_RELIC_LOG to stdout for output to CloudWatch, or set to any writeable file location. The log level is set to info by default. See other log levels. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Python To instrument your Python Lambda: Download our Python agent package and place it in the same directory as your function. To do this, use pip: pip install -t . newrelic If you use Homebrew, you may get this error: DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both. For details, see the Homebrew GitHub post. In your Lambda code, import the Python agent module and decorate the handler function using the New Relic decorator. The New Relic package must be imported first in your code. Here's an example: import newrelic.agent newrelic.agent.initialize() @newrelic.agent.lambda_handler() def handler(event, context): ... Optional: You can also add custom events to your Lambda using the record_custom_event API. Here's an example: @newrelic.agent.lambda_handler() def handler(event, context): newrelic.agent.record_custom_event('CustomEvent', {'foo': 'bar'}) … Zip your lambda_function.py and newrelic/ folder together using these guidelines: The New Relic files outside the newrelic/ folder don't need to be included. If your Lambda function file name is, for example, lambda_function.py, name your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set this environment variable: NEW_RELIC_SERVERLESS_MODE_ENABLED. Set to true The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_DISTRIBUTED_TRACING_ENABLED. Set to true. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To configure logging, use the NEW_RELIC_LOG and NEW_RELIC_LOG_LEVEL environment variables in the AWS Console. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. The New Relic decorator gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, configure CloudWatch to send those logs to New Relic. Step 4. Configure CloudWatch logs to stream to New Relic Lambda In this step, you'll link your Lambda function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda that was configured in Step 2. For Node.js and Python: This step isn't necessary if you used the Serverless Framework plugin option in Step 3. This step can be done using the CLI tool or using manual procedures. Use CLI tool Run this command for every Lambda function you want to monitor: newrelic-lambda subscriptions install --function FUNCTION_NAME_#1 Or to set subscription filters for all supported functions run this command:: newrelic-lambda subscriptions install --function all Notes on this command: You should only need one newrelic-log-ingestion Lambda per AWS account and region. You can subscribe as many functions to it as you like. To see more detail about the arguments, including a region-specifying argument, see our GitHub documentation. You may receive a CloudWatch validation error. This doesn't affect data reporting. If you see data reporting in New Relic, disregard that error message. If you have our Logs and want to send all your log data to us (not just Lambda logs), see Stream all logs. Manual procedures Here are the manual procedures performed by the CLI tool: Manual process: Stream CloudWatch logs to New Relic Lambda In Step 2, you set up a newrelic-log-ingestion Lambda function. After you've instrumented your Lambda function (Step 3), the newrelic-lambda subscriptions command links that function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda. To do this manually: Open CloudWatch and select Logs in the left-hand menu, and then select the log group for the function you are monitoring. Select Actions and choose Stream to AWS Lambda. Under Lambda function, select the newrelic-log-ingestion function. Set the Log format to JSON. Set the Subscription filter pattern to ?REPORT ?NR_LAMBDA_MONITORING ?\"Task timed out\". Alternatively, if you are using the LOGGING_ENABLED environment variable stream all your logs to our Logs, leave this field blank. See notes and caveats about this procedure. Make sure the newrelic-log-ingestion Lambda function you select in the method above is in the same AWS region as your Lambda function. What's next? After you complete these steps, here's what you can do next: See data reporting in the Lambda monitoring UI. If you're having trouble finding your data, see Lambda enable troubleshooting. Use configuration settings to fine-tune your data. Our newrelic-log-ingestion function is not updated automatically. For best results and access to latest features, we recommend you occasionally update our Lambda monitoring. Optional: Stream all logs to New Relic If you have log management enabled and want to report all your logs to New Relic, follow these instructions: Go to our newrelic-log-ingestion Lambda and set the LOGGING_ENABLED environment variable to true. It isn't possible to edit existing filter patterns, so they must be removed and re-added: Set the Subscription filter pattern to \"\". Go to the Log group for each monitored Lambda, and remove the newrelic-log-ingestion subscription. Add the subscription filter back, leaving the Subscription filter pattern field blank. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
+ "body": "Serverless monitoring for AWS Lambda offers in-depth performance monitoring for your Lambda functions. Read on to learn how to enable this feature and get started using it. Using this feature may result in AWS charges. For more information, see the Lambda monitoring requirements. How Lambda monitoring works Before enabling Lambda monitoring, understanding how data flows from your Lambda functions to New Relic may be helpful: Diagram showing how data flows from a Lambda function to New Relic. When our Lambda monitoring is enabled, this is how data moves from your Lambda function to New Relic: The Lambda function is instrumented with our code. CloudWatch collects Lambda log data and sends it to our log-ingestion Lambda. The log-ingestion Lambda sends that data to New Relic. Enable procedure overview If you already have a New Relic account and use Node.js or Python, we recommend you use our automated installer. If you do not use the automated installer, complete these steps to set up monitoring: Install our CLI tool (recommended) Connect AWS and New Relic (required) Enable instrumentation of your Lambda (required) Stream CloudWatch logs to New Relic (required) Step 1. Install the newrelic-lambda-cli tool We provide a command line interface (CLI) tool that's used in steps 2 through 4. We recommend the CLI because it simplifies some of the work, but you can also perform those steps manually. If you want to understand what it does before you install it, see the manual procedures that the CLI tool performs in Step 2, Step 3 (option 2), and Step 4. You can also see the CLI documentation on GitHub. If you prefer a manual install, skip to Step 2. Connect AWS to New Relic. CLI requirements To use the CLI too, you need: Python 3.3 or higher The AWS CLI You must be a user or admin with an infrastructure manager Add-on role. Your AWS account needs permissions for creating IAM resources (Role and Policy) and Lambda functions. These resources are created using CloudFormation stacks, so you'll need permissions to create those. For more on permissions, including setting custom policies, expand this collapser: AWS permissions details Resource: * Actions: \"cloudformation:CreateChangeSet\", \"cloudformation:CreateStack\", \"cloudformation:DescribeStacks\", \"cloudformation:ExecuteChangeSets\", \"iam:AttachRolePolicy\", \"iam:CreateRole\", \"iam:GetRole\", \"iam:PassRole\", \"lambda:AddPermission\", \"lambda:CreateFunction\", \"lambda:GetFunction\", \"logs:DeleteSubscriptionFilter\", \"logs:DescribeSubscriptionFilters\", \"logs:PutSubscriptionFilter\" \"s3:GetObject\" \"serverlessrepo:CreateCloudFormationChangeSet\" Resource: \"arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion\" Actions: \"serverlessrepo:CreateCloudFormationTemplate\" \"serverlessrepo:GetCloudFormationTemplate\" Be sure that the AWS account you use to execute the CLI has all of these permissions. If your AWS account permissions are restrictive and you're unable to use the CLI, you can optionally use a manually managed custom IAM policy. This policy would require, at minimum, the following permissions: Resource: \"*\" Action: \"cloudwatch:GetMetricStatistics\" \"cloudwatch:ListMetrics\" \"cloudwatch:GetMetricData\" \"lambda:GetAccountSettings\" \"lambda:ListFunctions\" \"lambda:ListAliases\" \"lambda:ListTags\" \"lambda:ListEventSourceMappings\" These permissions are the minimum required. We recommend granting a managed ReadOnlyAccess policy as described in Connect AWS to infrastructure monitoring. CLI installation To install the CLI tool: Ensure you have the required permissions for both your New Relic and AWS account. From the command line, run: pip install newrelic-lambda-cli You may need to use pip3 in the command above if you have Python 2.7 installed. The CLI requires Python >=3.3. Step 2. Connect AWS to New Relic You must complete this step, and steps 3 and 4, to enable our Lambda monitoring. This step connects AWS to New Relic and creates a newrelic-log-ingestion Lambda function that sends your instrumented data to New Relic. You can either use the CLI tool or do the steps manually. Use CLI tool When you use the CLI, you have one optional step and one required step: Optional: If you're using multiple AWS profiles or multiple regions, you may want to configure the AWS environment variables: AWS environment variable instructions Setting the region To configure your region, use this environment variable to override the default region: export AWS_DEFAULT_REGION=MY_REGION # us-west-2, for example The CLI tool also allows passing this per-command using --aws-region. Setting profiles If you have multiple AWS profiles and don't want to use the default, use AWS_PROFILE environment variable to set another profile name. Ensure the profile is properly configured (including the default region). Example: export AWS_PROFILE=MY_PROFILE Run the following command using the CLI tool: newrelic-lambda integrations install --nr-account-id YOUR_ACCOUNT_ID \\ --linked-account-name YOUR_LINKED_ACCOUNT_NAME \\ --nr-api-key YOUR_NR_API_KEY This command: Connects your AWS account to New Relic. Installs a newrelic-log-ingestion Lambda that will send your instrumented data to New Relic. More details: This defaults to U.S. region. If your account is in the EU region, add this argument: --nr-region \"eu\". If you're instrumenting functions in multiple AWS regions, this command must be run for each region using the --aws-region argument. YOUR_LINKED_ACCOUNT_NAME is either a new AWS account you want to link to New Relic, or it's the name of the AWS account that you linked to when setting up the AWS Lambda monitoring integration. YOUR_NR_API_KEY refers to your personal API key (not your REST API key). For more on the API key and other arguments, see our Lambda monitoring GitHub repo. Manual procedures Here are the manual procedures performed by the CLI tool: Connect AWS to New Relic The newrelic-lambda integration command connects the AWS account containing your Lambdas to New Relic. If you've already installed one of our AWS integrations, your accounts should be linked to New Relic and you can skip this section. To manually establish this connection, follow the instructions for connecting AWS to Infrastructure monitoring. Configure our log-ingestion Lambda The newrelic-lambda integration command sets up a newrelic-log-ingestion Lambda. This Lambda takes the logs generated by your Lambda functions and pushes those logs to New Relic. If you're configuring this manually, you must configure our Lambda for the regions you want. The CLI, by default, establishes our Lambda in all regions. To manually configure our Lambda, go to the AWS Serverless Application Repository, which is where the newrelic-log-ingestion Lambda is stored. This repo is a collection of serverless applications published by developers, companies, and partners in the serverless community. It allows developers to share their Lambda functions code with customers, who can then find and deploy the corresponding application Lambda function. Each application is packaged with an AWS Serverless Application Model (SAM) template that defines the AWS resources used. To manually configure our Lambda with the AWS Serverless Application Repository: From the AWS console, go to the Lambda section, select Create function, and select Serverless Application Repository. Search for newrelic and find the newrelic-log-ingestion Lambda. Follow the instructions in the Lambda's documentation to deploy it. A SAM template will build the Lambda. In the environment variable section in AWS console, set the LICENSE_KEY environment variable to your New Relic license key. Note: If you have multiple accounts or a master and sub-account hierarchy, make sure the license key you're using matches the same account connected to AWS. Optional: If you want to stream all your logs to New Relic, set the LOGGING_ENABLED environment variable to true. For more on this, see Stream all logs. Step 3. Enable Lambda instrumentation This step enables instrumentation of your Lambda function, which allows detailed monitoring and alerting functionality. Our instrumentation is designed to have minimal impact on your Lambda performance. If you're using Node.js or Python, we recommend the first two options. Option #1: Use Serverless Framework plugin (Node.js and Python) Requirements Available only for Node.js and Python. For other languages, see Manual instrumentation. Serverless Framework version 1.34.0 or higher. Features If you meet the requirements (above), you can use our Serverless Framework plugin, which allows you to add our AWS Lambda Layer to your functions without requiring a code change. Supports Node.js and Python runtimes No code change required to enable Lambda instrumentation Enables our APM agent functionality using a single layer Configures CloudWatch subscription filters automatically Gets the layer into your code base which is useful for redeploys Install To install our Serverless Framework plugin: Choose an install option: NPM: npm install --save-dev serverless-newrelic-lambda-layers yarn: yarn add --dev serverless-newrelic-lambda-layers Add the plugin to your serverless.yml: plugins: - serverless-newrelic-lambda-layers Get your account ID and put it in the serverless.yml: custom: newRelic: accountId: YOUR_ACCOUNT_ID Deploy it: sls deploy You can skip Step 4. Setting up CloudWatch Logs. This is automatically completed on deploy by our Serverless Framework plugin. For the next step, go to What's next? Option #2: Add Lambda Layer with our CLI (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework and don't intend to redeploy your function frequently, you can use the CLI to add our Lambda Layer: If you haven't already done so, install the CLI: pip install newrelic-lambda-cli List available functions: newrelic-lambda functions list Pass the option -f not-installed to see which functions have not yet been instrumented. Add the layer to your function: newrelic-lambda layers install --function FUNCTION_NAME --nr-account-id NEW_RELIC_ACCOUNT_ID Next, you will configure CloudWatch to send logs to New Relic. Option #3: Manually add our Lambda Layer (Node.js and Python) Available only for Node.js and Python. For other languages, see Manual instrumentation. If you don’t have Serverless Framework, you can manually add our Lambda Layer: Find the layer that matches your runtime and region. Copy the Amazon Resource Name (ARN) of the most recent version and add it in the AWS Lambda console for your function. Update your functions handler to point to the newly attached layer in the console for your function: Python: newrelic_lambda_wrapper.handler Node: newrelic-lambda-wrapper.handler Add these environment variables to your Lambda console: NEW_RELIC_ACCOUNT_ID: Your account ID NEW_RELIC_LAMBDA_HANDLER: Path to your initial handler. If you have Node 8 and get a Lambda can't find file error message, expand this collapser: Node 8 \"can't find file\" error troubleshooting If you have Node 8 and receive a Lambda can't find the file newrelic-lambda-wrapper.js message, it's likely that the Node runtime isn't resolving NPM_PATH for the newrelic-lambda module in /opt/nodejs/node_modules. These steps should fix this problem: Create a newrelic-wrapper-helper.js script in your project's root. The script's contents should be module.exports = require('newrelic-lambda-wrapper');. (That is all that needs to be in that script.) Update the handler for your layer declaration to newrelic-lambda-wrapper.handler. Next, you will configure CloudWatch to send logs to New Relic. Option #4: Manually instrument Lambda code for Go, Java, .NET Core, Node.js, and Python If none of the previous options work for you, you can manually instrument your Lambda code. Choose your language: Go To instrument your Go-language Lambda: Download our Go agent package and place it in the same directory as your function. Install the agent: go get -u github.com/newrelic/go-agent. In your Lambda code, import our components, create an application, and update how you start your Lambda. See our GitHub repo for an example of an instrumented Lambda. Optional: Add custom events that will be associated with your Lambda invocation by using the RecordCustomEvent API. For example: func handler(ctx context.Context) { if txn := newrelic.FromContext(ctx); nil != txn { txn.Application().RecordCustomEvent(\"MyEvent\", map[string]interface{}{ \"zip\": \"zap\", }) } fmt.Println(\"hello world!\") } Build and zip your Lambda function and upload it to AWS. Zip and upload recommendations Here are suggestions for zipping and uploading the Lambda: Build the binary for execution on Linux. This produces a binary file called main. You can use: $ GOOS=linux go build -o main Zip the binary into a deployment package using: $ zip deployment.zip main Upload the zip file to AWS using either the AWS Lambda console or the AWS CLI. Name the handler main (to match the name given during the binary build). The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this is the account ID for the root/parent account. Optional: To configure logging, see Go agent logging. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Java Monitoring for AWS Lambda in Java doesn't use our APM Java agent. Instead, it uses these two OpenTracing dependencies: AWS Lambda OpenTracing Java SDK: OpenTracing instrumentation for AWS Lambda RequestHandler and RequestStreamHandler. Our AWS Lambda OpenTracing Tracer: An OpenTracing Tracer implementation designed to monitor AWS Lambda. It generates spans, error events, transaction events, error traces, and provides distributed tracing support. Supported OpenTracing Versions OpenTracing 0.31.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:1.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:1.0.0 OpenTracing 0.32.0, 0.33.0: Lambda Tracer: com.newrelic.opentracing:newrelic-java-lambda:2.1.1 Lambda SDK: com.newrelic.opentracing:java-aws-lambda:2.1.0 To instrument your Java Lambda: In your project’s build.gradle file, include our OpenTracing AWS Lambda Tracer and the AWS Lambda OpenTracing SDK dependencies: dependencies { compile(\"com.newrelic.opentracing:java-aws-lambda:2.1.0\") compile(\"com.newrelic.opentracing:newrelic-java-lambda:2.1.1\") compile(\"io.opentracing:opentracing-util:0.33.0\") } Implement the AWS Lambda RequestHandler interface as shown in the Java Lambda example and override the doHandleRequest method. In the doHandleRequest method, call the LambdaTracing.instrument(...) API to create a root span to trace the lambda function's execution. This is also where you will define your business logic for the lambda function. Register a LambdaTracer.INSTANCE as the OpenTracing Global tracer, as shown in the Java Lambda example. Create a ZIP deployment package and upload it to AWS Lambda. Or deploy it via other means. In the AWS Lambda console, set the handler. For the example Java Lambda, the handler would be com.handler.example.MyLambdaHandler::handleRequest. Because handleRequest is assumed, you could also use com.handler.example.MyLambdaHandler. The following AWS console environment variables are required if you want your Lambda function to be included in distributed tracing. This is recommended. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_PRIMARY_APPLICATION_ID. This is also your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this must be the account ID for the root/parent account. Optional: In the Lambda console, enable debug logging by adding this environment variable: NEW_RELIC_DEBUG is true. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, you'll configure CloudWatch to send those logs to New Relic. Please see the AWS Lambda distributed tracing example for a complete project that illustrates common use cases such as: Distributed tracing between Lambda functions Manual span creation (aka custom instrumentation) Tracing external calls Adding custom attributes (aka Tags) to spans .NET Core Our monitoring of .NET Core-based AWS Lambda functions doesn't use our standard .NET Core APM agent. Instead, it uses a NuGet package. To instrument your .NET Core Lambda: In your Lambda Functions project, install the NewRelic.OpenTracing.AmazonLambda.Tracer NuGet package. Note: NewRelic.OpenTracing.AmazonLambda.Tracer depends on version 1.2.0+ of the Amazon.Lambda.APIGatewayEvent NuGet package. If the environment already uses a lower version of Amazon.Lambda.APIGatewayEvent, the New Relic package may produce errors such as System.MissingMethodException. Import the NuGet package and OpenTracing utils: using OpenTracing.Util; using NewRelic.OpenTracing.AmazonLambda; Instrument your function, as shown in this example: public class Function { static Function() { // Register The NewRelic Lambda Tracer Instance GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public object FunctionWrapper(ILambdaContext context) { // Instantiate NewRelic TracingWrapper and pass your FunctionHandler as // an argument return new TracingRequestHandler().LambdaWrapper(FunctionHandler, context); } /// /// A simple function that takes a string and does a ToUpper /// /// /// /// public object FunctionHandler(ILambdaContext context) { ... } } The arguments passed to FunctionWrapper must match the signature of FunctionHandler. If your handler function returns a Task, the Lambda wrapper will block on the return task until it completes, so that it can measure the duration and capture exceptions, if any are present. In addition, you may also inherit from the APIGatewayProxyFunction. For an example, see below: Async handler function public override Task FunctionHandlerAsync(ILambdaContext lambdaContext) { // This call will block by calling task.Result Task task = new TracingRequestHandler().LambdaWrapper( ActualFunctionHandlerAsync, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(ILambdaContext lambdaContext) { // Function can make other async operations here ... } Inheriting from APIGatewayProxyFunction public class LambdaFunction : APIGatewayProxyFunction { static LambdaFunction() { // Register The NewRelic Lambda Tracer Instance OpenTracing.Util.GlobalTracer.Register(NewRelic.OpenTracing.AmazonLambda.LambdaTracer.Instance); } public override Task FunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { Task task = new TracingRequestHandler().LambdaWrapper(ActualFunctionHandlerAsync, request, lambdaContext); return task; } public Task ActualFunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext lambdaContext) { return base.FunctionHandlerAsync(request, lambdaContext); } } Optional for SQS and SNS: Starting in version 1.0 of our .NET Lambda Tracer, distributed tracing support has been added for SQS and SNS. To enable distributed tracing for SQS or SNS you will need to complete the items in this step as well as setup the environment variables in the step that follows this one. Enabling distributed tracing support for SQS and SNS will disable automatic instrumentation for both of SQS and SNS and require the use of these wrappers to instrument them. Set the NEW_RELIC_USE_DT_WRAPPER environment variable to true. To instrument SQS and SNS calls you will need to use the provided wrappers. Using the SQS Wrapper The SQS wrapper supports wrapping the following methods: Amazon.SQS.AmazonSQSClient.SendMessageAsync(...) Amazon.SQS.AmazonSQSClient.SendMessageBatchAsync(...) Examples // SQS Client AmazonSQSClient client = new AmazonSQSClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // SendMessageRequest SendMessageRequest sendRequest = new SendMessageRequest(\"QUEUE_URI_STRING\", \"An SQS Message\"); Task responseOne = SQSWrapper.WrapRequest(client.SendMessageAsync, sendRequest); // String-based Task responseTwo = SQSWrapper.WrapRequest(client.SendMessageAsync, \"QUEUE_URI_STRING\", \"Another SQS Message\"); // SendMessageBatchRequest List batchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id1\", \"First SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id2\", \"Second SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id3\", \"Third SQS Message\")); SendMessageBatchRequest sendBatchRequest = new SendMessageBatchRequest(QUEUE_URI, batchEntries); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, sendBatchRequest); // SendMessageBatchRequestEntry List List moreBatchEntries = new List(); batchEntries.Add(new SendMessageBatchRequestEntry(\"id4\", \"Fourth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id5\", \"Fifth SQS Message\")); batchEntries.Add(new SendMessageBatchRequestEntry(\"id6\", \"Sixth SQS Message\")); Task response = SQSWrapper.WrapRequest(client.SendMessageBatchAsync, moreBatchEntries); Using the SNS Wrapper The SNS wrapper supports wrapping the following methods: Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient.PublishAsync(...) Examples // SNS Client AmazonSimpleNotificationServiceClient client = new Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient(\"AWS_SECRET_ACCESS_KEY\", AWS_REGION); // PublishRequest - Phone Number PublishRequest phonePublishRequest = new PublishRequest(); phonePublishRequest.PhoneNumber = +1XXX5555100; phonePublishRequest.Message = \"An SNS Message for phones\"; Task phoneResponse = SNSWrapper.WrapRequest(client.PublishAsync, phonePublishRequest); // PublishRequest - ARN PublishRequest publishRequest = new PublishRequest(\"TOPIC_ARN\", \"An SNS Message\"); Task publishResponse = SNSWrapper.WrapRequest(client.PublishAsync, publishRequest); // String-based without subject Task ResponseOne = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Another SNS Message\"); // String-based with subject Task ResponseTwo = SNSWrapper.WrapRequest(client.PublishAsync, \"TOPIC_ARN\", \"Yet Another SNS Message\", \"A Subject\"); The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS Lambda console: NEW_RELIC_ACCOUNT_ID: The account ID the Lambda is reporting to. NEW_RELIC_TRUSTED_ACCOUNT_KEY: This is also the account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Ensure that the wrapper function (FunctionWrapper in above example) is set up as the function handler. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Node.js To instrument your Node.js Lambda: Download our Node.js agent package and place it in the same directory as your function, ensuring the agent is installed as a dependency in the node_modules directory. Use the Node Package Manager: npm install newrelic --save Install our AWS SDK module alongside the Node.js agent: npm install @newrelic/aws-sdk --save In your Lambda code, require the agent module and the AWS SDK at the top of the file, and wrap the handler function. For example: const newrelic = require('newrelic'); require('@newrelic/aws-sdk'); module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { // This is your handler function code console.log('Lambda executed'); callback(); }); Optional: You can also add custom events to your Lambda using the recordCustomEvent API. For example: module.exports.handler = newrelic.setLambdaHandler((event, context, callback) => { newrelic.recordCustomEvent(‘MyEventType’, {foo: ‘bar’}); console.log('Lambda executed'); callback(); }); Zip your Lambda function and the Node.js agent folder together. Requirements and recommendations: The New Relic files outside the New Relic agent folder don't need to be included. If your Lambda function file name is, for example, lambda_function.node, we recommend naming your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set these environment variables: NEW_RELIC_NO_CONFIG_FILE. Set to true if not using a configuration file. NEW_RELIC_APP_NAME: Your application name. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To run the agent in serverless mode outside of AWS in a local environment, set the environment variable NEW_RELIC_SERVERLESS_MODE_ENABLED to true. (When executing this in an AWS Lambda environment, the agent will automatically run in serverless mode. Do not use this variable if you're running in AWS.) Optional: To enable logging in serverless mode, set these environment variables: Set NEW_RELIC_LOG_ENABLED to true. Set NEW_RELIC_LOG to stdout for output to CloudWatch, or set to any writeable file location. The log level is set to info by default. See other log levels. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. Our wrapper gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next you'll configure CloudWatch to send those logs to New Relic. Python To instrument your Python Lambda: Download our Python agent package and place it in the same directory as your function. To do this, use pip: pip install -t . newrelic If you use Homebrew, you may get this error: DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both. For details, see the Homebrew GitHub post. In your Lambda code, import the Python agent module and decorate the handler function using the New Relic decorator. The New Relic package must be imported first in your code. Here's an example: import newrelic.agent newrelic.agent.initialize() @newrelic.agent.lambda_handler() def handler(event, context): ... Optional: You can also add custom events to your Lambda using the record_custom_event API. Here's an example: @newrelic.agent.lambda_handler() def handler(event, context): newrelic.agent.record_custom_event('CustomEvent', {'foo': 'bar'}) … Zip your lambda_function.py and newrelic/ folder together using these guidelines: The New Relic files outside the newrelic/ folder don't need to be included. If your Lambda function file name is, for example, lambda_function.py, name your zip file lambda_function.zip. Do not use a tarball. Your Lambda and its associated modules must all be in the zip file's root directory. This means that if you zip a folder that contains the files, it won't work. Upload the zipped file to your AWS Lambda account. In the AWS console, set this environment variable: NEW_RELIC_SERVERLESS_MODE_ENABLED. Set to true The following environment variables are not required for Lambda monitoring to function but they are required if you want your Lambda functions to be included in distributed traces. To enable distributed tracing, set these environment variables in the AWS console: NEW_RELIC_DISTRIBUTED_TRACING_ENABLED. Set to true. NEW_RELIC_ACCOUNT_ID. Your account ID. NEW_RELIC_TRUSTED_ACCOUNT_KEY. This is also your account ID. If your account is a sub-account, this needs to be the account ID for the root/parent account. Optional: To configure logging, use the NEW_RELIC_LOG and NEW_RELIC_LOG_LEVEL environment variables in the AWS Console. Invoke the Lambda at least once. This creates a CloudWatch log group, which must be present for the next step to work. The New Relic decorator gathers data about the Lambda execution, generates a JSON message, and logs it to CloudWatch Logs. Next, configure CloudWatch to send those logs to New Relic. Step 4. Configure CloudWatch logs to stream to New Relic Lambda In this step, you'll link your Lambda function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda that was configured in Step 2. For Node.js and Python: This step isn't necessary if you used the Serverless Framework plugin option in Step 3. This step can be done using the CLI tool or using manual procedures. Use CLI tool Run this command for every Lambda function you want to monitor: newrelic-lambda subscriptions install --function FUNCTION_NAME_#1 Or to set subscription filters for all supported functions run this command:: newrelic-lambda subscriptions install --function all Notes on this command: You should only need one newrelic-log-ingestion Lambda per AWS account and region. You can subscribe as many functions to it as you like. To see more detail about the arguments, including a region-specifying argument, see our GitHub documentation. You may receive a CloudWatch validation error. This doesn't affect data reporting. If you see data reporting in New Relic, disregard that error message. If you have our Logs and want to send all your log data to us (not just Lambda logs), see Stream all logs. Manual procedures Here are the manual procedures performed by the CLI tool: Manual process: Stream CloudWatch logs to New Relic Lambda In Step 2, you set up a newrelic-log-ingestion Lambda function. After you've instrumented your Lambda function (Step 3), the newrelic-lambda subscriptions command links that function's CloudWatch Logs stream to the newrelic-log-ingestion Lambda. To do this manually: Open CloudWatch and select Logs in the left-hand menu, and then select the log group for the function you are monitoring. Select Actions and choose Stream to AWS Lambda. Under Lambda function, select the newrelic-log-ingestion function. Set the Log format to JSON. Set the Subscription filter pattern to ?REPORT ?NR_LAMBDA_MONITORING ?\"Task timed out\". Alternatively, if you are using the LOGGING_ENABLED environment variable stream all your logs to our Logs, leave this field blank. See notes and caveats about this procedure. Make sure the newrelic-log-ingestion Lambda function you select in the method above is in the same AWS region as your Lambda function. What's next? After you complete these steps, here's what you can do next: See data reporting in the Lambda monitoring UI. If you're having trouble finding your data, see Lambda enable troubleshooting. Use configuration settings to fine-tune your data. Our newrelic-log-ingestion function is not updated automatically. For best results and access to latest features, we recommend you occasionally update our Lambda monitoring. Optional: Stream all logs to New Relic If you have log management enabled and want to report all your logs to New Relic, follow these instructions: Go to our newrelic-log-ingestion Lambda and set the LOGGING_ENABLED environment variable to true. It isn't possible to edit existing filter patterns, so they must be removed and re-added: Set the Subscription filter pattern to \"\". Go to the Log group for each monitored Lambda, and remove the newrelic-log-ingestion subscription. Add the subscription filter back, leaving the Subscription filter pattern field blank. For more help If you need more help, check out these support and learning resources: Browse the Explorers Hub to get help from the community and join in discussions. Find answers on our sites and learn how to use our support portal. Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS. Review New Relic's data security and licenses documentation.",
"_index": "520d1d5d14cc8a32e600034b",
"_type": "520d1d5d14cc8a32e600034c",
- "_score": 122.0019,
+ "_score": 134.20006,
"_version": null,
"_explanation": null,
"sort": null,
"highlight": {
"sections": "Step 1. Install the newrelic-lambda-cli tool",
"info": "Read about how to install and enable New Relic monitoring for Amazon AWS Lambda. ",
- "body": " CloudWatch logs to New Relic (required) Step 1. Install the newrelic-lambda-cli tool We provide a command line interface (CLI) tool that's used in steps 2 through 4. We recommend the CLI because it simplifies some of the work, but you can also perform those steps manually. If you want to understand"
+ "body": " region). Example: export AWS_PROFILE=MY_PROFILE Run the following command using the CLI tool: newrelic-lambda integrations install --nr-account-id YOUR_ACCOUNT_ID \\ --linked-account-name YOUR_LINKED_ACCOUNT_NAME \\ --nr-api-key YOUR_NR_API_KEY This command: Connects your AWS account to New Relic"
},
"id": "5f6c67a464441f3a75eb72d3"
+ },
+ {
+ "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",
+ "type": "developer",
+ "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-10-06T02:07:12Z",
+ "updated_at": "2020-08-08T01:41:47Z",
+ "document_type": "page",
+ "popularity": 1,
+ "info": "Learn the essentials of the New Relic CLI, from install and configuration to basic usage.",
+ "body": "Get started with the New Relic CLI 20 min Access the New Relic platform from the comfort of your terminal: you can use the New Relic CLI to manage entity tags, define workloads, record deployment markers, and much more. Our CLI has been designed for automating common tasks in your DevOps workflow. This guide walks you through the essentials of New Relic CLI, from install and configuration to basic usage. Before you begin For this guide you just need: Your New Relic personal API Key, which you can create from the Account settings of your New Relic account An instrumented application in your New Relic account Step 1 of 10 Install the New Relic CLI The New Relic CLI can be downloaded via Homebrew (macOS), Scoop (Windows), and Snapcraft (Linux). You can also download pre-built binaries for all platforms, including .deb and .rpm packages, and our Windows x64 .msi installer. Linux With Snapcraft installed, run: sudo snap install newrelic-cli macOS With Homebrew installed, run: brew install newrelic-cli Windows With Scoop installed, run: scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli Step 2 of 10 Create your New Relic CLI profile Now that you've installed the New Relic CLI, it's time to create your first profile. Profiles contain credentials and settings that you can apply to any CLI command, which is useful when switching between accounts. To create your first CLI profile, run the profiles add command. Note that you need to set the region of your New Relic account: use -r to set either us or eu (this is required). # Create the tutorial account for the US region newrelic profiles add -n tutorial --apiKey YOUR_NEW_RELIC_API_KEY -r YOUR_REGION # Set the profile as defaults newrelic profiles default -n tutorial Copy Step 3 of 10 Get your application details In this example, you are going to add tags to the application you've instrumented with New Relic. Tags are key-value pairs that can help you organize and filter your entities. An entity (for example, an application) can have a maximum of 100 key-value pairs tied to it. Before searching for your application using the New Relic CLI, write down or copy your Account ID and the name of your application in New Relic - you need both to find applications in the New Relic platform. Step 4 of 10 The New Relic CLI can retrieve your application details as a JSON object. To search for your APM application use the apm application search command. If you get an error, check that the account ID and application name you provided are correct. newrelic apm application search --accountId YOUR_ACCOUNT_ID --name NAME_OF_YOUR_APP Copy Step 5 of 10 If the account ID is valid, and the application name exists in your account, apm application search yields data similar to this example. When you've successfully searched for your application, look for the guid value. It's a unique identifier for your application. You should copy it or write it down. [ { accountId: YOUR_ACCOUNT_ID, applicationId: YOUR_APP_ID, domain: 'APM', entityType: 'APM_APPLICATION_ENTITY', guid: 'A_LONG_GUID', name: 'NAME_OF_YOUR_APP', permalink: 'https://one.newrelic.com/redirect/entity/A_LONG_GUID', reporting: true, type: 'APPLICATION', }, ]; Copy Step 6 of 10 Add a simple tag to your application Now that you have the GUID, you can point the New Relic CLI directly at your application. Adding a tag is the simplest way to try out the CLI capabilities (don't worry, tags can be deleted by using entity tags delete). Let's suppose that you want to add an environment tag to your application. Go ahead and add the dev:testing tag (or any other key-value pair) to your application using the entities tags create command. newrelic entity tags create --guid YOUR_APP_GUID --tag devkit:testing Copy Step 7 of 10 What if you want to add multiple tags? Tag sets come to the rescue! While tags are key-value pairs separated by colons, tag sets are comma separated lists of tags. For example: tag1:value1,tag2:value2 To add multiple tags at once to your application, modify and run the following snippet. newrelic entity tags create --guid YOUR_APP_GUID --tag tag1:test,tag2:test Copy Adding tags is an asynchronous operation: this means it could take a while for the tags to get created. Step 8 of 10 You've created and added some tags to your application, but how do you know they're there? You need to retrieve your application's tags. To retrieve your application's tags, use the entity tags get command. newrelic entity tags get --guid YOUR_APP_GUID All tags associated with your application are retrieved as a JSON array. [ { Key: 'tag1', Values: ['true'], }, { Key: 'tag2', Values: ['test'], }, { Key: 'tag3', Values: ['testing'], }, // ... ]; Copy Step 9 of 10 Bonus step: Create a deployment marker Deployments of applications often go wrong. Deployment markers are labels that, when attached to your application data, help you track deployments and troubleshoot what happened. To create a deployment marker, run the apm deployment create command using the same Application ID from your earlier search. newrelic apm deployment create --applicationId YOUR_APP_ID --revision $(git describe --tags --always) Copy Step 10 of 10 Notice that the JSON response includes the revision and timestamp of the deployment. This workflow could be built into a continuous integration or continuous deployment (CI/CD) system to help indicate changes in your application's behavior after deployments. Here is an example. { \"id\": 37075986, \"links\": { \"application\": 204261368 }, \"revision\": \"v1.2.4\", \"timestamp\": \"2020-03-04T15:11:44-08:00\", \"user\": \"Developer Toolkit Test Account\" } Copy Next steps Have a look at all the available commands. For example, you could create a New Relic workflow using workload create If you'd like to engage with other community members, visit our New Relic Explorers Hub page. We welcome feature requests or bug reports on GitHub.",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 120.21307,
+ "_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"
+ },
+ {
+ "sections": [
+ "Nerdpack file structure",
+ "Generate Nerdpack components",
+ "Nerdlet file structure",
+ "index.js",
+ "nr1.json",
+ "styles.scss",
+ "icon.png",
+ "Launcher file structure"
+ ],
+ "title": "Nerdpack file structure",
+ "type": "developer",
+ "tags": [
+ "New Relic One CLI",
+ "nerdpack",
+ "file structure",
+ "nerdlets",
+ "launchers"
+ ],
+ "external_id": "c97bcbb0a2b3d32ac93b5b379a1933e7b4e00161",
+ "image": "",
+ "url": "https://developer.newrelic.com/explore-docs/nerdpack-file-structure/",
+ "published_at": "2020-10-06T02:10:04Z",
+ "updated_at": "2020-08-14T01:49:25Z",
+ "document_type": "page",
+ "popularity": 1,
+ "info": "An overview of the Nerdpack File Structure",
+ "body": "Nerdpack file structure A New Relic One application is represented by a Nerdpack folder, which can include one or more Nerdlet files, and (optionally) one or more launcher files. Here we explain: The file structure for a Nerdpack, a Nerdlet, and a launcher How to link a launcher file to a Nerdlet How to link your application with a monitored entity For basic component definitions, see our component reference. Generate Nerdpack components There are two ways to generate a Nerdpack template: Generate a Nerdpack: Use the New Relic One CLI command nr1 create and select Nerdpack to create a Nerdpack template that includes a Nerdlet and a launcher. Generate Nerdlet or launcher individually: Use the New Relic One CLI command nr1 create and choose either Nerdlet or launcher. This can be useful when adding Nerdlets to an existing Nerdpack. For documentation on generating and connecting Nerdpack components, see our app building guides and the New Relic One CLI command reference. Nerdpack file structure When you generate a Nerdpack template using the nr1 create command, it has the following file structure: my-nerdlet ├── README.md ├── launchers │ └── my-nerdlet-launcher │ ├── icon.png │ └── nr1.json ├── nerdlets │ └── my-nerdlet-nerdlet │ ├── index.js │ ├── nr1.json │ └── styles.scss ├── node_modules │ ├── js-tokens │ ├── loose-envify │ ├── object-assign │ ├── prop-types │ ├── react │ ├── react-dom │ ├── react-is │ └── scheduler ├── nr1.json ├── package-lock.json └── package.json Copy Nerdlet file structure A Nerdpack can contain one or more Nerdlets. A Nerdlet folder starts out with three default files, index.js, nr1.json, and styles.scss. Here is what the default files look like after being generated using the nr1 create command: index.js The JavaScript code of the Nerdlet. import React from 'react'; export default class MyAwesomeNerdpack extends React.Component { render() { return Hello, my-awesome-nerdpack Nerdlet!
; } } Copy nr1.json The Nerdlet configuration file. { \"schemaType\": \"NERDLET\", \"id\": \"my-awesome-nerdpack-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\" } Copy Besides using the launcher as the access point for your application, you can also associate the application with a monitored entity to get it to appear in the entity explorer. To do this, add two additional fields to the config file of the first-launched Nerdlet: entities and actionCategory. In the following example, the Nerdlet has been associated with all Browser-monitored applications and will appear under the Monitor UI category : { \"schemaType\": \"NERDLET\", \"id\": \"my-nerdlet\", \"description\": \"Describe me\", \"displayName\": \"Custom Data\", \"entities\": [{ \"domain\": \"BROWSER\", \"type\": \"APPLICATION\" }], \"actionCategory\": \"monitor\" } Copy To see this application in the UI, you would go to the entity explorer, select Browser applications, and select a monitored application. styles.scss An empty SCSS file for styling your application. icon.png The launcher icon that appears on the Apps page in New Relic One when an application is deployed. Launcher file structure Launchers have their own file structure. Note that: A launcher is not required; as an alternative to using a launcher, you can associate your application with a monitored entity. An application can have more than one launcher, which might be desired for an application with multiple Nerdlets. After generating a launcher using the nr1 create command, its folder contains two files: nr1.json The configuration file. { \"schemaType\": \"LAUNCHER\", \"id\": \"my-awesome-nerdpack-launcher\", \"description\": \"Describe me\", \"displayName\": \"MyAwesomeNerdpack\", \"rootNerdletId\": \"my-awesome-nerdpack-nerdlet\" } Copy To connect a launcher to a Nerdlet, the rootNerdletId must match the id in the launched Nerdlet's nr1.json config file. For Nerdpacks with multiple Nerdlets, this needs to be done only for the first-launched Nerdlet. icon.png The icon displayed on the launcher for the app on the Apps page.",
+ "_index": "520d1d5d14cc8a32e600034b",
+ "_type": "520d1d5d14cc8a32e600034c",
+ "_score": 118.33199,
+ "_version": null,
+ "_explanation": null,
+ "sort": null,
+ "highlight": {
+ "tags": "New Relic One CLI",
+ "body": " How to link your application with a monitored entity For basic component definitions, see our component reference. Generate Nerdpack components There are two ways to generate a Nerdpack template: Generate a Nerdpack: Use the New Relic One CLI command nr1 create and select Nerdpack to create"
+ },
+ "id": "5efa989e196a671300766404"
}
]
}
\ No newline at end of file