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:
In the Cloud Platform Console, go to the Projects page.
Select your smart home project.
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:
In the Actions console, go to the Projects page.
Select your smart home project.
Choose the Analytics tab, and click Go to Google Cloud Platform.
Related resources
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.
- Logs-based metrics: Building additional metrics from Cloud Logging entries.
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. |
|
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:
In the Cloud Platform console, go to the Projects page.
Select your smart home project.
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.
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:
In the Actions console, go to the Projects page.
Select your smart home project.
Choose the Develop tab, and click Actions on the side bar.
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).
Related resources
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.