Join us online for the Google Smart Home Developer Summit on October 21st! Register here to learn what's new, and what's coming up for Google Smart Home.

Monitoring and logging

This document describes how to monitor usage of your smart home Actions and how to access event logs. You can access these features from your Google Cloud Project to debug issues you may encounter.

Monitoring

You can get helpful usage metrics about your Smart home Actions through Cloud Monitoring. You can create dashboards, set up alerts, and access metrics data programmatically.

Supported metrics

Cloud Monitoring monitors the assistant_action_project resource type, and provides the following metrics:

Metric Kind Description
smarthome_action/request_count DELTA Count of intent requests, labeled with execution_type, status, and trait.

execution_type (String): Smart home intent type.

status (String): Result of the request.

trait (String): Smart home device trait. Events without an associated trait include the label UNKNOWN.
smarthome_action/request_latencies CUMULATIVE, DISTRIBUTION Distribution of latencies for intent requests, labeled with execution_type, status, and trait.

execution_type (String): Smart home intent type.

status (String): Result of the request.

trait (String): Smart home device trait. Events without an associated trait include the label UNKNOWN.
smarthome_action/num_active_users GAUGE Daily active users, labeled with trait.

trait (String): Smart home device trait. Events without an associated trait include the label UNKNOWN.
smarthome_action/seven_day_active_users GAUGE Weekly active users, labeled with trait.

trait (String): Smart home device trait. Events without an associated trait include the label UNKNOWN.
smarthome_action/twenty_eight_day_active_users GAUGE Monthly active users, labeled with trait.

trait (String): Smart home device trait. Events without an associated trait include the label UNKNOWN.
smarthome_action/local_event_count DELTA Count of local events, labeled with intent, status, and app version.

intent (String): Local fulfillment intent type.

status (String): Result of the event.

version (String): App version for local fulfillment.

Accessing metrics

To access Cloud Monitoring for your project:

  1. In the Cloud Platform Console, go to the Projects page.

    Go to the Projects Page

  2. Select your smart home project.

  3. Under Operations, select Monitoring > Metrics explorer.

Smart home dashboard

Smart home projects have access to the SmartHome Analytics dashboard, which is pre-populated with the following charts to surface metrics for cloud and local fulfillment usage:

Chart Cloud Local Overall
Total Request Count
Request Success Percentage
Execution Breakdown
Query Breakdown
95th Percentile Latency
Active Users (Daily, Weekly, Monthly)
Smarthome Error Breakdown
Local Fulfillment Errors (Per App Version)
Mean Request Latency

To access the smart home dashboard for your project:

  1. In the Actions console, go to the Projects page.

    Open the Actions console

  2. Select your smart home project.

  3. Choose the Analytics tab, and click Go to Google Cloud Platform.

To learn more about using Cloud Monitoring in your project, see the following documentation:

  • Pricing: Details on free allotments and overage costs.
  • Quotas and limits: Details on limits and retention policies for monitoring usage.

Logging

You can access event logs for your smart home Actions via Cloud Logging. You can view them in the Cloud console, or export them to other applications via Google Cloud Pub/Sub.

Cloud Logging provides the following resource types:

Resource Type Display Name Description Labels
assistant_action_project Google Assistant Action Project A container for the Google Cloud Project associated with an Assistant Action.
  • project_id: The identifier of the Actions project associated with this resource, such as "my-project".

Smart home events

Your Actions console project supports the following events in Cloud Logging:

Cloud Logging Resource Event
Google Assistant Action Project SYNC intent errors
QUERY intent errors
EXECUTE intent errors
Notifications errors
Account linking errors
Local Home SDK HandlerError

Sync payload

The table below lists the schema of a syncLog entry:

Property Description
requestId Smart home intent request ID.
httpLatencyMsec Elapsed time before a response was received.
status Indicates the status of the intent response.

Execution payload

The table below lists the schema of an executionLog entry:

Property Description
requestId Smart home intent request ID.
latencyMsec Elapsed time before a response was received.
executionType Transport used for the request, such as "Cloud" or "Local".
actionType Optional indicator of the user action taken, such as "QUERY" or "EXECUTE". For EXECUTE actions, includes the command issued to fulfillment for supported traits.
trait Optional trait associated with this user action.
deviceTypes List of device types affected by the event.
isSuccess Whether the request received a successful response.
fallbackToCloud Whether the request routed to cloud fulfillment following an error from local fulfillment.
statusType Indicates the status of the intent response, such as "SUCCESS", "PENDING", or "OFFLINE". For "ERROR" responses, this property contains the errorCode provided by the fulfillment.
externalDebugString Optional detailed debugging message associated with this user action.
locale Language code associated with the request.

Notification payload

The table below lists the schema of a notificationLog entry:

Property Description
requestId Notification request ID.
structName Name of the notification struct, such as "ObjectDetection".
status Indicates the status of the notification.

Accessing logs

To access Cloud Logging for your project:

  1. In the Cloud Platform console, go to the Projects page.

    Go to the Projects Page

  2. Select your smart home project.

  3. Under Operations, select Logging > Logs Explorer.

Access to logging data is managed through Identity and Access Management (IAM) for users of your Actions project. For more details on roles and permissions for logging data, see Cloud Logging access control.

Log entries are retained for 30 days per the Cloud Logging retention policy, then scheduled for deletion. You can also delete entries on demand by using the Logs Explorer interface.

Querying logs

There are multiple systems within Google Cloud Platform that send logs to your project. You need to write queries filtering your logs to find the ones you need. Queries can be based on a Time Range, Resource or custom entries.

To specify a Time Range, select the time range UI dropdown in Logs Explorer and choose one of the provided options. This will filter logs that originate in the selected time range.

To specify a Resource, select the resource dropdown in Logs Explorer and choose Google Assistant Action Project. This will filter logs that originate from your Smart Home project.

You can also use the Query field in the Logs Explorer to enter custom entries. For example, the custom entry below would return errors that come from your smart home project, which originate from lights:

resource.type = "assistant_action_project" AND severity = ERROR AND jsonPayload.executionLog.executionResults.actionResults.device.deviceType = "LIGHT"

You can visit the Query Library to find more examples for querying logs effectively.

Log level setting

Smart home projects are set to receive error logs by default, and it is possible for developers to opt-in to receive success logs as well. This is especially useful during the development phase when you plan to capture all logs from a few agents. Additional charges may apply to your project if you exceed the free logging quota.

You can control the log level for your project by:

  1. In the Actions console, go to the Projects page.

    Open the Actions console

  2. Select your smart home project.

  3. Choose the Develop tab, and click Actions on the side bar.

  4. Select All in the Log control ingestion dropdown list.

Log exclusions

Log exclusions

Developers can create log exclusions using logging query language to further customize their logs in a more flexible way. Logging query language is also used by Logs Explorer, so you can use Logs Explorer to help creating a query.

You can follow the steps for creating exclusion filters at this guide (configure the exclusion filter for the _Default sink).

Log-based metrics

Developers can use Log-based metrics to track and analyze patterns within their logs. It is also possible to create custom charts and set up alerts on log-based metrics.

To start using log-based metrics for smart home, check out creating a counter log-based metric guide.

To learn more about using Cloud Logging in your project, see the following documentation:

  • Pricing: Details on free allotments and overage costs.
  • Quotas and limits: Details on limits and retention policies for logging usage.
  • Advanced logs queries: Guide to using advanced expressions to query and analyze log data.

Learning resources

We do provide additional learning resources for you to discover how you can use the monitoring and logging features for smart home debugging: