Giter VIP home page Giter VIP logo

newrelic-azure-log-ingestion's Introduction

New Relic Experimental header

Note that this project is experimental, and may change considerably before it is released.

newrelic-azure-log-ingestion Build Status

An Azure Resource Manager template to export Azure Monitoring logs, metrics and traces to New Relic.

How Does It Work?

This integration creates and configures the Azure resources necessary to efficiently export telemetry data from an Azure account into New Relic. It relies on Azure Diagnostic Settings to stream telemetry data to an Azure Event Hub, this Event Hub subsequently batches and triggers an Azure Function to handle the transport of telemetry data on to New Relic.

Currently this integration only targets App Insights. If you have other telemetry data you would like to see exported using Diagnostic Settings, tell us about your use case.

Supported Data Types

Data Type Supported? In New Relic One
AppAvailabilityResults Yes Distributed Tracing and Custom Events (as AzureAppAvailabilityResult
AppBrowserTimings Yes Distributed Tracing and Custom Events (as AzureAppBrowserTiming
AppDependencies Yes Distributed Tracing
AppEvents Yes Custom Events (as AzureAppEvent
AppExceptions Yes Distributed Tracing and Custom Events (as AzureAppException
AppMetrics Planned Metrics
AppPageViews Yes Distributed Tracing and Custom Events (as AzureAppPageView
AppPerformanceCounters Yes Metrics
AppRequests Yes Distributed Tracing and Custom Events (as AzureAppRequest
AppTraces Yes Logs and Logs In Context

We also plan to support Azure Resource Logs. Let us know which resources we should target first.

Installation

This integration requires both a New Relic and Azure account.

Install Using Azure Portal

Retrieve your New Relic Insights Insert Key.

Then click the button below to start the installation process via the Azure Portal.

Deploy to Azure

Install Using Azure CLI

  1. Install the Azure CLI.

  2. Retrieve your New Relic Insights Insert Key.

  3. Run az login to login to Azure.

  4. Run az group create --name NewRelicLogs --location westus to create an Azure Resource Group. Replace NewRelicLogs with your preferred Resource Group name and westus with your prefered Azure location. This step is optional but recommended. If you have an existing Resource Group you want to use, you can skip this step.

  5. Deploy the Resource Manager template:

       az deployment group create \
           --name NewRelicLogs \
           --resource-group NewRelicLogs \
           --template-uri https://raw.githubusercontent.com/newrelic/newrelic-azure-log-ingestion/main/templates/azure-log-ingestion.json \
           --parameters NewRelicInsertKey=<new relic insert key here>
    

    Make sure the --resource-group argument is the same as the one you created in the previous step. Also make sure you replace <new relic insert key here> with your New Relic Insert Key.

Getting Started

Now that you have your New Relic export stack setup in your Azure account, you need to configure your App Insights resources to start sending telemetry data to it.

Automatic Reporting with Azure Policy

You can automatically configure your App Insights resources to report telemetry to New Relic using an Azure Policy.

This is the easiest option as it only needs to be setup once and all existing and future App Insights resources will be automatically configured to report to New Relic. Keep in mind there are costs associated with exporting telemetry data from Azure. You will want to monitor integration utilization to ensure they meet your expectations.

Using Azure Portal

Click the button below to start the installation process via the Azure Portal.

Deploy to Azure

Using Azure CLI

To set up this Azure Policy, run the following commands using the Azure CLI:

az policy definition create \
    --name New-Relic-Diagnostic \
    --mode All \
    --rules "https://raw.githubusercontent.com/newrelic/newrelic-azure-log-ingestion/main/policies/rules.json" 
    --params "https://raw.githubusercontent.com/newrelic/newrelic-azure-log-ingestion/main/policies/params.json"

az policy assignment create \
    --name New-Relic-Diagnostic-assignment \
    --policy New-Relic-Diagnostic \
    --assign-identity \
    --role Contributor \
    --identity-scope /subscriptions/${subscriptionId} \
    --location westus2 
    -p '{ "eventHubAuthorizationRuleId": { "value": "/subscriptions/${subscriptionId}/resourceGroups/${resource-group}/providers/Microsoft.EventHub/namespaces/${namespace-name)/authorizationRules/NewRelicLogsSharedAccessKey" } }'

az policy remediation create \
    --name New-Relic-Diagnostic-remediation \
    --policy-assignment New-Relic-Diagnostic-assignment

Replacing, as necessary, the ${subscriptionId}, ${resource-group}, and ${namespace-name} placeholders with the values appropriate to your installation.

Manually Configure Diagnostic Settings

You can manually configure Diagnostic Settings for only the App Insights resources you want to report telemetry data to New Relic. This option is more involved, but offers more fine grained control over the telemetry data being exported.

  1. Find the AppInsights resource you want to export telemetry data from in the Azure Portal.
  2. In the resource's menu, click Diagnostic Settings under Monitor.
  3. Click Add diagnostic setting.
  4. Enter a Name for your setting.
  5. Under Category details, Check the box for each category of data you want to export to New Relic.
  6. Under Destination details, check the Event Hub box.
  7. Under the Event Hub destination configuration, you'll need to specify the following:
    • The subscription which the event hub is part of. This should be the same subscription used during the installation steps above.
    • The Event hub namespace. This should be NewRelicLogs.
    • An Event hub name. This should be newrelic-log-ingestion.
    • An Event Hub policy. The policy selected must grant the permissions necessary to stream data to the Event Hub.
  8. Click Save.

After a few moments, the new setting appears in your list of settings for this resource, and logs are streamed to the specified destination as new event data is generated.

See the Azure documentation for more details.

Usage

From here, App Insights will begin streamingplatform logs and metrics out-of-the-box. However, to get the most out of your telemetry, you'll want to start instrumenting.

See below for details on how to instrument your code for your specific runtime:

Building

  1. Run npm install to install the dependencies.
  2. Run npm run build to run the build.

Testing

Run npm test to run tests.

Support

New Relic hosts and moderates an online forum where customers can interact with New Relic employees as well as other customers to get help and share best practices. Like all official New Relic open source projects, there's a related Community topic in the New Relic Explorers Hub. You can find this project's topic/threads here:

Add the url for the support thread here: discuss.newrelic.com

Contribute

We encourage your contributions to improve newrelic-azure-log-ingestion! Keep in mind that when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project.

If you have any questions, or to execute our corporate CLA (which is required if your contribution is on behalf of a company), drop us an email at [email protected].

A note about vulnerabilities

As noted in our security policy, New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.

If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through HackerOne.

If you would like to contribute to this project, review these guidelines.

To all contributors, we thank you! Without your contribution, this project would not be what it is today. We also host a community project page dedicated to Project Name.

License

newrelic-azure-log-ingestion is licensed under the Apache 2.0 License.

newrelic-azure-log-ingestion's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

newrelic-azure-log-ingestion's Issues

[Repolinter] Open Source Policy Issues

Repolinter Report

๐Ÿค–This issue was automatically generated by repolinter-action, developed by the Open Source and Developer Advocacy team at New Relic. This issue will be automatically updated or closed when changes are pushed. If you have any problems with this tool, please feel free to open a GitHub issue or give us a ping in #help-opensource.

This Repolinter run generated the following results:

โ— Error โŒ Fail โš ๏ธ Warn โœ… Pass Ignored Total
0 1 0 6 0 7

Fail #

โŒ readme-starts-with-community-header #

The README of a community project should have a community project header at the start of the README. If you already have a community project header and this rule is failing, your header may be out of date, and you should update your header with the suggested one below. For more information please visit https://opensource.newrelic.com/oss-category/. Below is a list of files or patterns that failed:

  • README.md: The first 5 lines do not contain the pattern(s): Open source Community header (see https://opensource.newrelic.com/oss-category).
    • ๐Ÿ”จ Suggested Fix: prepend [![Community header](https://github.com/newrelic/opensource-website/raw/master/src/images/categories/Community_Project.png)](https://opensource.newrelic.com/oss-category/#community-project) to file

Passed #

Click to see rules

โœ… license-file-exists #

Found file (LICENSE). New Relic requires that all open source projects have an associated license contained within the project. This license must be permissive (e.g. non-viral or copyleft), and we recommend Apache 2.0 for most use cases. For more information please visit https://docs.google.com/document/d/1vML4aY_czsY0URu2yiP3xLAKYufNrKsc7o4kjuegpDw/edit.

โœ… readme-file-exists #

Found file (README.md). New Relic requires a README file in all projects. This README should give a general overview of the project, and should point to additional resources (security, contributing, etc.) where developers and users can learn further. For more information please visit https://github.com/newrelic/open-by-default.

โœ… readme-contains-link-to-security-policy #

Contains a link to the security policy for this repository (README.md). New Relic recommends putting a link to the open source security policy for your project (https://github.com/newrelic/<repo-name>/security/policy or ../../security/policy) in the README. For an example of this, please see the "a note about vulnerabilities" section of the Open By Default repository. For more information please visit https://nerdlife.datanerd.us/new-relic/security-guidelines-for-publishing-source-code.

โœ… readme-contains-discuss-topic #

Contains a link to the appropriate discuss.newrelic.com topic (README.md). New Relic recommends directly linking the your appropriate discuss.newrelic.com topic in the README, allowing developer an alternate method of getting support. For more information please visit https://nerdlife.datanerd.us/new-relic/security-guidelines-for-publishing-source-code.

โœ… code-of-conduct-should-not-exist-here #

New Relic has moved the CODE_OF_CONDUCT file to a centralized location where it is referenced automatically by every repository in the New Relic organization. Because of this change, any other CODE_OF_CONDUCT file in a repository is now redundant and should be removed. Note that you will need to adjust any links to the local CODE_OF_CONDUCT file in your documentation to point to the central file (README and CONTRIBUTING will probably have links that need updating). For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view. Did not find a file matching the specified patterns. All files passed this test.

โœ… third-party-notices-file-exists #

Found file (THIRD_PARTY_NOTICES.md). A THIRD_PARTY_NOTICES.md file can be present in your repository to grant attribution to all dependencies being used by this project. This document is necessary if you are using third-party source code in your project, with the exception of code referenced outside the project's compiled/bundled binary (ex. some Java projects require modules to be pre-installed in the classpath, outside the project binary and therefore outside the scope of the THIRD_PARTY_NOTICES). Please review your project's dependencies and create a THIRD_PARTY_NOTICES.md file if necessary. For JavaScript projects, you can generate this file using the oss-cli. For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.