Supported OS Linux Mac OS Windows

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

概要

Logstash からメトリクスをリアルタイムに取得して、以下のことができます。

  • Logstash の状態を視覚化および監視できます。
  • Logstash のイベントに関する通知を受けることができます。

計画と使用

インフラストラクチャーリスト

Logstash チェックは Datadog Agent パッケージに含まれていないため、お客様自身でインストールする必要があります。

メトリクスベース SLO

Agent v7.21 / v6.21 以降の場合は、下記の手順に従い Logstash チェックをホストにインストールします。それ以前のバージョンの Agent については、コミュニティインテグレーションの使用を参照してください。

  1. 以下のコマンドを実行して、Agent インテグレーションをインストールします。

    datadog-agent integration install -t datadog-logstash==<INTEGRATION_VERSION>
    
  2. コアのインテグレーションと同様にインテグレーションを構成します。

コンテナ化

以下の Dockerfile を使用して、Logstash インテグレーションを含むカスタム Datadog Agent イメージを構築します。

FROM gcr.io/datadoghq/agent:latest
RUN datadog-agent integration install -r -t datadog-logstash==<INTEGRATION_VERSION>

Kubernetes を使用している場合は、Datadog Operator または Helm チャートの構成を更新して、このカスタム Datadog Agent イメージをプルします。

詳しくはコミュニティインテグレーションの使用を参照してください。

ブラウザトラブルシューティング

メトリクスの収集

メトリクスベース SLO
  1. Agent の構成ディレクトリのルートにある conf.d/ フォルダーの logstash.d/conf.yaml ファイルを編集します。

    init_config:
    
    instances:
      # The URL where Logstash provides its monitoring API.
      # This will be used to fetch various runtime metrics about Logstash.
      #
      - url: http://localhost:9600
    

    使用可能なすべての構成オプションの詳細については、サンプル logstash.d/conf.yaml を参照してください。

  2. Agent を再起動します

コンテナ化

コンテナ環境では、以下のパラメーターを指定したオートディスカバリーテンプレートを使用します。

パラメーター
<INTEGRATION_NAME>logstash
<INIT_CONFIG>空白または {}
<INSTANCE_CONFIG>{"server": "http://%%host%%:9600"}

このテンプレートの適用方法については、Docker インテグレーションまたは Kubernetes インテグレーションを参照してください。

使用可能なすべての構成オプションの詳細については、サンプル logstash.d/conf.yaml を参照してください。

収集データ

Datadog には、Datadog プラットフォームへのログの送信を処理する、Logstash 用の出力プラグインがあります。

このプラグインをインストールするには、次のコマンドを実行します。

  • logstash-plugin install logstash-output-datadog_logs

次に、Datadog API キーを使用して datadog_logs プラグインを構成します。

output {
    datadog_logs {
        api_key => "<DATADOG_API_キー>"
    }
}

デフォルトでは、ログを 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 をリージョン に設定します。

output {
   datadog_logs {
       api_key => "<DATADOG_API_キー>"
       host => "http-intake.logs.datadoghq.eu"
   }
}
ログへのメタデータの追加

Datadog でログを最大限活用するには、ログにホスト名やソースなどの適切なメタデータを関連付けることが重要です。デフォルトでは、Datadog のデフォルトの予約済み属性の再マップにより、ホスト名とタイムスタンプが適切に再マップされます。確実にサービスを正しく再マップするには、その属性値をサービス再マップリストに追加します。

ソース

Logstash フィルターをセットアップして、ログにソース (Datadog インテグレーション名) を設定します。

filter {
  mutate {
    add_field => {
 "ddsource" => "<ソースの値>"
       }
    }
 }

これにより、Datadog でインテグレーション自動セットアップがトリガーされます。

カスタムタグ

インフラストラクチャーリストに一致するホスト名があれば、ホストタグがログに自動的に設定されます。ログにカスタムタグを追加する場合は、ddtags 属性を使用します。

filter {
  mutate {
    add_field => {
        "ddtags" => "env:test,<KEY:VALUE>"
       }
    }
 }

検証

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

互換性

Logstash チェックは、Logstash バージョン 5.x、6.x および 7.x と互換性があります。また、Logstash 6.0 で導入された新しいマルチパイプラインメトリクスにも対応します。Logstash バージョン 5.6.15、6.3.0 および 7.0.0 でテスト済みです。

リアルユーザーモニタリング

データセキュリティ

logstash.process.open_file_descriptors
(gauge)
The number of open file descriptors used by this process.
logstash.process.peak_open_file_descriptors
(gauge)
The peak number of open file descriptors used by this process.
logstash.process.max_file_descriptors
(gauge)
The maximum number of file descriptors used by this process.
logstash.process.mem.total_virtual_in_bytes
(gauge)
Total virtual memory allocated to this process.
Shown as byte
logstash.process.cpu.total_in_millis
(gauge)
The CPU time in milliseconds.
Shown as millisecond
logstash.process.cpu.percent
(gauge)
CPU utilization in percentage.
Shown as percent
logstash.process.cpu.load_average.1m
(gauge)
The average CPU load over one minute.
logstash.process.cpu.load_average.5m
(gauge)
The average CPU load over five minutes
logstash.process.cpu.load_average.15m
(gauge)
The average CPU load over fifteen minutes.
logstash.jvm.threads.count
(gauge)
Number of threads used by the JVM.
Shown as thread
logstash.jvm.threads.peak_count
(gauge)
The peak number of threads used by JVM.
Shown as thread
logstash.jvm.mem.heap_used_percent
(gauge)
Total Java heap memory used.
Shown as percent
logstash.jvm.mem.heap_committed_in_bytes
(gauge)
Total Java heap memory committed.
Shown as byte
logstash.jvm.mem.heap_max_in_bytes
(gauge)
Maximum Java heap memory size.
Shown as byte
logstash.jvm.mem.heap_used_in_bytes
(gauge)
Total Java heap memory used.
Shown as byte
logstash.jvm.mem.non_heap_used_in_bytes
(gauge)
Total Java non-heap memory used.
Shown as byte
logstash.jvm.mem.non_heap_committed_in_bytes
(gauge)
Total Java non-heap memory committed.
Shown as byte
logstash.jvm.mem.pools.survivor.peak_used_in_bytes
(gauge)
The Java memory used in the Survivor space.
Shown as byte
logstash.jvm.mem.pools.survivor.used_in_bytes
(gauge)
The peak Java memory used in the Survivor space.
Shown as byte
logstash.jvm.mem.pools.survivor.peak_max_in_bytes
(gauge)
The peak maximum Java memory used in the Survivor space.
Shown as byte
logstash.jvm.mem.pools.survivor.max_in_bytes
(gauge)
The maximum Java memory used in the Survivor space.
Shown as byte
logstash.jvm.mem.pools.survivor.committed_in_bytes
(gauge)
The committed Java memory used in the Survivor space.
Shown as byte
logstash.jvm.mem.pools.old.peak_used_in_bytes
(gauge)
The peak Java memory used in the Old generation.
Shown as byte
logstash.jvm.mem.pools.old.used_in_bytes
(gauge)
The Java memory used in the Old generation.
Shown as byte
logstash.jvm.mem.pools.old.peak_max_in_bytes
(gauge)
The peak maximum Java memory used in the Old generation.
Shown as byte
logstash.jvm.mem.pools.old.max_in_bytes
(gauge)
The maximum Java memory used in the Old generation.
Shown as byte
logstash.jvm.mem.pools.old.committed_in_bytes
(gauge)
The committed Java memory used in the Old generation.
Shown as byte
logstash.jvm.mem.pools.young.peak_used_in_bytes
(gauge)
The peak Java memory used in the Young space.
Shown as byte
logstash.jvm.mem.pools.young.used_in_bytes
(gauge)
The Java memory used in the Young generation.
Shown as byte
logstash.jvm.mem.pools.young.peak_max_in_bytes
(gauge)
The peak maximum Java memory used in the Young generation.
Shown as byte
logstash.jvm.mem.pools.young.max_in_bytes
(gauge)
The maximum Java memory used in the Young generation.
Shown as byte
logstash.jvm.mem.pools.young.committed_in_bytes
(gauge)
The committed Java memory used in the Young generation.
Shown as byte
logstash.jvm.gc.collectors.old.collection_time_in_millis
(gauge)
Garbage collection time spent in the Old generation.
Shown as millisecond
logstash.jvm.gc.collectors.old.collection_count
(gauge)
Garbage collection count in the Old generation.
logstash.jvm.gc.collectors.young.collection_time_in_millis
(gauge)
Garbage collection time spent in the Young generation.
Shown as millisecond
logstash.jvm.gc.collectors.young.collection_count
(gauge)
Garbage collection time spent in the Young generation.
logstash.reloads.successes
(gauge)
Number of successful configuration reloads.
logstash.reloads.failures
(gauge)
Number of failed configuration reloads.
logstash.pipeline.dead_letter_queue.queue_size_in_bytes
(gauge)
Total size of the dead letter queue.
Shown as byte
logstash.pipeline.events.duration_in_millis
(gauge)
Events duration in the pipeline.
Shown as millisecond
logstash.pipeline.events.in
(gauge)
Number of events into the pipeline.
logstash.pipeline.events.out
(gauge)
Number of events out from the pipeline.
logstash.pipeline.events.filtered
(gauge)
Number of events filtered.
logstash.pipeline.reloads.successes
(gauge)
Number of successful pipeline reloads.
logstash.pipeline.reloads.failures
(gauge)
Number of failed pipeline reloads.
logstash.pipeline.plugins.inputs.events.out
(gauge)
Number of events out from the input plugin.
logstash.pipeline.plugins.inputs.events.queue_push_duration_in_millis
(gauge)
Duration of queue push in the input plugin.
Shown as millisecond
logstash.pipeline.plugins.outputs.events.in
(gauge)
Number of events into the output plugin.
logstash.pipeline.plugins.outputs.events.out
(gauge)
Number of events out from the output plugin.
logstash.pipeline.plugins.outputs.events.duration_in_millis
(gauge)
Duration of events in the output plugin.
Shown as millisecond
logstash.pipeline.plugins.filters.events.in
(gauge)
Number of events into the filter plugin.
logstash.pipeline.plugins.filters.events.out
(gauge)
Number of events out from the filter plugin.
logstash.pipeline.plugins.filters.events.duration_in_millis
(gauge)
Duration of events in the filter plugin.
Shown as millisecond
logstash.pipeline.queue.capacity.max_queue_size_in_bytes
(gauge)
Maximum queue capacity in bytes of a persistent queue.
Shown as byte
logstash.pipeline.queue.capacity.max_unread_events
(gauge)
Maximum unread events allowed in a persistent queue.
logstash.pipeline.queue.capacity.page_capacity_in_bytes
(gauge)
Queue page capacity in bytes of a persistent queue.
Shown as byte
logstash.pipeline.queue.capacity.queue_size_in_bytes
(gauge)
Disk used in bytes of a persistent queue.
Shown as byte
logstash.pipeline.queue.events
(gauge)
Number of events in a persistent queue.

イベント

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

サービスのチェック

logstash.can_connect
Returns Critical if the Agent cannot connect to Logstash to collect metrics, returns OK otherwise.
Statuses: ok, critical

トラブルシューティング

Agent が接続できない

    logstash
    -------
      - instance #0 [ERROR]: "('Connection aborted.', error(111, 'Connection refused'))"
      - Collected 0 metrics, 0 events & 1 service check

conf.yaml 内の url が正しいかどうかを確認してください。

それでも解決できない場合は、Datadog のサポートチームまでお問い合わせください。