You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/synapse-analytics/spark/apache-spark-azure-log-analytics.md
+38-60Lines changed: 38 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,12 @@ author: jejiang
5
5
ms.author: jejiang
6
6
ms.reviewer: whhender
7
7
ms.service: azure-synapse-analytics
8
-
ms.topic: tutorial
8
+
ms.topic: how-to
9
9
ms.subservice: spark
10
-
ms.date: 03/25/2021
10
+
ms.date: 12/13/2024
11
11
ms.custom: references_regions
12
12
---
13
+
13
14
# Monitor Apache Spark applications with Azure Log Analytics
14
15
15
16
In this tutorial, you learn how to enable the Synapse Studio connector that's built in to Log Analytics. You can then collect and send Apache Spark application metrics and logs to your [Log Analytics workspace](/azure/azure-monitor/logs/quick-create-workspace). Finally, you can use an Azure Monitor workbook to visualize the metrics and logs.
@@ -21,17 +22,18 @@ Follow these steps to configure the necessary information in Synapse Studio.
21
22
### Step 1: Create a Log Analytics workspace
22
23
23
24
Consult one of the following resources to create this workspace:
25
+
24
26
-[Create a workspace in the Azure portal.](/azure/azure-monitor/logs/quick-create-workspace)
25
27
-[Create a workspace with Azure CLI.](/azure/azure-monitor/logs/resource-manager-workspace)
26
28
-[Create and configure a workspace in Azure Monitor by using PowerShell.](/azure/azure-monitor/logs/powershell-workspace-configuration)
27
29
28
-
### Step 2: Prepare an Apache Spark configuration file
30
+
### Step 2: Gather configuration information
29
31
30
-
Use any of the following options to prepare the file.
32
+
Use any of the following options to prepare the configuration.
31
33
32
-
#### Option 1: Configure with Log Analytics workspace ID and key
34
+
#### Option 1: Configure with Log Analytics workspace ID and key
33
35
34
-
Copy the following Apache Spark configuration, save it as *spark_loganalytics_conf.txt*, and fill in the following parameters:
36
+
Gather the following values for the spark configuration:
-`<LOG_ANALYTICS_WORKSPACE_KEY>`: Log Analytics key. To find this, in the Azure portal, go to **Azure Log Analytics workspace** > **Agents** > **Primary key**.
For a list of Apache Spark configurations, see [Available Apache Spark configurations](../monitor-synapse-analytics-reference.md#available-apache-spark-configurations)
104
105
105
-
### Step 3: Upload your Apache Spark configuration to an Apache Spark pool
106
-
107
-
> [!NOTE]
108
-
>
109
-
> This step will be replaced by step 4.
110
-
111
-
You can upload the configuration file to your Azure Synapse Analytics Apache Spark pool. In Synapse Studio:
112
-
113
-
1. Select **Manage** > **Apache Spark pools**.
114
-
2. Next to your Apache Spark pool, select the **...** button.
115
-
3. Select **Apache Spark configuration**.
116
-
4. Select **Upload**, and choose the *spark_loganalytics_conf.txt* file.
117
-
5. Select **Upload**, and then select **Apply**.
106
+
### Step 3: Create an Apache Spark Configuration
118
107
119
-
> [!div class="mx-imgBorder"]
120
-
> 
108
+
You can create an Apache Spark Configuration to your workspace, and when you create Notebook or Apache spark job definition you can select the Apache Spark configuration that you want to use with your Apache Spark pool. When you select it, the details of the configuration are displayed.
121
109
122
-
> [!NOTE]
123
-
>
124
-
> All the Apache Spark applications submitted to the Apache Spark pool will use the configuration setting to push the Apache Spark application metrics and logs to your specified workspace.
1. Select **New** button to create a new Apache Spark configuration.
112
+
1.**New Apache Spark configuration** page will be opened after you select **New** button.
128
113
129
-
You can create an Apache Spark Configuration to your workspace, and when you create Notebook or Apache spark job definition can select the Apache Spark configuration that you want to use with your Apache Spark pool. When you select it, the details of the configuration are displayed.
114
+
:::image type="content" source="./media/apache-spark-azure-log-analytics/create-spark-configuration.png" alt-text="Screenshot that create spark configuration.":::
2. Click on **New** button to create a new Apache Spark configuration, or click on **Import** a local .json file to your workspace.
133
-
3.**New Apache Spark configuration** page will be opened after you click on **New** button.
134
-
4. For **Name**, you can enter your preferred and valid name.
135
-
5. For **Description**, you can input some description in it.
136
-
6. For **Annotations**, you can add annotations by clicking the **New** button, and also you can delete existing annotations by selecting and clicking **Delete** button.
137
-
7. For **Configuration properties**, customize the configuration by clicking **Add** button to add properties. If you do not add a property, Azure Synapse will use the default value when applicable.
116
+
1. For **Name**, you can enter your preferred and valid name.
117
+
1. For **Description**, you can input some description in it.
118
+
1. For **Annotations**, you can add annotations by clicking the **New** button, and also you can delete existing annotations by selecting and clicking **Delete** button.
119
+
1. For **Configuration properties**, add all the properties from the configuration option you chose by selecting the **Add** button. For **Property** add the property name as listed, and for **Value** use the value you gathered during step 2. If you don't add a property, Azure Synapse will use the default value when applicable.
138
120
139
-

121
+
:::image type="content" source="./media/apache-spark-azure-log-analytics/spark-configuration.png" alt-text="Screenshot with an example for updating configuration properties.":::
140
122
141
123
## Submit an Apache Spark application and view the logs and metrics
142
124
@@ -236,8 +218,6 @@ SparkMetrics_CL
236
218
| order by TimeGenerated asc
237
219
```
238
220
239
-
240
-
241
221
## Create and manage alerts
242
222
243
223
Users can query to evaluate metrics and logs at a set frequency, and fire an alert based on the results. For more information, see [Create, view, and manage log alerts by using Azure Monitor](/azure/azure-monitor/alerts/alerts-log).
@@ -246,29 +226,27 @@ Users can query to evaluate metrics and logs at a set frequency, and fire an ale
246
226
247
227
After the Synapse workspace is created with [data exfiltration protection](../security/workspace-data-exfiltration-protection.md) enabled.
248
228
249
-
When you want to enable this feature, you need to create managed private endpoint connection requests to [Azure Monitor private link scopes (A M P L S)](/azure/azure-monitor/logs/private-link-security) in the workspace’s approved Microsoft Entra tenants.
229
+
When you want to enable this feature, you need to create managed private endpoint connection requests to [Azure Monitor private link scopes (AMPLS)](/azure/azure-monitor/logs/private-link-security) in the workspace’s approved Microsoft Entra tenants.
250
230
251
-
You can follow below steps to create a managed private endpoint connection to Azure Monitor private link scopes (A M P L S):
231
+
You can follow below steps to create a managed private endpoint connection to Azure Monitor private link scopes (AMPLS):
252
232
253
-
1. If there is no existing A M P L S, you can follow [Azure Monitor Private Link connection setup](/azure/azure-monitor/logs/private-link-security) to create one.
254
-
2. Navigate to your A M P L S in Azure portal, on the **Azure Monitor Resources** page, click**Add** to add connection to your Azure Log Analytics workspace.
255
-
3. Navigate to **Synapse Studio > Manage > Managed private endpoints**, click**New** button, select **Azure Monitor Private Link Scopes**, and **continue**.
233
+
1. If there's no existing AMPLS, you can follow [Azure Monitor Private Link connection setup](/azure/azure-monitor/logs/private-link-security) to create one.
234
+
1. Navigate to your AMPLS in Azure portal, on the **Azure Monitor Resources** page, select**Add** to add connection to your Azure Log Analytics workspace.
235
+
1. Navigate to **Synapse Studio > Manage > Managed private endpoints**, select**New** button, select **Azure Monitor Private Link Scopes**, and **continue**.
256
236
> [!div class="mx-imgBorder"]
257
-
> 
258
-
4. Choose your Azure Monitor Private Link Scope you created, and click**Create** button.
237
+
> 
238
+
1. Choose your Azure Monitor Private Link Scope you created, and select**Create** button.
259
239
> [!div class="mx-imgBorder"]
260
-
> 
261
-
5. Wait a few minutes for private endpoint provisioning.
262
-
6. Navigate to your A M P L S in Azure portal again, on the **Private Endpoint connections** page, select the connection provisioned and **Approve**.
240
+
> 
241
+
1. Wait a few minutes for private endpoint provisioning.
242
+
1. Navigate to your AMPLS in Azure portal again, on the **Private Endpoint connections** page, select the connection provisioned and **Approve**.
263
243
264
-
> [!NOTE]
265
-
> - The A M P L S object has a number of limits you should consider when planning your Private Link setup. See [A M P L S limits](/azure/azure-monitor/logs/private-link-security) for a deeper review of these limits.
244
+
> [!NOTE]
245
+
> - The AMPLS object has a number of limits you should consider when planning your Private Link setup. See [AMPLS limits](/azure/azure-monitor/logs/private-link-security) for a deeper review of these limits.
266
246
> - Check if you have [right permission](../security/synapse-workspace-access-control-overview.md) to create managed private endpoint.
267
247
268
-
## Next steps
248
+
## Related content
269
249
270
-
-[Use serverless Apache Spark pool in Synapse Studio](../quickstart-create-apache-spark-pool-studio.md).
271
250
-[Run a Spark application in notebook](./apache-spark-development-using-notebooks.md).
272
-
-[Create Apache Spark job definition in Azure Studio](./apache-spark-job-definitions.md).
273
251
-[Collect Apache Spark applications logs and metrics with Azure Storage account](./azure-synapse-diagnostic-emitters-azure-storage.md).
274
252
-[Collect Apache Spark applications logs and metrics with Azure Event Hubs](./azure-synapse-diagnostic-emitters-azure-eventhub.md).
0 commit comments