Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

datadog-generic-monitors

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datadog-generic-monitors - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

8

CHANGELOG.md
# Changelog
## [0.0.2] - 2019-04-16
## [0.0.4] - 2019-04-18
### Added
- More sophisticated way to add alert recipients.
## [0.0.3] - 2019-04-16
### Fixed

@@ -6,0 +12,0 @@

23

dist/index.d.ts

@@ -7,4 +7,4 @@ // Generated by dts-bundle v0.7.3

getAllMonitors(): Promise<IMonitorResponse[]>;
createMonitor(config: IMonitorConfig): Promise<IMonitorResponse>;
createMonitors(configs: IMonitorConfig[]): Promise<IMonitorResponse[]>;
createMonitor(config: IMonitorConfigAndAlertRecipients): Promise<IMonitorResponse>;
createMonitors(configs: IMonitorConfigAndAlertRecipients[]): Promise<IMonitorResponse[]>;
deleteMonitorById(monitorId: number): Promise<IDeleteMonitorResponse>;

@@ -24,9 +24,5 @@ deleteAllMonitors(): Promise<IDeleteMonitorResponse[]>;

export interface IMonitorConfig {
type: MonitorType;
query: string;
name: string;
message: string;
options?: IMonitorOptions;
tags?: string[];
export interface IMonitorConfigAndAlertRecipients {
monitorConfig: IMonitorConfig;
alertRecipients?: string[];
}

@@ -54,2 +50,11 @@

export interface IMonitorConfig {
type: MonitorType;
query: string;
name: string;
message: string;
options?: IMonitorOptions;
tags?: string[];
}
export declare enum MonitorType {

@@ -56,0 +61,0 @@ Anomaly = "query alert",

@@ -156,3 +156,3 @@ import request from 'request';

DatadogGenericMonitors.prototype.createMonitor = function (config) {
var body = JSON.stringify(config);
var body = JSON.stringify(this.addAlertRecipientsToMonitorConfig(config));
return this.rest.post(this.url, body);

@@ -183,2 +183,13 @@ };

};
DatadogGenericMonitors.prototype.addAlertRecipientsToMonitorConfig = function (_a) {
var monitorConfig = _a.monitorConfig, alertRecipients = _a.alertRecipients;
var monitorConfigWithAlertRecipients = __assign({}, monitorConfig);
if (alertRecipients && alertRecipients.length > 0) {
monitorConfigWithAlertRecipients.message = monitorConfigWithAlertRecipients.message + "\n\n";
}
alertRecipients.forEach(function (alertRecipient) {
return monitorConfigWithAlertRecipients.message = monitorConfigWithAlertRecipients.message + " @" + alertRecipient;
});
return monitorConfigWithAlertRecipients;
};
return DatadogGenericMonitors;

@@ -244,3 +255,3 @@ }());

// tslint:disable-next-line: max-line-length
message: "{{#is_alert}}##Alert{{/is_alert}} \n{{#is_warning}}##Warning{{/is_warning}} \n\nKey space hit rate for Redis service `" + databaseConfig.name + "` is {{comparator}} {{threshold}} .\n\n",
message: "{{#is_alert}}##Alert{{/is_alert}} \n{{#is_warning}}##Warning{{/is_warning}} \n\nKey space hit rate for Redis service `" + databaseConfig.name + "` is {{comparator}} {{threshold}}.",
options: {

@@ -247,0 +258,0 @@ include_tags: true,

@@ -162,3 +162,3 @@ 'use strict';

DatadogGenericMonitors.prototype.createMonitor = function (config) {
var body = JSON.stringify(config);
var body = JSON.stringify(this.addAlertRecipientsToMonitorConfig(config));
return this.rest.post(this.url, body);

@@ -189,2 +189,13 @@ };

};
DatadogGenericMonitors.prototype.addAlertRecipientsToMonitorConfig = function (_a) {
var monitorConfig = _a.monitorConfig, alertRecipients = _a.alertRecipients;
var monitorConfigWithAlertRecipients = __assign({}, monitorConfig);
if (alertRecipients && alertRecipients.length > 0) {
monitorConfigWithAlertRecipients.message = monitorConfigWithAlertRecipients.message + "\n\n";
}
alertRecipients.forEach(function (alertRecipient) {
return monitorConfigWithAlertRecipients.message = monitorConfigWithAlertRecipients.message + " @" + alertRecipient;
});
return monitorConfigWithAlertRecipients;
};
return DatadogGenericMonitors;

@@ -250,3 +261,3 @@ }());

// tslint:disable-next-line: max-line-length
message: "{{#is_alert}}##Alert{{/is_alert}} \n{{#is_warning}}##Warning{{/is_warning}} \n\nKey space hit rate for Redis service `" + databaseConfig.name + "` is {{comparator}} {{threshold}} .\n\n",
message: "{{#is_alert}}##Alert{{/is_alert}} \n{{#is_warning}}##Warning{{/is_warning}} \n\nKey space hit rate for Redis service `" + databaseConfig.name + "` is {{comparator}} {{threshold}}.",
options: {

@@ -253,0 +264,0 @@ include_tags: true,

{
"name": "datadog-generic-monitors",
"version": "0.0.3",
"version": "0.0.4",
"description": "Create Datadog monitors configuration",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc