diff --git a/discovery/azure/azure.go b/discovery/azure/azure.go index 78fc6714db..2edaa2d9e4 100644 --- a/discovery/azure/azure.go +++ b/discovery/azure/azure.go @@ -40,6 +40,7 @@ const ( azureLabelMachineID = azureLabel + "machine_id" azureLabelMachineResourceGroup = azureLabel + "machine_resource_group" azureLabelMachineName = azureLabel + "machine_name" + azureLabelMachineOSType = azureLabel + "machine_os_type" azureLabelMachineLocation = azureLabel + "machine_location" azureLabelMachinePrivateIP = azureLabel + "machine_private_ip" azureLabelMachineTag = azureLabel + "machine_tag_" @@ -247,6 +248,7 @@ func (d *Discovery) refresh() (tg *targetgroup.Group, err error) { labels := model.LabelSet{ azureLabelMachineID: model.LabelValue(*vm.ID), azureLabelMachineName: model.LabelValue(*vm.Name), + azureLabelMachineOSType: model.LabelValue(vm.Properties.StorageProfile.OsDisk.OsType), azureLabelMachineLocation: model.LabelValue(*vm.Location), azureLabelMachineResourceGroup: model.LabelValue(r.ResourceGroup), } diff --git a/docs/configuration/configuration.md b/docs/configuration/configuration.md index a280b52710..809287f4a5 100644 --- a/docs/configuration/configuration.md +++ b/docs/configuration/configuration.md @@ -260,6 +260,7 @@ The following meta labels are available on targets during relabeling: * `__meta_azure_machine_id`: the machine ID * `__meta_azure_machine_location`: the location the machine runs in * `__meta_azure_machine_name`: the machine name +* `__meta_azure_machine_os_type`: the machine operating system * `__meta_azure_machine_private_ip`: the machine's private IP * `__meta_azure_machine_resource_group`: the machine's resource group * `__meta_azure_machine_tag_`: each tag value of the machine