honeykiq 0.3.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +10 -1
- data/CODE_OF_CONDUCT.md +70 -0
- data/CONTRIBUTORS.txt +3 -0
- data/Gemfile.lock +5 -5
- data/README.md +16 -23
- data/lib/honeykiq/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d5da094ed5b07d9c5b4c514370e14e641c4d88d7cd65d80afab77d3e18d5b0f1
|
4
|
+
data.tar.gz: 4abbc53f3905305b7322d4441cdbbf72f9a707fe525a84c27ccf5c79a1d0ff80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c6421a534757c3fbe8b6a59bf6b58fcfd95b12ee3b7ee927ceb58915ccce96bb13f04f8bb4de7f8dbb6569ddcfd9de710c42d00e1a618906b37586b5b2f6735
|
7
|
+
data.tar.gz: 176758798b49ba340ea658f0b82e2c2cdf57fd1d19d5ab14bccdabe939c9d5bc3eacea0d8c4e7093434435129231cbf830262f07bb56aa4e66762c8f80fe4486
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
|
+
## [1.0.0]
|
9
|
+
### Added
|
10
|
+
- CODE_OF_CONDUCT.md
|
11
|
+
- CONTRIBUTORS.txt
|
12
|
+
|
13
|
+
### Fixed
|
14
|
+
- Tidied up README.md
|
15
|
+
|
8
16
|
## [0.3.1]
|
9
17
|
### Fixed
|
10
18
|
- Ensure that `Honeykiq::ServerMiddleware#extra_fields` are still included after a job fails
|
@@ -20,7 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
20
28
|
### Removed
|
21
29
|
- `Honeykiq.periodic_reporter`. (Use `Honeykiq::PeriodicReporter.new` instead.)
|
22
30
|
|
23
|
-
[Unreleased]: https://github.com/carwow/honeykiq/compare/
|
31
|
+
[Unreleased]: https://github.com/carwow/honeykiq/compare/v1.0.0...HEAD
|
32
|
+
[1.0.0]: https://github.com/carwow/honeykiq/compare/v0.3.1...v1.0.0
|
24
33
|
[0.3.1]: https://github.com/carwow/honeykiq/compare/v0.3.0...v0.3.1
|
25
34
|
[0.3.0]: https://github.com/carwow/honeykiq/compare/v0.2.0...v0.3.0
|
26
35
|
[0.2.0]: https://github.com/carwow/honeykiq/compare/v0.1.0...v0.2.0
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as contributors and
|
6
|
+
maintainers pledge to making participation in our project and our community a
|
7
|
+
harassment-free experience for everyone, regardless of age, body size, disability,
|
8
|
+
ethnicity, gender identity and expression, level of experience, education, socio-economic
|
9
|
+
status, nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment include:
|
15
|
+
|
16
|
+
* Using welcoming and inclusive language
|
17
|
+
* Being respectful of differing viewpoints and experiences
|
18
|
+
* Gracefully accepting constructive criticism
|
19
|
+
* Focusing on what is best for the community
|
20
|
+
* Showing empathy towards other community members
|
21
|
+
|
22
|
+
Examples of unacceptable behavior by participants include:
|
23
|
+
|
24
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
25
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
26
|
+
* Public or private harassment
|
27
|
+
* Publishing others' private information, such as a physical or electronic address,
|
28
|
+
without explicit permission
|
29
|
+
* Other conduct which could reasonably be considered inappropriate in a professional
|
30
|
+
setting
|
31
|
+
|
32
|
+
## Our Responsibilities
|
33
|
+
|
34
|
+
Project maintainers are responsible for clarifying the standards of acceptable behavior
|
35
|
+
and are expected to take appropriate and fair corrective action in response to any
|
36
|
+
instances of unacceptable behavior.
|
37
|
+
|
38
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments,
|
39
|
+
commits, code, wiki edits, issues, and other contributions that are not aligned to this
|
40
|
+
Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors
|
41
|
+
that they deem inappropriate, threatening, offensive, or harmful.
|
42
|
+
|
43
|
+
## Scope
|
44
|
+
|
45
|
+
This Code of Conduct applies both within project spaces and in public spaces when an
|
46
|
+
individual is representing the project or its community. Examples of representing a
|
47
|
+
project or community include using an official project e-mail address, posting via an
|
48
|
+
official social media account, or acting as an appointed representative at an online or
|
49
|
+
offline event. Representation of a project may be further defined and clarified by project
|
50
|
+
maintainers.
|
51
|
+
|
52
|
+
## Enforcement
|
53
|
+
|
54
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
|
55
|
+
contacting the [project team](developers@carwow.co.uk). All complaints will be reviewed and
|
56
|
+
investigated and will result in a response that is deemed necessary and appropriate to the
|
57
|
+
circumstances. The project team is obligated to maintain confidentiality with regard to
|
58
|
+
the reporter of an incident. Further details of specific enforcement policies may be
|
59
|
+
posted separately.
|
60
|
+
|
61
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may
|
62
|
+
face temporary or permanent repercussions as determined by other members of the project's
|
63
|
+
leadership.
|
64
|
+
|
65
|
+
## Attribution
|
66
|
+
|
67
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
68
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
69
|
+
|
70
|
+
[homepage]: https://www.contributor-covenant.org
|
data/CONTRIBUTORS.txt
ADDED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
honeykiq (0.
|
4
|
+
honeykiq (1.0.0)
|
5
5
|
sidekiq
|
6
6
|
|
7
7
|
GEM
|
@@ -40,11 +40,11 @@ GEM
|
|
40
40
|
coderay (~> 1.1.0)
|
41
41
|
method_source (~> 0.9.0)
|
42
42
|
public_suffix (3.0.3)
|
43
|
-
rack (2.
|
43
|
+
rack (2.2.2)
|
44
44
|
rack-protection (2.0.8.1)
|
45
45
|
rack
|
46
46
|
rainbow (3.0.0)
|
47
|
-
rake (
|
47
|
+
rake (13.0.1)
|
48
48
|
redis (4.1.3)
|
49
49
|
rspec (3.8.0)
|
50
50
|
rspec-core (~> 3.8.0)
|
@@ -70,9 +70,9 @@ GEM
|
|
70
70
|
rubocop-rspec (1.30.1)
|
71
71
|
rubocop (>= 0.60.0)
|
72
72
|
ruby-progressbar (1.10.0)
|
73
|
-
sidekiq (6.0.
|
73
|
+
sidekiq (6.0.5)
|
74
74
|
connection_pool (>= 2.2.2)
|
75
|
-
rack (
|
75
|
+
rack (~> 2.0)
|
76
76
|
rack-protection (>= 2.0.0)
|
77
77
|
redis (>= 4.1.0)
|
78
78
|
unf (0.1.4)
|
data/README.md
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Sidekiq → Honeycomb 🐝
|
4
4
|
|
5
|
-
Send Sidekiq
|
5
|
+
Send [Sidekiq](https://sidekiq.org)-related events to [Honeycomb](https://www.honeycomb.io).
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
Add this line to your application's Gemfile
|
9
|
+
Add this line to your application's `Gemfile`:
|
10
10
|
|
11
11
|
```ruby
|
12
12
|
gem 'honeykiq'
|
@@ -24,9 +24,7 @@ The library provides two use cases:
|
|
24
24
|
|
25
25
|
### Honeykiq::ServerMiddleware
|
26
26
|
|
27
|
-
Add
|
28
|
-
shown below. It will send an event to Honeycomb once a job finishes or fails.
|
29
|
-
Have a look at [server_middleware.rb] to see what kind of information we send.
|
27
|
+
Add Honeykiq to your Sidekiq server middleware chain, and pass a [`Libhoney::Client`][libhoney] as shown below. It will send an event to Honeycomb once a job finishes or fails. Have a look at [server_middleware.rb] to see what kind of information we send.
|
30
28
|
|
31
29
|
[server_middleware.rb]: https://github.com/carwow/honeykiq/blob/master/lib/honeykiq/server_middleware.rb
|
32
30
|
|
@@ -42,10 +40,7 @@ Sidekiq.configure_server do |config|
|
|
42
40
|
end
|
43
41
|
```
|
44
42
|
|
45
|
-
|
46
|
-
You can add your own data or functions to the Honeycomb event by subclassing
|
47
|
-
`Honeykiq::ServerMiddleware` and overriding the the `extra_fields` method with your own
|
48
|
-
hash. These will be serialized into individual items in the event:
|
43
|
+
You can add your own data or functions to the Honeycomb event by subclassing `Honeykiq::ServerMiddleware`, and overriding the the `extra_fields` method with your own hash. The contents will be serialized into individual items in the event:
|
49
44
|
|
50
45
|
```ruby
|
51
46
|
class MyServerMiddleware < Honeykiq::ServerMiddleware
|
@@ -63,27 +58,18 @@ Sidekiq.configure_server do |config|
|
|
63
58
|
...
|
64
59
|
```
|
65
60
|
|
66
|
-
**Note
|
67
|
-
sent to Honeycomb when it finishes so it may appear as no jobs are running.
|
68
|
-
Also if the process gets a SIGKILL then no event is sent about that job and the
|
69
|
-
job may keep retrying and not appear in Honeycomb. The `PeriodicReporter`
|
70
|
-
should help with this but we are thinking of a nicer approach.
|
61
|
+
**Note:** If you have long running jobs, an event is only sent to Honeycomb when the job finishes. Therefore, it may appear as though no jobs are currently running. Additionally, if the process receives a `SIGKILL` then no event is sent about that job, and the job may keep retrying without appearing in Honeycomb. The `PeriodicReporter` should help with this, but we are thinking of a nicer approach.
|
71
62
|
|
72
63
|
### Honeykiq::PeriodicReporter
|
73
64
|
|
74
|
-
The periodic reporter should be scheduled to report every few seconds depending
|
75
|
-
on your use case (e.g. 30 seconds). Every time the `#report` method is called
|
76
|
-
it will send a total of `1 + P + Q` events to Honeycomb where P and Q are the
|
77
|
-
number of processes and queues respectively.
|
65
|
+
The periodic reporter should be scheduled to report every few seconds, depending on your use case. Every time the `#report` method is called it will send a total of `1 + P + Q` events to Honeycomb where `P` and `Q` are the number of processes and queues respectively.
|
78
66
|
|
79
|
-
It sends three types of events: instance
|
80
|
-
[periodic_reporter.rb] to see what kind of information we send for each type.
|
67
|
+
It sends three types of events: `instance`, `process`, and `queue`. Have a look at [periodic_reporter.rb] to see what kind of information we send for each type.
|
81
68
|
|
82
69
|
[periodic_reporter.rb]: https://github.com/carwow/honeykiq/blob/master/lib/honeykiq/periodic_reporter.rb
|
83
70
|
|
84
|
-
A
|
71
|
+
A setup using [clockwork] to report every 30 seconds would look like this:
|
85
72
|
|
86
|
-
[clockwork]: https://github.com/Rykian/clockwork
|
87
73
|
|
88
74
|
```ruby
|
89
75
|
require 'clockwork'
|
@@ -114,8 +100,15 @@ end
|
|
114
100
|
|
115
101
|
## Contributing
|
116
102
|
|
117
|
-
|
103
|
+
[Pull requests](https://github.com/carwow/honeykiq/pulls) are very welcome! Don't forget to add yourself to [CONTRIBUTORS.txt].
|
104
|
+
|
105
|
+
Please report bugs in a [new issue](https://github.com/carwow/honeykiq/issues/new).
|
106
|
+
|
107
|
+
[CONTRIBUTORS.txt]: https://github.com/carwow/honeykiq/blob/master/CONTRIBUTORS.txt
|
118
108
|
|
119
109
|
## License
|
120
110
|
|
121
111
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
112
|
+
|
113
|
+
[libhoney]: https://github.com/honeycombio/libhoney-rb
|
114
|
+
[clockwork]: https://github.com/Rykian/clockwork
|
data/lib/honeykiq/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: honeykiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- carwow Developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|
@@ -120,6 +120,8 @@ files:
|
|
120
120
|
- ".rspec"
|
121
121
|
- ".rubocop.yml"
|
122
122
|
- CHANGELOG.md
|
123
|
+
- CODE_OF_CONDUCT.md
|
124
|
+
- CONTRIBUTORS.txt
|
123
125
|
- Gemfile
|
124
126
|
- Gemfile.lock
|
125
127
|
- LICENSE.txt
|
@@ -151,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
153
|
version: '0'
|
152
154
|
requirements: []
|
153
155
|
rubyforge_project:
|
154
|
-
rubygems_version: 2.6
|
156
|
+
rubygems_version: 2.7.6
|
155
157
|
signing_key:
|
156
158
|
specification_version: 4
|
157
159
|
summary: "Sidekiq → Honeycomb \U0001F41D"
|