- 重要な情報
- はじめに
- 用語集
- ガイド
- エージェント
- インテグレーション
- OpenTelemetry
- 開発者
- API
- CoScreen
- アプリ内
- Service Management
- インフラストラクチャー
- アプリケーションパフォーマンス
- 継続的インテグレーション
- ログ管理
- セキュリティ
- UX モニタリング
- 管理
Supported OS
このインテグレーションは、Sidekiq〜DogStatsD を監視します。Datadog の DogStatsD Ruby クライアントを介してメトリクスを収集します。
注 Sidekiq Pro (>= 3.6) または Enterprise (>= 1.1.0) のユーザーのみがメトリクスを収集できます。
Sidekiq インテグレーションは Datadog Agent にパッケージ化されています。 サーバーに追加でインストールする必要はありません。
dogstatsd-ruby
gem をインストールします。
gem install dogstatsd-ruby
Sidekiq Pro メトリクス収集を初期化子に含めることで有効にします。コンテナ化されたデプロイの場合は、localhost
を Agent のコンテナのアドレスに更新します。
require 'datadog/statsd' # gem 'dogstatsd-ruby'
Sidekiq::Pro.dogstatsd = ->{ Datadog::Statsd.new('localhost', 8125, namespace:'sidekiq') }
Sidekiq.configure_server do |config|
config.server_middleware do |chain|
require 'sidekiq/middleware/server/statsd'
chain.add Sidekiq::Middleware::Server::Statsd
end
end
Sidekiq Enterprise を使用していて、履歴メトリクスを収集する場合は、次の行も含めます。
Sidekiq.configure_server do |config|
# history is captured every 30 seconds by default
config.retain_history(30)
end
詳細については、Sidekiq Pro および Enterprise のドキュメントを参照してください。詳細なコンフィギュレーションオプションについては、DogStatsD Ruby のドキュメントを参照してください。
下記のコンフィギュレーションを追加して、Datadog Agent のメインコンフィギュレーションファイルである datadog.yaml
を更新します。
# dogstatsd_mapper_cache_size: 1000 # default to 1000
dogstatsd_mapper_profiles:
- name: sidekiq
prefix: "sidekiq."
mappings:
- match: 'sidekiq\.sidekiq\.(.*)'
match_type: "regex"
name: "sidekiq.$1"
- match: 'sidekiq\.jobs\.(.*)\.perform'
name: "sidekiq.jobs.perform"
match_type: "regex"
tags:
worker: "$1"
- match: 'sidekiq\.jobs\.(.*)\.(count|success|failure)'
name: "sidekiq.jobs.worker.$2"
match_type: "regex"
tags:
worker: "$1"
これらのパラメーターは、Datadog Agent に DD_DOGSTATSD_MAPPER_PROFILES
環境変数を追加することで設定することも可能です。
sidekiq.jobs.perform.count (gauge) | Count of the amount of time spent in a worker Shown as millisecond |
sidekiq.jobs.perform.avg (gauge) | Average amount of time spent in a worker Shown as millisecond |
sidekiq.jobs.perform.max (gauge) | Max amount of time spent in a worker Shown as millisecond |
sidekiq.jobs.perform.median (gauge) | Median amount of time spent in a worker Shown as millisecond |
sidekiq.jobs.perform.95percentile (gauge) | 95th percentile of amount of time spent in a worker Shown as millisecond |
sidekiq.jobs.count (count) | Total count of Sidekiq jobs Shown as job |
sidekiq.jobs.success (count) | Total count of successful Sidekiq jobs Shown as job |
sidekiq.jobs.failure (count) | Total count of failed Sidekiq jobs Shown as job |
sidekiq.jobs.worker.count (count) | Count of Sidekiq jobs Shown as job |
sidekiq.jobs.worker.success (count) | Count of successful Sidekiq jobs Shown as job |
sidekiq.jobs.worker.failure (count) | Count of failed Sidekiq jobs Shown as job |
sidekiq.processed (count) | Number of job executions completed (success or failure) (Enterprise only) Shown as job |
sidekiq.failed (count) | Number of job executions which raised an error (Enterprise only) Shown as job |
sidekiq.enqueued (count) | Total size of all known queues (Enterprise only) Shown as job |
sidekiq.retries (count) | Total retries size (Enterprise only) Shown as job |
sidekiq.dead (count) | Total Dead Size (Enterprise only) Shown as job |
sidekiq.scheduled (count) | Total Scheduled Size (Enterprise only) Shown as job |
sidekiq.busy (count) | Total Busy Size (Enterprise only) Shown as job |
sidekiq.jobs.expired (count) | Count of when a job is expired Shown as job |
sidekiq.jobs.recovered.push (count) | Count of when a job is recovered by reliable_push after network outage Shown as job |
sidekiq.jobs.recovered.fetch (count) | Count of when a job is recovered by super_fetch after process crash Shown as job |
sidekiq.batches.created (count) | Count of when a batch is created |
sidekiq.batches.complete (count) | Count of when a batch is completed |
sidekiq.batches.success (count) | Count of when a batch is successful |
Sidekiq インテグレーションでは、カスタムメトリクスも使用できます。カスタムメトリクスのアイデアについては、Sidekiq Enterprise Historical Metrics を参照してください。
Datadog Agent でのログ収集は、デフォルトで無効になっています。以下のように、datadog.yaml
ファイルでこれを有効にします。
logs_enabled: true
Sidekiq のログの収集を開始するには、次のコンフィギュレーションブロックを sidekiq.d/conf.yaml
ファイルに追加します。
logs:
- type: file
path: /var/log/sidekiq.log
source: sidekiq
service: <SERVICE>
path
パラメーターと service
パラメーターの値を変更し、環境に合わせて構成してください。ログが見つからない場合は、Sidekiq Logging を参照してください。
Sidekiq には、サービスのチェック機能は含まれません。
Sidekiq には、イベントは含まれません。
ご不明な点は、Datadog のサポートチームまでお問合せください。