Using resource groups

Using the Google Cloud Console

Stackdriver Monitoring lets you define a set of resources as a group. After you define a group, you can set up alerting policies, charts, and dashboards to monitor the group. You can create up to 500 groups in your Workspace.

About groups

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 is triggered if some number of resources in the group violates a particular condition (for example, CPU load), rather than having each resource inform you of violations individually.

You define the membership criteria for your groups. A resource belongs to a group if the resource meets the membership criteria of the group. Membership criteria can be based on labels, regions, applications, and other criteria. Resources can belong to multiple groups.

The set of members in a group is dynamic, making groups useful for monitoring changing environments. For example, if you create a group whose membership criteria specifies a geographic region, then new resources in that region are automatically added to the group. You don't have to modify dashboards or alerting policies if the group membership changes.

Groups can contain subgroups, up to six levels deep. One application for groups and subgroups is management of physical or logical topologies. For example, with groups, you can separate your monitoring of production resources from your monitoring of test or development resources. You can also create subgroups to monitor your production resources by zone.

Creating a group

To create a group, do the following:

  1. In the Cloud Console, select Monitoring, and then select Groups:

    Go to Monitoring

  2. Click Create Group. The following screenshot shows the Create group dialog:

    Group-creation panel.

  3. Replace Name with a display name for the group. The display name isn't required to be unique in the project.

  4. Add the group membership criteria. See the next section, Specifying membership criteria, for more information.

  5. Click Create.

Specifying membership criteria

A group can have multiple membership criteria.

To specify a single criterion, do the following in the Create group dialog:

  1. Click Add Criteria.

  2. In the Add criteria dialog, select the Type of criterion from the menu:

    • Name: (Default) Group membership is determined by the display name of the resource.
    • Tag: Group membership is determined by tags. For this option, a secondary menu of resource values that are dependent on your configuration is displayed. 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.
    • Region: The location of the resource.
    • Security Group: Group membership is determined by Role Based Access Control (RBAC). For example, you can specify a security group when you are creating a Google Kubernetes Engine cluster. For more information, see the Kubernetes reference page Using RBAC Authorization.
    • Cloud Account/Project: Your Google Cloud project.
    • App Engine App: You App Engine applications.
    • App Engine Service: App Engine services such as the Users API, Memcache, and Images API.
  3. If you select a Name or Tag criterion, then an Operator menu is displayed. In this case, select how the comparison is to be performed. By default, the comparison operation is set to Contains.

    For example, if you don't want your group to contain any resources with instance in the name, you might set type to Name, value to instance, and the operator to Does not contain.

    When the Operator menu isn't displayed, the comparison operator is Equals.

  4. Enter the value to be matched.

  5. Click Done.

If you want to add a criterion, then repeat the previous procedure. When you have multiple criteria, you set how the criterion are to be combined with the Combine criteria operator selector. Choose AND if membership requires that a resource satisfy every criterion. Choose OR if membership requires that a resource satisfy a single criterion.

The following screenshot shows the group definition for a group named "My instances":

Create a group of resources named instance.

In this example, there are 2 criterion, both of which must be met.

Deleting a group

To delete a group, do the following:

  1. Begin the delete action by choosing 1 approach:

    • In the Groups window, identify the group to delete and click Delete .
    • In the group detail view, click Delete .
  2. In the Delete group and subgroup dialog, click Delete to confirm the action to delete the group and its subgroups. If you delete a group, you also remove the group from alerting policies and uptime checks.

Editing a group

To edit a group, choose 1 approach:

  • In the Groups window, identify the group to edit and click Edit .
  • In the group detail view, click Edit .

Using groups

When you create a group, Monitoring creates a dashboard for it. In addition to the standard dashboard controls, group dashboards provide controls to do the following:

  • Edit or delete the group.
  • Create a subgroup
  • View incidents
  • View events
  • View resources and follow a link to view a resource dashboard

Group dashboards are limited to 25 charts. Charts on a group dashboard display data only from the members of the group.

The following screenshot is the default dashboard for the group "My instances":

Default group dashboard for the My instances group.

Overview of your resource groups

To see a summary of the status of all your groups, select Groups in the Monitoring menu of the Cloud Console. You can add filters to modify which groups are listed. To add a filter, click Filter table, and make a selection for the filter type. Based on the type you select, make a selection for the filter value or enter the value.

For any group on the Groups window, you can do all of the following:

  • View a group's dashboard by clicking on the group's display name.
  • Edit the group by clicking Edit
  • Delete the group by clicking Delete
  • View the number VM instance and the number of resources in the group.

API

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 displayName field.

You can also use monitoring filters to:

What's next

Using the Stackdriver Monitoring console

Stackdriver Monitoring 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.

About groups

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

To create a group, do the following:

  1. From the Cloud Console, go to Monitoring:

    Go to Monitoring

  2. From Monitoring, you can reach the group-creation panel in two ways:

    • Select Groups > Create group from the navigation menu.
    • Click Create Group on the Groups pane.

The following screenshot shows the Create group panel:

Group-creation panel.

To create a group:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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:

  1. 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.
  2. 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 two values:
      • 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.

The following screenshot shows the options available in the sample account for the types of resources and for the matching requirements:

Fields for specifying group criteria.

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:

Apache monitoring group.

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.

API

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 displayName field.

You can also use monitoring filters to:

Using groups

When you create a group, Monitoring 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:

Apache monitoring dashboard.

Overview of your resource groups

To see a summary of the status of all your groups, do the following:

  1. From the Cloud Console, go to Monitoring:

    Go to Monitoring

  2. Select Groups > Overview.

This overview provides an indication of the general health of each group and summarizes related information, as seen in the following screenshot:

Groups overview window.

For any group on the Groups window, 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.
Hai trovato utile questa pagina? Facci sapere cosa ne pensi:

Invia feedback per...

Stackdriver Monitoring