Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
cbehera-newrelic committed Dec 31, 2024
1 parent d90240a commit 893f5fb
Show file tree
Hide file tree
Showing 4 changed files with 218 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ Before you [instrument Azure functions](/docs/serverless-function-monitoring/aws
* A <InlinePopover type="userKey" />.


<Callout variant="note">

Distributed tracing is supported for HTTP requests only. For more information, see [Distributed tracing](/docs/apm/distributed-tracing/distributed-tracing-ui/understand-distributed-tracing).
<Callout variant="tip" title="NOTE">

Distributed tracing is supported for HTTP requests only.

Check notice on line 19 in src/content/docs/serverless-function-monitoring/azure-function-monitoring/compatibility-requirement-azure-monitoring.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] src/content/docs/serverless-function-monitoring/azure-function-monitoring/compatibility-requirement-azure-monitoring.mdx#L19

[Microsoft.Passive] 'is supported' looks like passive voice.
Raw output
{"message": "[Microsoft.Passive] 'is supported' looks like passive voice.", "location": {"path": "src/content/docs/serverless-function-monitoring/azure-function-monitoring/compatibility-requirement-azure-monitoring.mdx", "range": {"start": {"line": 19, "column": 21}}}, "severity": "INFO"}
</Callout>


Expand Down Expand Up @@ -63,7 +62,7 @@ Based on your hosting environment, the following runtimes are supported.
## What's next

<DocTiles>
<DocTile title="Install and configure Lambda monitoring" path="/docs/serverless-function-monitoring/azure-function-monitoring/install-serverless-azure-monitoring" >Get started with instrumentation and configuration for your Azure functions</DocTile>
<DocTile title="Install and configure Azure functions monitoring" path="/docs/serverless-function-monitoring/azure-function-monitoring/install-serverless-azure-monitoring" >Get started with instrumentation and configuration for your Azure functions</DocTile>

</DocTiles>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ Environment variables are a way to store configuration and secrets outside of yo
<tr>
<td>`CORECLR_PROFILER`</td>
<td></td>
<td>`{36032161-FFC0-4B61-B559-F6C5D41BAE5A}`</td>
<td>**Required**: Set this to `{36032161-FFC0-4B61-B559-F6C5D41BAE5A}` to enable the .NET agent</td>
<td></td>
<td>**Required**: Set this to enable the .NET agent</td>
</tr>
<tr>
<td>`CORECLR_NEWRELIC_HOME`</td>
<td></td>
<td>`/opt/lib/newrelic-dotnet-agent`</td>
<td>**Required**: Set this to `/opt/lib/newrelic-dotnet-agent` to enable the .NET agent</td>
<td></td>
<td>**Required**: Set this to enable the .NET agent</td>
</tr>
<tr>
<td>`CORECLR_PROFILER_PATH`</td>
<td></td>
<td>`/opt/lib/newrelic-dotnet-agent/libNewRelicProfiler.so`</td>
<td>**Required**: Set this to `/opt/lib/newrelic-dotnet-agent/libNewRelicProfiler.so` to enable the .NET agent</td>
<td></td>
<td>**Required**: Set this to enable the .NET agent</td>
</tr>

<tr>
Expand Down Expand Up @@ -83,6 +83,6 @@ Environment variables are a way to store configuration and secrets outside of yo
## What's next

<DocTiles>
<DocTile title="Install and configure Lambda monitoring" path="/docs/serverless-function-monitoring/azure-function-monitoring/install-serverless-azure-monitoring" >Get started with instrumentation and configuration for your Azure functions</DocTile>
<DocTile title="Install and configure Azure functions monitoring" path="/docs/serverless-function-monitoring/azure-function-monitoring/install-serverless-azure-monitoring" >Get started with instrumentation and configuration for your Azure functions</DocTile>

</DocTiles>
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
---
title: "Install and configure Azure function monitoring on New Relic"
title: "Install and configure Azure functions monitoring on New Relic"
metaDescription: Configure your Azure functions with New Relic
freshnessValidatedDate: never

---

## Before you begin [#begin]

If you haven't done so, you may want to check that your Lambda function meets our [compatibility and requirements](/docs/serverless-function-monitoring/azure-function-monitoring/compatibility-requirement-azure-monitoring).
If you haven't done so, you may want to check that your Azure functions meet our [compatibility and requirements](/docs/serverless-function-monitoring/azure-function-monitoring/compatibility-requirement-azure-monitoring).

<Steps>

<Step>
## Link your Azure account to New Relic

You can link your Azure account to New Relic by configuring the polling of Azure Monitor metrics. This will allow you to see the metrics in the New Relic UI. For more information, see [Azure integration](https://docs.newrelic.com/docs/infrastructure/microsoft-azure-integrations/azure-integrations-list/azure-functions-monitoring-integration/#polling).
You can link your Azure account to New Relic by configuring the polling of Azure monitor metrics. This allows you to see the metrics in the New Relic UI. For more information, see [Azure integration](https://docs.newrelic.com/docs/infrastructure/microsoft-azure-integrations/azure-integrations-list/azure-functions-monitoring-integration/#polling).

Check notice on line 17 in src/content/docs/serverless-function-monitoring/azure-function-monitoring/install-serverless-azure-monitoring.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] src/content/docs/serverless-function-monitoring/azure-function-monitoring/install-serverless-azure-monitoring.mdx#L17

[new-relic.ComplexWords] Consider using 'check' or 'watch' instead of 'monitor'.
Raw output
{"message": "[new-relic.ComplexWords] Consider using 'check' or 'watch' instead of 'monitor'.", "location": {"path": "src/content/docs/serverless-function-monitoring/azure-function-monitoring/install-serverless-azure-monitoring.mdx", "range": {"start": {"line": 17, "column": 82}}}, "severity": "INFO"}
</Step>

<Step>
## Instrument your Azure Function with the New Relic .NET Agent
## Instrument your Azure functions with the New Relic .NET Agent

Based on your requirement, select one of the following options to instrument your Azure Function with the New Relic .NET Agent.
Based on your requirement, select one of the following options to instrument your Azure functions with the New Relic .NET Agent.

<Tabs>
<TabsBar>
Expand All @@ -35,15 +35,16 @@ Based on your requirement, select one of the following options to instrument you
<TabsPageItem id="linux-instrumentation">

1. Add the `NewRelic.Agent` NuGet package to your application project.
* In Visual Studio code editor, use the NuGet Package Manager to search for and add the latest version of `NewRelic.Agent` to your application.
* If you're using other development environments, you can add the package with `dotnet add packages NewRelic.Agent`.

* In Visual Studio code editor, use the NuGet Package Manager to search for and add the latest version of `NewRelic.Agent` to your application.
* If you're using other development environments, you can add the package with `dotnet add packages NewRelic.Agent`.
2. Use your preferred publishing mechanism to deploy your updated application to Azure. This includes the New Relic agent, which is installed to the `/home/site/www/newrelic` folder.

</TabsPageItem>
<TabsPageItem id="windows-instrumentation">

1. Navigate to the Kudu service page and do the following:

1. In the Azure portal, navigate to your function app.
2. Click the <DNT>**Development tools**</DNT> section, and select <DNT>**Advanced Tools > Go**</DNT>.
3. Click the <DNT>**Site extensions**</DNT> tab to view the available site extension to install.
Expand Down Expand Up @@ -79,21 +80,211 @@ Based on your requirement, select one of the following options to instrument you
<Step>
## Configure the environment variables

Check notice on line 81 in src/content/docs/serverless-function-monitoring/azure-function-monitoring/install-serverless-azure-monitoring.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] src/content/docs/serverless-function-monitoring/azure-function-monitoring/install-serverless-azure-monitoring.mdx#L81

[Microsoft.SentenceLength] Try to keep sentences short (< 30 words).
Raw output
{"message": "[Microsoft.SentenceLength] Try to keep sentences short (\u003c 30 words).", "location": {"path": "src/content/docs/serverless-function-monitoring/azure-function-monitoring/install-serverless-azure-monitoring.mdx", "range": {"start": {"line": 81, "column": 4}}}, "severity": "INFO"}

After you've instrumented your Azure Function with the New Relic .NET Agent, you need to configure the environment variables to send the data to New Relic. For more information, refer to [configure environment variables](/docs/serverless-function-monitoring/azure-function-monitoring/env-variables-azure).
After you've instrumented your Azure Functions with the New Relic .NET Agent, do the following to configure the [environment variables](/docs/serverless-function-monitoring/azure-function-monitoring/env-variables-azure) to send the data to New Relic.

1. Navigate to your Azure function in the Azure portal, under **Settings**, click **Environment variables**, and then click **Advanced edit**.

2. Based on your application requirement, paste the following values.

<Callout variant="important">
Ensure that you add a comma at the end of the last existing line and update your license key and app name in the following configurations.
</Callout>

<Tabs>
<TabsBar>

<TabsBarItem id="linux-configuration">Linux</TabsBarItem>
<TabsBarItem id="windows-configuration">Windows</TabsBarItem>
<TabsBarItem id="containerized-configuration">Containerized functions</TabsBarItem>

</TabsBar>

<TabsPages>

<TabsPageItem id="linux-configuration">

```json
{
"name": "CORECLR_ENABLE_PROFILING",
"value": "1",
"slotSetting": false
},
{
"name": "CORECLR_NEWRELIC_HOME",
"value": "/home/site/wwwroot/newrelic",
"slotSetting": false
},
{
"name": "CORECLR_PROFILER",
"value": "{36032161-FFC0-4B61-B559-F6C5D41BAE5A}",
"slotSetting": false
},
{
"name": "CORECLR_PROFILER_PATH",
"value": "/home/site/wwwroot/newrelic/libNewRelicProfiler.so",
"slotSetting": false
},
{
"name": "NEW_RELIC_AZURE_FUNCTION_MODE_ENABLED",
"value": "1",
"slotSetting": false
},
{
"name": "NEW_RELIC_LICENSE_KEY",
"value": "<your newrelic license key here>",
"slotSetting": false
},
{
"name": "NEWRELIC_LOG_DIRECTORY",
"value": "/home/LogFiles/NewRelic",
"slotSetting": false
},
{
"name": "NEWRELIC_LOG_LEVEL",
"value": "info",
"slotSetting": false
},


```

</TabsPageItem>

<TabsPageItem id="windows-configuration">

```json
{
"name": "CORECLR_PROFILER_PATH",
"value": "C:\\home\\NewRelicAgent\\Core\\NewRelic.Profiler.dll",
"slotSetting": false
},
{
"name": "CORECLR_NEWRELIC_HOME",
"value": "C:\\home\\NewRelicAgent\\Core",
"slotSetting": false
},
{
"name": "NEWRELIC_LOG_DIRECTORY",
"value": "C:\\home\\LogFiles\\NewRelic",
"slotSetting": false
},
{
"name": "CORECLR_PROFILER_PATH",
"value": "/home/site/wwwroot/newrelic/libNewRelicProfiler.so",
"slotSetting": false
},
{
"name": "CORECLR_NEWRELIC_HOME",
"value": "/home/site/wwwroot/newrelic",
"slotSetting": false
},
{
"name": "NEWRELIC_LOG_DIRECTORY",
"value": "/home/LogFiles/NewRelic",
"slotSetting": false
},
{
"name": "NEW_RELIC_AZURE_FUNCTION_MODE_ENABLED",
"value": "1",
"slotSetting": false
},
{
"name": "CORECLR_ENABLE_PROFILING",
"value": "1",
"slotSetting": false
},
{
"name": "CORECLR_PROFILER",
"value": "{36032161-FFC0-4B61-B559-F6C5D41BAE5A}",
"slotSetting": false
},
{
"name": "NEW_RELIC_LICENSE_KEY",
"value": "<your newrelic license key here>",
"slotSetting": false
},
{
"name": "NEWRELIC_LOG_LEVEL",
"value": "info",
"slotSetting": false
},
{
"name": "NEW_RELIC_APP_NAME",
"value": "<your app name>",
"slotSetting": false
},

```
</TabsPageItem >

<TabsPageItem id="containerized-configuration">

```json
{
"name": "CORECLR_ENABLE_PROFILING",
"value": "1",
"slotSetting": false
},
{
"name": "CORECLR_NEWRELIC_HOME",
"value": "/usr/local/newrelic-dotnet-agent",
"slotSetting": false
},
{
"name": "CORECLR_PROFILER",
"value": "{36032161-FFC0-4B61-B559-F6C5D41BAE5A}",
"slotSetting": false
},
{
"name": "CORECLR_PROFILER_PATH",
"value": "/usr/local/newrelic-dotnet-agent/libNewRelicProfiler.so",
"slotSetting": false
},
{
"name": "NEW_RELIC_AZURE_FUNCTION_MODE_ENABLED",
"value": "1",
"slotSetting": false
},
{
"name": "NEW_RELIC_LICENSE_KEY",
"value": "<your newrelic license key here>",
"slotSetting": false
},
{
"name": "NEWRELIC_LOG_DIRECTORY",
"value": "/home/LogFiles/NewRelic",
"slotSetting": false
},
{
"name": "NEWRELIC_LOG_LEVEL",
"value": "info",
"slotSetting": false
},

```

</TabsPageItem>

</TabsPages>


</Tabs>


</Step>

<Step>
## Restart your Azure Function

After you've added the environment variables, restart your Azure Function to apply the changes.
## Restart your Azure functions

After you've added the environment variables, restart your Azure functions to apply the changes.
</Step>

<Step>
## Send traffic to your Azure Function
## Send traffic to your Azure functions

Send traffic to the azure function and review the NewRelic UI dashboard to see the metrics.
Send traffic to the Azure function and review the NewRelic UI dashboard to see the metrics.
</Step>

</Steps>
</Steps>

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ freshnessValidatedDate: never

New Relic's instrumentation for Azure functions offers deep visibility into the inner workings of your functions. By adding the New Relic agent to your function, each invocation is monitored by New Relic. This enables you to track the duration of function invocations, monitor errors, distributed tracing, and record details about the source events and your function's responses.

Check notice on line 11 in src/content/docs/serverless-function-monitoring/azure-function-monitoring/introduction-azure-monitoring.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] src/content/docs/serverless-function-monitoring/azure-function-monitoring/introduction-azure-monitoring.mdx#L11

[Microsoft.Passive] 'is monitored' looks like passive voice.
Raw output
{"message": "[Microsoft.Passive] 'is monitored' looks like passive voice.", "location": {"path": "src/content/docs/serverless-function-monitoring/azure-function-monitoring/introduction-azure-monitoring.mdx", "range": {"start": {"line": 11, "column": 179}}}, "severity": "INFO"}

Check notice on line 11 in src/content/docs/serverless-function-monitoring/azure-function-monitoring/introduction-azure-monitoring.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] src/content/docs/serverless-function-monitoring/azure-function-monitoring/introduction-azure-monitoring.mdx#L11

[new-relic.ComplexWords] Consider using 'check' or 'watch' instead of 'monitor'.
Raw output
{"message": "[new-relic.ComplexWords] Consider using 'check' or 'watch' instead of 'monitor'.", "location": {"path": "src/content/docs/serverless-function-monitoring/azure-function-monitoring/introduction-azure-monitoring.mdx", "range": {"start": {"line": 11, "column": 270}}}, "severity": "INFO"}

Add distributed tracing (http)


{/* <img
title="new-relic-lambda-entities-screenshot.png"
Expand All @@ -19,7 +19,7 @@ Add distributed tracing (http)
/> */}


<Callout variant="tip">
<Callout variant="important">

For Azure functions, the agent reports data such as distributed traces and logs, which are available under 'Services - APM' as an APM entity, unlike Lambda monitoring. However, a separate entity for Azure Functions will still exist with only the metric data.

Expand All @@ -29,7 +29,7 @@ For Azure functions, the agent reports data such as distributed traces and logs,
## What's next

<DocTiles>
<DocTile title="Compatibility and requirement" path="/docs/serverless-function-monitoring/azure-function-monitoring/compatibity-requirement-azure-monitoring">Learn more about supported runtimes and prerequisites</DocTile>
<DocTile title="Install and configure Lambda monitoring" path="/docs/serverless-function-monitoring/azure-function-monitoring/install-serverless-azure-monitoring" >Get started with instrumentation and configuration for your Azure functions</DocTile>
<DocTile title="Compatibility and requirements" path="/docs/serverless-function-monitoring/azure-function-monitoring/compatibility-requirement-azure-monitoring">Learn more about supported runtimes and prerequisites</DocTile>
<DocTile title="Install and configure Azure functions monitoring" path="/docs/serverless-function-monitoring/azure-function-monitoring/install-serverless-azure-monitoring" >Get started with instrumentation and configuration for your Azure functions</DocTile>

</DocTiles>

0 comments on commit 893f5fb

Please sign in to comment.