ran prettier

This commit is contained in:
Larissa Wandzura
2026-01-14 15:04:56 -06:00
parent 0382bec6c7
commit c34766014c
7 changed files with 52 additions and 57 deletions
@@ -127,10 +127,10 @@ The following documents will help you get started with the Google Cloud Monitori
The Google Cloud Monitoring data source supports the following query types: The Google Cloud Monitoring data source supports the following query types:
| Query type | Description | | Query type | Description |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------- | | ----------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| **Metrics** | Query time series data from GCP resources using the Monitoring Query Language (MQL) or the visual builder. | | **Metrics** | Query time series data from GCP resources using the Monitoring Query Language (MQL) or the visual builder. |
| **Service Level Objectives (SLOs)** | Query SLO data defined in Google Cloud Monitoring to track service reliability and error budgets. | | **Service Level Objectives (SLOs)** | Query SLO data defined in Google Cloud Monitoring to track service reliability and error budgets. |
## Additional features ## Additional features
@@ -74,12 +74,12 @@ Before you create alert rules, ensure the following:
The following query types support alerting: The following query types support alerting:
| Query type | Use case | Notes | | Query type | Use case | Notes |
| ------------------------------- | ----------------------------------------------------- | -------------------------------------------------- | | ---------------------------------- | ------------------------------------------------------ | -------------------------------------------------- |
| **Builder** | Threshold-based alerts on GCP resource metrics | Best suited for alerting; returns time-series data | | **Builder** | Threshold-based alerts on GCP resource metrics | Best suited for alerting; returns time-series data |
| **MQL** | Complex metric queries using Monitoring Query Language | Use for advanced filtering and aggregations | | **MQL** | Complex metric queries using Monitoring Query Language | Use for advanced filtering and aggregations |
| **Service Level Objectives (SLO)** | Alert on SLO compliance, error budgets, or burn rate | Monitor service reliability | | **Service Level Objectives (SLO)** | Alert on SLO compliance, error budgets, or burn rate | Monitor service reliability |
| **PromQL** | Prometheus-style queries on GCP metrics | Familiar syntax for Prometheus users | | **PromQL** | Prometheus-style queries on GCP metrics | Familiar syntax for Prometheus users |
{{< admonition type="note" >}} {{< admonition type="note" >}}
Alert queries must return numeric data that Grafana can evaluate against a threshold. Queries that return only text or non-numeric data can't be used directly for alerting. Alert queries must return numeric data that Grafana can evaluate against a threshold. Queries that return only text or non-numeric data can't be used directly for alerting.
@@ -89,10 +89,10 @@ Alert queries must return numeric data that Grafana can evaluate against a thres
Alerting rules run as background processes without a user context. Both supported authentication methods work with alerting: Alerting rules run as background processes without a user context. Both supported authentication methods work with alerting:
| Authentication method | Supported | | Authentication method | Supported |
| ------------------------------ | --------- | | --------------------------- | --------- |
| Google JWT File | ✓ | | Google JWT File | ✓ |
| GCE Default Service Account | ✓ | | GCE Default Service Account | ✓ |
## Create an alert rule ## Create an alert rule
@@ -262,4 +262,3 @@ For additional troubleshooting help, refer to [Troubleshoot Google Cloud Monitor
- [Create alert rules](ref:create-alert-rule) - [Create alert rules](ref:create-alert-rule)
- [Create recording rules](ref:recording-rules) - [Create recording rules](ref:recording-rules)
- [Google Cloud Monitoring query editor](ref:query-editor) - [Google Cloud Monitoring query editor](ref:query-editor)
@@ -90,4 +90,3 @@ To create annotations for uptime check failures:
1. Set the **Text** to: `Region: {{resource.label.zone}}` 1. Set the **Text** to: `Region: {{resource.label.zone}}`
This creates an annotation marker on your graph each time an uptime check fails. This creates an annotation marker on your graph each time an uptime check fails.
@@ -120,25 +120,25 @@ The following are configuration options for the Google Cloud Monitoring data sou
Configure how Grafana authenticates with Google Cloud. Configure how Grafana authenticates with Google Cloud.
| Setting | Description | | Setting | Description |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Authentication type** | Select the authentication method. Choose **Google JWT File** to use a service account key file, or **GCE Default Service Account** if Grafana is running on a GCE virtual machine. | | **Authentication type** | Select the authentication method. Choose **Google JWT File** to use a service account key file, or **GCE Default Service Account** if Grafana is running on a GCE virtual machine. |
### JWT Key Details ### JWT Key Details
These settings appear when you select **Google JWT File** as the authentication type. These settings appear when you select **Google JWT File** as the authentication type.
| Setting | Description | | Setting | Description |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **JWT token** | Upload or paste your Google JWT token. You can drag and drop a `.json` key file, click **Click to browse files** to upload, or use **Paste JWT Token** or **Fill In JWT Token manually**. | | **JWT token** | Upload or paste your Google JWT token. You can drag and drop a `.json` key file, click **Click to browse files** to upload, or use **Paste JWT Token** or **Fill In JWT Token manually**. |
### Service account impersonation ### Service account impersonation
Use service account impersonation to have Grafana authenticate as a different service account than the one provided in the JWT token. Use service account impersonation to have Grafana authenticate as a different service account than the one provided in the JWT token.
| Setting | Description | | Setting | Description |
| -------------------------------- | ----------------------------------------------------------------------------------------------------- | | ---------------------------------- | --------------------------------------------------------------------------------------------------- |
| **Enable** | Toggle to enable service account impersonation. | | **Enable** | Toggle to enable service account impersonation. |
| **Service account to impersonate** | Enter the email address of the service account to impersonate when making requests to Google Cloud. | | **Service account to impersonate** | Enter the email address of the service account to impersonate when making requests to Google Cloud. |
### Private data source connect ### Private data source connect
@@ -147,8 +147,8 @@ _Only available for Grafana Cloud._
Use private data source connect (PDC) to connect to and query data within a secure network without opening that network to inbound traffic from Grafana Cloud. For more information on how PDC works, refer to [Private data source connect](ref:private-data-source-connect). For steps on setting up a PDC connection, refer to [Configure Grafana private data source connect (PDC)](ref:configure-pdc). Use private data source connect (PDC) to connect to and query data within a secure network without opening that network to inbound traffic from Grafana Cloud. For more information on how PDC works, refer to [Private data source connect](ref:private-data-source-connect). For steps on setting up a PDC connection, refer to [Configure Grafana private data source connect (PDC)](ref:configure-pdc).
| Setting | Description | | Setting | Description |
| ------------------------------- | ------------------------------------------------------------------------------- | | ------------------------------- | --------------------------------------------------------------------------- |
| **Private data source connect** | Select a PDC connection from the drop-down menu or create a new connection. | | **Private data source connect** | Select a PDC connection from the drop-down menu or create a new connection. |
### Save and test ### Save and test
@@ -313,4 +313,3 @@ resource "grafana_data_source" "google_cloud_monitoring" {
``` ```
For all available configuration options, refer to the [Grafana provider data source resource documentation](https://registry.terraform.io/providers/grafana/grafana/latest/docs/resources/data_source). For all available configuration options, refer to the [Grafana provider data source resource documentation](https://registry.terraform.io/providers/grafana/grafana/latest/docs/resources/data_source).
@@ -45,10 +45,10 @@ Before you configure authentication, ensure you have the following:
The Google Cloud Monitoring data source supports the following authentication methods: The Google Cloud Monitoring data source supports the following authentication methods:
| Method | Use case | | Method | Use case |
| -------------------------------- | --------------------------------------------------------------------------------------------- | | --------------------------------- | --------------------------------------------------------------------------------------------------- |
| **Google JWT File** | Use when Grafana runs outside of GCP, or when you need explicit control over credentials. | | **Google JWT File** | Use when Grafana runs outside of GCP, or when you need explicit control over credentials. |
| **GCE Default Service Account** | Use when Grafana runs on a Google Compute Engine VM with a configured service account. | | **GCE Default Service Account** | Use when Grafana runs on a Google Compute Engine VM with a configured service account. |
| **Service account impersonation** | Use when you need Grafana to act as a different service account than the one it authenticates with. | | **Service account impersonation** | Use when you need Grafana to act as a different service account than the one it authenticates with. |
## Use a Google Service Account key file ## Use a Google Service Account key file
@@ -43,12 +43,12 @@ For general documentation on querying data sources in Grafana, see [Query and tr
The Google Cloud Monitoring query editor supports the following query types: The Google Cloud Monitoring query editor supports the following query types:
| Query type | Description | | Query type | Description |
| --------------------------------------- | ------------------------------------------------------------------------------------------------ | | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| [**Builder**](#query-metrics) | Build metrics queries visually by selecting a service, metric, filters, and aggregation options. | | [**Builder**](#query-metrics) | Build metrics queries visually by selecting a service, metric, filters, and aggregation options. |
| [**MQL**](#use-the-monitoring-query-language) | Write queries using the Monitoring Query Language for advanced use cases. | | [**MQL**](#use-the-monitoring-query-language) | Write queries using the Monitoring Query Language for advanced use cases. |
| [**Service Level Objectives (SLO)**](#query-service-level-objectives) | Query SLO data to track service reliability and error budgets. | | [**Service Level Objectives (SLO)**](#query-service-level-objectives) | Query SLO data to track service reliability and error budgets. |
| [**PromQL**](#query-with-promql) | Write Prometheus-style queries against Google Cloud Monitoring metrics. | | [**PromQL**](#query-with-promql) | Write Prometheus-style queries against Google Cloud Monitoring metrics. |
## Query metrics ## Query metrics
@@ -244,9 +244,9 @@ Press `Shift+Enter` to run the query.
The following options are available for MQL queries: The following options are available for MQL queries:
| Setting | Description | | Setting | Description |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Alias by** | Control the format of legend keys. Refer to [Set alias patterns for MQL queries](#set-alias-patterns-for-mql-queries) for available patterns. | | **Alias by** | Control the format of legend keys. Refer to [Set alias patterns for MQL queries](#set-alias-patterns-for-mql-queries) for available patterns. |
| **Graph period** | Enable the toggle to override the default time period. Select a period from the dropdown to control the granularity of the returned time series data. | | **Graph period** | Enable the toggle to override the default time period. Select a period from the dropdown to control the granularity of the returned time series data. |
### Set alias patterns for MQL queries ### Set alias patterns for MQL queries
@@ -314,8 +314,8 @@ To create a PromQL query:
The following options are available for PromQL queries: The following options are available for PromQL queries:
| Setting | Description | | Setting | Description |
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Min step** | Defines the lower bounds on the interval between data points. For example, set this to `1h` to hint that measurements are taken hourly. Supports the `$__interval` and `$__rate_interval` macros. | | **Min step** | Defines the lower bounds on the interval between data points. For example, set this to `1h` to hint that measurements are taken hourly. Supports the `$__interval` and `$__rate_interval` macros. |
### PromQL query examples ### PromQL query examples
@@ -339,4 +339,3 @@ compute_googleapis_com:instance_cpu_utilization{instance_name="my-instance"}
```promql ```promql
rate(logging_googleapis_com:log_entry_count[5m]) rate(logging_googleapis_com:log_entry_count[5m])
``` ```
@@ -66,13 +66,13 @@ These errors occur when GCP credentials are invalid, missing, or don't have the
**Possible causes and solutions:** **Possible causes and solutions:**
| Cause | Solution | | Cause | Solution |
| -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Service account missing required permissions | Assign the **Monitoring Viewer** role to the service account in the GCP Console under **IAM & Admin** > **IAM**. Refer to [Configure Google Cloud Monitoring](ref:configure-gcm) for details. | | Service account missing required permissions | Assign the **Monitoring Viewer** role to the service account in the GCP Console under **IAM & Admin** > **IAM**. Refer to [Configure Google Cloud Monitoring](ref:configure-gcm) for details. |
| Incorrect service account key file | Verify the JSON key file was downloaded correctly and contains valid credentials. Generate a new key if necessary. | | Incorrect service account key file | Verify the JSON key file was downloaded correctly and contains valid credentials. Generate a new key if necessary. |
| Service account key has been deleted | Check the service account in GCP Console under **IAM & Admin** > **Service Accounts**. If the key was deleted, create a new one. | | Service account key has been deleted | Check the service account in GCP Console under **IAM & Admin** > **Service Accounts**. If the key was deleted, create a new one. |
| Wrong project selected | Verify the default project in the data source configuration matches a project the service account has access to. | | Wrong project selected | Verify the default project in the data source configuration matches a project the service account has access to. |
| APIs not enabled | Enable the Monitoring API and Cloud Resource Manager API in the GCP Console. Refer to [Configure Google Cloud Monitoring](ref:configure-gcm) for links. | | APIs not enabled | Enable the Monitoring API and Cloud Resource Manager API in the GCP Console. Refer to [Configure Google Cloud Monitoring](ref:configure-gcm) for links. |
### "Invalid JWT" or "JWT token error" ### "Invalid JWT" or "JWT token error"
@@ -161,13 +161,13 @@ These errors occur when querying Google Cloud Monitoring metrics.
**Possible causes and solutions:** **Possible causes and solutions:**
| Cause | Solution | | Cause | Solution |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | | ------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| Time range doesn't contain data | Expand the dashboard time range. GCP metrics have different retention periods based on the metric type. | | Time range doesn't contain data | Expand the dashboard time range. GCP metrics have different retention periods based on the metric type. |
| Wrong project selected | Verify you've selected the correct project in the query editor. | | Wrong project selected | Verify you've selected the correct project in the query editor. |
| Incorrect metric type | Verify the service, metric type, and metric are correct. Check available metrics in the GCP Console Metrics Explorer. | | Incorrect metric type | Verify the service, metric type, and metric are correct. Check available metrics in the GCP Console Metrics Explorer. |
| Missing labels/filters | Some metrics require specific label filters to return data. Try removing filters to see if data appears. | | Missing labels/filters | Some metrics require specific label filters to return data. Try removing filters to see if data appears. |
| Resource not emitting metrics | Verify the resource exists and is actively emitting metrics. Some metrics only populate under certain conditions. | | Resource not emitting metrics | Verify the resource exists and is actively emitting metrics. Some metrics only populate under certain conditions. |
### Metrics don't appear in drop-down ### Metrics don't appear in drop-down
@@ -336,4 +336,3 @@ If you've tried the solutions above and still encounter issues:
- Error messages (redact sensitive information) - Error messages (redact sensitive information)
- Steps to reproduce - Steps to reproduce
- Query configuration (redact credentials) - Query configuration (redact credentials)