בדף הזה מוסבר איך להשתמש ביומני הפלטפורמה שנוצרו על ידי AML AI כחלק מ-Cloud Logging. AML AI משתמש בשם שירות ה-API של Logging financialservices.googleapis.com כדי לרשום ביומן את הפעילות של:
- יצירת הגדרות מנוע (כוונון)
- יצירת מודל (אימון)
- פעולות של בדיקה לאחור
- פעולות חיזוי
לפני שמתחילים
כדי לצפות ביומנים ולנהל אותם, צריך לוודא שיש לכם את ההרשאות והתפקידים הנכונים ב-IAM.
סטטוס ההפעלה של רישום ביומן בפלטפורמה
יומני הפלטפורמה של AML AI תמיד פעילים (אי אפשר להשבית אותם).
מידת החומרה ביומן
רשומות ביומן של AML AI משתמשות בשלוש רמות חומרה:
-
NOTICEעבור רשומות שנשלחות כשהפעולות מתחילות או מסתיימות בהצלחה -
ERRORעבור רשומות שקשורות לסיום של פעולות שנכשלו INFOלרשומות לגבי התקדמות הפעולה
צפייה ביומני הפלטפורמה
כדי לראות את יומני הפלטפורמה, פועלים לפי ההוראות הבאות:
המסוף
כדי לראות את יומני הפלטפורמה במסוף Google Cloud :
מנווטים אל Logs Explorer:
בוחרים את הפרויקט המתאים Google Cloud .
בשדה Query, מזינים את פקודת השאילתה הבאה:
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")where:
PROJECT_IDהוא מזהה הפרויקט שרוצים לנפות בו באגים או לעקוב אחריו. לדוגמה,my-project.לוחצים על Run query.
מידע נוסף על Logs Explorer זמין במאמרים סקירה כללית על Logs Explorer ושימוש ב-Logs Explorer.
gcloud
כלי שורת הפקודה של Google Cloud מספק ממשק שורת פקודה ל-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 .
למידע נוסף על השימוש בכלי 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"
יומן התקדמות
יומנים עם 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