azure
azure copied to clipboard
Support for Metric Namespace on azure_rm_autoscale Module
SUMMARY
I was looking at using custom metric namespaces for VMSS scaling was hoping azure_rm_autoscale provided this support. Upon looking at the implementation for the module, it doesn't seem like there's support for the property metricNamespace as provided through the feature set on VMSSs.
ISSUE TYPE
- Feature Idea
COMPONENT NAME
azure_rm_autoscale
ADDITIONAL INFORMATION
We're sending custom metrics to VMSS Azure Metrics via Telegraf and are attempting to attach scaling policies to VMSS based on these custom metrics through Ansible.
Usage would be an additional parameter of metric_namespace in the below statement example
- name: Attach scaling policies
azure.azcollection.azure_rm_autoscale:
target: "{{ vmss_resource_uri }}"
resource_group: "{{ resource_group }}"
name: "{{ vmss_name }}"
profiles:
- name: Scale based on Custom Telegraf Metric
count: 1
min_count: 1
max_count: 5
rules:
- metric_name: gauges_some_custom_metric
metric_namespace: telegraf/http
metric_resource_uri: "{{ vmss_resource_uri }}"
direction: Increase
cooldown: 5
operator: GreaterThan
statistic: Average
threshold: 5
time_grain: 1
time_window: 5
type: ChangeCount
value: 1
As a workaround, I imagine I can probably end up using azure_rm_resource to hit the API directly and update this property. Thanks in advance