Skip to content

Commit 0607dc0

Browse files
amee-sumosumoanemajpipkin1
authored
Update Azure database for mysql with Azure metrics source compatibility (#5386)
* Update azure-database-for-mysql.md * Listing the newly added monitors in the Azure Database for MySQL doc * Update docs/integrations/microsoft-azure/azure-database-for-mysql.md Co-authored-by: John Pipkin (Sumo Logic) <[email protected]> * Update docs/integrations/microsoft-azure/azure-database-for-mysql.md Co-authored-by: John Pipkin (Sumo Logic) <[email protected]> * Note added for collecting error logs for azure mysql * Apply suggestions from code review Co-authored-by: John Pipkin (Sumo Logic) <[email protected]> --------- Co-authored-by: sumoanema <[email protected]> Co-authored-by: John Pipkin (Sumo Logic) <[email protected]> Co-authored-by: Alekh Nema <[email protected]>
1 parent 816b9c1 commit 0607dc0

File tree

1 file changed

+39
-93
lines changed

1 file changed

+39
-93
lines changed

docs/integrations/microsoft-azure/azure-database-for-mysql.md

Lines changed: 39 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ For Azure Database for MySQL, you can collect the following logs and metrics:
2020
* **MySQL Slow Query Logs**. In the Azure Database for MySQL flexible server, the slow query log is available to users to configure and access. Slow query logs are disabled by default and can be enabled to assist with identifying performance bottlenecks during troubleshooting. To learn more about the different log types and schemas collected for Azure Database for MySQL, refer to the [Azure documentation](https://learn.microsoft.com/en-gb/azure/mysql/flexible-server/concepts-slow-query-logs#access-slow-query-logs).
2121
* **MySQL Error Logs**. In the Azure Database for MySQL flexible server, the error log is available to users to configure and access. Error logs in MySQL gather diagnostic messages during server startup and shutdown and while the server is running, to provide information that can help proactive troubleshooting. For more information about the MySQL error log, see the [Error Log Documentation](https://learn.microsoft.com/en-us/azure/mysql/flexible-server/concepts-error-logs).
2222
:::note
23-
MySQL Error Logs are currently in a preview phase and are only available under Server Logs. These logs cannot be emitted to Azure diagnostic logs directly. To access the error logs, navigate to **Server Logs > Error Logs**, download them, and then [upload the logs](/docs/send-data/hosted-collectors/http-source/logs-metrics/upload-logs) to a Sumo Logic HTTP source endpoint.
23+
MySQL Error Logs are currently in a preview phase and are only available under Server Logs. These logs cannot be emitted to Azure diagnostic logs directly. To access the error logs, navigate to **Server Logs > Error Logs**, download them.
2424
:::
2525
* **Platform Metrics for Azure Database for MySQL**. These metrics are available in the [Microsoft.DBforMySQL/flexibleServers](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/supported-metrics/microsoft-dbformysql-flexibleservers-metrics) namespace. For more information on supported metrics and dimensions, refer to the [Azure documentation](https://learn.microsoft.com/en-us/azure/mysql/flexible-server/concepts-monitoring#list-of-metrics).
2626

@@ -30,105 +30,15 @@ Azure service sends monitoring data to Azure Monitor, which can then [stream dat
3030

3131
* Logs collection from [Azure Monitor](https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-get-started) using our [Azure Event Hubs source](/docs/send-data/collect-from-other-data-sources/azure-monitoring/ms-azure-event-hubs-source/).
3232
* Activity Logs collection from [Azure Monitor](https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-get-started) using our [Azure Event Hubs source](/docs/send-data/collect-from-other-data-sources/azure-monitoring/ms-azure-event-hubs-source/). It is recommended to create a separate source for activity logs. If you are already collecting these logs, you can skip this step.
33-
* Metrics collection using our [HTTP Logs and Metrics source](/docs/send-data/collect-from-other-data-sources/azure-monitoring/collect-metrics-azure-monitor/) via Azure Functions deployed using the ARM template.
33+
* Metrics collection using our [Azure Metrics Source](/docs/send-data/hosted-collectors/microsoft-source/azure-metrics-source).
3434

3535
You must explicitly enable diagnostic settings for each Azure Database for MySQL server you want to monitor. You can forward logs to the same event hub provided they satisfy the limitations and permissions as described [here](https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=portal#destination-limitations).
3636

3737
When you configure the event hubs source or HTTP source, plan your source category to ease the querying process. A hierarchical approach allows you to make use of wildcards. For example: `Azure/DatabaseForMySQL/Logs`, `Azure/DatabaseForMySQL/Metrics`.
3838

39-
### Configure field in field schema
40-
41-
1. [**Classic UI**](/docs/get-started/sumo-logic-ui-classic). In the main Sumo Logic menu, select **Manage Data > Logs > Fields**. <br/>[**New UI**](/docs/get-started/sumo-logic-ui). In the top menu select **Configuration**, and then under **Logs** select **Fields**. You can also click the **Go To...** menu at the top of the screen and select **Fields**.
42-
2. Search for the following fields:
43-
- `tenant_name`. This field is tagged at the collector level. You can get the tenant name using the instructions in the [Microsoft Documentation](https://learn.microsoft.com/en-us/azure/active-directory-b2c/tenant-management-read-tenant-name#get-your-tenant-name).
44-
- `location`. The region to which the resource name belongs to.
45-
- `subscription_id`. ID associated with a subscription where the resource is present.
46-
- `resource_group`. The resource group name where the Azure resource is present.
47-
- `provider_name`. Azure resource provider name (for example, Microsoft.Network).
48-
- `resource_type`. Azure resource type (for example, storage accounts).
49-
- `resource_name`. The name of the resource (for example, storage account name).
50-
- `service_type`. Type of the service that can be accessed with a Azure resource.
51-
- `service_name`. Services that can be accessed with an Azure resource (for example, Azure SQL databases in Azure SQL Server).
52-
3. Create the fields if they are not present. Refer to [Manage fields](/docs/manage/fields/#manage-fields).
53-
54-
### Configure Field Extraction Rules
55-
56-
Create the following Field Extraction Rules (FER) for Azure Storage by following the instructions in the [Create a Field Extraction Rule](/docs/manage/field-extractions/create-field-extraction-rule/).
57-
58-
#### Azure location extraction FER
59-
60-
```sql
61-
Rule Name: AzureLocationExtractionFER
62-
Applied at: Ingest Time
63-
Scope (Specific Data): tenant_name=*
64-
```
65-
66-
```sql title="Parse Expression"
67-
json "location", "properties.resourceLocation", "properties.region" as location, resourceLocation, service_region nodrop
68-
| replace(toLowerCase(resourceLocation), " ", "") as resourceLocation
69-
| if (!isBlank(resourceLocation), resourceLocation, location) as location
70-
| if (!isBlank(service_region), service_region, location) as location
71-
| if (isBlank(location), "global", location) as location
72-
| fields location
73-
```
74-
75-
#### Resource ID extraction FER
76-
77-
```sql
78-
Rule Name: AzureResourceIdExtractionFER
79-
Applied at: Ingest Time
80-
Scope (Specific Data): tenant_name=*
81-
```
82-
83-
```sql title="Parse Expression"
84-
json "resourceId", "ResourceId" as resourceId1, resourceId2 nodrop
85-
| if (isBlank(resourceId1), resourceId2, resourceId1) as resourceId
86-
| toUpperCase(resourceId) as resourceId
87-
| parse regex field=resourceId "/SUBSCRIPTIONS/(?<subscription_id>[^/]+)" nodrop
88-
| parse field=resourceId "/RESOURCEGROUPS/*/" as resource_group nodrop
89-
| parse regex field=resourceId "/PROVIDERS/(?<provider_name>[^/]+)" nodrop
90-
| parse regex field=resourceId "/PROVIDERS/[^/]+(?:/LOCATIONS/[^/]+)?/(?<resource_type>[^/]+)/(?<resource_name>.+)" nodrop
91-
| parse regex field=resource_name "(?<parent_resource_name>[^/]+)(?:/PROVIDERS/[^/]+)?/(?<service_type>[^/]+)/?(?<service_name>.+)" nodrop
92-
| if (isBlank(parent_resource_name), resource_name, parent_resource_name) as resource_name
93-
| fields subscription_id, location, provider_name, resource_group, resource_type, resource_name, service_type, service_name
94-
```
95-
96-
### Configure metric rules
97-
98-
Create the following metrics rules by following the instructions in [Create a metrics rule](/docs/metrics/metric-rules-editor/#create-a-metrics-rule).
99-
100-
#### Azure observability metadata extraction flexible mysql server level
101-
102-
```sql
103-
Rule Name: AzureObservabilityMetadataExtractionFlexibleMySQLServerLevel
104-
```
105-
106-
```sql title="Metric match expression"
107-
resourceId=/SUBSCRIPTIONS/*/RESOURCEGROUPS/*/PROVIDERS/*/FLEXIBLESERVERS/* tenant_name=*
108-
```
109-
110-
| Fields extracted | Metric rule |
111-
|:------------------|:---------------------|
112-
| subscription_id | $resourceId._1 |
113-
| resource_group | $resourceId._2 |
114-
| provider_name | MICROSOFT.DBFORMYSQL |
115-
| resource_type | FLEXIBLESERVERS |
116-
| resource_name | $resourceId._3 |
117-
118-
11939
### Configure metrics collection
12040

121-
In this section, you will configure a pipeline for shipping metrics from Azure Monitor to an Event Hub, onto an Azure Function, and finally to an HTTP Source on a hosted collector in Sumo Logic.
122-
123-
1. Create a hosted collector and tag the `tenant_name` field. <br/><img src={useBaseUrl('img/integrations/microsoft-azure/Azure-Storage-Tag-Tenant-Name.png')} alt="Azure Tag Tenant Name" style={{border: '1px solid gray'}} width="500" />
124-
2. [Configure an HTTP Source](/docs/send-data/collect-from-other-data-sources/azure-monitoring/collect-metrics-azure-monitor/#step-1-configure-an-http-source).
125-
1. [Configure and deploy the ARM Template](/docs/send-data/collect-from-other-data-sources/azure-monitoring/collect-metrics-azure-monitor/#step-2-configure-azure-resources-using-arm-template).
126-
1. [Export metrics to Event Hub](/docs/send-data/collect-from-other-data-sources/azure-monitoring/collect-metrics-azure-monitor/#step-3-export-metrics-for-a-particular-resource-to-event-hub). Perform the steps below for each Flexible Mysql Server resource that you want to monitor.
127-
1. Choose `Stream to an event hub` as the destination.
128-
1. Select `AllMetrics`.
129-
1. Use the Event hub namespace created by the ARM template in Step 2 above. You can create a new Event hub or use the one created by the ARM template. You can use the default policy `RootManageSharedAccessKey` as the policy name. <br/><img src={useBaseUrl('img/send-data/azureflexible-mysqlserver-metrics.png')} alt="Azure flexible mysql server metrics" style={{border: '1px solid gray'}} width="800" />
130-
4. Tag the location field in the source with the right location value.
131-
<img src={useBaseUrl('img/integrations/microsoft-azure/Azure-Storage-Tag-Location.png')} alt="Azure Database for MySql Tag Location" style={{border: '1px solid gray'}} width="500" />
41+
To set up the Azure Metrics source in Sumo Logic, refer to [Azure Metrics Source](/docs/send-data/hosted-collectors/microsoft-source/azure-metrics-source).
13242

13343
### Configure logs collection
13444

@@ -165,6 +75,19 @@ To collect activity logs, follow the instructions [here](/docs/integrations/micr
16575
Since this source contains logs from multiple regions, ensure that you do not tag this source with the location tag.
16676
:::
16777

78+
### Collecting Error Logs
79+
Error logs cannot be emitted to Azure diagnostic logs directly. To access the error logs, navigate to **Server Logs > Error Logs**, download them, then [upload the logs](/docs/send-data/hosted-collectors/http-source/logs-metrics/upload-logs) to a Sumo Logic HTTP source endpoint. Note that the HTTP source created to receive the error logs needs to be tagged with the following [fields](/docs/manage/fields/#manage-fields) with appropriate values. These values can be copied from the appropriate resource for which logs are ingested through the Azure Event Hub Source for Logs:
80+
81+
- resource_name
82+
- location
83+
- resource_type
84+
- provider_name
85+
- resource_group
86+
- tenant_name
87+
- subscription_id
88+
89+
Error logs dashboard will get populated only if the error logs are collected following the above instructions.
90+
16891
## Installing the Azure Flexible Database for Mysql app
16992

17093
Now that you have set up data collection, install the Azure Load Balancer Sumo Logic app to use the pre-configured dashboards that provide visibility into your environment for real-time analysis of overall usage.
@@ -173,6 +96,18 @@ import AppInstallNoDataSourceV2 from '../../reuse/apps/app-install-index-apps-v2
17396

17497
<AppInstallNoDataSourceV2/>
17598

99+
As part of the app installation process, the following fields will be created by default:
100+
101+
- `tenant_name`. This field is tagged at the collector level. You can get the tenant name using the instructions [here](https://learn.microsoft.com/en-us/azure/active-directory-b2c/tenant-management-read-tenant-name#get-your-tenant-name).
102+
- `location`. The region the resource name belongs to.
103+
- `subscription_id`. ID associated with a subscription where the resource is present.
104+
- `resource_group`. The resource group name where the Azure resource is present.
105+
- `provider_name`. Azure resource provider name (for example, Microsoft.Network).
106+
- `resource_type`. Azure resource type (for example, storage accounts).
107+
- `resource_name`. The name of the resource (for example, storage account name).
108+
- `service_type`. Type of the service that can be accessed with an Azure resource.
109+
- `service_name`. Services that can be accessed with an Azure resource (for example, in Azure Container Instances the service is Subscriptions).
110+
176111
## Viewing the Flexible Database for Mysql dashboards
177112

178113
import ViewDashboards from '../../reuse/apps/view-dashboards.md';
@@ -242,6 +177,17 @@ The **Azure Database for Mysql - Storage Overview** dashboard provides details a
242177
<img src={useBaseUrl('https://sumologic-app-data-v2.s3.amazonaws.com/dashboards/AzureDatabaseForMysql/Azure-Database-for-MySQL-Storage-Overview.png')} alt="Azure Database for Mysql - Storage Overview" style={{border: '1px solid gray'}} width="800" />
243178

244179

180+
## Azure Database for MySQL alerts
181+
These alerts are metric based and will work for all Azure Database for MySQL.
182+
183+
| Alert Name | Alert Description and Conditions | Alert Condition | Recover Condition |
184+
|:--|:--|:--|:--|
185+
| `Azure Database for MySQL - Active Connections` | This alert fires when number of active connections in Azure MySQL instance is greater than a threshold value (default value 50). | connections >= 50 | connections < 50 |
186+
| `Azure Database for MySQL - High CPU Utilization` | This alert fires when CPU usage % on a host in a Azure MySQL instance is greater than a threshold value (default value 90) | percentage >= 90 | percentage < 90 |
187+
| `Azure Database for MySQL - High Memory Utilization` | This alert fires when memory % on a resource in a Azure MySQL instance is greater than a threshold value (default value 90%) | percentage >= 90 | percentage < 90 |
188+
| `Azure Database for MySQL - High Storage IO %` | This alert fires when storage IO % on a resource in a Azure MySQL instance is greater than a threshold value (default value 80%) | percentage >= 80 | percentage < 80 |
189+
| `Azure Database for MySQL - High Storage Utilization` | This alert fires when storage % on a resource in a Azure MySQL instance is greater than a threshold value (default value 90%) | percentage >= 90 | percentage < 90 |
190+
245191
## Troubleshooting
246192

247193
### HTTP Logs and Metrics Source used by Azure Functions

0 commit comments

Comments
 (0)