Skip to content

Commit ea9adf1

Browse files
amee-sumosachin-sumologicjpipkin1
authored
Update Azure Database for PostgreSQL with Azure metrics source compatibility (#5408)
* Update azure-database-for-postgresql.md * added monitors for azure database for postgresql * Update docs/integrations/microsoft-azure/azure-database-for-postgresql.md Co-authored-by: John Pipkin (Sumo Logic) <[email protected]> * Update docs/integrations/microsoft-azure/azure-database-for-postgresql.md Co-authored-by: John Pipkin (Sumo Logic) <[email protected]> --------- Co-authored-by: Sachin Magar <[email protected]> Co-authored-by: Sachin Magar <[email protected]> Co-authored-by: John Pipkin (Sumo Logic) <[email protected]>
1 parent 93d53f2 commit ea9adf1

File tree

2 files changed

+31
-98
lines changed

2 files changed

+31
-98
lines changed

docs/integrations/microsoft-azure/azure-cache-for-redis.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ The **Azure Cache for Redis - Resource Performance(Non-Enterprise)** dashboard p
159159
<img src={useBaseUrl('https://sumologic-app-data-v2.s3.amazonaws.com/dashboards/AzureCacheForRedis/Azure-Cache-for-Redis-Resource-Performance-Non-Enterprise.png')} alt="Azure Cache for Redis - Resource Performance(Non-Enterprise)" style={{border: '1px solid gray'}} width="800" />
160160

161161

162-
### Azure Application Gateway alerts
163-
These alerts are metric based and will work for all Azure Application Gateways.
162+
### Azure Cache for Redis alerts
163+
These alerts are metric based and will work for all Azure Cache for Redis.
164164

165165
| Alert Name | Alert Description and Conditions | Alert Condition | Recover Condition |
166166
|:-------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------|:------------------|

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

Lines changed: 29 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -26,105 +26,15 @@ Azure service sends monitoring data to Azure Monitor, which can then [stream dat
2626

2727
* **PostgreSQL Audit logs**. Azure Database for PostgreSQL flexible server provides users with the ability to configure audit logs. Audit logs can be used to track database-level activity including connection, admin, DDL, and DML events. These types of logs are commonly used for compliance purposes. To learn more about the different log types and schemas collected for Azure Database for PostgreSQL, refer to the [Azure documentation](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-audit).
2828
* Logs collection from [Azure Monitor](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-monitoring#logs) using our [Azure Event Hubs source](/docs/send-data/collect-from-other-data-sources/azure-monitoring/ms-azure-event-hubs-source/).
29-
* Metrics collection using our [HTTP Logs and Metrics source](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-monitoring#metrics) via Azure Functions deployed using the ARM template.
29+
* Metrics collection using our [Azure Metrics Source](/docs/send-data/hosted-collectors/microsoft-source/azure-metrics-source).
3030

3131
You must explicitly enable diagnostic settings for each Azure Database for the PostgreSQL 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).
3232

3333
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/DatabaseForPostgreSQL/Logs`, `Azure/DatabaseForPostgreSQL/Metrics`.
3434

35-
36-
### Configure field in field schema
37-
38-
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**.
39-
2. Search for the following fields:
40-
- `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).
41-
- `location`. The region to which the resource name belongs.
42-
- `subscription_id`. ID associated with a subscription where the resource is present.
43-
- `resource_group`. The resource group name where the Azure resource is present.
44-
- `provider_name`. Azure resource provider name (for example, Microsoft.Network).
45-
- `resource_type`. Azure resource type (for example, storage accounts).
46-
- `resource_name`. The name of the resource (for example, storage account name).
47-
- `service_type`. Type of the service that can be accessed with an Azure resource.
48-
- `service_name`. Services that can be accessed with an Azure resource (for example, Azure SQL databases in Azure SQL Server).
49-
3. Create the fields if they are not present. Refer to [Manage fields](/docs/manage/fields/#manage-fields).
50-
51-
### Configure Field Extraction Rules
52-
53-
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/).
54-
55-
#### Azure location extraction FER
56-
57-
```sql
58-
Rule Name: AzureLocationExtractionFER
59-
Applied at: Ingest Time
60-
Scope (Specific Data): tenant_name=*
61-
```
62-
63-
```sql title="Parse Expression"
64-
json "location", "properties.resourceLocation", "properties.region" as location, resourceLocation, service_region nodrop
65-
| replace(toLowerCase(resourceLocation), " ", "") as resourceLocation
66-
| if (!isBlank(resourceLocation), resourceLocation, location) as location
67-
| if (!isBlank(service_region), service_region, location) as location
68-
| if (isBlank(location), "global", location) as location
69-
| fields location
70-
```
71-
72-
#### Resource ID extraction FER
73-
74-
```sql
75-
Rule Name: AzureResourceIdExtractionFER
76-
Applied at: Ingest Time
77-
Scope (Specific Data): tenant_name=*
78-
```
79-
80-
```sql title="Parse Expression"
81-
json "resourceId", "ResourceId" as resourceId1, resourceId2 nodrop
82-
| if (isBlank(resourceId1), resourceId2, resourceId1) as resourceId
83-
| toUpperCase(resourceId) as resourceId
84-
| parse regex field=resourceId "/SUBSCRIPTIONS/(?<subscription_id>[^/]+)" nodrop
85-
| parse field=resourceId "/RESOURCEGROUPS/*/" as resource_group nodrop
86-
| parse regex field=resourceId "/PROVIDERS/(?<provider_name>[^/]+)" nodrop
87-
| parse regex field=resourceId "/PROVIDERS/[^/]+(?:/LOCATIONS/[^/]+)?/(?<resource_type>[^/]+)/(?<resource_name>.+)" nodrop
88-
| parse regex field=resource_name "(?<parent_resource_name>[^/]+)(?:/PROVIDERS/[^/]+)?/(?<service_type>[^/]+)/?(?<service_name>.+)" nodrop
89-
| if (isBlank(parent_resource_name), resource_name, parent_resource_name) as resource_name
90-
| fields subscription_id, location, provider_name, resource_group, resource_type, resource_name, service_type, service_name
91-
```
92-
93-
### Configure metric rules
94-
95-
Create the following metrics rules by following the instructions in [Create a metrics rule](/docs/metrics/metric-rules-editor/#create-a-metrics-rule).
96-
97-
#### Azure observability metadata extraction flexible PostgreSQL server level
98-
99-
```sql
100-
Rule Name: AzureObservabilityMetadataExtractionAzureDatabaseForPostgreSQLLevel
101-
```
102-
103-
```sql title="Metric match expression"
104-
resourceId=/SUBSCRIPTIONS/*/RESOURCEGROUPS/*/PROVIDERS/MICROSOFT.DBFORPOSTGRESQL/FLEXIBLESERVERS/* tenant_name=*
105-
```
106-
107-
| Fields extracted | Metric rule |
108-
|:------------------|:-------------------------|
109-
| subscription_id | $resourceId._1 |
110-
| resource_group | $resourceId._2 |
111-
| provider_name | MICROSOFT.DBFORPOSTGRESQL|
112-
| resource_type | FLEXIBLESERVERS |
113-
| resource_name | $resourceId._3 |
114-
115-
11635
### Configure metrics collection
11736

118-
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.
119-
120-
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" />
121-
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).
122-
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).
123-
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 PostgreSQL Server resource that you want to monitor.
124-
1. Choose `Stream to an event hub` as the destination.
125-
1. Select `AllMetrics`.
126-
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-postgresqlserver-metrics.png')} alt="Azure flexible postgresql server metrics" style={{border: '1px solid gray'}} width="800" />
127-
1. Tag the location field in the source with the right location value. <br/><img src={useBaseUrl('img/integrations/microsoft-azure/Azure-Storage-Tag-Location.png')} alt="Azure Database for PostgreSql Tag Location" style={{border: '1px solid gray'}} width="400" />
37+
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).
12838

12939
### Configure logs collection
13040

@@ -159,15 +69,27 @@ Since this source contains logs from multiple regions, ensure that you do not ta
15969

16070
Now that you have set up data collection, install the Azure Database for PostgreSQL Sumo Logic app to use the pre-configured dashboards that provide visibility into your environment for real-time analysis of overall usage.
16171

162-
import AppInstallNoDataSourceV2 from '../../reuse/apps/app-install-index-apps-v2.md';
72+
import AppInstallIndexV2 from '../../reuse/apps/app-install-index-option.md';
16373

164-
<AppInstallNoDataSourceV2/>
74+
<AppInstallIndexV2/>
75+
76+
As part of the app installation process, the following fields will be created by default:
77+
78+
- `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).
79+
- `location`. The region the resource name belongs to.
80+
- `subscription_id`. ID associated with a subscription where the resource is present.
81+
- `resource_group`. The resource group name where the Azure resource is present.
82+
- `provider_name`. Azure resource provider name (for example, Microsoft.Network).
83+
- `resource_type`. Azure resource type (for example, storage accounts).
84+
- `resource_name`. The name of the resource (for example, storage account name).
85+
- `service_type`. Type of the service that can be accessed with an Azure resource.
86+
- `service_name`. Services that can be accessed with an Azure resource (for example, in Azure Container Instances the service is Subscriptions).
16587

16688
## Viewing the Flexible Database for PostgreSQL dashboards
16789

168-
import ViewDashboards from '../../reuse/apps/view-dashboards.md';
90+
import ViewDashboardsIndex from '../../reuse/apps/view-dashboards-index.md';
16991

170-
<ViewDashboards/>
92+
<ViewDashboardsIndex/>
17193

17294
### Disk
17395

@@ -250,6 +172,17 @@ The **Azure Database for PostgreSQL - Transactions** dashboard provides insights
250172

251173
<img src={useBaseUrl('https://sumologic-app-data-v2.s3.amazonaws.com/dashboards/AzureDatabaseForPostgresql/Azure-Database-for-PostgreSQL-Transactions.png')} alt="Azure Database for PostgreSql - Transactions" style={{border: '1px solid gray'}} width="800" />
252174

175+
### Azure Database for PostgreSQL alerts
176+
These alerts are metric based and will work for all Azure Database for PostgreSQL.
177+
178+
| Alert Name | Alert Description and Conditions | Alert Condition | Recover Condition |
179+
|:-----------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------|:------------------|
180+
| `Azure Database for PostgreSQL - Active Connections` | This alert is triggered when Average Active Connections Count is greater than 1000. | Count >= 1000 | Count < 1000 |
181+
| `Azure Database for PostgreSQL - CPU Percent` | This alert is triggered when CPU Percentage is greater than 90. Also a warning type alert will be triggered when CPU Percentage is greater than 80. | Percentage >= 90 | Percentage < 90 |
182+
| `Azure Database for PostgreSQL - Failed Connections` | This alert is triggered when Failed Connections Count is greater than 10. | Count >= 10 | Count < 10 |
183+
| `Azure Database for PostgreSQL - Memory Percent` | This alert is triggered when Memory Percentage is greater than 80. Also a warning type alert will be triggered when Memory Percentage greater than 70. | percentage >= 80 | percentage < 80 |
184+
| `Azure Database for PostgreSQL - Storage Percent` | This alert is triggered when Storage Percent greater than 95. Also a warning type alert will be triggered when Storage Percent greater than 90. | percentage >= 95 | percentage < 95 |
185+
253186
## Troubleshooting
254187

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

0 commit comments

Comments
 (0)