mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Merge pull request #4969 from prometheus/azuresubid
Add Azure tenant and subscription ID labels
This commit is contained in:
commit
ca93c8e19b
|
@ -37,6 +37,8 @@ import (
|
||||||
|
|
||||||
const (
|
const (
|
||||||
azureLabel = model.MetaLabelPrefix + "azure_"
|
azureLabel = model.MetaLabelPrefix + "azure_"
|
||||||
|
azureLabelSubscriptionID = azureLabel + "subscription_id"
|
||||||
|
azureLabelTenantID = azureLabel + "tenant_id"
|
||||||
azureLabelMachineID = azureLabel + "machine_id"
|
azureLabelMachineID = azureLabel + "machine_id"
|
||||||
azureLabelMachineResourceGroup = azureLabel + "machine_resource_group"
|
azureLabelMachineResourceGroup = azureLabel + "machine_resource_group"
|
||||||
azureLabelMachineName = azureLabel + "machine_name"
|
azureLabelMachineName = azureLabel + "machine_name"
|
||||||
|
@ -332,6 +334,8 @@ func (d *Discovery) refresh() (tg *targetgroup.Group, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
labels := model.LabelSet{
|
labels := model.LabelSet{
|
||||||
|
azureLabelSubscriptionID: model.LabelValue(d.cfg.SubscriptionID),
|
||||||
|
azureLabelTenantID: model.LabelValue(d.cfg.TenantID),
|
||||||
azureLabelMachineID: model.LabelValue(vm.ID),
|
azureLabelMachineID: model.LabelValue(vm.ID),
|
||||||
azureLabelMachineName: model.LabelValue(vm.Name),
|
azureLabelMachineName: model.LabelValue(vm.Name),
|
||||||
azureLabelMachineOSType: model.LabelValue(vm.OsType),
|
azureLabelMachineOSType: model.LabelValue(vm.OsType),
|
||||||
|
|
|
@ -267,6 +267,8 @@ The following meta labels are available on targets during relabeling:
|
||||||
* `__meta_azure_machine_resource_group`: the machine's resource group
|
* `__meta_azure_machine_resource_group`: the machine's resource group
|
||||||
* `__meta_azure_machine_tag_<tagname>`: each tag value of the machine
|
* `__meta_azure_machine_tag_<tagname>`: each tag value of the machine
|
||||||
* `__meta_azure_machine_scale_set`: the name of the scale set which the vm is part of (this value is only set if you are using a [scale set](https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/))
|
* `__meta_azure_machine_scale_set`: the name of the scale set which the vm is part of (this value is only set if you are using a [scale set](https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/))
|
||||||
|
* `__meta_azure_subscription_id`: the subscription ID
|
||||||
|
* `__meta_azure_tenant_id`: the tenant ID
|
||||||
|
|
||||||
See below for the configuration options for Azure discovery:
|
See below for the configuration options for Azure discovery:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue