本页介绍了如何使用 AML AI 在 Cloud Logging 中生成的平台日志。AML AI 使用 Logging API 服务名称 financialservices.googleapis.com 记录以下活动:
- 引擎配置创建(调优)
- 模型创建(训练)
- 回测操作
- 预测操作
准备工作
如需查看和管理日志,请确保您拥有正确的 IAM 权限和角色。
平台日志记录激活状态
AML AI 的平台日志始终处于活动状态(无法关闭)。
日志严重级别
AML AI 日志条目使用三种严重级别:
NOTICE(对于在操作启动或成功时发送的条目)ERROR(用于记录失败操作的结束)INFO(适用于与操作进度相关的条目)
查看平台日志
如需查看平台日志,请按以下说明操作:
控制台
如需在 Google Cloud 控制台中查看平台日志,请执行以下操作:
导航到日志浏览器:
选择相应的 Google Cloud 项目。
在查询字段中,输入以下查询命令:
logName=("projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fbacktest" OR "projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fengine_config_creation" OR "projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fmodel_creation" OR "projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fprediction")其中:
PROJECT_ID是您要调试或监控的项目的 ID。例如my-project。点击运行查询。
gcloud
gcloud 命令行工具提供了 Cloud Logging 的命令行界面。
如需查看项目的日志,请运行以下命令:
gcloud logging read 'logName=("projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fbacktest" OR
"projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fengine_config_creation" OR
"projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fmodel_creation" OR
"projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fprediction")' --project=PROJECT_ID
其中,PROJECT_ID 是您的 Google Cloud 项目的 ID。
如需详细了解如何将 gcloud 工具与 Cloud Logging 搭配使用,请参阅 gcloud logging。
了解平台日志
本部分介绍了如何了解 AML AI 的特定平台日志。
START 日志
操作开始执行时,系统会生成包含 eventKind=START 的日志。
以下是启动预测运行的日志示例。
jsonPayload:
'@type': type.googleapis.com/google.cloud.financialservices.logging.v1.PredictionLog
engineVersion: projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/engineVersions/ENGINE_VERSION_ID
eventKind: START
predictionResult:
dataset: projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/datasets/DATASET_ID
endTime: '2023-05-31T00:00:00Z'
model: projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/models/MODEL_ID
outputs:
explainabilityDestination:
tableUri: bq://PROJECT_ID.DATASET_ID.EXPLAINABILITY_TABLE_ID
writeDisposition: WRITE_EMPTY
predictionDestination:
tableUri: bq://PROJECT_ID.DATASET_ID.PREDICTION_TABLE_ID
writeDisposition: WRITE_EMPTY
logName: projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fprediction
operation:
first: true
id: projects/PROJECT_NUMBER/locations/REGION_ID/operations/OPERATION_ID
producer: financialservices.googleapis.com
receiveTimestamp: '2023-06-07T12:30:48.417285528Z'
resource:
labels:
instance_id: INSTANCE_ID
location: REGION_ID
prediction_result_id: PREDICTION_ID
resource_container: projects/PROJECT_NUMBER
type: financialservices.googleapis.com/PredictionResult
您可以在 Logs Explorer 的查询字段中添加其他命令,以缩小显示的日志范围。
添加以下命令可显示所选数据集上已开始的所有预测运行:
logName="projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fprediction" AND jsonPayload.predictionResult.dataset="projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/datasets/DATASET_ID" AND jsonPayload.eventKind="START"
PROGRESS 日志
包含 eventKind=PROGRESS 的日志用于提供操作进度信息。
以下是创建模型的日志示例。completedTaskCount 与 taskCount 的对比结果可用于估算模型训练的进度。
jsonPayload:
'@type': type.googleapis.com/google.cloud.financialservices.logging.v1.ModelCreationLog
completedTaskCount: 11
engineVersion: projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/engineVersions/ENGINE_VERSION_ID
eventKind: PROGRESS
model:
endTime: '2023-05-31T00:00:00Z'
engineConfig: projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/engineConfigs/ENGINE_CONFIG_ID
engineVersion: projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/engineVersions/ENGINE_VERSION_ID
lineOfBusiness: RETAIL
primaryDataset: projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/datasets/DATASET_ID
state: CREATING
partyCount: '9246'
taskCount: 16
logName: projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fmodel_creation
operation:
id: projects/PROJECT_NUMBER/locations/REGION_ID/operations/OPERATION_ID
producer: financialservices.googleapis.com
receiveTimestamp: '2023-06-07T13:57:00.454668648Z'
resource:
labels:
instance_id: INSTANCE_ID
location: REGION_ID
model_id: MODEL_ID
resource_container: projects/PROJECT_NUMBER
type: financialservices.googleapis.com/Model
severity: INFO
timestamp: '2023-06-07T13:56:59.772973055Z'
END 日志
操作结束时,系统会生成包含 eventKind=END 的日志。
以下是引擎配置创建失败的日志示例。其中包含与所提供数据集中数据有误相关的错误。
jsonPayload:
'@type': type.googleapis.com/google.cloud.financialservices.logging.v1.EngineConfigCreationLog
completedTaskCount: 3
engineConfig:
engineVersion: projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/engineVersions/ENGINE_VERSION_ID
lineOfBusiness: RETAIL
performanceTarget:
partyInvestigationsPerPeriodHint: '100'
state: CREATING
tuning:
endTime: '2019-04-30T00:00:00Z'
primaryDataset: projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/datasets/DATASET_ID
eventKind: END
operationStatus:
code: 9
details:
- '@type': type.googleapis.com/google.rpc.ErrorInfo
domain: financialservices.googleapis.com
metadata:
count: '15'
data_field: party_id, validity_start_time
data_table: party
description: There is a duplicate primary key value in the database resulting
in unique key violation. Note that for tables with validity_start_time,
the primary key includes validity_start_time
test: GROUP BY party_id, validity_start_time HAVING count(1) > 1
reason: DUPLICATE_PRIMARY_KEY
message: Dataset validation failed with 1 error. See error details for individual
violations.
partyCount: '9246'
taskCount: 16
logName: projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fengine_config_creation
operation:
id: projects/PROJECT_NUMBER/locations/REGION_ID/operations/OPERATION_ID
last: true
producer: financialservices.googleapis.com
receiveTimestamp: '2023-06-07T14:26:30.214382295Z'
resource:
labels:
engine_config_id: ENGINE_CONFIG_ID
instance_id: INSTANCE_ID
location: REGION_ID
resource_container: projects/PROJECT_NUMBER
type: financialservices.googleapis.com/EngineConfig
severity: ERROR
timestamp: '2023-06-07T14:26:29.670913895Z'
如需查看所有创建引擎配置错误日志,请使用以下过滤条件:
logName="projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fengine_config_creation" AND severity>=ERROR