View a markdown version of this page

オブザーバビリティツールに接続する - Amazon SageMaker AI

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

オブザーバビリティツールに接続する

Amazon CloudWatch の SageMaker AI Insights ダッシュボードを使用する代わりに、既存のオブザーバビリティツールから詳細なオブザーバビリティメトリクスをクエリするために、SageMaker AI はAmazon CloudWatch Managed Grafana、セルフホスト型 Grafana、その他の PromQL 互換プラットフォームなどの Prometheus ベースのツールと互換性のあるリージョンの PromQL エンドポイントを介してメトリクスを Amazon PromQL に発行します。 AWS 署名バージョン 4 (SigV4) を使用して認証します。このセクションでは、Prometheus データソースの設定、事前設定されたダッシュボードテンプレートのインポート、推論メトリクスの PromQL クエリの書き込みを行う方法について説明します。

PromQL エンドポイントと認証

PromQL 接続設定
設定 値
エンドポイント URL https://monitoring.region.amazonaws.com
Auth 署名バージョン 4 (SigV4)
サービス monitoring
必要なアクセス許可 cloudwatch:QueryMetrics, cloudwatch:GetMetricData, cloudwatch:ListMetrics

Grafana での Prometheus データソースの設定

オプション 1: Amazon Managed Prometheus (AMG に推奨)

  1. AMG ワークスペースを開く → データソース → 追加 → Amazon Managed Service for Prometheus

  2. 名前: SageMaker Inference (PromQL) region

  3. URL: https://monitoring.region.amazonaws.com

  4. デフォルトのリージョン: region

  5. サービス:monitoring

  6. 保存してテストするをクリックします

SageMaker Inference PromQL の Amazon Managed Grafana データソース設定。

オプション 2: Standard Prometheus データソース

{ "name": "SageMaker Inference (PromQL)", "type": "prometheus", "url": "https://monitoring.region.amazonaws.com", "access": "proxy", "jsonData": { "sigV4Auth": true, "sigV4AuthType": "default", "sigV4Region": "region", "sigV4Service": "monitoring", "httpMethod": "POST" } }

IAM ポリシー

{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": [ "cloudwatch:QueryMetrics", "cloudwatch:DescribeMetrics", "cloudwatch:GetMetricData", "cloudwatch:ListMetrics" ], "Resource": "*" }] }

ダッシュボードテンプレートのインポート

  1. SageMaker AI コンソール → エンドポイント → 「オブザーバビリティツールに接続する」 → ダッシュボードテンプレートタブ

  2. Grafana テンプレートのダウンロード (JSON) をクリックします。

  3. Grafana の場合: ダッシュボード → インポート → JSON のアップロード

  4. データソースの選択 → インポート

テンプレートには、SageMaker AI Insights ダッシュボードに一致する 3 つのセクション (パフォーマンス、キャパシティ、信頼性) があります。

Grafana データソースの選択とインポート手順を示すダッシュボードテンプレートのインポートワークフロー。

PromQL で利用可能な OTel ラベル

PromQL では、ドット付きのラベルは一重引用符で囲む必要があります。

OTel ラベル
ラベル 説明
'aws.sagemaker.endpoint.name' エンドポイント名
'aws.sagemaker.inference_component.name' IC 名
'aws.sagemaker.inference_framework' フレームワーク (vllm、sglang)
'aws.sagemaker.variant.name' バリアント名
@resource.host.id [インスタンス ID]
@resource.cloud.availability_zone アベイラビリティーゾーン
@resource.host.type インスタンスタイプ

PromQL クエリの例

# GPU utilization per IC avg by ('aws.sagemaker.inference_component.name') ( DCGM_FI_DEV_GPU_UTIL{'aws.sagemaker.endpoint.name'="$endpoint"}) # Token throughput (total TPS) sum(rate(vllm_prompt_tokens_total{'aws.sagemaker.endpoint.name'="$endpoint"}[5m])) + sum(rate(vllm_generation_tokens_total{'aws.sagemaker.endpoint.name'="$endpoint"}[5m])) # TTFT P99 histogram_quantile(0.99, sum by (le) ( rate(vllm_time_to_first_token_seconds_bucket{'aws.sagemaker.endpoint.name'="$endpoint"}[5m]))) # KV cache utilization avg(vllm_kv_cache_usage_perc{'aws.sagemaker.endpoint.name'="$endpoint"}) # Queue depth per IC sum by ('aws.sagemaker.inference_component.name') ( vllm_num_requests_waiting{'aws.sagemaker.endpoint.name'="$endpoint"}) # CPU utilization (computed) 100 * (1 - avg by ('aws.sagemaker.endpoint.name') ( rate(node_cpu_seconds_total{mode="idle",'aws.sagemaker.endpoint.name'="$endpoint"}[5m]))) # Error rate (5XX) sum(rate(Response_5XX_total{'aws.sagemaker.endpoint.name'="$endpoint"}[5m]))