概要

ユニバーサルサービスモニタリングは、一般的なコンテナタグ (appshort_imagekube_deployment など) を使用してサービスを検出し、それらのサービスのサービスカタログにエントリーを生成します。

You can access request, error, and duration metrics in Datadog for both inbound and outbound traffic on all services discovered with Universal Service Monitoring. These service health metrics are useful for creating alerts, tracking deployments, and getting started with service level objectives (SLOs) so you can get broad visibility into all services running on your infrastructure.

BITSBOUTIQUE のユニバーサルサービスモニタリング SLO

このガイドでは、universal.http.* などの USM メトリクスを検索して、モニター、SLO、ダッシュボードで使用する方法について説明します。

USM メトリクスと APM メトリクスの比較

メトリクス名単位タイプ説明
universal.http.clientDistributionアウトバウンドリクエストのレイテンシー、カウント、エラー、およびレート。
universal.http.client.hitsHitsカウントアウトバウンドリクエストとエラーの合計数。
universal.http.client.apdexスコアGaugeこのサービスのアウトバウンドリクエストの Apdex スコア。
universal.http.serverDistributionインバウンドリクエストのレイテンシー、カウント、エラー、およびレート。
universal.http.server.hitsHitsカウントインバウンドリクエストとエラーの合計数。
universal.http.server.apdexスコアGaugeこの Web サービスの Apdex スコア。

APM メトリクスとは異なり、エラーは別のメトリクスとしてではなく、error:true タグの下で利用可能です。

Note: The .hits metrics have all of your infrastructure tags and are the recommended way to query request and error counts. You can also add second primary tags to all USM metrics.

メトリクス構文

The USM metric query syntax differs from the APM metric query syntax, which uses trace.*. USM Metrics fall under a single distribution metric name.

例:

APMUSM
trace.universal.http.client.hits{*}count:universal.http.client{*}
trace.universal.http.client.errorscount:universal.http.client{error:true}
trace.universal.http.client.hits.by_http_statuscount:universal.http.client{*} by http_status_family
pXX:trace.universal.http.client{*}pXX:universal.http.client{*}
trace.universal.http.client.apdex{*}universal.http.client.apdex{*}

The same translations apply for the universal.http.server operation that captures inbound traffic. For more information about distribution metrics, see DDSketch-based Metrics in APM.

使用方法

Navigate to Infrastructure > Universal Service Monitoring, filter by Universal Service Monitoring telemetry type, and click on a service. The Performance tab displays service-level graphs on hits, latency, requests, errors, and more. You can also access these metrics when creating a monitor or an SLO, or by looking at a dashboard in the Service Catalog.

モニターを作成

You can create an APM Monitor to trigger an alert when a USM metric such as universal.http.client either crosses a threshold or deviates from an expected pattern.

  1. Navigate to Monitors > New Monitor and click APM.
  2. Select APM Metrics and define a service or resource’s env and any other primary tags. Select a service or resource to monitor and define time interval for the monitor to evaluate the query over.
  3. Threshold Alert を選択し、トリガーするモニターのために Requests per Second のような USM メトリクスを選択します。次に、アラートと警告のしきい値をまたはにするかどうかを定義します。アラートしきい値、およびオプションで警告しきい値に値を入力します。
  4. 通知セクションには、このモニター用にあらかじめ入力されたメッセージが含まれています。アラート名とメッセージをカスタマイズし、このモニターの権限を定義します。
  5. Create をクリックします。
BITSBOUTIQUE のユニバーサルサービスモニタリングモニター

For more information, see the APM Monitor documentation.

SLO を作成する

You can create an SLO on a per-service basis to ensure you are meeting objectives set by USM metrics and improving availability over time. Datadog recommends creating an SLO programmatically to cover a lot of services.

サービスカタログから SLO を作成するには

  1. Navigate to the Reliability tab of the Service Catalog.
  2. SLOs 列で、サービスにカーソルを合わせ、+ Create Availability SLO または + Create Latency SLO をクリックします。
BITSBOUTIQUE のユニバーサルサービスモニタリング SLO を設定する

オプションで、USM メトリクスを使用して SLO を手動で作成するには

  1. Navigate to Service Management > SLOs and click New SLO.

  2. Metric Based を選択し、Good events (numerator) セクションで 2 つのクエリを作成します。

    • クエリ A: universal.http.server のような USM メトリクスを入力し、from フィールドにプライマリ serviceenv タグを追加して特定のサービスにフィルターし、as フィールドで count を選択します。
    • クエリ B: universal.http.server のような USM メトリクスを入力し、from フィールドに error:true タグに加えて、プライマリ serviceenv タグを追加して特定のサービスにフィルターし、as フィールドで count を選択します。
  3. + Add Formula をクリックし、a-b と入力します。

  4. Total events (denominator) セクションでは、universal.http.server のような USM メトリクスを入力し、from フィールドにプライマリ serviceenv タグを追加して特定のサービスにフィルターし、as フィールドで count を選択します。

  5. + New Target をクリックすると、以下の設定でターゲットしきい値が作成されます。

    • タイムウィンドウは 7 Days、ターゲットしきい値は 95%、警告しきい値は 99.5% です。Datadog では、すべてのタイムウィンドウで同じターゲットしきい値を設定することを推奨しています。
  6. この SLO の名前と説明を入力します。team タグに加えて、プライマリ envservice タグを設定します。

  7. Save and Set Alert をクリックします。

BITSBOUTIQUE のユニバーサルサービスモニタリング SLO を設定する

For more information, see the Service Level Objectives documentation.

定義されたダッシュボードにアクセスする

サービスカタログでは、サービス定義ファイルに定義されたダッシュボードを識別し、Dashboards タブに一覧表示します。Manage Dashboards をクリックすると、GitHub で直接サービス定義にアクセスし編集することができます。

サービスカタログのサービスの Dashboards タブにある Manage Dashboards ボタン

For more information, see the Dashboards documentation.

その他の参考資料

PREVIEWING: bartol/timeshift-docs