Stackdriver lets you define and monitor groups of resources, such as VM instances, databases, and load balancers. You can organize resources into groups based on criteria that make sense for your applications. Groups can be based on names, labels, regions, applications, and other criteria. You can also create subgroups, up to six levels deep, within groups.
You can create up to 500 groups in your Workspace.
With groups, you can monitor a set of resources as a single entity.
The set of members in a group is dynamic, making groups useful for monitoring changing environments. For example, if you create a group based on a geographic region, then new resources in that region are automatically added to the group. You don't have to modify dashboards or alerts if the group membership changes.
A resource belongs to a group if the resource meets the membership criteria of the group. Resources can belong to multiple groups. See Creating a group for more information.
Groups provide a mechanism for alerting on the behavior of a set of resources, rather than on individual resources. For example, you can create an alerting policy that fires when some number of resources in a group violates a particular condition (for example, CPU load), rather than having each resource inform you of violations individually. This way, you can ensure that your alerts inform you only about issues that are affecting your production operations.
Groups and subgroups can also help you manage physical or logical topologies. For example, with groups, you can separate your monitoring of production resources from your monitoring of test or development resources, and then create subgroups to monitor your production resources by zone.
Creating a group
From the Stackdriver Monitoring console, you can reach the group-creation panel in two ways:
- Select Groups > Create group from the navigation menu.
- Click the Add Group button on the Groups pane.
Click the following button:
The following screenshot shows the Create group panel:
To create a group:
- Provide a display name for the group in the Group Name field. This is for display purpose only; it does not have to be unique in the project.
- Add the filter criteria for membership in the group. You can provide a single criterion or a set. See the next section, Specifying membership criteria, for more information.
- If you have specified more than one criterion, use the Filter criteria match pull-down menu to indicate whether you require a resource to match all of the criteria, or just any one of them, for group membership.
- If your group consists of members where you expect each member's behavior to be about the same as that of all other members, check the This is a cluster box.
- Click the Save button to create the group.
Specifying membership criteria
A group can have a single membership criterion or many. The criteria available depend on the resources you are using.
To specify a single criterion, you must provide two or three values:
- Choose the type of information on which you want to filter in the field with the Name option visible. The pull-down menu provides choices in addition to Name.
- Depending on the previous choice and your resources, you have to
provide one or two additional values:
- If you are filtering based on a string match, you have to provide
- The value to match.
- The matching requirement. This is specified in the field with the Contains option visible. The pull-down menu provides other options for matching.
- If you are filtering based on a value that can't be partially matched, or on a value that has only one possible match in your environment, you need only specify a single value to match.
- If you are filtering based on a string match, you have to provide two values:
The following screenshot shows the options available in the sample account for the types of resources and for the matching requirements:
The choices available to you in the menus vary with the resources you are using, so the menus you see may offer different options. The Tag option provides a secondary menu of resource values that are dependent on your configuration. For example, if you've created Compute Engine instances and have assigned network tags or labels to the instances, these tags and labels are listed in the secondary menu.
The following screenshot shows the specification of a group of Apache-related resources:
To specify additional criteria, click the Add Criteria button. If you have multiple criteria, be sure to specify whether all or any of them must be met by selecting a value from the Filter criteria match menu.
To remove any criterion that you no longer want, click the
X following its specification.
You can create, modify, retrieve, and delete groups by using the
projects.groups API. However, groups created by using the API
are not editable in the UI.
In the API, groups are identified by a
groupId field. This is an identifier
assigned by Stackdriver Monitoring when you create the group. The value you provide
for the group in the Group Name field is a display-only name, stored in a
You can also use monitoring filters to:
When you create a group, Stackdriver creates a dashboard for it. From this dashboard, you can:
- Edit or delete the group.
- Create subgroups within the group; this works just like the creation of the parent group.
- Create up to 25 charts for metrics relevant to the group. The chart displays data only from the members of the group.
- Create and view uptime checks for the group.
- Create alerting policies for the group.
- See all incidents related the resources in the group.
The following screenshot shows the dashboard for the new Apache resources group:
Overview of your resource groups
To see a summary of the status of all your groups, go to Groups > Overview:
This overview provides an indication of the general health of each group and summarizes related information, as seen in the following screenshot:
For any group on the Groups page, you can:
- Go to the group's dashboard by clicking on the group's display name.
- Get a summary of the resources in the group by clicking on the icon next to the number of total resources.