Google Cloud Platform (GCP) plugin
Monitor your GCP environment, including GKE, Hosts and more.
How to add the Google Cloud Platform plugin
Prerequisites
In the GCP console select your project and check that the following are enabled:
VMware Engine API, see GCP - Enabling the VMware Engine
Google Kubernetes Engine (GKE), see GCP - Enabling the Artifact Registry and Google Kubernetes Engine APIs
Cloud Monitoring API, see GCP - Enabling the Monitoring API
To view cost information in SquaredUp using the Cost data stream check the following:
Export your billing data to Google BigQuery: GCP - Export Cloud Billing data to BigQuery
Enable BigQuery API, see GCP - Enable the BigQuery API
GCP Service Account Configuration
Create a new Service Account, or edit an existing account.
Ensure the account has the role Viewer by adding the role Basic > Viewer.
To view cost information, the account also needs to have BigQuery Data Viewer role.
Create a new key for the Service Account using the key type JSON. Download the JSON file as you will need to copy information from this JSON file when adding the plugin next.
See GCP - Creating service account keys
Make sure to store the key file securely, because it can be used to authenticate as your service account.
Add the Google Cloud Platform (GCP) plugin to SquaredUp
In SquaredUp browse to Settings > Plugins > Add plugin and search for the plugin.
Open the JSON file that you downloaded when creating the key.
Copy and paste the clientEmailfrom the JSON file into the plugin form.
Copy and paste the private_key from the JSON file into the plugin form (everything between the quotes).
Copy and paste the project_ids from the JSON file into the plugin form.
Optionally, to use the Cost data stream, copy and paste in the billingProjectId, billingDataSetName , and billingTableName.
Leave the checkbox for Automatically create a workspace ticked, this will create a new workspace for this plugin containing out of the box dashboards and scopes.
Optionally, select whether you would like to restrict access to this plugin instance. By default, restricted access is set to off.
Restrict access to this plugin?
The term plugin here really means plugin instance. For example, a user may configure two instances of the AWS plugin, one for their development environment and one for production. In that case, each plugin instance has its own access control settings.
By default, Restrict access to this plugin? is set to off. The plugin can be viewed, edited and administered by anyone. If you would like to control who has access to this plugin, switch Restrict access to this plugin? to on.
Use the Restrict access to this plugin? dropdown to control who has access to the workspace:
By default, the user setting the permissions for the plugin will be given Full Control and the Everyone group will be given Link to workspace permissions.
Tailor access to the plugin, as required, by selecting individual users or user groups from the dropdown and giving them Link to workspace or Full Control permissions.
If the user is not available from the dropdown, you are able to invite them to the plugin by typing in their email address and then clicking Add. The new user will then receive an email inviting them to create an account on SquaredUp Cloud. Once the account has been created, they will gain access to the tenant.
At least one user or group must be given Full Control.
Admin users can edit the configuration, modify the Access Control List (ACL) and delete the plugin, regardless of the ACL chosen.
Plugin access levels
Access Level:
Link to workspace
- User can link the plugin to any workspace they have at least Editor permissions for.
- Data from the plugin can then be viewed by anyone with any access to the workspace.
User can share the plugin data with anyone they want.
User cannot configure the plugin in any way, or delete it.
Full Control - User can change the plugin configuration, ACL, and delete the plugin.
See Access control for more information.
Click Test and save to validate the plugin configuration.
Testing outcomes
Testing passed – a success message will be displayed and then the configuration will be saved.
Testing passed with warnings – warnings will be listed and potential fixes suggested. You can still use the plugin with warnings. Select Save with warnings if you believe that you can still use the plugin as required with the warnings listed. Alternatively, address the issues listed and then select Rerun tests to validate the plugin configuration again. If the validation now passes, click Save.
Testing Failed – errors will be listed and potential fixes suggested. You cannot use the plugin with errors. You are able to select Save with errors if you believe that a system outside of SquaredUp Cloud is causing the error that you need to fix. Alternatively, address the issues listed and then select Rerun tests to validate the plugin configuration again. If the validation now passes, click Save.
You can edit any plugin configurations at any time from Settings > Plugins.
Using the Google Cloud Platform (GCP) plugin
data streams

A data stream brings you data to answer a specific question like "What's the health state of the objects?", "What kind of alerts are coming from this plugin for my servers?", "What's the average memory usage of this app?"
The magic of data streams is that they standardize data from all the different shapes and formats your tools use into a straightforward tabular format. While creating a tile you can tweak data streams by grouping or aggregating specific columns. Depending on the kind of data, SquaredUp will automatically suggest how to visualize the result, for example as a table or line graph.
There are three types of data streams available for this plugin:
Data streams installed with the plugin, see Tips for using the GCP Cost data stream
Configurable data streams, see Using Configurable data streams with the GCP plugin
Custom data streams, see Using Custom data streams with the GCP plugin
Using Configurable data streams with the GCP plugin

A configurable data stream allows you to easily create new data streams specific to your needs, by entering information into a form, such as metric names or queries. Configurable data streams have a + before the name, and once new data streams have been created they show in the normal list of data streams.
Any data streams you create can be edited from Settings > Data Streams.
Google Cloud Platform - BigQuery
The GCP plugin allows you to set up configurable data streams for any kind of query for Google BigQuery.
Scope to an object that supports Google BigQuery.
Select + Google Cloud Platform - BigQuery from the data stream list.
Enter a Display Name for the new data stream.
Query:
Enter a BigQuery query.
Project ID:
Specify the project that you would like to run the BigQuery against.
Click Save.
Google Cloud Platform - MQL Query
The GCP plugin allows you to set up configurable data streams for any kind of query for Monitoring Query Language (MQL). Use the + MQL Query data stream to enter your own MQL queries into SquaredUp Cloud. You are able to query any object from your Google Cloud, even if they are not imported in the SquaredUp Cloud graph. See Google Cloud: Using Monitoring Query Language for more information about MQL.
Either scope to an object that supports MQL query, scope to a project, or scope to the GCP plugin instance itself.
Select + MQL Query from the data stream list.
Enter a Display Name for the new data stream.
Project:
Select the project that you would like to run the MQL against from the dropdown.
You will not need to select a project if you have already selected one in the scope.
MQL Query:
Enter a MQL query.
Mustache parameters are only supported if you have scoped to a GCP object and selected the + MQL Query. Mustache parameters are not supported if you have scoped to a project or the plugin instance itself.
See MQL query examples: below for more information about queries.
Supports mustache parameters supplied in an arrayA mustache parameter is a dynamic value, the actual value will be inserted from the properties of the object(s) in scope.
This data stream supplies scoped objects in an array for mustache parameters. When there are multiple objects in scope this plugin will send the query once with all the objects in an array.
When the scoped objects are supplied in an array the normal mustache syntax, for example
{{name}}
, must be contained between{{#.}}
and{{/.}}
(the full-stop indicates that the whole object should be used, in this case the array of objects in scope).For example, a query where clause might look like:
Copy| where ComputerName in ( {{#.}} '{{name}}', {{/.}} '' )
The
{{#.}}
and{{/.}}
indicate that what is contained within is expanded for each element in the array of objects.You can use properties of objects and write them in between curly braces e.g
{{name}}
to use them as mustache parameters. For example, if objects of type "host" have a property calledname
, you can use{{name}}
. This will resolve{{name}}
to the value of the name property of the different "host" objects used in the scope.'{{name}}',
means that the name property is expanded inside single-quotes with a trailing comma.The trailing single quotes
''
are necessary to stop the query being rejected because a trailing comma is disallowed.Whenever you use mustache parameters, you need to use a scope of objects that contain the property you're referencing.
Automatically apply dashboard timeframe:
By default, Automatically apply dashboard timeframe will be selected.
The dashboard timeframe is the current timeframe setting for a dashboard. Users can change the dashboard timeframe to see data for a different time span, for example, instead of showing data from "the last 12 hours" it can be changed to show data from "the last 7 days".
Tiles can be configured to:
Use dashboard timeframe (default). For these tiles the data shown will change when the user changes the dashboard timeframe.
Use a fixed timeframe from the options available. These tiles show a clock icon and hovering shows the fixed timeframe configured. The data will not change when the dashboard timeframe is changed.
Tip: Indicate with the name of a tile if the tile's timeframe can be changed. For example, naming a tile "Performance during the last week" tells users that this tile always shows data for the last week. Naming a tile just "Performance" indicates to users that changing the dashboard timeframe will change the data.
If you do not wish to use a dashboard timeframe, you can set the timeframe in the MQL query by adding
within
to the query. If you deselect Automatically apply dashboard timeframe and do not specify a timeframe in the MQL query, the query will fail. To add a timeframe to a query, simply type| within (timeframe)
at the end of your query. For example, to add a timeframe of 24 hours you enter:| within (24h)
Click Save.
MQL query examples:
MQL query not using dashboard timeframe - CPU usage time in the last 20 minutes in the selected project:
fetch gce_instance | metric 'compute.googleapis.com/instance/cpu/usage_time' | within (20m)
MQL query not using dashboard timeframe - authentication events count in the last 24 hours:
fetch iam_service_account
| metric 'iam.googleapis.com/service_account/authn_events_count'
| align rate(1m)
| every 1m | within (24h)
MQL query using dashboard timeframe - uploaded bytes in BigQuery data set:
fetch bigquery_dataset
| metric 'bigquery.googleapis.com/storage/uploaded_bytes'
| align rate(1m)
| every 1m
MQL query scoped to Hosts and using mustache syntax - CPU usage time using dashboard timeframe:
fetch gce_instance
| metric 'compute.googleapis.com/instance/cpu/usage_time'
| filter (metadata.system_labels.name == '{{#.}}{{name}}{{/.}}')
| align rate(1m)
| every 1m
Monitor Metric
Scope to an object that supports Monitor Metric.
If you are scoping to multiple objects, we suggest you only scope to objects of the same type. For example, the data will probably not be displayed in a helpful way if you were to select both Host objects and SQL objects in the same scope.
Select + Monitor Metric from the data stream list.
Enter a Display Name for the new data stream.
Metric Name:
Select the desired metric from the dropdown. The dropdown options will automatically update depending on the object that you have scoped to. For example, scope to a Host and select
CPU usage
from the Metric Name dropdown.Click Save.
Using Custom data streams with the GCP plugin
Add one or more custom data streams in SquaredUp.
Go to Settings > Data Streams.
Click Add new Data Stream.
Enter a display name for your Data Stream.
Note: The display name is the name that you use to identify your Data Stream in SquaredUp. It has no technical impact and doesn't need to be referenced in the Data Stream's code.
Choose the plugin this Data Stream is for.
After you've chosen the plugin a new field Data Source appears.
Data source and code:
To find out which data source to select and get code examples for the Code field, see the help below.
Click Save to save your Data Stream.
Create generic scoped custom data stream for BigQuery
Which data source do I have to select from the dropdown?
BigQuery (Scoped)
Code example:
{
"name": "exampleScopedBigQuery",
"dataSourceConfig": {
"query": "SELECT project.name, service.description FROM `<project_id>.<data_set_name>.<table_name>` WHERE project.id in ('{{sourceId}}') GROUP BY 1,2 ORDER BY 1,2;"
},
"rowPath": [],
"matches": {
"sourceType.0": {
"type": "oneOf",
"values": [
"GCP Project"
]
}
},
"metadata": [
{ "name": "name", "displayName": "Project","shape": "string", "role": "label" },
{ "name": "description", "displayName": "Service", "shape": "string" },
]
}

| Mandatory The internal name of the data stream. Can be used the refer to this data stream in a tile's JSON instead of using the data stream's internal ID. | |||||||||||||||||||||||||
useTimeFrame | Optional You can add For example: Copy
![]() The dashboard timeframe is the current timeframe setting for a dashboard. Users can change the dashboard timeframe to see data for a different time span, for example, instead of showing data from "the last 12 hours" it can be changed to show data from "the last 7 days". Tiles can be configured to:
Tip: Indicate with the name of a tile if the tile's timeframe can be changed. For example, naming a tile "Performance during the last week" tells users that this tile always shows data for the last week. Naming a tile just "Performance" indicates to users that changing the dashboard timeframe will change the data. | |||||||||||||||||||||||||
query | Mandatory Insert your query here. The query must be written all in one line. The query supports mustache parameters (in between curly braces e.g {{name}}). Mustache must refer to the property names of a GCP object that is the scope of the query. In the example we scope a query by GCP project. The query will execute for each object in the scope and return all results. ![]() A mustache parameter is a dynamic value, the actual value will be inserted from the properties of the object(s) in scope. This data stream supplies scoped objects individually for mustache parameters. When there are multiple objects in scope this plugin will send the query multiple times, once for each object. The results are then displayed together, for example in a single table. You can use properties of objects and write them in between curly braces e.g For example, if objects of type "host" have a property called | |||||||||||||||||||||||||
rowPath | Optional Depends on the data returned from your query. Enter the path to the row you want to use. | |||||||||||||||||||||||||
matches | Matches should be populated appropriately to the type of objects in the scope, that you want this data stream to work for. Note: Defining the With the Format for Copy
Example for limiting a data stream to objects: If you are using multiple values for the object property, you can decide if you want the data stream to be visible for objects that match all of the criteria or at least one of the criteria. Lets say you have two values you want objects to have in order for the data stream to be visible for them:
If you want the data stream to be visible only for objects that match both of the criteria, your code would look like this: Copy
If you want the data stream to be visible for objects that match at least one of the criteria, your code would look like this: Copy
Note: If you run into errors when configuring the ![]() Global data sources can't use specific objects in the There are two possible options for the matches parameter for global data sources:
| |||||||||||||||||||||||||
metadata | Optional, but recommended The
Note: If you don't specify any metadata, all columns will be returned and SquaredUp will do its best to determine which columns should be used for which purpose. If you're returning pretty simple data, for example just a string and a number, this can work fine. But if you're returning two columns with numbers it gets trickier for SquaredUp to figure out which one is the value and which one is just an ID or some other number. Parameters: Tip: Before you start specifying metadata, leave them empty at first and get all the raw data with your new data stream once. In order to do this, finish creating your custom data stream without metadata and create a tile with this data stream. The Table visualization will show you all raw data.
![]() There are many different shapes you can use for your columns and the list of possible shapes gets expanded constantly:
Tip: Some shapes can be configured. If a shape is configurable, you can edit how the shape displays data in the UI. ![]()
|
Tips for using the GCP Cost data stream
The Cost data stream is part of the GCP plugin and uses the GCP BigQuery API. The GCP plugin needs some additional configuration to enable the Cost data stream see How to add the Google Cloud Platform plugin
The GCP Cost data stream shows daily data.
By default the Cost data stream splits costs by service.
We recommend scopes used with the GCP Cost data stream contain only one type of object, for example, only accounts, projects or hosts. Mixed scopes may include duplicated data in the results, because a query is sent for each type of object in the scope, and the results are combined. For example, resulting data would show the cost of a host, as well as the cost of a project, even if the host is part of that project. It is useful to create a scope for your account(s), a scope of project(s) and a scope for hosts.
Use Cases for the GCP Cost data stream

Create a new tile on a dashboard with the following settings:
Scope:
Account(s) or Project(s)
Data stream:
Cost.
(No advanced settings required).
Visualization:
Line Graph is good for showing data for dashboard timeframes of 7 or 30 days. A line will be shown for each service.
As the GCP Cost data stream shows daily data, so dashboard timeframes of less than 7 days won't show a line.

The dashboard timeframe is the current timeframe setting for a dashboard. Users can change the dashboard timeframe to see data for a different time span, for example, instead of showing data from "the last 12 hours" it can be changed to show data from "the last 7 days".
Tiles can be configured to:
Use dashboard timeframe (default). For these tiles the data shown will change when the user changes the dashboard timeframe.
Use a fixed timeframe from the options available. These tiles show a clock icon and hovering shows the fixed timeframe configured. The data will not change when the dashboard timeframe is changed.
Tip: Indicate with the name of a tile if the tile's timeframe can be changed. For example, naming a tile "Performance during the last week" tells users that this tile always shows data for the last week. Naming a tile just "Performance" indicates to users that changing the dashboard timeframe will change the data.
When the dashboard timeframe covers more than one day the first column of a table shows the date. To only show each service once for the selected dashboard timeframe see Use Case: How much does each GCP service cost for a specific timeframe?.

Create a new tile on a dashboard with the following settings:
Scope:
Account(s) or Project(s) or Hosts
Data stream:
Click on the Configure button next to the Cost Data Stream to open the advanced settings. The following settings will show how much each service costs you in total for the account(s) or project(s) in scope for the whole timeframe selected:
Group by | Service (For each service...) |
Aggregate column | Amount (...show me the combined amount...) |
Aggregation type | Total (... in total.) |
Visualization:
Table, Donut or Bar Chart. Each bar or segment will show a service.
After you're done creating the tile, you can specify the timeframe by changing the dashboard timeframe to 7 or 30 days.

The dashboard timeframe is the current timeframe setting for a dashboard. Users can change the dashboard timeframe to see data for a different time span, for example, instead of showing data from "the last 12 hours" it can be changed to show data from "the last 7 days".
Tiles can be configured to:
Use dashboard timeframe (default). For these tiles the data shown will change when the user changes the dashboard timeframe.
Use a fixed timeframe from the options available. These tiles show a clock icon and hovering shows the fixed timeframe configured. The data will not change when the dashboard timeframe is changed.
Tip: Indicate with the name of a tile if the tile's timeframe can be changed. For example, naming a tile "Performance during the last week" tells users that this tile always shows data for the last week. Naming a tile just "Performance" indicates to users that changing the dashboard timeframe will change the data.

Create a new tile on a dashboard with the following settings:
Scope:
Hosts
Data stream:
Click on the Configure button next to the Cost Data Stream to open the advanced settings. The following settings will show how much each service costs you in total for the account(s) or project(s) in scope for the whole timeframe selected:
Group by | Object (For each host...) |
Aggregate column | Amount (...show me the combined amount...) |
Aggregation type | Total (... in total.) |
Visualization:
Table, Donut or Bar Chart. If, for example, you've scoped to Hosts, then each bar will be the cost for one host.
When you choose to 'Group by' Object this means it will group by whatever you have scoped to. In this case it will group by Host, but if you've scoped to Project(s) it will group by projects and each segment or bar would show a project.
After you're done creating the tile, you can specify the timeframe by changing the dashboard timeframe to 7 or 30 days.

The dashboard timeframe is the current timeframe setting for a dashboard. Users can change the dashboard timeframe to see data for a different time span, for example, instead of showing data from "the last 12 hours" it can be changed to show data from "the last 7 days".
Tiles can be configured to:
Use dashboard timeframe (default). For these tiles the data shown will change when the user changes the dashboard timeframe.
Use a fixed timeframe from the options available. These tiles show a clock icon and hovering shows the fixed timeframe configured. The data will not change when the dashboard timeframe is changed.
Tip: Indicate with the name of a tile if the tile's timeframe can be changed. For example, naming a tile "Performance during the last week" tells users that this tile always shows data for the last week. Naming a tile just "Performance" indicates to users that changing the dashboard timeframe will change the data.

Create a new tile on a dashboard with the following settings:
Scope:
Account(s)
Data stream:
Click on the Configure button next to the Cost Data Stream to open the advanced settings. The following settings will show how much all the service cost you in total for the accounts in scope for the whole timeframe selected:
Group by | Object (For the account(s) in scope...) |
Aggregate column | Amount (...show me the combined amount...) |
Aggregation type | Total (... in total.) |
When you choose to 'Group by' Object this means it will group by whatever you have scoped to. In this case it will group by Account, but if you've scoped to Project(s) it will group by projects.
Visualization:
If you only have one account in the scope you can choose Scalar, as you only want to see one number (total cost for all services).
If you have several accounts in the scope you can choose Table, to see the cost per account.
After you're done creating the tile, you can specify the timeframe by changing the dashboard timeframe to 7 or 30 days.

The dashboard timeframe is the current timeframe setting for a dashboard. Users can change the dashboard timeframe to see data for a different time span, for example, instead of showing data from "the last 12 hours" it can be changed to show data from "the last 7 days".
Tiles can be configured to:
Use dashboard timeframe (default). For these tiles the data shown will change when the user changes the dashboard timeframe.
Use a fixed timeframe from the options available. These tiles show a clock icon and hovering shows the fixed timeframe configured. The data will not change when the dashboard timeframe is changed.
Tip: Indicate with the name of a tile if the tile's timeframe can be changed. For example, naming a tile "Performance during the last week" tells users that this tile always shows data for the last week. Naming a tile just "Performance" indicates to users that changing the dashboard timeframe will change the data.
Comments
0 comments
Please sign in to leave a comment.