npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@azbake/ingredient-metric-alert

v0.1.112

Published

Ingredient for deploying a metric alert

Readme

Changelogs

Overview

The Metric Alert ingredient is a plugin for Bake. When included in a recipe, this plugin will create a custom Alert Rule for an Azure resource.

Usage

Recipe

name: Event Hub Namespace for diagnostics with a custom metric alert
shortName: diagnostics
version: 0.0.1
ingredients:
  - "@azbake/ingredient-metric-alert@~0"
  - "@azbake/ingredient-event-hub-namespace@~0"
parallelRegions: true
#rgOverride:
resourceGroup: true
variables:
recipe:
  ehndiag-deploy: 
    properties:
      type: "@azbake/ingredient-event-hub-namespace"
      source: ""
      parameters:    
        eventHubNamespaceName: "[eventhubnamespace.get_resource_name()]"            
        skuName: Standard
        skuTier: Standard
        skuCapacity: "1"
        isAutoInflateEnabled: "true"
        maximumThroughputUnits: "10"  
  alert-deploy: 
    properties:
      type: "@azbake/ingredient-metric-alert"
      source: "[eventhubnamespace.get_resource_profile()]"
      parameters:
        alertName: "Event Hub Namespace Alert"
        alertDescription: "New alert created via Bake"
        alertSeverity: 3
        isEnabled: true
        source-type: "Microsoft.EventHub/namespaces"
        metricName: "ThrottledRequests"
        operator: "GreaterThan"
        threshold: "0"
        timeAggregation: "Maximum"
        windowSize: "PT5M"
        evaluationFrequency: "PT5M"
        actionGroupName: "[coreutils.create_resource_name('act','emailops', false)]"
        actionGroupResourceGroup: "[coreutils.create_resource_name('','actiongroups', true)]"
        #Uncomment below and comment above if using rgOverride 
        #actionGroupResourceGroup: "[coreutils.resource_group()]"
        #alertType: "Static"
        alertType: "Dynamic"
        #Dynamic alert params have defaults.  Uncomment and specify below to override defaults.
        # dynamicAlertParameters:
        #   alertSensitivity: "Low"
        #   failingPeriods:
        #     numberOfEvaluationPeriods: "4"
        #     minFailingPeriodsToAlert: "3"
    dependsOn:
      - ehndiag-deploy

| property|required|description| |---------|--------|-----------| | source | yes | Name of the target resource for the metric that the alert is monitoring. | | alertName | yes | Name of the Alert resource. | | alertSeverity | no (default 3) | The severity level of the alert. | | isEnabled | no (default true) | Specifies whether the alert is enabled.| | source-type | yes | The metric namespace of the alert. An example is Microsoft.KeyVault/vaults. | | metricName | yes | The name of the metric that the alert is monitoring. | | operator | yes | The comparison operator for the alert. | | threshold | yes | The threshold value to trigger the alert. | | timeAggregation | no (default Average) | The aggregation function used for comparing against the threshold. | windowSize | no (default PT5M) | Period of time used to monitor alert activity based on the threshold. Must be between five minutes and one day. ISO 8601 duration format. | | evaluationFrequency| no (default PT5M) | How often the metric alert is evaluated represented in ISO 8601 duration format.| | actionGroupName | yes | The name of the action group to trigger when the alert is fired.| | actionGroupResourceGroup | yes | The action group's resource group.| | alertType | yes | Static or Dynamic (AIOps) | | dynamicAlertProperties | no (default below) | Object for specifying dynamic alert properties. |

dynamicAlertProperties object

| property|required|description| |---------|--------|-----------| | alertSensitivity | no (default Low) | Low, Medium, and High sensitivities (in order of least to most noisy alerts.) | failingPeriods | no (default below) | Object for specifying dynamic alert failing periods properties. |

failingPeriods object - this advanced criteria defaults to fire the alert if 3 of of the last 4 evaluation periods failed

| property|required|description| |---------|--------|-----------| | numberOfEvaluationPeriods | no (default 4) | The total number of periods for evaluating against the failing periods. | | minFailingPeriodsToAlert | no (default 3)| The minimum number of failing periods to fire the alert. |

See Azure Monitor documentation for additional details

Platform metric alert rules - Using Resource Manager template

Azure Monitor REST API - Metric Alerts - Create or Update

Utilities

Utility classes can be used inside of the bake.yaml file for parameter and source values.

metricalert class

No functions at this time.