Skip to content

Commit

Permalink
Prepping for 1.0.0 release (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
revdan authored Mar 6, 2020
1 parent e71ed06 commit 5a2d230
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 23 deletions.
70 changes: 70 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Contributor Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and
maintainers pledge to making participation in our project and our community a
harassment-free experience for everyone, regardless of age, body size, disability,
ethnicity, gender identity and expression, level of experience, education, socio-economic
status, nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address,
without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional
setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior
and are expected to take appropriate and fair corrective action in response to any
instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments,
commits, code, wiki edits, issues, and other contributions that are not aligned to this
Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors
that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an
individual is representing the project or its community. Examples of representing a
project or community include using an official project e-mail address, posting via an
official social media account, or acting as an appointed representative at an online or
offline event. Representation of a project may be further defined and clarified by project
maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
contacting the [project team](developers@carwow.co.uk). All complaints will be reviewed and
investigated and will result in a response that is deemed necessary and appropriate to the
circumstances. The project team is obligated to maintain confidentiality with regard to
the reporter of an incident. Further details of specific enforcement policies may be
posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may
face temporary or permanent repercussions as determined by other members of the project's
leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
3 changes: 3 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Pedro Chambino <pedro.chambino@carwow.co.uk>
Dan Rees-Jones <dan.reesjones@carwow.co.uk>
Christian Gregg <christian.gregg@carwow.co.uk>
39 changes: 16 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

Sidekiq → Honeycomb 🐝

Send Sidekiq related events to Honeycomb.
Send [Sidekiq](https://sidekiq.org)-related events to [Honeycomb](https://www.honeycomb.io).

## Installation

Add this line to your application's Gemfile:
Add this line to your application's `Gemfile`:

```ruby
gem 'honeykiq'
Expand All @@ -24,9 +24,7 @@ The library provides two use cases:

### Honeykiq::ServerMiddleware

Add it to Sidekiq server middleware chain and pass a `Libhoney::Client` 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.
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.

[server_middleware.rb]: https://github.com/carwow/honeykiq/blob/master/lib/honeykiq/server_middleware.rb

Expand All @@ -42,10 +40,7 @@ Sidekiq.configure_server do |config|
end
```

#### Adding extra data to events
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. These will be serialized into individual items in the event:
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:

```ruby
class MyServerMiddleware < Honeykiq::ServerMiddleware
Expand All @@ -63,27 +58,18 @@ Sidekiq.configure_server do |config|
...
```

**Note on long running jobs:** If you have long running jobs an event is only
sent to Honeycomb when it finishes so it may appear as no jobs are running.
Also if the process gets a SIGKILL then no event is sent about that job and the
job may keep retrying and not appear in Honeycomb. The `PeriodicReporter`
should help with this but we are thinking of a nicer approach.
**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.

### Honeykiq::PeriodicReporter

The periodic reporter should be scheduled to report every few seconds depending
on your use case (e.g. 30 seconds). 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.
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.

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.
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.

[periodic_reporter.rb]: https://github.com/carwow/honeykiq/blob/master/lib/honeykiq/periodic_reporter.rb

A simple setup using [clockwork] would look like this:
A setup using [clockwork] to report every 30 seconds would look like this:

[clockwork]: https://github.com/Rykian/clockwork

```ruby
require 'clockwork'
Expand Down Expand Up @@ -114,8 +100,15 @@ end

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/carwow/honeykiq.
[Pull requests](https://github.com/carwow/honeykiq/pulls) are very welcome! Don't forget to add yourself to [CONTRIBUTORS.txt].

Please report bugs in a [new issue](https://github.com/carwow/honeykiq/issues/new).

[CONTRIBUTORS.txt]: https://github.com/carwow/honeykiq/blob/master/CONTRIBUTORS.txt

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

[libhoney]: https://github.com/honeycombio/libhoney-rb
[clockwork]: https://github.com/Rykian/clockwork

0 comments on commit 5a2d230

Please sign in to comment.