简体   繁体   中英

Can Vertex AI model monitoring job send a pubsub message instead of email?

I have been using this example of creating a Vertex AI monitoring job. It sends an email.

alerting_config = vertex_ai_beta.ModelMonitoringAlertConfig(
email_alert_config=vertex_ai_beta.ModelMonitoringAlertConfig.EmailAlertConfig(
    user_emails=NOTIFY_EMAILS
)

Is there any way to instead send a Pubsub message?

You can configure the alert to be sent to Cloud Logging . To enable Cloud Logging alerts you have to set the enableLogging field on your ModelMonitoringAlertConfig configuration to TRUE . Then you can forward the logs to any service that Cloud Logging supports, Pub/Sub is one of these.

For this you'll need one of the following permissions:

  • Owner (roles/owner)
  • Logging Admin (roles/logging.admin)
  • Logs Configuration Writer (roles/logging.configWriter)

Then you need to create a sink .

After that you have created the sink you'll need to set the destination permissions .

While Cloud Logging provides you with the ability to exclude logs from being ingested, you might want to consider keeping logs that help with supportability. Using these logs can help you quickly troubleshoot and identify issues with your applications.

Logs routed to Pub/Sub are generally available within seconds, with 99% of logs available in less than 60 seconds.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM