Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
azure - metric filter - support for child resources #4743
The following is a proposal for how we can extend the current MetricFilter to make it easy to support child resources. It also includes an example of a metric filter for cosmosdb-databases. This can be tested with the following yaml policy:
policies: - name: cosmosdb-database-metric resource: azure.cosmosdb-database filters: - type: metric metric: TotalRequestUnits op: le aggregation: total threshold: 1000 timeframe: 24
The core of the proposed change is refactoring the portion of
Please comment and ask further questions. I have raw notes going over the different solutions to this problem that I am happy to share, but the proposed solution here seems to be the best. Once everyone has agreed on an implementation I will extend the methodology for other child resources, include tests and new example documentation.
I plan on adding the extended subclass to support cosmos db containers as well. Then tests for both and add the examples for both of them