sidekiq-job_alert 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/README.md +18 -22
- data/lib/sidekiq/job_alert/version.rb +1 -1
- data/sidekiq_job_alert.yml +7 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ebae05bf920c412d640839f133b0fa028caf5c3
|
4
|
+
data.tar.gz: d817838aa611f5a8a831ed81e1607152bf49ff2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8812b0957d32f160b5cfdecd37590ad6a24bd61f5a0b46d1b5d9c9e94c64f793672ebe28c61a56a07e8c7ba5ceaedd5ac6810da58bb2330ccda3a33db346fbc8
|
7
|
+
data.tar.gz: 909758252d9e43e6a901145802036aad38f2c594a3293e2850155a8e96b55944bac2df7d5690c0f7df2fd7fa2c78900fc6f5319b80fd5c90d22e0c3114bf878f
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Sidekiq::JobAlert
|
2
2
|
|
3
|
-
Sidekiq-job_alert is a gem to send alert to slack to warn you when there are too many waiting jobs or dead jobs
|
3
|
+
Sidekiq-job_alert is a gem to send alert to slack to warn you when there are too many waiting jobs or dead jobs
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -19,41 +19,37 @@ Or install it yourself as:
|
|
19
19
|
$ gem install sidekiq-job_alert
|
20
20
|
|
21
21
|
## Usage
|
22
|
-
-
|
22
|
+
- config
|
23
|
+
- copy `sidekiq_job_alert.yml` to your local and edit it to fit your needs
|
24
|
+
- example:
|
23
25
|
|
24
26
|
```yaml
|
25
|
-
:webhook_url: "
|
26
|
-
:username: "
|
27
|
-
:channel: "
|
27
|
+
:webhook_url: "https://hooks.slack.com/services/xxxx"
|
28
|
+
:username: "Sidekiq_Job_Alert"
|
29
|
+
:channel: "sidekiq-job"
|
28
30
|
:link_names: 'false'
|
29
|
-
:sidekiq_url: "http://localhost:3000/sidekiq/"
|
31
|
+
:sidekiq_url: "http://localhost:3000/sidekiq/"
|
30
32
|
:alert_dead_jobs:
|
31
33
|
:message: "%<job_counter>d dead jobs.\n"
|
32
34
|
:alert_total_waiting_jobs:
|
33
35
|
:message: "Totally %<job_counter>d waiting jobs.\n"
|
34
36
|
:all:
|
35
|
-
:limit:
|
37
|
+
:limit: 50
|
36
38
|
:alert_each_waiting_job:
|
37
39
|
:message: "%<job_counter>d waiting jobs in %<queue_name>s.\n"
|
38
|
-
:
|
39
|
-
:limit:
|
40
|
-
:
|
41
|
-
:limit:
|
40
|
+
:create_place:
|
41
|
+
:limit: 10
|
42
|
+
:update_place:
|
43
|
+
:limit: 10
|
42
44
|
```
|
43
45
|
|
44
46
|
- run
|
47
|
+
- command line tool
|
48
|
+
- `sidekiq_job_alert alert --config ./sidekiq_job_alert.yml`
|
49
|
+
- rails application
|
50
|
+
- ` Sidekiq::JobAlert::Notifier.new('config/sidekiq_job_alert.yml').call `
|
51
|
+
- notification
|
45
52
|
|
46
|
-
```ruby
|
47
|
-
sidekiq_job_alert alert --config ./sidekiq_job_alert.yml
|
48
|
-
```
|
49
|
-
|
50
|
-
or
|
51
|
-
|
52
|
-
```ruby
|
53
|
-
Sidekiq::JobAlert::Notifier.new('config/sidekiq_job_alert.yml').call
|
54
|
-
```
|
55
|
-
|
56
|
-
## Example
|
57
53
|
![image](https://user-images.githubusercontent.com/853200/65889183-c2612480-e3db-11e9-9c9c-cdae69ef2863.png)
|
58
54
|
|
59
55
|
## Development
|
data/sidekiq_job_alert.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
:webhook_url: "YOUR SLACK INCOMING WEBHOOK"
|
2
|
-
:username: "
|
3
|
-
:channel: "YOUR CHANNEL"
|
2
|
+
:username: "Sidekiq_Job_Alert"
|
3
|
+
:channel: "YOUR CHANNEL NAME"
|
4
4
|
:link_names: 'false'
|
5
5
|
:sidekiq_url: "http://localhost:3000/sidekiq/" # Replace with your sidekiq url
|
6
6
|
:alert_dead_jobs:
|
@@ -8,11 +8,10 @@
|
|
8
8
|
:alert_total_waiting_jobs:
|
9
9
|
:message: "Totally %<job_counter>d waiting jobs.\n"
|
10
10
|
:all:
|
11
|
-
:limit:
|
11
|
+
:limit: 50 # Send alert when total waiting jobs over 50
|
12
12
|
:alert_each_waiting_job:
|
13
13
|
:message: "%<job_counter>d waiting jobs in %<queue_name>s.\n"
|
14
|
-
:queue_1:
|
15
|
-
:limit:
|
16
|
-
:queue_2:
|
17
|
-
:limit:
|
18
|
-
|
14
|
+
:queue_1: # Replace `queue_1` with our own sidekiq queue name
|
15
|
+
:limit: 10 # Send alert when queue_1's jobs is over 10
|
16
|
+
:queue_2: # Replace `queue_2` with our own sidekiq queue name
|
17
|
+
:limit: 10 # Send alert when queue_2's jobs is over 10
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-job_alert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- feng.zhang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|