I try to query the metric for DataProtection/BackupVault resource which has two metrics namely BackupHealthEvents
and ResourceHealthEvents
using the azure rest api(a sample is given below):
GET https://management.azure.com/subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.DataProtection/BackupVaults/{vaultName}/backupJobs/{jobName}/providers/Microsoft.Insights/metrics?api-version=2018-01-01
It returns an output, but the metric BackupHealthEvents
does not return any values even though I have created Backup jobs in the Backup vault
I had seen that not all resources might give metrics by default and we need to manually go and enable it, I saw the 'Diagnostic Setting' option and added it to DataProtection/BackupVault resource where there was an option to add the metric 'Health' for backup vaults as shown in this link. I added the destination as my LA workspace and i still do not understand why I don't get any values for the metric, it returns an empty list. I have probably checked most of the links if any additional configurations are required to get those metrics.
Here is the
KQL
query to checkRecovery Service Vault
metrics in `Log Analytics Workspace.Result:
To check the metric for the
Recovery Service Vault
inLog Analytics
, ensure that you select the 'Metric' option when enabling theDiagnostic Setting
, as shown below.Reference : Monitor the health of your backups using Azure Backup Metrics (preview)