Categorygithub.com/DataDog/ddmonitor
modulepackage
0.0.7
Repository: https://github.com/datadog/ddmonitor.git
Documentation: pkg.go.dev

# README

DDMON

Description

ddmon is a simple means to manage Datadog monitors via templates + terraform. It is opinionated on the structure of a monitor. It allows for terse YAML monitor definitions.

Note: This project is under active development and is not intended to be used in production.

Setup

# Install the latest version
go get github.com/DataDog/ddmonitor

# Install a specific version
GO111MODULE=on go get github.com/DataDog/[email protected]

Usage

Given many common monitor patterns, ddmon aids in generating terraform
files for Datadog by providing a rich templating language built off sprig and terse
YAML monitor definitions to generate terraform Datadog monitors.

Usage:
  ddmon [command]

Available Commands:
  generate    Generates all templates into terraform files
  help        Help about any command
  init        Initialze the directory for ddmon usage

Flags:
      --config string   config file (default is $HOME/.ddmon.yaml)
  -h, --help            help for ddmon
      --version         version for ddmon

Use "ddmon [command] --help" for more information about a command.

Contribution Guides

TODO

Expected Project Structure

/monitors
  output/
    *.tf
  resources/
    $GROUP/
      $MONITOR-1.tpl
      $MONITOR-2.tpl
    templates/
      base.tpl
  data/
    common.yaml
    $NAMESPACE
      common.yaml
      $GROUP/
        common.yaml
        $MONITOR-1.yaml
        $MONITOR-2.yaml
        ...

Guide

All monitors are defined in YAML files.

Data Inheritance

Each $MONITOR-N.yaml is merged into its groups's common.yaml, this is merged into the groups common.yaml, and finally the data's common.yaml.

Thus $MONITOR-N.yaml has precedence, followed by $GROUP/common.yaml, followed by $NAMESPACE/common.yaml, followed by data/common.yaml.

YAML Specificiation

The $MONITOR-N.yaml file has the following specification:

All fields populate terraform fields in some form, in so, they must meet the terraform datadog specification

keyrequired?descriptiondefault
identifierrequireda unique identifier for the tag, will be prefixed with the service name. Alphanumerics + - only.N/A
namerequiredthe name of the monitorN/A
typerequiredsee terraform docsN/A
descriptionrequireda short description of the alertN/A
recovery_planrequireda run book on how to resolve the alertN/A
wiki_linkrequireda link to the services wiki. should be in the services common.yamlinherited
dashboard_linkrequireda link to the services dashboard. should be in the services common.yamlinherited
slackoptionalthe slack room to post to. inherited from data/common.yaml"@slack-milkyway-ops"
tagsoptionalthe tags for the monitor["team:team-aaa", "terraform:true", "datacenter:$DATACENTER", "service:host-conumser"]
datacenterinheritedthe datacenter for the monitor, inherited from the common.yamlinherited
default_messageinheriteda default message for all monitorssee data/common.yaml
should_pageoptionalif set to true, the monitor will pagefalse

The following fields are directly equivelent to their terraform specification

keyrequired?descriptiondefault
escalation_messageoptionalTODO""
thresholds.criticaloptionalTODONil
thresholds.critical_recoveryoptionalTODONil
thresholds.warningoptionalTODONil
thresholds.warning_recoveryoptionalTODONil
notify_no_dataoptionalTODOfalse
new_host_delayoptionalTODO300
evaluation_delayoptionalTODONil
no_data_timeframeoptionalTODO2x timeframe for metric alerts, 2 minutes for service checks.
renotify_intervaloptionalTODOnil
notify_auditoptionalTODOfalse
require_full_windowoptionalTODOfalse
lockedoptionalTODOfalse

Useful Links

# Packages

Package cmd configures and executes the given CLI command Copyright © 2019 Dan Piet <[email protected]> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
No description provided by the author