Using IBM Cloud Monitoring with IBM Cloud Object Storage
Use the IBM Cloud® Monitoring service to monitor your IBM Cloud® Object Storage (COS) data in the IBM Cloud. The results of the activity can be measured for compliance and other analysis through the web dashboard UI.
This feature is not currently supported in Object Storage for Satellite. Learn more.
Features
IBM Cloud Monitoring is a cloud-native management system. Documentation from Monitoring can guide you in how to use the comprehensive dashboards. In this guide we will focus on how to measure activity on individual buckets in your instance of IBM Cloud Object Storage.
Working with Metrics
According to the Monitoring documentation, "A metric is a quantitative measure that has one or more labels to define its characteristics." When you configure your buckets to forward data to a Monitoring instance, that data is automatically collected and available for analysis through the web UI.
Before you begin
Before you provision an instance of IBM Cloud Monitoring, consider the following guidance:
- The account owner can create, view, and delete an instance of a service in the IBM Cloud. This user can also grant permissions to other users to work with the IBM Cloud Monitoring service.
- Other IBM Cloud users with
administrator
oreditor
permissions can manage the IBM Cloud Monitoring service in the IBM Cloud. These users must also have platform permissions to create resources within the context of the resource group where they plan to provision the instance.
In this guide, we will examine using both the IBM Cloud Console as well as the IBM Cloud Developer Tools (CLI) to integrate Monitoring in your Object Storage instance. For more information about IBM Cloud Developer Tools, check out the documentation.
Using either set of instructions, Console or CLI, you will be able to get started using this guide. If the instructions that you seek do not appear in this guide, click on the appropriate item using the context switcher.
Instantiating and Provisioning IBM Cloud Object Storage
If you have not already done so, set up and provision your instance of Object Storage. If you already have an instance of Monitoring to work with, verify you have
either the manager
or writer
role to work with this guide.
Manage User Access
There are many ways to manage access to your Object Storage instance, but for this guide we'll focus on how to access the dashboard you are going to create.
Users in an account must be assigned a platform role in order to manage instances as well as launching the IBM Cloud Monitoring UI from the IBM Cloud console. In addition, users must have a service role that defines the permissions to work with IBM Cloud Monitoring.
Provisioning an instance of Monitoring
From the catalog choose IBM Cloud Monitoring from the available services. When selected, you will be taken to the configuration shown in Figure 1. At the bottom of the screen under "IBM platform metrics:" select Enable before creating the instance. You can use either the console or the CLI to provision a new service instance.
After you login using IBM Cloud Developer Tools and target both the region and resource group for your account, create a new resource using the command as shown.
ibmcloud resource service-instance-create <INSTANCE_NAME> <SERVICE_NAME> <SERVICE_PLAN_NAME> <LOCATION>
In the code sample, replace the placeholders with the appropriate values.
Value | Description | Sample |
---|---|---|
<INSTANCE_NAME> | The name of your new instance | MyMonitoring |
<SERVICE_NAME> | The name of the service | sysdig-monitor |
<SERVICE_PLAN_NAME> | The name of the plan | Lite |
|
The region of your buckets | us-east |
ibmcloud resource service-instance-update <INSTANCE_NAME> -p '{"default_receiver": true}'
Connect Object Storage to Monitoring
Most of the work you will do with Monitoring will be in specific dashboards to be discussed later. But first, there are a couple of ways in which you can get started.
Complete the following steps to get an IAM token:
-
From a terminal, log in to the IBM Cloud.
-
Run the following command to get a token:
ibmcloud iam oauth-tokens
Keep the token handy for later if you are using the Dev Tools CLI.
Configure a bucket for metrics
Metrics are only sent to Monitoring every 24 hours. Any alert thresholds exceeded on metrics will not trigger until the next time the metrics are sent to Monitoring.
When creating a bucket, you can configure your Monitoring instance at the same time.
You can also configure an existing bucket to use the Monitoring instance by selecting configuration
in the console.
Note that in each case the region
for your new instance of Monitoring is automatically tied to the region of the bucket.
Note that if the Monitoring instance is created by COS, Platform metrics must be set on the Monitoring instance.
To set Platform metrics on the instance:
- Go to your dashboard.
- Click on "Configure platform metrics."
- Select the region where the Monitoring instance was created.
- Click "Configure."
- Your Monitoring instance is now set for Platform metrics.
We will use cURL to connect to the Resource Configuration API and modify our bucket's configuration.
curl -X PATCH -k \
-H "authorization: Bearer $TOKEN" \
https://config.cloud-object-storage.cloud.ibm.com/v1/b/$1 \
-H 'cache-control: no-cache' \
-d '{"metrics_monitoring": {
"usage_metrics_enabled": true,
"request_metrics_enabled": true,
"metrics_monitoring_crn": "crn:v1:bluemix:public:sysdig-monitor:us-east:a/9xxxxxxxxxb1xxxc7fdxxxxxxxxxx5:7xxxxxxxx0-xx7x-xdx8-9fxx-123456789012::"
}
}'
In the code sample, replace the placeholders with the appropriate values.
Value | Description |
---|---|
$TOKEN | The token for authentication created previously |
$1 | The name of your bucket |
Launch your instance of Monitoring
When you have created your instance of Monitoring, click on the "View Monitoring" button in the "View dashboard" column, as shown in Figure 4.
Choose a pre-built dashboard for Monitoring
This guide has skipped right past the installation of agents that is typical of most monitoring configurations. In addition, you can also skip the manual creation of building a dashboard by using a pre-built solution. As shown in Figure 2, you can choose how to present your data using one of the options given.
View your data in Monitoring
Once you've configured your dashboard, you can view your data. Figures 3-5 show different views of your usage.
Cloud Object Storage metrics details
Usage metrics
There are a set of basic metrics that track usage:
- ibm_cos_bucket_used_bytes
- ibm_cos_bucket_object_count
- ibm_cos_bucket_hard_quota_bytes
Request metrics
There are metrics that report the aggregates for different classes of HTTP requests:
- ibm_cos_bucket_all_requests
- ibm_cos_bucket_get_requests
- ibm_cos_bucket_put_requests
- ibm_cos_bucket_delete_requests
- ibm_cos_bucket_post_requests
- ibm_cos_bucket_list_requests
- ibm_cos_bucket_head_requests
Errors are also collected, with server-side (5xx) errors broken out:
- ibm_cos_bucket_4xx_errors
- ibm_cos_bucket_5xx_errors
The minimum, maximum, and average bytes transferred by network type are reported:
- ibm_cos_bucket_bytes_download_public_min
- ibm_cos_bucket_bytes_download_public_max
- ibm_cos_bucket_bytes_download_public_avg
- ibm_cos_bucket_bytes_download_private_min
- ibm_cos_bucket_bytes_download_private_max
- ibm_cos_bucket_bytes_download_private_avg
- ibm_cos_bucket_bytes_download_direct_min
- ibm_cos_bucket_bytes_download_direct_max
- ibm_cos_bucket_bytes_download_direct_avg
- ibm_cos_bucket_bytes_upload_public_min
- ibm_cos_bucket_bytes_upload_public_max
- ibm_cos_bucket_bytes_upload_public_avg
- ibm_cos_bucket_bytes_upload_private_min
- ibm_cos_bucket_bytes_upload_private_max
- ibm_cos_bucket_bytes_upload_private_avg
- ibm_cos_bucket_bytes_upload_direct_min
- ibm_cos_bucket_bytes_upload_direct_max
- ibm_cos_bucket_bytes_upload_direct_avg
Latency metrics (first byte and general) for requests are broken down by request type:
- ibm_cos_bucket_first_byte_latency_read_min
- ibm_cos_bucket_first_byte_latency_read_max
- ibm_cos_bucket_first_byte_latency_read_avg
- ibm_cos_bucket_first_byte_latency_write_min
- ibm_cos_bucket_first_byte_latency_write_max
- ibm_cos_bucket_first_byte_latency_write_avg
- ibm_cos_bucket_first_byte_latency_misc_min
- ibm_cos_bucket_first_byte_latency_misc_max
- ibm_cos_bucket_first_byte_latency_misc_avg
- ibm_cos_bucket_request_latency_read_min
- ibm_cos_bucket_request_latency_read_max
- ibm_cos_bucket_request_latency_read_avg
- ibm_cos_bucket_request_latency_write_min
- ibm_cos_bucket_request_latency_write_max
- ibm_cos_bucket_request_latency_write_avg
- ibm_cos_bucket_request_latency_misc_min
- ibm_cos_bucket_request_latency_misc_max
- ibm_cos_bucket_request_latency_misc_avg
All metrics are reported as float64
numeric values:
Attributes for Segmentation
You can filter your results by attributes. In this guide, we'll look at some general examples as well as those specific to IBM Cloud Object Storage.
Global Attributes
The following attributes are available for segmenting all of the metrics listed above
Attribute | Attribute Name | Attribute Description |
---|---|---|
Cloud Type |
ibm_ctype |
public, dedicated or local |
Location |
ibm_location |
The location of the monitored resource. This may be a Cross Region, Regional, or Single Site bucket. |
Resource |
ibm_resource |
COS bucket name |
Resource Type |
ibm_resource_type |
COS bucket |
Scope |
ibm_scope |
The scope is the account associated with this metric. |
Service name |
ibm_service_name |
cloud-object-storage |
Additional Attributes
The following attributes are available for segmenting one or more attributes as described in the reference above. Please see the individual metrics for segmentation options.
Attribute | Attribute Name | Attribute Description |
---|---|---|
IBM COS Bucket storage class |
ibm_cos_bucket_storage_class |
Storage class of the bucket |
Service instance |
ibm_service_instance |
The service instance segment identifies the guid of the instance the metric is associated with. |
Next Steps
You will want to manage the data the Monitoring instance is collecting for you. From management to setting alerts, see Managing data to monitor your data quickly and efficiently.