View FHIR store metrics

This page explains how to view the following metrics about a FHIR store:

  • The types of FHIR resources in the FHIR store
  • The number of each type of resource
  • The size of the data in the FHIR store

You can use the metrics to do the following:

  • Estimate future costs based on current usage.
  • Track how the FHIR store is growing and changing over time.
  • Ensure that the number of FHIR resources in a FHIR store matches the number you imported, created using a bundle, or de-identified.

When you add or change FHIR resources, the resources are added to the FHIR store asynchronously. There might be a delay between when you make a change and when it appears in the metrics.

The following examples show how to view the metrics about a FHIR store.

Console

  1. In the Google Cloud console, go to the Datasets page.

    Go to Datasets

  2. Select the dataset containing the FHIR store whose metrics you want to view. The Data stores page is displayed.

  3. In the Data stores list, select the FHIR store whose metrics you want to view. The Datastore details page is displayed.

  4. Click the Metrics tab. The tab shows the following metrics:

    • Total number of resource types
    • Total number of resources
    • Total size of all resources
  5. View and filter metrics in the Metrics table. After you filter metrics, select a FHIR resource type to view information about all resources of that type in the FHIR viewer.

gcloud

Run the gcloud healthcare fhir-stores metrics command.

Before using any of the command data below, make the following replacements:

  • PROJECT_ID: the ID of your Google Cloud project
  • LOCATION: the dataset location
  • DATASET_ID: the FHIR store's parent dataset
  • FHIR_STORE_ID: the FHIR store ID

Execute the following command:

Linux, macOS, or Cloud Shell

gcloud healthcare fhir-stores metrics FHIR_STORE_ID \
  --project=PROJECT_ID \
  --location=LOCATION \
  --dataset=DATASET_ID

Windows (PowerShell)

gcloud healthcare fhir-stores metrics FHIR_STORE_ID `
  --project=PROJECT_ID `
  --location=LOCATION `
  --dataset=DATASET_ID

Windows (cmd.exe)

gcloud healthcare fhir-stores metrics FHIR_STORE_ID ^
  --project=PROJECT_ID ^
  --location=LOCATION ^
  --dataset=DATASET_ID

You should receive a response similar to the following:

Response

metrics:
- count: 'FHIR_RESOURCE_TYPE_COUNT'
  resourceType: FHIR_RESOURCE_TYPE
  structuredStorageSizeBytes: 'FHIR_RESOURCE_TYPE_SIZE'
...
name: projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID

REST

Use the fhirStores.getFHIRStoreMetrics method.

Before using any of the request data, make the following replacements:

  • PROJECT_ID: the ID of your Google Cloud project
  • LOCATION: the dataset location
  • DATASET_ID: the FHIR store's parent dataset
  • FHIR_STORE_ID: the FHIR store ID

To send your request, choose one of these options:

curl

Execute the following command:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID:getFHIRStoreMetrics"

PowerShell

Execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID:getFHIRStoreMetrics" | Select-Object -Expand Content

APIs Explorer

Open the method reference page. The APIs Explorer panel opens on the right side of the page. You can interact with this tool to send requests. Complete any required fields and click Execute.

You should receive a JSON response similar to the following: