Auf dieser Seite wird beschrieben, wie Sie Plattformlogs verwenden, die von AML AI im Rahmen von Cloud Logging generiert werden. AML AI verwendet den Dienstnamen financialservices.googleapis.com der Logging API, um die Aktivitäten der folgenden Elemente zu protokollieren:
- Engine-Konfiguration erstellen (Abstimmung)
- Modellerstellung (Training)
- Backtest-Vorgänge
- Vorhersagevorgänge
Hinweise
Damit Sie Protokolle aufrufen und verwalten können, benötigen Sie die richtigen IAM-Berechtigungen und ‑Rollen.
Aktivierungsstatus des Plattform-Loggings
Die Plattformprotokolle für AML-KI sind immer aktiv und können nicht deaktiviert werden.
Logschweregrad
Für AML-KI-Logeinträge werden drei Schweregrade verwendet:
NOTICEfür Einträge, die gesendet werden, wenn Vorgänge gestartet oder erfolgreich abgeschlossen werdenERRORfür Einträge zum Ende fehlgeschlagener VorgängeINFOfür Einträge zum Fortschritt des Vorgangs
Plattformprotokolle ansehen
So rufen Sie Plattformprotokolle auf:
Console
So rufen Sie Plattformprotokolle in der Google Cloud Console auf:
Rufen Sie den Log-Explorer auf:
Wählen Sie das entsprechende Google Cloud Projekt aus.
Geben Sie im Feld Abfrage den folgenden Abfragebefehl ein:
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")Dabei gilt:
PROJECT_IDist die ID des Projekts, das Sie debuggen oder überwachen möchten. Beispiel:my-project.Klicken Sie auf Abfrage ausführen.
Weitere Informationen zum Log-Explorer finden Sie unter Log-Explorer – Übersicht und Log-Explorer verwenden.
gcloud
Das Befehlszeilentool „gcloud“ bietet eine Befehlszeile für Cloud Logging.
Führen Sie den folgenden Befehl aus, um die Protokolle für Ihr Projekt aufzurufen:
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
Dabei ist PROJECT_ID die ID Ihres Google Cloud Projekts.
Weitere Informationen zur Verwendung des gcloud-Tools mit Cloud Logging finden Sie unter gcloud logging.
Plattformlogs
In diesem Abschnitt wird beschrieben, wie Sie bestimmte Plattformprotokolle für AML AI lesen.
START-Protokoll
Logs mit eventKind=START werden generiert, wenn der Vorgang gestartet wird.
Im Folgenden finden Sie ein Beispiel für ein Protokoll zum Starten einer Vorhersageausführung.
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
Sie können im Feld Abfrage des Log-Explorers zusätzliche Befehle hinzufügen, um die angezeigten Logs einzugrenzen.
Fügen Sie den folgenden Befehl hinzu, um alle gestarteten Vorhersageläufe für ein ausgewähltes Dataset aufzurufen:
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-Protokoll
Logs mit eventKind=PROGRESS informieren über den Fortschritt eines Vorgangs.
Im folgenden Beispiel wird ein Protokoll zum Erstellen eines Modells gezeigt. Anhand von completedTaskCount und taskCount lässt sich der Fortschritt beim Modelltraining schätzen.
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-Protokoll
Logs mit eventKind=END werden am Ende des Vorgangs erstellt.
Im Folgenden finden Sie ein Beispiel für ein Protokoll einer fehlgeschlagenen Engine-Konfiguration. Er enthält den Fehler zu falschen Daten im bereitgestellten Datensatz.
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'
Mit dem folgenden Filter können Sie alle Fehlerprotokolle für die Engine-Konfiguration aufrufen:
logName="projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fengine_config_creation" AND severity>=ERROR