New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@baselime/cdk

Package Overview
Dependencies
Maintainers
2
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@baselime/cdk

Define your observability as code using the AWS CDK

latest
Source
npmnpm
Version
0.0.46
Version published
Maintainers
2
Created
Source

Baselime CDK

Documentation Latest Release License

Baselime CDK offers the most effective approach to adding observability to a serverless CDK application.

baselime.Config.init(stack, {
  apiKey: 'xxxxxx',
});

new Alert("service-errors", {
  parameters: {
    query: {
      filters: [
        filter.inArray("LogLevel", ["ERROR", "WARN"]),
      ],
    },
    channels: [{ type: "slack", targets: ["baselime-alerts"] }]
  },
});

Installation

npm i @baselime/cdk

Usage

Get your baselime api key from the Baselime console or using the Baselime CLI with the command baselime iam.

// Initialize Config, you must do this in a construct before adding querys, alerts and dashboards.
baselime.Config.init(stack, {
  apiKey: 'xxxxxx',
});

// Create Query
const query = new baselime.Query("ColdStarts", {
  description: "optional",
  parameters: {
    datasets: [
      "lambda-logs",
    ],
    calculations: [
      max("@initDuration"),
      p90("@initDuration"),
      min("@initDuration"),
    ],
    filters: [
      eq("@type", "REPORT"),
    ],
  }
});

// Add an alert
query.addAlert({
  enabled: true,
  parameters: {
    frequency: '30mins',
    threshold: gt(500),
    window: '1 hour',
  },
  channels: [{ targets: ['baselime-alerts'], type: 'slack' }],
});

// Create Dashboard
new baselime.Dashboard('ServiceHealth', {
  parameters: {
    widgets: [{ query, type: WidgetType.TIMESERIES}],
  },
});

License

© Baselime Limited, 2023

Distributed under MIT License (The MIT License).

See LICENSE for more information.

Keywords

AWS

FAQs

Package last updated on 30 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts