CloudWatch 自带容器的指标 - Amazon SageMaker
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

CloudWatch 自带容器的指标

如果该publish_cloudwatch_metricsEnabled/opt/ml/processing/processingjobconfig.json文件Environment的地图中,则容器代码会在以下位置发出亚马逊 CloudWatch 指标:/opt/ml/output/metrics/cloudwatch

此文件的架构紧密基于 CloudWatch PutMetrics API。此处未指定命名空间。它默认为以下内容:

  • For real-time endpoints: /aws/sagemaker/Endpoint/data-metrics

  • For batch transform jobs: /aws/sagemaker/ModelMonitoring/data-metrics

不过,您可以指定维度。建议您至少添加以下维度:

  • EndpointMonitoringSchedule(对于实时端点)

  • MonitoringSchedule(对于批量转换作业)

以下 JSON 片段展示了如何设置维度。

对于实时端点,请参阅以下 JSON 片段,其中包含 EndpointMonitoringSchedule 维度:

{ "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 }