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

Change in the metrics request url and updated API version. #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions check_azure_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,11 @@ def _is_dimension_required(self):
def _get_metric_value(self):
"""Get latest metric value available for the Azure resource object."""

query = {'metric': self['metric']}
query = {'metricnames': self['metric']}
if self['dimension'] is not None:
query['$filter'] = "{} eq '{}'".format(self['dimension'], self['dimension-value'])

path = '{}/providers/Microsoft.Insights/metrics/{}'.format(self['resource'],
self['metric'])
path = '{}/providers/Microsoft.Insights/metrics/'.format(self['resource'])

try:
metric_values = _call_arm_rest_api(self._client, path,
Expand Down