Giter Club home page Giter Club logo

dogwatch's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dogwatch's Issues

Composite monitors

hello, this looks like an interesting project, i was wondering if it was possible to create composite monitors with this tool?
I am not sure what would be the best way to represent a dependency graph of monitors something like this:

                                +-----------------+
                           +----+composite monitor+---+
                           |    +-----------------+   |
                           |                          |
                           |                          |
                     +-----v-----------+     +--------v--+
                   +-+composite monitor+--+  |query alert|
                   | +-----------------+  |  +-----------+
                   |                      |
                   |                      |
         +---------v-------+       +------v----+
      +--+composite monitor+--+    |query alert|
      |  +-----------------+  |    +-----------+
      |                       |
      |                       |
+-----v-----+         +-------v---+
|query alert|         |query alert|
+-----------+         +-----------+

Dogwatch should resolve monitors by ID instead of name

Dogwatch resolves monitors by name. So if you have two different teams sharing one DataDog account, they can accidentally clobber each others monitors if they don't have a naming scheme thought out. Dogwatch should resolve monitors by ID instead.

I'm thinking this should be similar to what Terraform does, where monitors are tracked in a local state file that's committed to source control.

Add support for metric alert thresholds

Add support for thresholds on metric_alert(s). From the docs:

METRIC ALERT OPTIONS

These options only apply to metric alerts.

  • thresholds a dictionary of thresholds by threshold type. Currently we have two threshold types for >metric alerts: critical and warning. Critical is defined in the query, but can also be specified in this option. Warning threshold can only be specified using the thresholds option.
    Example: {'critical': 90, 'warning': 80}

Can not set notify_no_data

With the following Dogfile:

DogWatch.monitor do
  # Check if restdb is available via haproxy
  monitor "Logentries: restdb available" do
    type :metric_alert
    query "max(last_1m):min:haproxy.backend_hosts{service:servicenamei,available:true} < 1"
    message %Q(service not available via haproxy

Playbook:

* Run `something magic`

Setup via Dogwatch)

    options do
        notify_no_data true
    end
   end
end

generates the following exception:

/var/lib/gems/1.9.1/gems/dogwatch-1.0.4/lib/dogwatch/model/options.rb:25:in `render': undefined method `to_h' for nil:NilClass (NoMethodError)
    from /var/lib/gems/1.9.1/gems/dogwatch-1.0.4/lib/dogwatch/model/monitor.rb:56:in `options'
    from /tmp/Dogfile:17:in `block (2 levels) in create'
    from /var/lib/gems/1.9.1/gems/dogwatch-1.0.4/lib/dogwatch/monitor.rb:28:in `instance_eval'
    from /var/lib/gems/1.9.1/gems/dogwatch-1.0.4/lib/dogwatch/monitor.rb:28:in `monitor'
    from /tmp/Dogfile:4:in `block in create'
    from /var/lib/gems/1.9.1/gems/dogwatch-1.0.4/lib/dogwatch/monitor.rb:20:in `instance_exec'
    from /var/lib/gems/1.9.1/gems/dogwatch-1.0.4/lib/dogwatch/monitor.rb:20:in `initialize'
    from /var/lib/gems/1.9.1/gems/dogwatch-1.0.4/lib/dogwatch.rb:7:in `new'
    from /var/lib/gems/1.9.1/gems/dogwatch-1.0.4/lib/dogwatch.rb:7:in `monitor'
    from /tmp/Dogfile:2:in `create'
    from /var/lib/gems/1.9.1/gems/dogwatch-1.0.4/lib/dogwatch/dogfile.rb:19:in `instance_eval'
    from /var/lib/gems/1.9.1/gems/dogwatch-1.0.4/lib/dogwatch/dogfile.rb:19:in `create'
    from /var/lib/gems/1.9.1/gems/dogwatch-1.0.4/bin/dogwatch:23:in `create'
    from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /var/lib/gems/1.9.1/gems/dogwatch-1.0.4/bin/dogwatch:28:in `<top (required)>'
    from /usr/local/bin/dogwatch:23:in `load'
    from /usr/local/bin/dogwatch:23:in `<main>'

Need clearer error messaging

Currently, trying to add some monitors and my queries are clearly broken, but all I'm seeing is:

"error ["The value provided for parameter 'query' is invalid"]"

I think it'd be helpful to see at the very least what the query was that it was trying to use.

Running dogwatch against the example Dogfile results in an Syntax error

$ /usr/local/bin/dogwatch create --dogfile=Dogfile
/var/lib/gems/1.9.1/gems/dogwatch-1.0.4/lib/dogwatch/dogfile.rb:19:in `instance_eval': /tmp/Dogfile:10: syntax error, unexpected ':', expecting keyword_end (SyntaxError)
      silenced '*': nil
                   ^
    from /var/lib/gems/1.9.1/gems/dogwatch-1.0.4/lib/dogwatch/dogfile.rb:19:in `create'
    from /var/lib/gems/1.9.1/gems/dogwatch-1.0.4/bin/dogwatch:23:in `create'
    from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /var/lib/gems/1.9.1/gems/dogwatch-1.0.4/bin/dogwatch:28:in `<top (required)>'
    from /usr/local/bin/dogwatch:23:in `load'
    from /usr/local/bin/dogwatch:23:in `<main>'

with the following content in Dogfile

# $ cat Dogfile
DogWatch.monitor do
  ## Create a new monitor - monitor name is REQUIRED
  monitor 'MONITOR NAME' do
    type :metric_alert # REQUIRED: One of [:metric_alert | :service_check | :event_alert]
    query 'time_aggr(time_window):space_aggr:metric{tags} [by {key}] operator' # REQUIRED
    message 'MESSAGE'
    tags %w(A list of tags to associate with your monitor)

    options do
      silenced '*': nil
      notify_no_data false
      no_data_timeframe 3
      timeout_h 99
      renotify_interval 60
      escalation_message 'oh snap'
      include_tags true
    end
  end
end

which is exactly the example provided in the README.md file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.