ran prettier
This commit is contained in:
@@ -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:
|
||||
|
||||
| Query type | Description |
|
||||
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
||||
| **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. |
|
||||
| Query type | Description |
|
||||
| ----------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
||||
| **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. |
|
||||
|
||||
## Additional features
|
||||
|
||||
|
||||
@@ -74,12 +74,12 @@ Before you create alert rules, ensure the following:
|
||||
|
||||
The following query types support alerting:
|
||||
|
||||
| Query type | Use case | Notes |
|
||||
| ------------------------------- | ----------------------------------------------------- | -------------------------------------------------- |
|
||||
| **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 |
|
||||
| **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 |
|
||||
| Query type | Use case | Notes |
|
||||
| ---------------------------------- | ------------------------------------------------------ | -------------------------------------------------- |
|
||||
| **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 |
|
||||
| **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 |
|
||||
|
||||
{{< 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.
|
||||
@@ -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:
|
||||
|
||||
| Authentication method | Supported |
|
||||
| ------------------------------ | --------- |
|
||||
| Google JWT File | ✓ |
|
||||
| GCE Default Service Account | ✓ |
|
||||
| Authentication method | Supported |
|
||||
| --------------------------- | --------- |
|
||||
| Google JWT File | ✓ |
|
||||
| GCE Default Service Account | ✓ |
|
||||
|
||||
## 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 recording rules](ref:recording-rules)
|
||||
- [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}}`
|
||||
|
||||
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.
|
||||
|
||||
| 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. |
|
||||
|
||||
### JWT Key Details
|
||||
|
||||
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**. |
|
||||
|
||||
### Service account impersonation
|
||||
|
||||
Use service account impersonation to have Grafana authenticate as a different service account than the one provided in the JWT token.
|
||||
|
||||
| Setting | Description |
|
||||
| -------------------------------- | ----------------------------------------------------------------------------------------------------- |
|
||||
| **Enable** | Toggle to enable service account impersonation. |
|
||||
| Setting | Description |
|
||||
| ---------------------------------- | --------------------------------------------------------------------------------------------------- |
|
||||
| **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. |
|
||||
|
||||
### 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).
|
||||
|
||||
| Setting | Description |
|
||||
| ------------------------------- | ------------------------------------------------------------------------------- |
|
||||
| Setting | Description |
|
||||
| ------------------------------- | --------------------------------------------------------------------------- |
|
||||
| **Private data source connect** | Select a PDC connection from the drop-down menu or create a new connection. |
|
||||
|
||||
### 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).
|
||||
|
||||
|
||||
@@ -45,10 +45,10 @@ Before you configure authentication, ensure you have the following:
|
||||
|
||||
The Google Cloud Monitoring data source supports the following authentication methods:
|
||||
|
||||
| Method | Use case |
|
||||
| -------------------------------- | --------------------------------------------------------------------------------------------- |
|
||||
| **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. |
|
||||
| Method | Use case |
|
||||
| --------------------------------- | --------------------------------------------------------------------------------------------------- |
|
||||
| **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. |
|
||||
| **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
|
||||
|
||||
@@ -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:
|
||||
|
||||
| Query type | Description |
|
||||
| --------------------------------------- | ------------------------------------------------------------------------------------------------ |
|
||||
| [**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. |
|
||||
| [**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. |
|
||||
| Query type | Description |
|
||||
| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
|
||||
| [**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. |
|
||||
| [**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. |
|
||||
|
||||
## Query metrics
|
||||
|
||||
@@ -244,9 +244,9 @@ Press `Shift+Enter` to run the query.
|
||||
|
||||
The following options are available for MQL queries:
|
||||
|
||||
| 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. |
|
||||
| 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. |
|
||||
| **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
|
||||
@@ -314,8 +314,8 @@ To create a PromQL query:
|
||||
|
||||
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. |
|
||||
|
||||
### PromQL query examples
|
||||
@@ -339,4 +339,3 @@ compute_googleapis_com:instance_cpu_utilization{instance_name="my-instance"}
|
||||
```promql
|
||||
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:**
|
||||
|
||||
| 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. |
|
||||
| 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. |
|
||||
| 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. |
|
||||
| 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. |
|
||||
| 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. |
|
||||
| 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. |
|
||||
|
||||
### "Invalid JWT" or "JWT token error"
|
||||
|
||||
@@ -161,13 +161,13 @@ These errors occur when querying Google Cloud Monitoring metrics.
|
||||
|
||||
**Possible causes and solutions:**
|
||||
|
||||
| Cause | Solution |
|
||||
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| 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. |
|
||||
| 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. |
|
||||
| Resource not emitting metrics | Verify the resource exists and is actively emitting metrics. Some metrics only populate under certain conditions. |
|
||||
| Cause | Solution |
|
||||
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
||||
| 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. |
|
||||
| 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. |
|
||||
| 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
|
||||
|
||||
@@ -336,4 +336,3 @@ If you've tried the solutions above and still encounter issues:
|
||||
- Error messages (redact sensitive information)
|
||||
- Steps to reproduce
|
||||
- Query configuration (redact credentials)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user