IBM Cloud Docs
Monitoring metrics by using IBM Cloud Monitoring

Monitoring metrics by using IBM Cloud Monitoring

Support for the IBM Cloud Monitoring service ended 31 March 2020. IBM Cloud® Load Balancer monitoring is now provided with IBM Cloud Monitoring, a third-party monitoring tool that specializes in data aggregation, usage alerts, and in-depth visualizations. For more information, see IBM Cloud Monitoring.

Load balancers calculate the metrics and send those metrics to your IBM Cloud Monitoring instance, which reflects different types of use and traffic. You can visualize and analyze metrics from either the IBM Cloud Monitoring dashboard, or its API.

Metrics available by service plan

The supported monitoring metrics include:

  • Active connections to your load balancer at a given time.
  • Throughput of data passing through your load balancer over a given time.
  • Connection rate, or an analysis of when more or less connections are made to your load balancer.

These metrics help track the traffic and usage patterns for your load balancers and can provide insight about peak traffic hours, usage dropouts, and overall usage patterns.

Each metric is composed of the following metadata types:

  • Metric name - The name for the collected metric.
  • Metric type - Determines whether the metric value is a counter metric or a gauge metric. Each of these metrics is of the type gauge, which represents a single numerical value that can arbitrarily fluctuate over time.
  • Value type - A unit of measurement for a specific metric. Examples include bytes or counts. A value type of none means that the metric value represents individual occurrences of that metric type.
  • Segment - How you want IBM Cloud Monitoring to divide and display the monitoring metrics.

Active connections

Active connections are the number of connections that are established on a load balancer at a specific time.

The active connection metric contains the following metadata:

Table 1: IBM Cloud Load Balancer active connections metrics metadata
Metadata Description
Metric name ibm_cloud_load_balancer_active_connections
Metric type gauge
Value type none
Segment by IBM Cloud Load Balancer appliance metrics and IBM Cloud Load Balancer listener metrics

Connection rate

Connection rate is the number of new incoming active connections per second to your load balancer.

Table 2: IBM Cloud Load Balancer connection rate metric metadata
Metadata Description
Metric name ibm_cloud_load_balancer_connection_rate
Metric type gauge
Value type none
Segment by IBM Cloud Load Balancer appliance metrics and IBM Cloud Load Balancer listener metrics

Throughput

Throughput is the amount of data that passes in and out of a load balancer over a period.

Table 3: IBM Cloud Load Balancer throughput metric metadata
Metadata Description
Metric name ibm_cloud_load_balancer_throughput
Metric type gauge
Value type byte
Segment by IBM Cloud Load Balancer appliance metrics or IBM Cloud Load Balancer listener metrics

Metric segmentation

You can split the data that IBM Cloud Monitoring presents into various visualizations in the IBM Cloud Monitoring dashboard, allowing views of different metrics based on your preferences. For example, if you have multiple load balancers or accounts with different load balancers in each account, you might want to focus on a particular listener (front-end protocol) port.

As an example, you can segment the active connections by IBM Cloud Load Balancer listener port to show how many active users are connected to the load balancer through each listener type. To illustrate this, let's assume that your load balancer has two different listener protocols one HTTP on port 80 and another for TCP on port 8080. The dashboard would contain different lines showing 10 users who are connected through HTTP on Port 80 in one color, and 6 users connected through TCP on port 8080 in another color.

Global attributes

The following attributes are available for segmenting all three of the IBM Cloud Monitoring metrics.

Table 4: IBM Cloud Monitoring global attributes
Attribute Attribute Name Attribute Description
Resource ibm_resource A load balancer's unique ID
Scope ibm_scope The account that is associated with a given load balancer
Service name ibm_service_name ibm-cloud-load-balancer

Extra attributes

The following attributes are available to segment one or more of the global attributes. See the individual metrics for any segmentation options.

Table 5: IBM Cloud Monitoring additional attributes
Attribute Attribute Name Attribute Description
IBM Cloud Load Balancer appliance metrics ibm_cloud_load_balancer_appliance_ip The metrics coming from the load balancer back end. Because the load balancer is highly available, multiple appliances support each load balancer for redundancy.
IBM Cloud Load Balancer listener metrics ibm_cloud_load_balancer_listener_port The metrics that are gathered from individual listeners and their ports. Configure the listeners in your load balancer settings. The monitoring metrics reflect the metrics coming from those listeners.

The displayed metrics contain a timestamp and the metric value for the time interval ending at that timestamp. You can specify different scopes, as well as the time interval over which to report the metrics.

The supported protocols include:

  • HTTP
  • HTTPS
  • TCP

Specifying a listener port filters the metric by that listener. For example, if you don't specify a port, and the metric is Throughput, then IBM Cloud Monitoring reports the total throughput for all listener protocols. However, if the listener protocol is HTTP on port 80, then IBM Cloud Monitoring reports the throughput for HTTP traffic only.

You can also specify the time interval over which to report your metrics. Time intervals that are supported in the IBM Cloud Monitoring dashboard are:

  • 10 seconds
  • 1 minute
  • 10 minutes
  • 1 hour
  • 6 hours
  • 2 weeks
  • Custom

The number of data points you can report is roughly the same for each time interval. For example, if the interval is 1 hour, then each data point represents 5 minutes of data. If the interval is 2 weeks, then each data point represents 24 hours of data.

Enabling metrics monitoring

To receive monitoring metrics, you must set up your IBM Cloud Monitoring instance.

To do so, follow these steps:

  1. Navigate to the metrics monitoring portal, then click Create a monitoring instance.

  2. Select a region for your IBM Cloud Monitoring instance.

    If you do not have an existing load balancer, see Using an elastic IBM Cloud Load Balancer for server load balancing to provision one.

    The region must match the location of your existing load balancer.

  3. Choose your pricing plan.

    Pricing plan details are explained in the selection window. Select the plan that best meets your requirements.

  4. Provide a service name for your instance. It can be any name that you want, and has no impact on functions.

    Do not create multiple IBM Cloud Monitoring instances with the same name.

  5. Optionally, select a resource group. A resource group is a way to organize account resources in customizable groupings. Any account resource that is managed by using IBM Cloud Identity and Access Management (IAM) access control belongs to a resource group within your account.

    If you do not have any pre-configured resource groups, or have no reason to share this resource selectively, use the default selection.

    If your account has multiple resource groups, you can choose which one has access to this IBM Cloud Monitoring instance. This allows you to have metrics available to some resource groups and not to others.

  6. Select the Enable Platform Metrics checkbox. Select this to receive metrics from your load balancer.

  7. Click Create. You are taken back to the monitoring metrics home page.

Within a few minutes, your new instance displays. You might have to refresh your browser to see it.

Working with the IBM Cloud Monitoring dashboard

To view and work with your IBM Cloud Monitoring metrics, follow these steps:

  1. Navigate to the metrics monitoring portal.

  2. Click View IBM Cloud Monitoring next to the service name of the IBM Cloud Monitoring instance you want to work with.

    The first time that you access your IBM Cloud Monitoring instance, several windows display as part of the internal setup. Leave these selections with their default entries, and click through the pages until you reach the IBM Cloud Monitoring main page.

  3. Select Dashboards on the left sidebar to open the IBM Load Balancer Monitoring Metrics dashboard. Then, click Default Dashboards > IBM > Load Balancer Monitoring Metrics. The default dashboard is not editable.

  4. Three main metrics in the dashboard are shown: Throughput, Active Connections, and Connection Rate. To modify options and segment your metrics by load balancer ID or listener port, you must create a custom dashboard.

    You can choose what time window that you want to see your metrics by using the time selection bar. You can also zoom in and out for more granularity and drag the mouse to create a selection of a specific time window.

Creating a custom metrics dashboard

You can create your own dashboard to customize your monitoring metrics, such as viewing information about particular load balancers, or seeing only traffic that comes through HTTPS listeners.

To customize your dashboard, follow these steps:

  1. Navigate to the metrics monitoring portal.

  2. Click View IBM Cloud Monitoring next to the service name of the IBM Cloud Monitoring instance you want to work with. The dashboard opens.

  3. On the left sidebar, select Dashboards. Then, click the green + sign in the page.

  4. Select the Blank dashboard, then select the type of visual representation you want.

    IBM Cloud Monitoring offers eight different visualizations for your dashboard. Read the description for each visualization, then choose the one that best meets your requirements.

    Line ("View trends over time") is the easiest and most basic option. It is also the most frequently selected option. The following examples show a Line-based visualization.

  5. Configure your custom dashboard.

    • In the Metrics field, enter ibm_cloud to display the IBM IBM Cloud Monitoring load balancer metrics. The ones discussed so far in this topic are ibm_cloud_load_balancer_active_connections, ibm_cloud_load_balancer_connection_rate, and ibm_cloud_load_balancer_throughput. After you click and add each metric, a new dropdown menu appears to select the next one. Repeat this process until you added all three.

    You can monitor listener port traffic by enabling the ibm_cloud_load_balancer_listener_port metric.

    • You can choose a scope to display in your dashboard by clicking Override Dashboard Scope. For example, you can display the metrics for a particular load balancer.

    • You can also set a segment to compare metrics across the scope you defined. For example, you can look at throughput for a particular load balancer segmented by listener port.

  6. Click Save for your new custom dashboard to be accessible.

    By default, the dashboard begins with the name "blank dashboard". You can change the name by selecting Dashboards from the sidebar, then clicking the Pencil icon next to the name.

To return to the default IBM Cloud Monitoring dashboard at any time, select Dashboards > Default Dashboards > IBM > Load Balancer Monitoring Metrics.

Working with IBM Cloud Monitoring using the APIs

You can also work with the IBM Cloud Monitoring instance by using the metric query API. You might want to do this if you need raw data points or want to consume your metrics from a command-line interface rather than using the IBM Cloud Monitoring dashboard.

After you create your IIBM Cloud Monitoring instance, you must collect the following two pieces of information.

  • The IBM Cloud Monitoring Monitor API token
  • The endpoint of your IBM Cloud Monitoring IBM Cloud Monitoring instance

To collect this information and start working with your IBM Cloud Monitoring instance by using the metric query API, follow these steps:

  1. Access the Monitoring home page, and click View IBM Cloud Monitoring next to the instance you want to work with. After the IBM Cloud Monitoring dashboard shows, select your Account Profile icon on the left sidebar, then select Settings. Your account settings display.

  2. Your API token is an alphanumeric string that is located in the IBM Cloud Monitoring Monitor API Token field. Click the Copy button to the right of the key to transfer it to your clipboard.

    Do not share this key. Anyone who has this key has full access to your metrics.

  3. To get the endpoint of your IBM Cloud Monitoring instance, navigate to your main IBM Cloud Monitoring dashboard in your browser. Then, select the URL to the dashboard, which appears similar to:

    https://us-south.monitoring.cloud.ibm.com/#/default-dashboard/ibm_cloud_load_balancer?last=3600
    

    The first part of the URL (in this case, us-south.monitoring.cloud.ibm.com) is your endpoint. Make note of it.

  4. After you have both the API token and the endpoint, you can format your POST request. The following POST request is an example, with all the options that you can modify. These options are:

    • The IBM Cloud Monitoring Monitor API token.

    • The endpoint of your IBM Cloud Monitoring instance.

    • The value for ibm_resource (this is the load balancer ID you want to see metrics for).

      If you want to see this metric for all of your load balancers, do not enter a value for the scope attribute. For example, use "scope” : "".

    • The metric type that you want to see the results for. This example uses ibm_cloud_load_balancer_throughput, but ibm_cloud_load_balancer_active_connections and ibm_cloud_load_balancer_connection_rate are also valid options.

    • The from and to attributes define the times to focus the scan, set in Epoch Time and in microseconds.

    • The sampling and value attributes set the granularity of which data is returned in the POST request.

      Because a large volume of data is stored in IBM Cloud Monitoring, choosing the specific level of granularity is important. IBM Cloud Monitoring can return only 600 data points at any time with a given request. As a result, the sampling and value attributes are important. Leaving these two lines out of your request returns an aggregate sum over that time period instead.

      If the time range specified by from and to is large (for example, 4 days), but you define a sampling and value of 10 seconds, this means that you receive 4 days worth of data that is split into 10-second chunks. This is not a useful sampling due to the large amount of data returned. Specifying a larger chunk is recommended (for example, 1 hour instead of 10 seconds).

    curl \
    -H 'Authorization: Bearer <API_TOKEN>’ \
    -H 'Content-Type: application/json' \
    https://us-south.monitoring.cloud.ibm.com/api/data/batch  \
    -d '{
     "requests": [
         {
             "format": {
                 "type": "data"
             },
             "scope": "ibm_resource=\"908461\"",
             "metrics": {
                 "k0": "timestamp",
                 “v1”: "ibm_cloud_load_balancer_throughput"
             },
             "time": {
                 "from": 1584396900000000,
                 "to": 1584402600000000,
                   “sampling”: 600000000
             },
             "group": {
                 "by": [
                     {
                         "metric": "k0",
                         “value” : 600000000
                     }
                 ],
                 "aggregations": {
                     “v1”: "sum"
                 },
                 "groupAggregations": {
                     “v1”: "sum"
                 }
             }
         }
       ]
     }