- 重要な情報
- はじめに
- 用語集
- ガイド
- エージェント
- インテグレーション
- OpenTelemetry
- 開発者
- API
- CoScreen
- アプリ内
- Service Management
- インフラストラクチャー
- アプリケーションパフォーマンス
- 継続的インテグレーション
- ログ管理
- セキュリティ
- UX モニタリング
- 管理
Supported OS
Logstash サービスからメトリクスをリアルタイムに取得して、以下のことができます。
Logstash チェックは Datadog Agent パッケージに含まれていないため、お客様自身でインストールする必要があります。
Agent v7.21 / v6.21 以降の場合は、下記の手順に従い Logstash チェックをホストにインストールします。Docker Agent または 上記バージョン以前の Agent でインストールする場合は、コミュニティインテグレーションの使用をご参照ください。
以下のコマンドを実行して、Agent インテグレーションをインストールします。
datadog-agent integration install -t datadog-logstash==<INTEGRATION_VERSION>
コアのインテグレーションと同様にインテグレーションを構成します。
Logstash のメトリクスとログの収集を開始するには、Agent のコンフィギュレーションディレクトリのルートにある conf.d/
フォルダーの logstash.d/conf.yaml
ファイルを編集します。使用可能なすべてのコンフィギュレーションオプションについては、サンプル logstash.d/conf.yaml を参照してください。
Logstash メトリクスの収集を開始するには、conf.yaml
ファイルに次の構成設定を追加します。
init_config:
instances:
# Logstash がモニタリング API を提供する URL。
# これは Logstash に関するさまざまなランタイムメトリクスを取得するために使用されます。
#
- url: http://localhost:9600
サーバーとポートを指定するように構成します。
使用可能なすべてのコンフィギュレーションオプションについては、サンプル conf.yaml を参照してください。
最後に、Agent を再起動すると、Datadog への Logstash メトリクスの送信が開始されます。
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
に設定し、host
と port
を状況に応じて更新します (デフォルトは 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
logstash
-------
- instance #0 [ERROR]: "('Connection aborted.', error(111, 'Connection refused'))"
- Collected 0 metrics, 0 events & 1 service check
conf.yaml
内の url
が正しいかどうかを確認してください。
それでも解決できない場合は、Datadog のサポートチームまでお問合せください。