百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

slackiq

> 编程语言
开源

Slackiq = Slack + Sidekiq

198 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

Slackiq = Slack + Sidekiq

Slackiq

Slackiq (pronounced slack-kick) integrates Slack and Sidekiq so that you can have vital information about your Sidekiq jobs sent directly to your team's Slack.

Installation

Add this line to your Gemfile:

ruby
gem 'slackiq'

Then run:

bundle install

Configuration

First, set up any number of Slack Incoming Webhooks from your Slack.

Then, you only need to call the configure method when your application launches to configure all of the webhooks to which you want to post. If you're using Rails, create an initializer at config/initializers/slackiq.rb. Here's an example:

ruby
Slackiq.configure( web_scrapes: 'https://hooks.slack.com/services/HA298HF2/ALSKF2451/lknsaHHA2323KKDKND', 
                   data_processing: 'https://hooks.slack.com/services/HA298HF2/ALSKF2451/H24dLKAHD22423')

:web_scrapes and data_processing are examples of keys. Use whatever keys you want.

Usage

You can call notify to send a nicely-formatted notification to your Slack. You can call notify

  • Inside the Sidekiq Pro on_success or on_complete callback (not available on regular Sidekiq--only Pro)
  • From inside a Sidekiq worker while it's running, in which case you should pass in the bid to the perform method of the worker

The notify method has a single Hash parameter. Here are the keys and values in the Hash:

  • :webhook_name The name of the webhook (Symbol) that you configured (eg. :web_scrapes or :data_processing)
  • :title The title of the notification (String)
  • :status An instance of Sidekiq::Batch::Status
  • Any other keys and values (both Strings) can be added too, and they'll be added to the Slack notification!

If you haven't used batches with Sidekiq Pro before, read this first.

Here's an example showing how you would use Slackiq to send a notification to your Slack when your Sidekiq batch completes:

ruby
class WebScraper
  
  class  URL.count.to_s, 
    'Servers' => "#{Server.active_count} active, #{Server.inactive_count} inactive")
  end
  
end

Note that in this case, 'Total URLs in DB' and 'Servers' are custom fields that will also appear in Slack!

Want to send a message to Slack that isn't Sidekiq-related?

No prob. Just:

ruby
Slackiq.message('Server 5 is overloaded!', webhook_name: :data_processing)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/MightySignal/slackiq. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Blog Post about Slackiq

https://blog.mightysignal.com/slackiq-a-ruby-gem-that-connects-slack-and-sidekiq-a2308c1974b7

More Open Source Projects

  • Slacktivity

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言