-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run
rubocop -a
on the monitor code examples, and updated some snipp…
…ets.
- Loading branch information
1 parent
bf35c15
commit 7fcce5f
Showing
24 changed files
with
228 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Style/FrozenStringLiteralComment: | ||
Enabled: false | ||
|
||
Metrics/LineLength: | ||
Max: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
require 'rubygems' | ||
require 'dogapi' | ||
|
||
api_key = '<YOUR_API_KEY>' | ||
app_key = '<YOUR_APP_KEY>' | ||
|
||
dog = Dogapi::Client.new(api_key, app_key) | ||
|
||
# Unmute all alerts | ||
dog.unmute_monitor(62628) | ||
# Unmute an alert | ||
dog.unmute_monitor(62_628) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# This is not yet supported by the Ruby Client for Datadog API | ||
# Consult the curl example | ||
# Consult the curl example |
38 changes: 19 additions & 19 deletions
38
content/en/api/monitors/code_snippets/result.api-monitor-create.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
["200", { | ||
"name" => "Bytes received on host0", | ||
"org_id" => 1499, | ||
"tags" => ["app:webserver", "frontend"], | ||
"options" => { | ||
"notify_no_data" => true, | ||
"no_data_timeframe" => 20, | ||
"notify_audit" => false, | ||
"silenced" => {} | ||
}, | ||
"state" => {}, | ||
"query" => "avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 100", | ||
"message" => "We may need to add web hosts if this is consistently high.", | ||
"type" => "metric alert", | ||
"id" => 92089, | ||
"multi" => false, | ||
"created" => "2015-12-18T16:34:14.014039+00:00", | ||
"modified" => "2015-12-18T16:34:14.014039+00:00" | ||
}] | ||
['200', { | ||
'name' => 'Bytes received on host0', | ||
'org_id' => 1499, | ||
'tags' => ['app:webserver', 'frontend'], | ||
'options' => { | ||
'notify_no_data' => true, | ||
'no_data_timeframe' => 20, | ||
'notify_audit' => false, | ||
'silenced' => {} | ||
}, | ||
'state' => {}, | ||
'query' => 'avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 100', | ||
'message' => 'We may need to add web hosts if this is consistently high.', | ||
'type' => 'metric alert', | ||
'id' => 92_089, | ||
'multi' => false, | ||
'created' => '2015-12-18T16:34:14.014039+00:00', | ||
'modified' => '2015-12-18T16:34:14.014039+00:00' | ||
}] |
6 changes: 3 additions & 3 deletions
6
content/en/api/monitors/code_snippets/result.api-monitor-delete.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
["200", { | ||
"deleted_monitor_id" => 62625 | ||
}] | ||
['200', { | ||
'deleted_monitor_id' => 62_625 | ||
}] |
32 changes: 16 additions & 16 deletions
32
content/en/api/monitors/code_snippets/result.api-monitor-edit.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
[ | ||
"200", { | ||
"name" => "We may need to add web hosts if this is consistently high.", | ||
"org_id" => 1499, | ||
"options" => { | ||
"notify_no_data" => false, "notify_audit" => false, "silenced" => {} | ||
}, | ||
"state" => {}, | ||
"query" => "avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 100", | ||
"message" => "Bytes received on host0", | ||
"type" => "metric alert", | ||
"id" => 91879, | ||
"multi" => false, | ||
"created" => "2015-12-18T16:34:14.014039+00:00", | ||
"modified" => "2015-12-18T18:39:24.391207+00:00" | ||
} | ||
] | ||
'200', { | ||
'name' => 'We may need to add web hosts if this is consistently high.', | ||
'org_id' => 1499, | ||
'options' => { | ||
'notify_no_data' => false, 'notify_audit' => false, 'silenced' => {} | ||
}, | ||
'state' => {}, | ||
'query' => 'avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 100', | ||
'message' => 'Bytes received on host0', | ||
'type' => 'metric alert', | ||
'id' => 91_879, | ||
'multi' => false, | ||
'created' => '2015-12-18T16:34:14.014039+00:00', | ||
'modified' => '2015-12-18T18:39:24.391207+00:00' | ||
} | ||
] |
26 changes: 13 additions & 13 deletions
26
content/en/api/monitors/code_snippets/result.api-monitor-group-search.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
["200", | ||
{"counts"=> | ||
{"status"=>[{"count"=>1, "name"=>"Alert"}], | ||
"type"=>[{"count"=>1, "name"=>"apm"}]}, | ||
"groups"=> | ||
[{"status"=>"Alert", | ||
"last_triggered_ts"=>1540483133, | ||
"group"=>"*", | ||
"monitor_id"=>6797333, | ||
"group_tags"=>["*"], | ||
"last_nodata_ts"=>0, | ||
"monitor_name"=>"Service sample has a high error rate on env:myenv"}], | ||
"metadata"=>{"total_count"=>1, "page_count"=>1, "page"=>0, "per_page"=>30}}] | ||
['200', | ||
{ 'counts' => | ||
{ 'status' => [{ 'count' => 1, 'name' => 'Alert' }], | ||
'type' => [{ 'count' => 1, 'name' => 'apm' }] }, | ||
'groups' => | ||
[{ 'status' => 'Alert', | ||
'last_triggered_ts' => 1_540_483_133, | ||
'group' => '*', | ||
'monitor_id' => 6_797_333, | ||
'group_tags' => ['*'], | ||
'last_nodata_ts' => 0, | ||
'monitor_name' => 'Service sample has a high error rate on env:myenv' }], | ||
'metadata' => { 'total_count' => 1, 'page_count' => 1, 'page' => 0, 'per_page' => 30 } }] |
18 changes: 9 additions & 9 deletions
18
content/en/api/monitors/code_snippets/result.api-monitor-mute-all.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
[ | ||
"200", { | ||
"end" => nil, | ||
"disabled" => false, | ||
"start" => 1412805855, | ||
"active" => true, | ||
"scope" => ["*"], | ||
"id" => 1647 | ||
} | ||
] | ||
'200', { | ||
'end' => nil, | ||
'disabled' => false, | ||
'start' => 1_412_805_855, | ||
'active' => true, | ||
'scope' => ['*'], | ||
'id' => 1647 | ||
} | ||
] |
44 changes: 22 additions & 22 deletions
44
content/en/api/monitors/code_snippets/result.api-monitor-mute.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
[ | ||
"200", { | ||
"name" => "avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 200", | ||
"org_id" => 1499, | ||
"options" => { | ||
"notify_no_data" => false, | ||
"notify_audit" => true, | ||
"timeout_h" => nil, | ||
"silenced" => { | ||
"*" => nil | ||
}, | ||
"is_data_sparse" => false, | ||
"renotify_interval" => nil | ||
}, | ||
"state" => {}, | ||
"query" => "avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 200", | ||
"message" => "", | ||
"type" => "metric alert", | ||
"id" => 62628, | ||
"created" => "2015-12-18T16:34:14.014039+00:00", | ||
"modified" => "2015-12-18T18:39:24.391207+00:00" | ||
} | ||
] | ||
'200', { | ||
'name' => 'avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 200', | ||
'org_id' => 1499, | ||
'options' => { | ||
'notify_no_data' => false, | ||
'notify_audit' => true, | ||
'timeout_h' => nil, | ||
'silenced' => { | ||
'*' => nil | ||
}, | ||
'is_data_sparse' => false, | ||
'renotify_interval' => nil | ||
}, | ||
'state' => {}, | ||
'query' => 'avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 200', | ||
'message' => '', | ||
'type' => 'metric alert', | ||
'id' => 62_628, | ||
'created' => '2015-12-18T16:34:14.014039+00:00', | ||
'modified' => '2015-12-18T18:39:24.391207+00:00' | ||
} | ||
] |
52 changes: 26 additions & 26 deletions
52
content/en/api/monitors/code_snippets/result.api-monitor-search.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
["200", | ||
{"counts"=> | ||
{"status"=>[{"count"=>1, "name"=>"Alert"}], | ||
"muted"=>[{"count"=>1, "name"=>false}], | ||
"tag"=> | ||
[{"count"=>1, "name"=>"env:myenv"}, | ||
{"count"=>1, "name"=>"service:sample"}], | ||
"type"=>[{"count"=>1, "name"=>"apm"}]}, | ||
"monitors"=> | ||
[{"status"=>"Alert", | ||
"scopes"=>["env:myenv", "service:sample"], | ||
"classification"=>"apm", | ||
"creator"=> | ||
{"handle"=>"[email protected]", | ||
"id"=>795042, | ||
"name"=>"Jane"}, | ||
"metrics"=>["trace.servlet.request.hits", "trace.servlet.request.errors"], | ||
"notifications"=> | ||
[{"handle"=>"[email protected]", "name"=>"Jane"}], | ||
"last_triggered_ts"=>1540483133, | ||
"id"=>6797333, | ||
"name"=>"Service sample has a high error rate on env:myenv", | ||
"tags"=>["env:myenv", "service:sample"], | ||
"org_id"=>11287, | ||
"type"=>"query alert"}], | ||
"metadata"=>{"total_count"=>1, "page_count"=>1, "page"=>0, "per_page"=>30}}] | ||
['200', | ||
{ 'counts' => | ||
{ 'status' => [{ 'count' => 1, 'name' => 'Alert' }], | ||
'muted' => [{ 'count' => 1, 'name' => false }], | ||
'tag' => | ||
[{ 'count' => 1, 'name' => 'env:myenv' }, | ||
{ 'count' => 1, 'name' => 'service:sample' }], | ||
'type' => [{ 'count' => 1, 'name' => 'apm' }] }, | ||
'monitors' => | ||
[{ 'status' => 'Alert', | ||
'scopes' => ['env:myenv', 'service:sample'], | ||
'classification' => 'apm', | ||
'creator' => | ||
{ 'handle' => '[email protected]', | ||
'id' => 795_042, | ||
'name' => 'Jane' }, | ||
'metrics' => ['trace.servlet.request.hits', 'trace.servlet.request.errors'], | ||
'notifications' => | ||
[{ 'handle' => '[email protected]', 'name' => 'Jane' }], | ||
'last_triggered_ts' => 1_540_483_133, | ||
'id' => 6_797_333, | ||
'name' => 'Service sample has a high error rate on env:myenv', | ||
'tags' => ['env:myenv', 'service:sample'], | ||
'org_id' => 11_287, | ||
'type' => 'query alert' }], | ||
'metadata' => { 'total_count' => 1, 'page_count' => 1, 'page' => 0, 'per_page' => 30 } }] |
Oops, something went wrong.