Supported OS Linux Windows Mac OS

インテグレーションバージョン5.1.0

To find out if this integration is available in your organization, see your Datadog Integrations page or ask your organization administrator.

To initiate an exception request to enable this integration for your organization, email [email protected].

Fluentd ダッシュボード

概要

Fluentd からメトリクスを取得して、以下のことができます。

  • Fluentd のパフォーマンスを視覚化できます。
  • Fluentd のパフォーマンスを他のアプリケーションと関連付けることができます。

セットアップ

インストール

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

Fluentd の準備

FluentD コンフィギュレーションファイルに monitor_agent ソースを追加します。

<source>
  @type monitor_agent
  bind 0.0.0.0
  port 24220
</source>

構成

ホスト

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

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

    init_config:
    
    instances:
      ## @param monitor_agent_url - string - required
      ## Monitor Agent URL to connect to.
      #
      - monitor_agent_url: http://example.com:24220/api/plugins.json
    
  2. Agent を再起動します

ログ収集

Datadog の FluentD プラグインを使用して FluentD から Datadog アカウントへログを直接転送することができます。

ログへのメタデータの追加

適切なメタデータ (ホスト名、ソースなど) は、Datadog でログの可能性をフルに引き出すためのカギです。デフォルトでは、ホスト名およびタイムスタンプフィールドが、予約済み属性の再マップによって適切に再マップされます。

ソースとカスタムタグ

Datadog でインテグレーションの自動セットアップをトリガーするには、ログに ddsource 属性を追加して、ログのインテグレーションの名前を設定します。 インフラストラクチャーリストに一致するホスト名があれば、ホストタグがログに自動的に設定されます。ログにカスタムタグを追加する場合は、ddtags 属性を使用します。

セットアップ例:

  # "datadog.**" タグが付いたイベントを照合して
  # Datadog に送信

<match datadog.**>
  @type datadog
  @id awesome_agent
  api_key <your_api_key>

  # オプション
  include_tag_key true
  tag_key 'tag'

  # オプションのタグ
  dd_source '<INTEGRATION_NAME>'
  dd_tags '<KEY1:VALUE1>,<KEY2:VALUE2>'

  <buffer>
          @type memory
          flush_thread_count 4
          flush_interval 3s
          chunk_limit_size 5m
          chunk_limit_records 500
  </buffer>
</match>

デフォルトでは、ログを gzip 圧縮して HTTPS (ポート 443) から送信するためにプラグインを構成します。 次のパラメーターを使用して、この動作を変更できます。

  • use_http: TCP 転送を使用する場合はこれを false に設定し、hostport を 状況に応じて更新します (デフォルトは true)
  • use_compression: 圧縮は HTTP にのみ利用できます。無効にする場合はこれを false に設定します (デフォルトは true)
  • compression_level: HTTP の圧縮レベルを 1 ~ 9 の範囲で設定します。最大値は 9 となります (デフォルトは 6)

以下の追加パラメーターを使用すると、プロキシを通過するために、使用するエンドポイントを変更できます。

  • host: ログを Datadog に直接転送しない場合のプロキシのエンドポイント (デフォルト値は http-intake.logs.datadoghq.com)。
  • port: ログを Datadog に直接転送しない場合のプロキシのポート (デフォルト値は 80)
  • ssl_port: ログをセキュリティ保護された TCP/SSL 接続で Datadog に転送する場合に使用するポート (デフォルトは 443)
  • use_ssl: Datadog へのセキュリティ保護された TCP/SSL 接続を初期化するよう Agent に指示します (デフォルト値は true)。
  • no_ssl_validation: SSL ホスト名の検証を無効化します (デフォルト値は false)。

: host および port をリージョン に設定します。

<match datadog.**>

  #...
  host 'http-intake.logs.datadoghq.eu'

</match>
Kubernetes と Docker タグ

製品のある部分から別の部分に移動できるようにするには、Datadog タグがたいへん重要です。コンテナビューやコンテナメトリクスから最も関連するログに移動するには、ログに正しいメタデータを関連付けることが大切です。

以下の属性がログに含まれている場合は、これらの属性が Datadog タグとしてログに自動的に追加されます。

  • kubernetes.container_image
  • kubernetes.container_name
  • kubernetes.namespace_name
  • kubernetes.pod_name
  • docker.container_id

Datadog Agent は Docker と Kubernetes のメタデータを自動的に収集しますが、FluentD では、そのためのプラグインが必要です。このメタデータの収集には、fluent-plugin-kubernetes_metadata_filter を使用することを Datadog はお勧めします。

構成例:

# "kubernetes.**" のタグが付いたログのメタデータを収集
 <filter kubernetes.*>
   type kubernetes_metadata
 </filter>

コンテナ化

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

メトリクスの収集
パラメーター
<INTEGRATION_NAME>fluentd
<INIT_CONFIG>空白または {}
<INSTANCE_CONFIG>{"monitor_agent_url": "http://%%host%%:24220/api/plugins.json"}

検証

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

収集データ

メトリクス

fluentd.buffer_available_buffer_space_ratios
(gauge)
Show available space for buffer
fluentd.buffer_queue_byte_size
(gauge)
Current bytesize of queued buffer chunks
Shown as byte
fluentd.buffer_queue_length
(gauge)
The length of the buffer queue for this plugin.
Shown as buffer
fluentd.buffer_stage_byte_size
(gauge)
Current bytesize of staged buffer chunks
Shown as byte
fluentd.buffer_stage_length
(gauge)
The length of staged buffer chunks
fluentd.buffer_total_queued_size
(gauge)
The size of the buffer queue for this plugin.
Shown as byte
fluentd.emit_count
(gauge)
The total number of emit call in output plugin
Shown as unit
fluentd.emit_records
(gauge)
The total number of emitted records
Shown as record
fluentd.flush_time_count
(gauge)
The total time of buffer flush in milliseconds
Shown as millisecond
fluentd.retry_count
(gauge)
The number of retries for this plugin.
Shown as time
fluentd.rollback_count
(gauge)
The total number of rollback. rollback happens when write/try_write failed
Shown as unit
fluentd.slow_flush_count
(gauge)
The total number of slow flush. This count will be incremented when buffer flush is longer than slow_flush_log_threshold
Shown as unit
fluentd.tracked_file_count
(gauge)
Number of files currently being tracked by the in_tail plugin
Shown as file
fluentd.write_count
(gauge)
The total number of write/try_write call in output plugin
Shown as unit

イベント

FluentD チェックには、イベントは含まれません。

サービスチェック

fluentd.is_ok

Returns OK if fluentd and its monitor agent are running, CRITICAL otherwise.

Statuses: ok, critical

トラブルシューティング

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

その他の参考資料