플랫폼 로그 사용

이 페이지에서는 Cloud Logging의 일부로 AML AI에서 생성된 플랫폼 로그를 사용하는 방법을 설명합니다. AML AI는 Logging API 서비스 이름 financialservices.googleapis.com을 사용하여 다음 활동을 로깅합니다.

  • 엔진 구성 생성(조정)
  • 모델 생성(학습)
  • 백테스트 작업
  • 예측 작업

시작하기 전에

로그를 보고 관리하려면 올바른 IAM 권한 및 역할이 있어야 합니다.

플랫폼 로깅 활성화 상태

AML AI의 플랫폼 로그는 항상 활성 상태(사용 중지할 수 없음)입니다.

로그 심각도

AML AI 로그 항목은 세 가지 심각도 수준을 사용합니다.

  • NOTICE: 작업이 시작되거나 성공할 때 전송되는 항목
  • ERROR: 실패한 작업의 종료에 대한 항목
  • INFO: 작업 진행 상황에 대한 항목

플랫폼 로그 보기

플랫폼 로그를 보려면 다음 안내를 따르세요.

콘솔

Google Cloud 콘솔에서 플랫폼 로그를 보려면 다음 안내를 따르세요.

  1. 로그 탐색기로 이동합니다.

    로그 탐색기로 이동

  2. 적합한 Google Cloud 프로젝트를 선택합니다.

  3. 쿼리 필드에 다음 쿼리 명령어를 입력합니다.

    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입니다.

  4. 쿼리 실행을 클릭합니다.

로그 탐색기에 대한 자세한 내용은 로그 탐색기 개요로그 탐색기 사용을 참조하세요.

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입니다.

Cloud Logging에서 gcloud 도구를 사용하는 방법에 대한 자세한 내용은 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

로그 탐색기 쿼리 필드에 명령어를 추가하여 표시되는 로그의 범위를 좁힐 수 있습니다.

선택한 데이터 세트에서 시작된 모든 예측 실행을 표시하려면 다음 명령어를 추가합니다.

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가 사용된 로그는 작업의 진행 상태를 알려줍니다.

다음은 모델 생성의 로그 예시입니다. completedTaskCounttaskCount는 모델 학습의 진행 상황을 추정하는 데 사용할 수 있습니다.

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