sidekiq-datadog-monitor 0.0.0.5 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d84d08e0320ca9b9e399bb8eff1efd74af038a534fe9936c8cfcfb3e169dc40
|
4
|
+
data.tar.gz: f7cedc8a2816f04c886a2a0c8f841d7cd2819bbb916cd59737208ceff35043c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f1384e84c750d8510cc1102c9f4286276c8a6fdefa050e2576ce0baebde5da806859c8d4e34e316921260814fd4a251d8f20bd652073bb5bdee9a0af6fdbbda
|
7
|
+
data.tar.gz: 489cf5542ec468a81eb8e0c218b5f34babb3a23699e444e1702cf65cd105e8326f4667d01ab5765a599564600dba8c9e4a6564dd0a4a838766f9ece447b9e707
|
data/README.md
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
# Sidekiq::Datadog::Monitor
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/sidekiq/datadog/monitor`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
5
6
|
|
6
7
|
## Installation
|
7
8
|
|
8
9
|
Add this line to your application's Gemfile:
|
9
10
|
|
10
11
|
```ruby
|
11
|
-
gem 'sidekiq-datadog-monitor'
|
12
|
+
gem 'sidekiq-datadog-monitor'
|
12
13
|
```
|
13
14
|
|
14
15
|
And then execute:
|
@@ -21,31 +22,7 @@ Or install it yourself as:
|
|
21
22
|
|
22
23
|
## Usage
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
```ruby
|
27
|
-
# Import the library
|
28
|
-
require 'sidekiq/datadog/monitor/data'
|
29
|
-
|
30
|
-
# Initiate a Sidekiq::Datadog::Monitor client instance.
|
31
|
-
Sidekiq::Datadog::Monitor::Data.initialize!(
|
32
|
-
{agent_host: 'localhost',
|
33
|
-
agent_port: 8125,
|
34
|
-
env: 'production', # optional
|
35
|
-
tag: 'tag', # optional
|
36
|
-
queue: 'queue name', # optional
|
37
|
-
cron: "*/30 * * * *" # default: "*/1 * * * *"
|
38
|
-
}
|
39
|
-
)
|
40
|
-
|
41
|
-
```
|
42
|
-
`agent_host` and `agent_port` instantiate DogStatsD client
|
43
|
-
|
44
|
-
`env`, `tag`, `queue` settings for background job that will gather and send Sidekiq metrics
|
45
|
-
|
46
|
-
`cron` - schedule settings for background job that will gather and send Sidekiq metrics
|
47
|
-
|
48
|
-
|
25
|
+
TODO: Write usage instructions here
|
49
26
|
|
50
27
|
## Development
|
51
28
|
|
@@ -1,9 +1,5 @@
|
|
1
|
-
require
|
2
|
-
require "sidekiq/datadog/config"
|
1
|
+
require 'datadog/statsd'
|
3
2
|
require 'sidekiq/datadog/monitor/metrics_worker'
|
4
|
-
require 'sidekiq-scheduler'
|
5
|
-
require 'sidekiq/api'
|
6
|
-
|
7
3
|
module Sidekiq
|
8
4
|
module Datadog
|
9
5
|
module Monitor
|
@@ -12,22 +8,16 @@ module Sidekiq
|
|
12
8
|
attr_reader :agent_port, :agent_host, :tag, :env, :queue, :cron
|
13
9
|
|
14
10
|
def initialize!(options)
|
15
|
-
@agent_port
|
11
|
+
@agent_port = options[:agent_port]
|
12
|
+
@agent_host = options[:agent_host]
|
16
13
|
@tag = options[:tag] || ''
|
17
14
|
@env = options[:env] || ''
|
18
15
|
@queue = options[:queue] || ''
|
19
16
|
@cron = options[:cron] || "*/1 * * * *"
|
20
17
|
|
21
|
-
Sidekiq::Datadog::Config.reload_schedule
|
22
|
-
|
23
18
|
start
|
24
|
-
|
25
|
-
rescue StandardError => e
|
26
|
-
raise Sidekiq::Datadog::Monitor::Error.new(e.message)
|
27
19
|
end
|
28
20
|
|
29
|
-
private
|
30
|
-
|
31
21
|
def start
|
32
22
|
Sidekiq.set_schedule('send_metrics',
|
33
23
|
{ "cron"=> cron, 'class' => 'Sidekiq::Datadog::Monitor::MetricsWorker', 'queue' => queue })
|
@@ -1,5 +1,5 @@
|
|
1
|
-
require "sidekiq/datadog/monitor/data"
|
2
1
|
require 'datadog/statsd'
|
2
|
+
require 'sidekiq'
|
3
3
|
|
4
4
|
module Sidekiq
|
5
5
|
module Datadog
|
@@ -23,13 +23,13 @@ module Sidekiq
|
|
23
23
|
|
24
24
|
def post_queue_size(queue_name, size)
|
25
25
|
statsd.gauge('sidekiq.queue.size', size,
|
26
|
-
tags: ["queue_name:#{queue_name}", "
|
26
|
+
tags: ["queue_name:#{queue_name}", "environment:#{Data.env}", Data.tag])
|
27
27
|
end
|
28
28
|
|
29
29
|
def post_queue_latency(queue_name)
|
30
30
|
latency = Sidekiq::Queue.new(queue_name).latency
|
31
31
|
statsd.gauge('sidekiq.queue.latency', latency,
|
32
|
-
tags: ["queue_name:#{queue_name}", "
|
32
|
+
tags: ["queue_name:#{queue_name}", "environment:#{Data.env}", Data.tag])
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-datadog-monitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aleksa_castle
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,20 +66,6 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 2.2.1
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: sidekiq-scheduler
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 3.0.1
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 3.0.1
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: dogstatsd-ruby
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -105,7 +91,6 @@ files:
|
|
105
91
|
- README.md
|
106
92
|
- bin/console
|
107
93
|
- bin/setup
|
108
|
-
- lib/sidekiq/datadog/config.rb
|
109
94
|
- lib/sidekiq/datadog/monitor.rb
|
110
95
|
- lib/sidekiq/datadog/monitor/data.rb
|
111
96
|
- lib/sidekiq/datadog/monitor/metrics_worker.rb
|