Skip to content

Commit 2a6df9a

Browse files
Merge pull request #290011 from alfpark/alpark/batch
Remove batch-insights reference
2 parents 1778029 + eb8b289 commit 2a6df9a

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

articles/batch/monitor-application-insights.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to instrument an Azure Batch .NET application using the A
44
ms.topic: how-to
55
ms.devlang: csharp
66
ms.custom: devx-track-csharp, devx-track-dotnet
7-
ms.date: 06/13/2024
7+
ms.date: 11/06/2024
88
---
99

1010
# Monitor and debug an Azure Batch .NET application with Application Insights
@@ -15,16 +15,13 @@ This article shows how to add and configure the Application Insights library int
1515

1616
A sample C# solution with code to accompany this article is available on [GitHub](https://github.com/Azure/azure-batch-samples/tree/master/CSharp/ArticleProjects/ApplicationInsights). This example adds Application Insights instrumentation code to the [TopNWords](https://github.com/Azure/azure-batch-samples/tree/master/CSharp/TopNWords) example. If you're not familiar with that example, try building and running TopNWords first. Doing this will help you understand a basic Batch workflow of processing a set of input blobs in parallel on multiple compute nodes.
1717

18-
> [!TIP]
19-
> As an alternative, configure your Batch solution to display Application Insights data such as VM performance counters in Batch Explorer. [Batch Explorer](https://github.com/Azure/BatchExplorer) is a free, rich-featured, standalone client tool to help create, debug, and monitor Azure Batch applications. Download an [installation package](https://azure.github.io/BatchExplorer/) for Mac, Linux, or Windows. See the [batch-insights repo](https://github.com/Azure/batch-insights) for quick steps to enable Application Insights data in Batch Explorer.
20-
2118
## Prerequisites
2219

2320
- [Visual Studio 2017 or later](https://www.visualstudio.com/vs)
2421
- [Batch account and linked storage account](batch-account-create-portal.md)
2522
- [Application Insights resource](/previous-versions/azure/azure-monitor/app/create-new-resource). Use the Azure portal to create an Application Insights *resource*. Select the *General* **Application type**.
2623
- Copy the [instrumentation key](/previous-versions/azure/azure-monitor/app/create-new-resource#copy-the-instrumentation-key) from the Azure portal. You'll need this value later.
27-
24+
2825
> [!NOTE]
2926
> You may be [charged](https://azure.microsoft.com/pricing/details/application-insights/) for data stored in Application Insights. This includes the diagnostic and monitoring data discussed in this article.
3027
@@ -186,7 +183,7 @@ private static readonly List<string> AIFilesToUpload = new List<string>()
186183
"Microsoft.AI.PerfCounterCollector.dll",
187184
"Microsoft.AI.ServerTelemetryChannel.dll",
188185
"Microsoft.AI.WindowsServer.dll",
189-
186+
190187
// custom telemetry initializer assemblies
191188
"Microsoft.Azure.Batch.Samples.TelemetryInitializer.dll",
192189
};
@@ -230,7 +227,7 @@ for (int i = 1; i <= topNWordsConfiguration.NumberOfTasks; i++)
230227
accountSettings.StorageAccountName,
231228
accountSettings.StorageAccountKey));
232229

233-
//This is the list of files to stage to a container -- for each job, one container is created and
230+
//This is the list of files to stage to a container -- for each job, one container is created and
234231
//files all resolve to Azure Blobs by their name (so two tasks with the same named file will create just 1 blob in
235232
//the container).
236233
task.FilesToStage = new List<IFileStagingProvider>
@@ -242,7 +239,7 @@ for (int i = 1; i <= topNWordsConfiguration.NumberOfTasks; i++)
242239
foreach (FileToStage stagedFile in aiStagedFiles)
243240
{
244241
task.FilesToStage.Add(stagedFile);
245-
}
242+
}
246243
task.RunElevated = false;
247244
tasksToRun.Add(task);
248245
}
@@ -260,7 +257,7 @@ To view trace logs in your Applications Insights resource, click **Live Stream**
260257

261258
### View trace logs
262259

263-
To view trace logs in your Applications Insights resource, click **Search**. This view shows a list of diagnostic data captured by Application Insights including traces, events, and exceptions.
260+
To view trace logs in your Applications Insights resource, click **Search**. This view shows a list of diagnostic data captured by Application Insights including traces, events, and exceptions.
264261

265262
The following screenshot shows how a single trace for a task is logged and later queried for debugging purposes.
266263

@@ -292,7 +289,7 @@ To create a sample chart:
292289
## Monitor compute nodes continuously
293290

294291
You may have noticed that all metrics, including performance counters, are only logged when the tasks are running. This behavior is useful because it limits the amount of
295-
data that Application Insights logs. However, there are cases when you would always like to monitor the compute nodes. For example, they might be running background work which is not scheduled via the Batch service. In this case, set up a monitoring process to run for the life of the compute node.
292+
data that Application Insights logs. However, there are cases when you would always like to monitor the compute nodes. For example, they might be running background work which is not scheduled via the Batch service. In this case, set up a monitoring process to run for the life of the compute node.
296293

297294
One way to achieve this behavior is to spawn a process that loads the Application Insights library and runs in the background. In the example, the start task loads the binaries on the machine and keeps a process running indefinitely. Configure the Application Insights configuration file for this process to emit additional data you're interested in, such as performance counters.
298295

0 commit comments

Comments
 (0)