RabbitMQ

RabbitMQ

Agent Check Agentチェック

Supported OS Linux Mac OS Windows

RabbitMQ ダッシュボード

概要

このチェックは、Datadog Agent を通じて RabbitMQ を監視します。

  • キューサイズ、コンシューマーカウント、未承認メッセージ、再配布メッセージなどのキューベースの統計を追跡できます。
  • 待機プロセス、使用されたソケット、使用されたファイルディスクリプタなどのノードベースの統計を追跡できます。
  • vhost の死活状態や接続数を監視できます。

これらは一例です。

セットアップ

インストール

RabbitMQ チェックは Datadog Agent パッケージに含まれています。サーバーに追加でインストールする必要はありません。

コンフィギュレーション

RabbitMQ の準備

RabbitMQ 管理プラグインを有効にします。詳細については、RabbitMQ のドキュメントを参照してください。さらに、Agent ユーザーには、少なくとも monitoring タグと以下のアクセス許可が必要です。

アクセス許可コマンド
conf^aliveness-test$
write^amq\.default$
read.*

次のコマンドで、デフォルトの vhost 用に Agent ユーザーを作成します。

rabbitmqctl add_user datadog <シークレット>
rabbitmqctl set_permissions  -p / datadog "^aliveness-test$" "^amq\.default$" ".*"
rabbitmqctl set_user_tags datadog monitoring

ここで、/ はデフォルトのホストを表します。これを、指定した仮想ホスト名に設定してください。詳細については、RabbitMQ のドキュメントを参照してください。

ホスト

ホストで実行中の Agent に対してこのチェックを構成するには:

メトリクスの収集
  1. RabbitMQ メトリクスの収集を開始するには、Agent のコンフィギュレーションディレクトリのルートにある conf.d/ フォルダーの rabbitmq.d/conf.yaml ファイルを編集します。使用可能なすべてのコンフィギュレーションオプションの詳細については、サンプル rabbitmq.d/conf.yaml を参照してください。

    : Agent は、デフォルトですべてのキュー、vhost、ノードをチェックしますが、リストまたは正規表現を指定してこれを制限できます。例については、rabbitmq.d/conf.yaml を参照してください。

  2. Agent を再起動します

ログの収集

Agent バージョン 6.0 以降で利用可能

  1. デフォルトのログファイルの場所を変更するには、RABBITMQ_LOGS 環境変数を設定するか、以下の行を RabbitMQ 構成ファイル (/etc/rabbitmq/rabbitmq.conf) に追加します。

      log.dir = /var/log/rabbit
      log.file = rabbit.log
    
  2. Datadog Agent で、ログの収集はデフォルトで無効になっています。以下のように、datadog.yaml ファイルでこれを有効にします。

    logs_enabled: true
    
  3. RabbitMQ ログの収集を開始するには、rabbitmq.d/conf.yaml ファイルの logs セクションを編集します。

    logs:
      - type: file
        path: /var/log/rabbit/*.log
        source: rabbitmq
        service: myservice
        log_processing_rules:
          - type: multi_line
            name: logs_starts_with_equal_sign
            pattern: "="
    
  4. Agent を再起動します

コンテナ化

コンテナ環境の場合は、オートディスカバリーのインテグレーションテンプレートのガイドを参照して、次のパラメーターを適用してください。

メトリクスの収集
パラメーター
<インテグレーション名>rabbitmq
<初期コンフィギュレーション>空白または {}
<インスタンスコンフィギュレーション>{"rabbitmq_api_url":"%%host%%:15672/api/","username": <ユーザー名>, "password": <パスワード>}
ログの収集

Agent バージョン 6.0 以降で利用可能

Datadog Agent で、ログの収集はデフォルトで無効になっています。有効にする方法については、Kubernetes ログ収集のドキュメントを参照してください。

パラメーター
<LOG_CONFIG>{"source": "rabbitmq", "service": "rabbitmq", "log_processing_rules": [{"type":"multi_line","name":"logs_starts_with_equal_sign", "pattern": "="}]}

検証

Agent の status サブコマンドを実行し、Checks セクションで rabbitmq を探します。

収集データ

メトリクス

rabbitmq.node.fd_used
(gauge)
Used file descriptors
rabbitmq.node.disk_free
(gauge)
Current free disk space
Shown as byte
rabbitmq.node.mem_used
(gauge)
Memory used in bytes
Shown as byte
rabbitmq.node.mem_limit
(gauge)
Memory usage high watermark in bytes
Shown as byte
rabbitmq.node.run_queue
(gauge)
Average number of Erlang processes waiting to run
Shown as process
rabbitmq.node.sockets_used
(gauge)
Number of file descriptors used as sockets
rabbitmq.node.partitions
(gauge)
Number of network partitions this node is seeing
rabbitmq.node.running
(gauge)
Is the node running or not
rabbitmq.node.mem_alarm
(gauge)
Does the host has memory alarm
rabbitmq.node.disk_alarm
(gauge)
Does the node have disk alarm
rabbitmq.exchange.messages.ack.count
(gauge)
Number of messages in exchanges delivered to clients and acknowledged
Shown as message
rabbitmq.exchange.messages.ack.rate
(gauge)
Rate of messages in exchanges delivered to clients and acknowledged per second
Shown as message
rabbitmq.exchange.messages.confirm.count
(gauge)
Count of messages in exchanges confirmed
Shown as message
rabbitmq.exchange.messages.confirm.rate
(gauge)
Rate of messages in exchanges confirmed per second
Shown as message
rabbitmq.exchange.messages.deliver_get.count
(gauge)
Sum of messages in exchanges delivered in acknowledgement mode to consumers, in no-acknowledgement mode to consumers, in acknowledgement mode in response to basic.get, and in no-acknowledgement mode in response to basic.get
Shown as message
rabbitmq.exchange.messages.deliver_get.rate
(gauge)
Rate per second of the sum of exchange messages delivered in acknowledgement mode to consumers, in no-acknowledgement mode to consumers, in acknowledgement mode in response to basic.get, and in no-acknowledgement mode in response to basic.get
Shown as message
rabbitmq.exchange.messages.redeliver.count
(gauge)
Count of subset of messages in exchanges in deliver_get which had the redelivered flag set
Shown as message
rabbitmq.exchange.messages.redeliver.rate
(gauge)
Rate of subset of messages in exchanges in deliver_get which had the redelivered flag set per second
Shown as message
rabbitmq.exchange.messages.return_unroutable.count
(gauge)
Count of messages in exchanges returned to publisher as unroutable
Shown as message
rabbitmq.exchange.messages.return_unroutable.rate
(gauge)
Rate of messages in exchanges returned to publisher as unroutable per second
Shown as message
rabbitmq.exchange.messages.publish.count
(gauge)
Count of messages in exchanges published
Shown as message
rabbitmq.exchange.messages.publish.rate
(gauge)
Rate of messages in exchanges published per second
Shown as message
rabbitmq.exchange.messages.publish_in.count
(gauge)
Count of messages published from channels into this exchange
Shown as message
rabbitmq.exchange.messages.publish_in.rate
(gauge)
Rate of messages published from channels into this exchange per sec
Shown as message
rabbitmq.exchange.messages.publish_out.count
(gauge)
Count of messages published from this exchange into queues
Shown as message
rabbitmq.exchange.messages.publish_out.rate
(gauge)
Rate of messages published from this exchange into queues per second
Shown as message
rabbitmq.queue.active_consumers
(gauge)
Number of active consumers, consumers that can immediately receive any messages sent to the queue
rabbitmq.queue.bindings.count
(gauge)
Number of bindings for a specific queue
rabbitmq.queue.consumers
(gauge)
Number of consumers
rabbitmq.queue.consumer_utilisation
(gauge)
The ratio of time that a queue's consumers can take new messages
Shown as fraction
rabbitmq.queue.head_message_timestamp
(gauge)
Timestamp of the head message of the queue
Shown as millisecond
rabbitmq.queue.memory
(gauge)
Bytes of memory consumed by the Erlang process associated with the queue, including stack, heap and internal structures
Shown as byte
rabbitmq.queue.messages
(gauge)
Count of the total messages in the queue
Shown as message
rabbitmq.queue.messages.rate
(gauge)
Count per second of the total messages in the queue
Shown as message
rabbitmq.queue.messages_ready
(gauge)
Number of messages ready to be delivered to clients
Shown as message
rabbitmq.queue.messages_ready.rate
(gauge)
Number per second of messages ready to be delivered to clients
Shown as message
rabbitmq.queue.messages_unacknowledged
(gauge)
Number of messages delivered to clients but not yet acknowledged
Shown as message
rabbitmq.queue.messages_unacknowledged.rate
(gauge)
Number per second of messages delivered to clients but not yet acknowledged
Shown as message
rabbitmq.queue.messages.ack.count
(gauge)
Number of messages in queues delivered to clients and acknowledged
Shown as message
rabbitmq.queue.messages.ack.rate
(gauge)
Number per second of messages delivered to clients and acknowledged
Shown as message
rabbitmq.queue.messages.deliver.count
(gauge)
Count of messages delivered in acknowledgement mode to consumers
Shown as message
rabbitmq.queue.messages.deliver.rate
(gauge)
Rate of messages delivered in acknowledgement mode to consumers
Shown as message
rabbitmq.queue.messages.deliver_get.count
(gauge)
Sum of messages in queues delivered in acknowledgement mode to consumers, in no-acknowledgement mode to consumers, in acknowledgement mode in response to basic.get, and in no-acknowledgement mode in response to basic.get.
Shown as message
rabbitmq.queue.messages.deliver_get.rate
(gauge)
Rate per second of the sum of messages in queues delivered in acknowledgement mode to consumers, in no-acknowledgement mode to consumers, in acknowledgement mode in response to basic.get, and in no-acknowledgement mode in response to basic.get.
Shown as message
rabbitmq.queue.messages.publish.count
(gauge)
Count of messages in queues published
Shown as message
rabbitmq.queue.messages.publish.rate
(gauge)
Rate per second of messages published
Shown as message
rabbitmq.queue.messages.redeliver.count
(gauge)
Count of subset of messages in queues in deliver_get which had the redelivered flag set
Shown as message
rabbitmq.queue.messages.redeliver.rate
(gauge)
Rate per second of subset of messages in deliver_get which had the redelivered flag set
Shown as message
rabbitmq.connections
(gauge)
Number of current connections to a given rabbitmq vhost, tagged 'rabbitmq_vhost:'
Shown as connection
rabbitmq.connections.state
(gauge)
Number of connections in the specified connection state
Shown as connection
rabbitmq.overview.object_totals.connections
(gauge)
Total number of connections
Shown as connection
rabbitmq.overview.object_totals.channels
(gauge)
Total number of channels
Shown as item
rabbitmq.overview.object_totals.queues
(gauge)
Total number of queues
Shown as item
rabbitmq.overview.object_totals.consumers
(gauge)
Total number of consumers
Shown as item
rabbitmq.overview.queue_totals.messages.count
(gauge)
Total number of messages (ready plus unacknowledged)
Shown as message
rabbitmq.overview.queue_totals.messages.rate
(gauge)
Rate of number of messages (ready plus unacknowledged)
Shown as message
rabbitmq.overview.queue_totals.messages_ready.count
(gauge)
Number of messages ready for delivery
Shown as message
rabbitmq.overview.queue_totals.messages_ready.rate
(gauge)
Rate of number of messages ready for delivery
Shown as message
rabbitmq.overview.queue_totals.messages_unacknowledged.count
(gauge)
Number of unacknowledged messages
Shown as message
rabbitmq.overview.queue_totals.messages_unacknowledged.rate
(gauge)
Rate of number of unacknowledged messages
Shown as message
rabbitmq.overview.messages.ack.count
(gauge)
Number of messages delivered to clients and acknowledged
Shown as message
rabbitmq.overview.messages.ack.rate
(gauge)
Rate of messages delivered to clients and acknowledged per second
Shown as message
rabbitmq.overview.messages.confirm.count
(gauge)
Count of messages confirmed
Shown as message
rabbitmq.overview.messages.confirm.rate
(gauge)
Rate of messages confirmed per second
Shown as message
rabbitmq.overview.messages.deliver_get.count
(gauge)
Sum of messages delivered in acknowledgement mode to consumers, in no-acknowledgement mode to consumers, in acknowledgement mode in response to basic.get, and in no-acknowledgement mode in response to basic.get
Shown as message
rabbitmq.overview.messages.deliver_get.rate
(gauge)
Rate per second of the sum of messages delivered in acknowledgement mode to consumers, in no-acknowledgement mode to consumers, in acknowledgement mode in response to basic.get, and in no-acknowledgement mode in response to basic.get
Shown as message
rabbitmq.overview.messages.redeliver.count
(gauge)
Count of subset of messages in deliver_get which had the redelivered flag set
Shown as message
rabbitmq.overview.messages.redeliver.rate
(gauge)
Rate of subset of messages in deliver_get which had the redelivered flag set per second
Shown as message
rabbitmq.overview.messages.return_unroutable.count
(gauge)
Count of messages returned to publisher as unroutable
Shown as message
rabbitmq.overview.messages.return_unroutable.rate
(gauge)
Rate of messages returned to publisher as unroutable per second
Shown as message
rabbitmq.overview.messages.publish.count
(gauge)
Count of messages published
Shown as message
rabbitmq.overview.messages.publish.rate
(gauge)
Rate of messages published per second
Shown as message
rabbitmq.overview.messages.publish_in.count
(gauge)
Count of messages published from channels into this overview
Shown as message
rabbitmq.overview.messages.publish_in.rate
(gauge)
Rate of messages published from channels into this overview per sec
Shown as message
rabbitmq.overview.messages.publish_out.count
(gauge)
Count of messages published from this overview into queues
Shown as message
rabbitmq.overview.messages.publish_out.rate
(gauge)
Rate of messages published from this overview into queues per second
Shown as message

Agent は、キュー名に基づいて rabbitmq.queue.* メトリクスをタグ付けし、ノード名に基づいて rabbitmq.node.* メトリクスをタグ付けします。

イベント

パフォーマンス上の理由から、RabbitMQ チェックは、メトリクスの収集対象となるエクスチェンジ、キュー、ノードの数を制限します。この制限に近づくと、イベントストリームに警告レベルのイベントが送信されます。

エクスチェンジ、キュー、またはノードの数を増やす必要がある場合は、Datadog のサポートチームまでお問合せください。

サービスのチェック

rabbitmq.aliveness
Returns the status of a vhost based on the RabbitMQ Aliveness API. The Aliveness API will create a test queue, then publish and consume a message from that queue. Returns OK if the status code from the API is 200 and CRITICAL otherwise.
Statuses: ok, critical

rabbitmq.status
Returns the status of the RabbitMQ server. Returns OK if the agent was able to contact the API and CRITICAL otherwise.
Statuses: ok, critical

トラブルシューティング

ご不明な点は、Datadog のサポートチームまでお問合せください。

その他の参考資料

お役に立つドキュメント、リンクや記事:

よくあるご質問