本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
CloudWatch 自攜容器的指標
如果 publish_cloudwatch_metrics
值Enabled
位於 /opt/ml/processing/processingjobconfig.json
檔案的Environment
映射中,容器程式碼會在此位置發出 Amazon CloudWatch 指標:/opt/ml/output/metrics/cloudwatch
。
此檔案的結構描述以 PutMetrics
為基礎 CloudWatchAPI。此處未指定命名空間。它預設為下列項目:
-
For real-time endpoints: /aws/sagemaker/Endpoint/data-metrics
-
For batch transform jobs: /aws/sagemaker/ModelMonitoring/data-metrics
但是,您可以指定維度。建議您至少增加以下維度:
-
適用於即時端點的
Endpoint
和MonitoringSchedule
-
適用於批次轉換工作的
MonitoringSchedule
下列JSON程式碼片段說明如何設定維度。
如需即時端點,請參閱下列程式碼片段,其中包含 JSON Endpoint
和 MonitoringSchedule
維度:
{ "MetricName": "", # Required "Timestamp": "2019-11-26T03:00:00Z", # Required "Dimensions" : [{"Name":"Endpoint","Value":"endpoint_0"},{"Name":"MonitoringSchedule","Value":"schedule_0"}] "Value": Float, # Either the Value or the StatisticValues field can be populated and not both. "StatisticValues": { "SampleCount": Float, "Sum": Float, "Minimum": Float, "Maximum": Float }, "Unit": "Count", # Optional }
如需批次轉換任務,請參閱下列程式碼JSON片段,其中包含 MonitoringSchedule
維度:
{ "MetricName": "", # Required "Timestamp": "2019-11-26T03:00:00Z", # Required "Dimensions" : [{"Name":"MonitoringSchedule","Value":"schedule_0"}] "Value": Float, # Either the Value or the StatisticValues field can be populated and not both. "StatisticValues": { "SampleCount": Float, "Sum": Float, "Minimum": Float, "Maximum": Float }, "Unit": "Count", # Optional }