Platform logging

Google Health API integrates with Cloud Logging to provide third-party clients with detailed insights into the status and outcomes of webhook notification deliveries. This logging integration empowers clients to monitor, troubleshoot, and verify the reliability of data delivery to their registered endpoints.

Overview

When relevant user data changes occur in the Google Health platform, the platform sends a webhook notification to the third-party client's pre-registered endpoint as an HTTP request. Platform logging captures the transaction details of these delivery attempts—including HTTP status codes, headers, and response payloads—and automatically routes them to the client's Google Cloud project.

For more information about Cloud Logging log entries, see the Cloud Logging platform log entries documentation.

Monitored Resource

In Cloud Logging, log entries are grouped under a Monitored Resource. Webhook notification log entries for the Google Health API are associated with the individual subscriber instance resource type:

  • Resource Type: health.googleapis.com/Subscriber

Each log entry is labeled to uniquely identify the affected subscriber instance using the following labels:

  • resource_container: The Google Cloud project ID (or the relevant organization ID or folder ID) that owns the subscriber resource.
  • subscriber_id: The unique subscriber ID assigned by the client upon the subscriber's creation.
  • location: Set to global, as subscriber definitions are not regionalized.

These labels enable you to query and filter log entries specific to a single subscriber in the Google Cloud Console's Log Explorer.

Log Structure and Details

  • Log Name: projects/<PROJECT_ID>/logs/health.googleapis.com%2Fwebhook_notification
  • Payload Type: Contains a WebhookNotificationCloudLog structure wrapping the google.rpc.HttpResponse details of the delivery attempt.
  • Log Labels:
    • dataType: The data type associated with the subscription (e.g., NUTRITION, SLEEP).

Filter log entries

You can filter webhook log entries in the Log Explorer using queries. For example, to find all log entries related to webhook deliveries:

resource.type="health.googleapis.com/Subscriber"
logName="projects/<PROJECT_ID>/logs/health.googleapis.com%2Fwebhook_notification"

To further narrow down your search to a specific subscriber or data type, you can append additional filter criteria:

resource.labels.subscriber_id="YOUR_SUBSCRIBER_ID"
labels.dataType="SLEEP"