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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis page outlines how to view metrics for a FHIR store, including the types and number of FHIR resources, as well as the data size.\u003c/p\u003e\n"],["\u003cp\u003eThese metrics can be utilized to estimate future costs, monitor store growth, and ensure resource counts align with imported, created, or de-identified data.\u003c/p\u003e\n"],["\u003cp\u003eFHIR store metrics can be accessed through the Google Cloud console, by running a \u003ccode\u003egcloud\u003c/code\u003e command, or via a REST API call.\u003c/p\u003e\n"],["\u003cp\u003eThe Google Cloud console provides a visual interface with a metrics tab, which shows the total number of resource types, total number of resources, and total size of all resources.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egcloud\u003c/code\u003e command and REST API methods provide detailed data about the amount of each resource type and its size in bytes, via command line and JSON response, respectively.\u003c/p\u003e\n"]]],[],null,["# View FHIR store metrics\n\nThis page explains how to view the following metrics about a FHIR store:\n\n- The types of FHIR resources in the FHIR store\n- The number of each type of resource\n- The size of the data in the FHIR store\n\nYou can use the metrics to do the following:\n\n- Estimate future costs based on current usage.\n- Track how the FHIR store is growing and changing over time.\n- Ensure that the number of FHIR resources in a FHIR store matches the number you [imported](/healthcare-api/docs/how-tos/fhir-import-export), [created using a bundle](/healthcare-api/docs/how-tos/fhir-bundles), or [de-identified](/healthcare-api/docs/how-tos/fhir-deidentify).\n\nWhen you add or change FHIR resources, the resources are added\nto the FHIR store asynchronously. There might be a delay\nbetween when you make a change and when it appears in the metrics.\n\nThe following examples show how to view the metrics about a FHIR store. \n\n### Console\n\n1. In the Google Cloud console, go to the **Datasets** page.\n\n [Go to Datasets](https://console.cloud.google.com/healthcare/browser)\n2. Select the dataset containing the FHIR store whose metrics you want to view.\n The **Data stores** page is displayed.\n\n3. In the **Data stores** list, select the FHIR store whose metrics you want\n to view. The **Datastore details** page is displayed.\n\n4. Click the **Metrics** tab. The tab shows the following metrics:\n\n - **Total number of resource types**\n - **Total number of resources**\n - **Total size of all resources**\n5. View and filter metrics in the **Metrics** table. After you filter metrics,\n select a FHIR resource type to view information about all resources of\n that type in the [FHIR viewer](/healthcare-api/docs/how-tos/fhir-search#using_the_fhir_viewer).\n\n### gcloud\n\nRun the [`gcloud healthcare fhir-stores metrics`](/sdk/gcloud/reference/healthcare/fhir-stores/metrics) command.\n\n\nBefore using any of the command data below,\nmake the following replacements:\n\n- \u003cvar class=\"edit\" scope=\"PROJECT_ID\" translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project\n- \u003cvar class=\"edit\" scope=\"LOCATION\" translate=\"no\"\u003eLOCATION\u003c/var\u003e: the dataset location\n- \u003cvar class=\"edit\" scope=\"DATASET_ID\" translate=\"no\"\u003eDATASET_ID\u003c/var\u003e: the FHIR store's parent dataset\n- \u003cvar class=\"edit\" scope=\"FHIR_STORE_ID\" translate=\"no\"\u003eFHIR_STORE_ID\u003c/var\u003e: the FHIR store ID\n\n\nExecute the\n\nfollowing\n\ncommand:\n\n#### Linux, macOS, or Cloud Shell\n\n**Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n```bash\ngcloud healthcare fhir-stores metrics FHIR_STORE_ID \\\n --project=PROJECT_ID \\\n --location=LOCATION \\\n --dataset=DATASET_ID\n```\n\n#### Windows (PowerShell)\n\n**Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n```bash\ngcloud healthcare fhir-stores metrics FHIR_STORE_ID `\n --project=PROJECT_ID `\n --location=LOCATION `\n --dataset=DATASET_ID\n```\n\n#### Windows (cmd.exe)\n\n**Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n```bash\ngcloud healthcare fhir-stores metrics FHIR_STORE_ID ^\n --project=PROJECT_ID ^\n --location=LOCATION ^\n --dataset=DATASET_ID\n```\n\nYou should receive a response similar to the following:\n\n#### Response\n\n```\nmetrics:\n- count: 'FHIR_RESOURCE_TYPE_COUNT'\n resourceType: FHIR_RESOURCE_TYPE\n structuredStorageSizeBytes: 'FHIR_RESOURCE_TYPE_SIZE'\n...\nname: projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID\n```\n\n### REST\n\nUse the [`fhirStores.getFHIRStoreMetrics`](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores/getFHIRStoreMetrics)\nmethod.\n\n\nBefore using any of the request data,\nmake the following replacements:\n\n- \u003cvar class=\"edit\" scope=\"PROJECT_ID\" translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project\n- \u003cvar class=\"edit\" scope=\"LOCATION\" translate=\"no\"\u003eLOCATION\u003c/var\u003e: the dataset location\n- \u003cvar class=\"edit\" scope=\"DATASET_ID\" translate=\"no\"\u003eDATASET_ID\u003c/var\u003e: the FHIR store's parent dataset\n- \u003cvar class=\"edit\" scope=\"FHIR_STORE_ID\" translate=\"no\"\u003eFHIR_STORE_ID\u003c/var\u003e: the FHIR store ID\n\nTo send your request, choose one of these options: \n\n#### curl\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) , or by using [Cloud Shell](/shell/docs), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nExecute the following command:\n\n```\ncurl -X GET \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n \"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID:getFHIRStoreMetrics\"\n```\n\n#### PowerShell\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nExecute the following command:\n\n```\n$cred = gcloud auth print-access-token\n$headers = @{ \"Authorization\" = \"Bearer $cred\" }\n\nInvoke-WebRequest `\n -Method GET `\n -Headers $headers `\n -Uri \"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID:getFHIRStoreMetrics\" | Select-Object -Expand Content\n```\n\n#### APIs Explorer\n\n\nOpen the\n\n[method reference page](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores/getFHIRStoreMetrics).\nThe APIs Explorer panel opens on the right side of the page.\nYou can interact with this tool to send requests.\n\nComplete any required fields and click **Execute**.\n\nYou should receive a JSON response similar to the following:\n\n#### Response\n\n```\n{\n \"name\": \"projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID\",\n \"metrics\": [\n {\n \"resourceType\": \"FHIR_RESOURCE_TYPE\",\n \"count\": \"FHIR_RESOURCE_TYPE_COUNT\",\n \"structuredStorageSizeBytes\": \"FHIR_RESOURCE_TYPE_SIZE\"\n },\n ...\n ]\n}\n```\n\n\u003cbr /\u003e"]]