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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@condensetech/cdk-monitoring

v0.1.1

Published

AWS CDK constructs for alarm and notification monitoring: metric alarms via Aspects, severity-based audience routing, Discord + Microsoft Teams notification pipelines, and EventBridge rules for non-metric state changes.

Readme

@condensetech/cdk-monitoring

AWS CDK constructs for alarm-driven monitoring and notifications.

  • Metric alarms via CDK Aspects — automatically discovers Fargate services, ALBs, target groups, ElastiCache clusters, RDS clusters and instances in a stack and attaches alarms with sensible defaults.
  • Severity-based audience routingwarning alarms go to the dev SNS topic only; critical alarms go to both dev and management topics. One subscription per audience (e.g. Discord for dev, Microsoft Teams for management).
  • Discord + Microsoft Teams pipelines — ready-made NotificationStack with an inline Node.js Lambda that posts CloudWatch alarms and EventBridge events to Discord, plus an optional AWS Chatbot Microsoft Teams configuration.
  • EventBridge rules for state changes — helpers for ECS task failures, ECS deployment errors, and RDS cluster events published to the same SNS topics.

This library is intentionally alarm-only: no CloudWatch Dashboards are created. Operators read metrics from the AWS console on demand and act on alarms delivered to chat channels.

Installation

pnpm add @condensetech/cdk-monitoring

Peer dependencies: aws-cdk-lib ^2.240.0, constructs ^10.5.0.

Quick start

import { App, Stack } from 'aws-cdk-lib';
import {
  MonitoringFacade,
  NotificationStack,
  EventRulesStack,
} from '@condensetech/cdk-monitoring';

const app = new App();

// 1. Shared notification pipeline (one per environment).
const notifications = new NotificationStack(app, 'MyApp-Dev-Notifications', {
  namePrefix: 'myapp-dev',
  discordWebhookSecretName: 'myapp/monitoring/discord-webhook-dev',
  // teamsChannel: { teamId, tenantId, channelId } // optional
});

// 2. Attach MonitoringFacade to each application stack you want covered.
const appStack = new MyAppStack(app, 'MyApp-Dev-Core', { /* ... */ });

new MonitoringFacade(appStack, {
  environmentName: 'myapp-dev',
  devTopicArn: notifications.devTopic.topicArn,
  // managementTopicArn: notifications.managementTopic.topicArn,
});

// 3. Optional: EventBridge rules for non-metric state changes.
new EventRulesStack(app, 'MyApp-Dev-EventRules', {
  devTopic: notifications.devTopic,
  ecsCluster: appStack.cluster,
  rdsCluster: appStack.database,
});

MonitoringFacade

MonitoringFacade(scope, props) registers six CDK Aspects on the given stack. The aspects scan the stack at synth time and create alarms for any resource of a supported type they find:

| Aspect | Resource type | Alarms (default) | |---|---|---| | FargateServiceMonitoringAspect | ecs.FargateService | CPU (Average 90%), Memory (Maximum 90%) | | ApplicationLoadBalancerMonitoringAspect | elbv2.ApplicationLoadBalancer | RedirectUrlLimit, RejectedConnections, TargetConnectionErrors, Target5xx | | TargetGroupMonitoringAspect | elbv2.ApplicationTargetGroup | MinHealthyHosts (treat-missing BREACHING) | | CacheClusterMonitoringAspect | elasticache.CfnCacheCluster | CPU per node, Connections per node, Memory, EngineCPU | | RdsClusterMonitoringAspect | rds.DatabaseCluster | CPU, ReadLatency, EBS Balance (skipped on Aurora) | | RdsInstanceMonitoringAspect | rds.DatabaseInstance | CPU, ReadLatency, EBS Balance |

Per-resource overrides are available via configFargateService(), configRdsCluster(), etc.

Severity-based routing

Every alarm carries a severity of warning (default) or critical. The facade wires SNS actions accordingly:

  • warningdevTopic only
  • criticaldevTopic AND managementTopic (if provided)

Set minSeverity: 'critical' on the facade to skip the creation of warning-level alarms altogether (saves ~$0.10/month per skipped alarm).

Alarm naming

Set environmentName to prepend an env prefix to every alarm name and description, so Discord notifications immediately show which deployment fired the alarm:

ALARM: myapp-dev-FargateService-MemoryUtilizationAlarm-core-service
[myapp-dev] Memory Utilization high on core-service

NotificationStack

Creates:

  • Two SNS topics: <namePrefix>-dev-notifications and <namePrefix>-management-notifications
  • A Node.js Lambda (aws-lambda-nodejs) subscribed to the dev topic that formats CloudWatch alarm and EventBridge event messages as Discord embeds and POSTs to the webhook stored in Secrets Manager
  • An SQS dead-letter queue for the Lambda
  • An AWS Chatbot MicrosoftTeamsChannelConfiguration subscribed to the management topic (when teamsChannel is provided)
  • SSM parameters <ssmParameterPrefix>/dev-topic-arn and /management-topic-arn so other repos can look up the topic ARNs via StringParameter.valueForStringParameter without CloudFormation cross-stack imports

The Discord webhook Secrets Manager secret must be created separately (the stack references it by name). Value can be a plain URL or {"url": "..."} JSON.

EventRulesStack

Helpers and a ready-made stack for EventBridge rules that publish non-metric events to the same SNS pipeline:

  • addEcsTaskFailureRule(scope, id, { cluster, devTopic, ... }) — ECS task STOPPED with a stop code other than normal scheduler/user stops
  • addEcsDeploymentFailureRule(scope, id, { cluster, devTopic, ... }) — ECS deployment eventType=ERROR
  • addRdsClusterEventRule(scope, id, { cluster, devTopic, ... }) — RDS cluster failover, failure, maintenance events

License

MIT — see LICENSE.