Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Provide scraper for Azure Monitor Autoscale #1624

Merged
merged 3 commits into from
May 6, 2021

Conversation

tomkerkhove
Copy link
Owner

@tomkerkhove tomkerkhove commented May 6, 2021

Signed-off-by: Tom Kerkhove [email protected]

When implementing a new scraper; these tasks are completed:

  • Implement configuration
  • Implement validation
  • Implement scraping
  • Implement resource discovery
  • Provide unit tests
  • Test end-to-end
  • Document scraper
  • Add entry to changelog

Metrics output:

# HELP promitor_demo_appplan_autoscale_actions_scale Average amount of current instances for an Azure App Plan with Azure Monitor Autoscale
# TYPE promitor_demo_appplan_autoscale_actions_scale gauge
promitor_demo_appplan_autoscale_actions_scale{resource_group="demo",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",resource_uri="subscriptions/0f9d7fea-99e8-4768-8672-06a28514f77e/resourceGroups/demo/providers/Microsoft.Insights/autoscalesettings/app-service-autoscaling-rules",instance_name="app-service-autoscaling-rules",scaledirection="Increase",app="promitor",geo="china",environment="dev"} 0 1620294180665
# HELP promitor_demo_appplan_autoscale_instances_current Average amount of current instances for an Azure App Plan with Azure Monitor Autoscale
# TYPE promitor_demo_appplan_autoscale_instances_current gauge
promitor_demo_appplan_autoscale_instances_current{resource_group="demo",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",resource_uri="subscriptions/0f9d7fea-99e8-4768-8672-06a28514f77e/resourceGroups/demo/providers/Microsoft.Insights/autoscalesettings/app-service-autoscaling-rules",instance_name="app-service-autoscaling-rules",app="promitor",geo="china",environment="dev"} 2 1620294180987
# HELP promitor_demo_appplan_autoscale_observed_capacity Average amount of current instances for an Azure App Plan with Azure Monitor Autoscale
# TYPE promitor_demo_appplan_autoscale_observed_capacity gauge
promitor_demo_appplan_autoscale_observed_capacity{resource_group="demo",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",resource_uri="subscriptions/0f9d7fea-99e8-4768-8672-06a28514f77e/resourceGroups/demo/providers/Microsoft.Insights/autoscalesettings/app-service-autoscaling-rules",instance_name="app-service-autoscaling-rules",metrictriggerrule="Auto created scale condition:microsoft.web/serverfarms:Average:CpuPercentage:PT10M:Increase",app="promitor",geo="china",environment="dev"} -1 1620294180806
promitor_demo_appplan_autoscale_observed_capacity{resource_group="demo",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",resource_uri="subscriptions/0f9d7fea-99e8-4768-8672-06a28514f77e/resourceGroups/demo/providers/Microsoft.Insights/autoscalesettings/app-service-autoscaling-rules",instance_name="app-service-autoscaling-rules",metrictriggerrule="unknown",app="promitor",geo="china",environment="dev"} -1 1620293739695
# HELP promitor_demo_appplan_autoscale_observed_metric Average amount of current instances for an Azure App Plan with Azure Monitor Autoscale
# TYPE promitor_demo_appplan_autoscale_observed_metric gauge
promitor_demo_appplan_autoscale_observed_metric{resource_group="demo",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",resource_uri="subscriptions/0f9d7fea-99e8-4768-8672-06a28514f77e/resourceGroups/demo/providers/Microsoft.Insights/autoscalesettings/app-service-autoscaling-rules",instance_name="app-service-autoscaling-rules",metrictriggersource="unknown",app="promitor",geo="china",environment="dev"} -1 1620293739695
promitor_demo_appplan_autoscale_observed_metric{resource_group="demo",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",resource_uri="subscriptions/0f9d7fea-99e8-4768-8672-06a28514f77e/resourceGroups/demo/providers/Microsoft.Insights/autoscalesettings/app-service-autoscaling-rules",instance_name="app-service-autoscaling-rules",metrictriggersource="Auto created scale condition:microsoft.web/serverfarms:Average:CpuPercentage:PT10M",app="promitor",geo="china",environment="dev"} -1 1620294180887
# HELP promitor_demo_appplan_autoscale_instances_current_discovered Average amount of current instances for an Azure App Plan with Azure Monitor Autoscale
# TYPE promitor_demo_appplan_autoscale_instances_current_discovered gauge
promitor_demo_appplan_autoscale_instances_current_discovered{resource_group="demo",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",resource_uri="subscriptions/0f9d7fea-99e8-4768-8672-06a28514f77e/resourceGroups/demo/providers/Microsoft.Insights/autoscalesettings/app-service-autoscaling-rules",instance_name="app-service-autoscaling-rules",app="promitor",geo="china",environment="dev"} 2 1620299642051
promitor_demo_appplan_autoscale_instances_current_discovered{resource_group="promitor-sources",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",resource_uri="subscriptions/0f9d7fea-99e8-4768-8672-06a28514f77e/resourceGroups/promitor-sources/providers/Microsoft.Insights/autoscalesettings/autoscale-promitor-app-plan",instance_name="autoscale-promitor-app-plan",app="promitor",geo="china",environment="dev"} -1 1620299642382

Discovery output:

[
  {
    "$type": "Promitor.Core.Contracts.ResourceTypes.MonitorAutoscaleResourceDefinition, Promitor.Core.Contracts",
    "AutoscaleSettingsName": "app-service-autoscaling-rules",
    "ResourceType": "MonitorAutoscale",
    "SubscriptionId": "0f9d7fea-99e8-4768-8672-06a28514f77e",
    "ResourceGroupName": "demo",
    "ResourceName": "app-service-autoscaling-rules",
    "UniqueName": "app-service-autoscaling-rules"
  },
  {
    "$type": "Promitor.Core.Contracts.ResourceTypes.MonitorAutoscaleResourceDefinition, Promitor.Core.Contracts",
    "AutoscaleSettingsName": "autoscale-promitor-app-plan",
    "ResourceType": "MonitorAutoscale",
    "SubscriptionId": "0f9d7fea-99e8-4768-8672-06a28514f77e",
    "ResourceGroupName": "promitor-sources",
    "ResourceName": "autoscale-promitor-app-plan",
    "UniqueName": "autoscale-promitor-app-plan"
  }
]
R

Fixes #1593

Signed-off-by: Tom Kerkhove <[email protected]>
Signed-off-by: Tom Kerkhove <[email protected]>
Signed-off-by: Tom Kerkhove <[email protected]>
@tomkerkhove tomkerkhove merged commit fd9807c into master May 6, 2021
@tomkerkhove tomkerkhove deleted the azure-monitor-autoscale branch May 6, 2021 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide scraper for Azure Monitor Autoscale
1 participant