Hello Lorenzo Dalla Pozza,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
Regarding your explanation and question, I understand that you would like to monitor the WindowsAgent.SqlServer
extension in Azure Arc and also create a custom metric for communication status.
To achieve your goal, try to understand that from the message you shared, it looks like the extension is providing many key pieces of information such as Extension Health, Upload Status, Telemetry Upload Status, Automatic Backups, Purview Plugin, AAD Plugin Status and so forth. So, you will need to create a custom metric, that will extract and analyze data from Azure Monitor Logs (Log Analytics) and this will help to query the logs for the relevant status data provided by the extension.
Secondly, you can query Azure Monitor Logs by navigate to Log Analytics Workspace or run a Kusto Query Language (KQL) Query to filters logs for the specific extension and projects relevant fields.
- Log Analytics Workspace:
- Go to the Azure Portal.
- Navigate to your Log Analytics workspace where Azure Arc logs are collected.
- Kusto Query Language (KQL) Query
- You’ll need to write a KQL query to extract the data related to the
WindowsAgent.SqlServer
extension status as it shown below:
- You’ll need to write a KQL query to extract the data related to the
AzureDiagnostics
| where ResourceType == "MICROSOFT.HYBRIDCONNECTION/CONNECTIONS"
| where Category == "ExtensionLogs" // Adjust based on actual category
| where ExtensionName_s == "WindowsAgent.SqlServer"
| project TimeGenerated, ExtensionStatus_s, UploadStatus_s, TelemetryUploadStatus_s, AutomaticBackups_s
Now, if you want to create a custom metric based on the extension’s status here is a simple guide.
- In Azure Monitor, go to “Alerts.”
- Click on “+ New alert rule.”
- Choose the appropriate scope (your Log Analytics workspace).
- Under “Condition,” use the custom KQL query to define the condition for your metric.
- Set up the logic to trigger an alert based on the extracted data. For instance, you could set up an alert if the extension's
UploadStatus
is not "OK" for a certain period. - Define who should be notified and how (email, SMS, webhook, etc.) if the alert is triggered.
For more revie and steps you can use this best resource links: https://docs.microsoft.com/en-us/azure/azure-monitor and https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful ** so that others in the community facing similar issues can easily find the solution.
Best Regards,
Sina Salam