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

Microsoft.Insights/scheduledQueryRules does not allow PT1M frequency #20341

Open
mdowst opened this issue Aug 23, 2022 · 2 comments
Open

Microsoft.Insights/scheduledQueryRules does not allow PT1M frequency #20341

mdowst opened this issue Aug 23, 2022 · 2 comments
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Monitor - Operational Insights question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@mdowst
Copy link

mdowst commented Aug 23, 2022

The API will not allow you to update an existing query rule with the evaluationFrequency set to 'PT1M'. When I run the payload below I receive the error "Couldn't optimize this query so the selected frequency was not supported. Try selecting a different frequency". If I leave off the evaluationFrequency it will still fail if the frequency is set to PT1M in the existing rule. This behavior is present in the 2021-02-01-preview and 2021-08-01 versions. I can create the with evaluationFrequency set to 'PT1M' through the portal and via ARM. It is only in the API where it fails.

{
  "properties": {
    "criteria": {
      "allOf": [
        {
          "query": "My query",
          "timeAggregation": "Count",
          "resourceIdColumn": "null",
          "operator": "GreaterThan",
          "threshold": 2,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          },
          "dimensions": [
            {
              "name": "Subject",
              "operator": "Include",
              "values": [
                "*"
              ]
            }
          ]
        }
      ]
    },
    "skipQueryValidation": true,
    "windowSize": "PT1M",
    "evaluationFrequency": "PT1M"
  }
}
@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Aug 23, 2022
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Aug 26, 2022
@navba-MSFT navba-MSFT added Monitor - Operational Insights Service Attention Workflow: This issue is responsible by Azure service team. and removed CXP Attention labels Dec 9, 2022
@joschi27
Copy link

Was this ever resolved? I have the same issue.

@greatvovan
Copy link

greatvovan commented Oct 3, 2024

I am seeing the same error whn trying to create a new alert in the Portal. Quite a misleading message, and the hint link leading to a wrong page, but after some search I found this:

There are some limitations to using an alert rule frequency of one minute. When you set the alert rule frequency to one minute, an internal manipulation is performed to optimize the query. This manipulation can cause the query to fail if it contains unsupported operations. The most common reasons why a query isn't supported are:

  • The query contains the search, union, or take (limit) operation.
  • The query contains the ingestion_time() function.
  • The query uses the adx pattern.
  • The query calls a function that calls other tables.

My case was using workspace() function, whuch probably falls under item #4.

To summarize, the problem is likely not with updating the rule, but with the query that is not compatible with 1 minute frequency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Monitor - Operational Insights question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

5 participants