vania-janet/multiturn-rag-retrieval-data huggingface dataset:
IBM Cloud Metrics Routing can only route metrics that are generated in [supported regions](https://cloud.ibm.com/docs/metrics-router?topic=metrics-router-regions). Other regions, where IBM Cloud Metrics Routing is not available, continue to collect and manage metrics by using the Monitoring service.



You can collect metrics that are generated by IBM Cloud Metrics Routing by using any of the following methods:



Table 1. Methods to manage metrics in an IBM Cloud account.

 Method Supported 

 Configuring IBM Cloud Metrics Routing ![Checkmark icon](https://cloud.ibm.com/docs-content/v1/content/dad8f28785f0dc036aaae4b777787e73db9ff0d4/icons/checkmark-icon.svg) 
 Configuring the Monitoring service ![Checkmark icon](https://cloud.ibm.com/docs-content/v1/content/dad8f28785f0dc036aaae4b777787e73db9ff0d4/icons/checkmark-icon.svg) 







 Locations of service metrics 

IBM Cloud Metrics Routing automatically generates metrics in all of the [supported regions](https://cloud.ibm.com/docs/atracker?topic=atracker-regionsregions-atracker) so that you can track activity of the service in the account.

The following tables list the locations where the automatic collection of IBM Cloud Metrics Routing service metrics is enabled.



Table 2. The automatic collection of IBM Cloud Metrics Routing metrics in Americas locations

 Locations in Americas Service metrics available 

 Dallas (us-south) ![Checkmark icon](https://cloud.ibm.com/docs-content/v1/content/dad8f28785f0dc036aaae4b777787e73db9ff0d4/icons/checkmark-icon.svg) 
 Washington DC (us-east) !
Analyzing event data trends by using the API 

In IBM Cloud® Activity Tracker, you can query your auditing instance and identify usage trends over a period of time by using the Usage API. You can get aggregated usage data information for 1 or more services during a specific period of time and within the last 6 months.



 API method 

The method for querying usage data is:

curl "<ENDPOINT>/v1/usage/hosts/<SERVICE_NAME>?from=<FROM_DATE>&to=<TO_DATE>&limit=<LIMIT_NUMBER>" -u <SERVICE_KEY>:



* Replace <ENDPOINT> with the IBM Cloud Activity Tracker API endpoint. To see the list of endpoints, see either [Public API endpoints](https://cloud.ibm.com/docs/activity-tracker?topic=activity-tracker-endpointsendpoints_api-at-public) or [Private API endpoints](https://cloud.ibm.com/docs/activity-tracker?topic=activity-tracker-endpointsendpoints_api-at-private) as appropriate for your environment.
* Replace <SERVICE_NAME> with the [CRN service name](https://cloud.ibm.com/docs/activity-tracker?topic=activity-tracker-cloud_services) for the service you are interested in. If not specified, data for all services meeting the other criteria will be returned.
* Replace the <SERVICE_KEY> with a valid service key for the IBM Cloud Activity Tracker instance. For more information, see [Service keys by using the API](https://cloud.ibm.com/docs/activity-tracker?topic=activity-tracker-service_keysservice_keys_api).
* Replace <LIMIT_NUMBER> with the number of services to be returned from the highest usage to the lowest. If not specified, only the highest-usage service will be returned. <LIMIT_NUMBER> is an integer number.
* Replace <FROM_DATE> with your desired starting date in Unix epoch format.
Extracting metrics from a Monitoring instance by using the Monitoring API 

You can extract metrics from an IBM Cloud Monitoring instance by using the Monitoring API.



 Get metrics by using cURL 

You can use the following [cURL command](https://cloud.ibm.com/docs/monitoring?topic=monitoring-mon-curl) to get metrics:

curl -X POST <SYSDIG_REST_API_ENDPOINT>/data -H "Authorization: $AUTH_TOKEN" -H "IBMInstanceID: $GUID" -H "SysdigTeamID: $TEAM_ID" -H "content-type: application/json" -d DATA

Where



* <SYSDIG_REST_API_ENDPOINT>indicates the endpoint targetted by the REST API call. For more information, see [Monitoring REST API endpoints](https://cloud.ibm.com/docs/monitoring?topic=monitoring-endpointsendpoints_rest_api). For example, the public endpoint for an instance that is available in us-south is the following: https://us-south.monitoring.cloud.ibm.com/api
* You can pass multiple headers by using -H.

Authorization and IBMInstanceID are headers that are required for authentication.

SysdigTeamID is optional. When you specify this header, you limit the request to the data and resources available for the team specified.

To get an AUTH_TOKEN and the GUID see, [Headers for IAM Tokens](https://cloud.ibm.com/docs/monitoring?topic=monitoring-mon-curlmon-curl-headers-iam).
* You can pass the file metrics.json to extract metrics by using -d, for example, -d @metrics.json.



The following sample shows a template for the metrics.json file:

{
"start": "Number: seconds",
"end": "Number: seconds",
"last": "Number: last available seconds",
"metrics": [
{
"id": "<>",
Monitoring logs in your account 

You can monitor logs in your account through the IBM Log Analysis web UI. You can also export sets of logs to analyze them in a different context.

To view logs, you must [launch the web UI](https://cloud.ibm.com/docs/log-analysis?topic=log-analysis-launch&interface=ui) in the location where logs are available. Then, you can work with views to monitor those logs. You view logs in your local time.

You can select the logs that are displayed through a view by applying a timestamp, a search query, or both.



* You can apply a search query, and save it as a custom view.
* You can apply a timestamp to jump to a specific time in your event log.



When you apply a search query, you can save that view for reuse later. However, timestamps are not saved.

Notice that instances might have different service plans, and consequently different data retention periods that determine the number of days that you have data available for search though the web UI. You can only monitor logs within your retention period. Different [service plans](https://cloud.ibm.com/docs/log-analysis?topic=log-analysis-service_plans) have different retention periods.



 Monitoring logs through the default view 

The default view is named Everything.

As soon as you open the web UI in a location, this is the view that you see.

All logs in your instance are displayed through this view.





 Monitoring logs through custom views 

You might want to monitor a set of logs in your account. To anayze a subset of logs, you can create custom views.

You create a custom view by applying a search query that defines what logs to display through the view. [Learn more](https://cloud.ibm.com/docs/log-analysis?topic=log-analysis-views).

You can also run any of the following tasks:



* [Attach an alert](https://cloud.ibm.com/docs/log-analysis?topic=log-analysis-alerts) to a custom view
The UI presents the different available zones in the same region.
3. Resource group - Select the resource group from the list.
4. Tags - Optionally, specify [user tags](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-managing&interface=uifs-add-user-tags). The tags that you apply to the replica can be the same as or different from the source share's tags.
5. Mount Targets - Optionally, create a mount target for the replica share. Mount targets depend on the VPC in the zone that you're using. You can specify a mount target later.



1. Provide a mount target name.
2. Select a virtual private cloud.
3. Click Save.



6. Profile - Select a [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) for the replica file share. The profile can be different from the source file share's profile. Selecting a different replica profile determines the performance that you get when you [perform a failover](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-failover). Depending on the source volume size, some profiles might be disabled.
7. Size - The replica size (GBs) is inherited from the source volume.
8. Sync frequency - Specify how often you want to synchronize changes from the primary file share to the replica share. The Summary shows the selections that you made. For Frequency, the options are hourly, daily, weekly, monthly, or by cron-spec expression:



* For hourly, enter a value in the range 0 - 60 to specify exactly how many minutes past the hour, every hour, every day the replication is to start.
* For daily, specify the starting time in hours and minutes in Coordinated Universal Time. Enter a value between 00:00 and 23:59. For your convenience, the Coordinated Universal Time value is converted into your local time.
[Pencil icon](https://cloud.ibm.com/docs-content/v1/content/220cdcbf6f4421bd7fee83fd1028048dba3f16c8/monitoring/images/pencil.png). Then, change the scope. If you need to restore the dashboard scope to the panel, delete the custom scope. Click Apply.
6. In the Compare to field set the time range for the comparison.
7. For Number and Threshold chart types you can set the panel color based on metric thresholds. Click Override Color Coding, then, Enable. Set values for the different thresholds.
8. Click Save.









 Changing the scope 

Instead of changing the scope of a pre-defined dashboard, copy the dashboard and change the scope in the copied dashboard.

Complete the following steps to change the scope of a dashboard:



1. Navigate to the Dashboards section in the Web UI, and select a dashboard.
2. Click the Pencil icon ![Pencil icon](https://cloud.ibm.com/docs-content/v1/content/220cdcbf6f4421bd7fee83fd1028048dba3f16c8/monitoring/images/pencil.png) to Edit Dashboard Scope to change default scope.
3. Select the scope.
When a user uses toolchains in multiple regions or resource groups, they are counted and billed for each Continuous Delivery service instance within each unique pairing of region and resource group.

You can manage the list of authorized users on the Manage tab within the Continuous Delivery service instance.



1. Go to the [Resource list](https://cloud.ibm.com/resources) for your IBM Cloud account.
2. In the Name column, in the filter text box, type Continuous Delivery to view your existing services.
3. For each service, click the hyperlink in the Name column.
4. In the Manage tab, you can view, add, or remove users from the list of Authorized Users, as needed.



Users are automatically added or added again when they use the Continuous Delivery service.





 How can you view billing and usage information? 

You can view all of the instances of the Continuous Delivery service in your account and the number of users and pipeline executions that are reported against each instance in an IBM Cloud Public environment.



1. From the menu bar, click Manage > Billing and usage.
2. Click Usage.
3. In the Services section, click View plans for the Continuous Delivery service.
4. Click View details for the plan that you want to view information about.
5. Click View instance details for the instance of Continuous Delivery that you want to view usage information for.



The AUTHORIZED_USERS_PER_MONTH metric is calculated based on a monthly average of users that is counted daily.





 What happens when you exceed the limits of your service plan? 

The Lite service plan has other limitations, such as the number of Classic Delivery Pipeline jobs or Tekton steps that can run, or the storage consumption. For more information about the plan description, see the [service catalog](https://cloud.ibm.com/catalog/services/continuous-delivery). If any of the plan limitations are exceeded in a billing period, the service suspends. For example, Classic Delivery Pipeline jobs (or Tekton pipeline runs) do not run for the remainder of the billing period.

Upgrading to the Professional plan will remove these limitations and reactivate the service.





 How can you change to a different service plan?
Then, identify the panel that displays the metric that you want to copy.
2. Click the Actions icon ![Three dots icon](https://cloud.ibm.com/docs-content/v1/content/220cdcbf6f4421bd7fee83fd1028048dba3f16c8/monitoring/monitor/images/actions.png) and select Duplicate Panel![Duplicate Panel icon](https://cloud.ibm.com/docs-content/v1/content/220cdcbf6f4421bd7fee83fd1028048dba3f16c8/monitoring/monitor/images/duplicate.png).







 Delete a panel 

Complete the following steps to delete a panel in the current dashboard:



1. Navigate to the Dashboards* section in the Web UI. Select a dashboard. Then, identify the panel that displays the metric that you want to copy.
2. Click the Actions icon ![Three dots icon](https://cloud.ibm.com/docs-content/v1/content/220cdcbf6f4421bd7fee83fd1028048dba3f16c8/monitoring/monitor/images/actions.png) and select Delete![Delete icon](https://cloud.ibm.com/docs-content/v1/content/220cdcbf6f4421bd7fee83fd1028048dba3f16c8/monitoring/monitor/images/delete.png).
3. Click Delete Panel to confirm the deletion of the panel.







 Export data from a panel 

Complete the following steps to export data from a panel:



1. Navigate to the Dashboards* section in the Web UI. Select a dashboard. Then, identify the panel that displays the metric that you want to copy.
2. Click the Actions icon !
When you change the scope, you can change the scope to report on a specific Cloud Foundry app, on a Cloud Foundry app index, on apps running in a Cloud Foundry organization, or on apps running in a Cloud Foundry space.







 Metrics dictionary 



* [CPU entitlement of the Cloud Foundry application](https://cloud.ibm.com/docs/cloud-foundry-public?topic=cloud-foundry-public-monitor-cf-sysdigibm_cloudfoundry_app_cpu_entitlement)
* [CPU usage of the Cloud Foundry application](https://cloud.ibm.com/docs/cloud-foundry-public?topic=cloud-foundry-public-monitor-cf-sysdigibm_cloudfoundry_app_cpu_usage)
* [CPU utilization of the Cloud Foundry application](https://cloud.ibm.com/docs/cloud-foundry-public?topic=cloud-foundry-public-monitor-cf-sysdigibm_cloudfoundry_app_cpu_utilization)
* [Container age of the Cloud Foundry application](https://cloud.ibm.com/docs/cloud-foundry-public?topic=cloud-foundry-public-monitor-cf-sysdigibm_cloudfoundry_app_container_age)
* [Disk usage of the Cloud Foundry application](https://cloud.ibm.com/docs/cloud-foundry-public?topic=cloud-foundry-public-monitor-cf-sysdigibm_cloudfoundry_app_disk_bytes_used)
* [Memory usage of the Cloud Foundry application](https://cloud.ibm.com/docs/cloud-foundry-public?topic=cloud-foundry-public-monitor-cf-sysdigibm_cloudfoundry_app_memory_bytes_used)
* [Total disk size of the Cloud Foundry application](https://cloud.ibm.com/docs/cloud-foundry-public?topic=cloud-foundry-public-monitor-cf-sysdigibm_cloudfoundry_app_disk_bytes_total)
IBM Cloud Monitoring is available for deployments in every region. Deployments in Multi-zone Regions (MZRs) - eu-gb, eu-de, us-east, us-south, jp-tok, au-syd - have their metrics in the corresponding region.

If you have deployments that are in Single-zone Region (SZR)che01 then your logs are forwarded to an IBM Cloud Monitoring instance in another region. You need to provision monitoring instances in the region where your metrics are forwarded to. Metrics for deployments in che01 go to jp-tok.





 Oplog Sizing 

Oplog sizing is handled by Cloud Databases. If you run a command to resize your Oplog in Compass, the resize will not persist. For more information, please [create a support ticket](https://www.ibm.com/cloud/support).





 Available Metrics 



Table 1. Available Metrics

 Metric Name 

 [Average time spent acquiring locks in microseconds](https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-monitoringibm_databases_for_mongodb_locks_time_acquiring_microseconds_total_average) 
 [Average time spent acquiring locks in microseconds](https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-monitoringibm_databases_for_mongodb_locks_time_acquiring_microseconds_W_average) 
 [Connections](https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-monitoringibm_databases_for_mongodb_connections) 
 [Disk read latency mean](https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-monitoringibm_databases_for_mongodb_disk_read_latency_mean)
Optionally specify a time range for the selected days. A graph will help you determine the number of log entries for the timezone and time range.



6. Configure the Monitoring instance details.

Specify the API key. Set this field to the API token. For more information on how to get the token, see [Working with tokens](https://cloud.ibm.com/docs/monitoring?topic=monitoring-api_token).

Specify the Monitoring (Sysdig) instance URL. Set this field to the endpoint where the instance is available. For more information, see [Monitoring endpoints](https://cloud.ibm.com/docs/monitoring?topic=monitoring-endpointsendpoints). For example, https://eu-gb.monitoring.cloud.ibm.com.

You might need to manually enter the appropriate URL for your instance. Your instance URL might not be included in the provided list. Specifying the incorrect URL will result in your data flowing to the wrong instance and you will not see your data where intended.

Specify the Severity. Valid values are Info, Low, Medium, or High.
7. Optional: You can click Test to test that your alert configuration is correct.
8. Click Save Alert.

The alert definition must be saved for alerts to be sent to Monitoring.







 Managing alerts 

In Monitoring, you get a custom event when an alert is triggered.

You can view the events by filtering by name or level in the Events section of the Monitoring instance.

![Monitoring sample](https://cloud.ibm.com/docs-content/v1/content/6f3c07c34058f637b1c86044ca4f9b24214330a7/activity-tracker/alerts/images/sysdig-sample.png)

To view alerts, a user must have permissions to navigate to the web UI. [Learn more](https://cloud.ibm.com/docs/monitoring?topic=monitoring-launch).
Note that manual verification of your storage metrics is a temporary workaround and not a permanent monitoring solution for viewing metrics. After completing the following steps, if you are able to manually view the metrics in the CLI and not the dashboard, this indicates that there is a console issue for which you must [open a support issue](https://cloud.ibm.com/docs/openshift?topic=openshift-get-helphelp-support).

After you complete the following steps, make sure to remove the resources you created while debugging.



1. Create and deploy a custom clusterRole configuration. In this example, the clusterRole is named test-metrics-reader.

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: test-metrics-reader
rules:
- nonResourceURLs:
- "/metrics"
verbs:
- get
- apiGroups:
- ""
resources:
- nodes/metrics
verbs:
- get
Show more

oc apply -f <file_name>
2. Create a service account. In this example, the service account is named test-sa.

oc create sa test-sa
3. Add a clusterRoleBinding to the clusterRole.

oc create clusterrolebinding test-metrics-reader --clusterrole test-metrics-reader --serviceaccount=default:test-sa
4. List your nodes and note the name and IP of the node for which you want to gather metrics.

oc get nodes

Example output.

NAME STATUS ROLES AGE VERSION
10.111.1.11 Ready <none> 1d v1.26+IKS
5. Create a yaml file to deploy a pod onto the node. Make sure to specify the service account you created and the node IP address.

apiVersion: v1
kind: Pod
metadata:
name: testpod
spec:
nodeName: 10.111.1.111
You can also use the Usage Reports API to get [account summary usage](https://github.ibm.com/BSS/metering-report-downloader/wiki/Regular-Usage-Reportsaccount-summary-report) and [resource instance usage](https://github.ibm.com/BSS/metering-report-downloader/wiki/Regular-Usage-Reportsaccount-instance-report).

The following examples show queries that you can use to download your enterprise account .csv report. When you call the API, replace the ID variables and IAM token with the values from your enterprise.

curl -X GET -H 'Authorization: Bearer <IAM Token>' '{base_url}/v1/resource-usage-reports?month=2023-03&format=csv&recurse=true&enterprise_id={enterprise_id}'



 Understanding .csv table headings and JSON report fields for enterprise account summary 

The following table shows the correlation between the heading titles in your .csv report and JSON report fields.

Entity Metadata

Entity Hierarchy

Billing Units

Credit Pools

Overages

Enterprise Usage Summary

Enterprise Resource Usage



Table 1. Enterprise usage report CSV contents for entity metadata

 .csv Header Description 

 Entity ID ID of the requested entity (enterprise_id/account_group_id/account_id) 
 Entity Type Type of the requested entity (enterprise/account_group/account) 
 Billing Month The month in which usages were incurred. Represented in yyyy-mm format 
 Currency Rate Currency Exchange Rate with USD as the base 
 Created Time Timestamp at which the CSV report was generated 



When recurse=true, the usage in the Enterprise Resource Usage section is aggregated by each metric of a service plan and it's broken down by child accounts. Each row represents the total usage of a service plan metric in some child account. When recurse=false, the usage is aggregated by each metric of a service plan and each row represents the total usage of a service plan metric of all the sub-accounts or child-accounts in the requested entity hierarchy.
[Jump to timeframe field](https://cloud.ibm.com/docs-content/v1/content/f61dbc5d84bf0c89e477a05cab04c72f429e1b7a/log-analysis/images/jumptotimeframe.png) enter a timeframe to filter the log.



1. Specify a specific date or date time. For example, Nov 16 will jump to log entries starting with that date. You can also specify a date and time. For example, Nov 16 22:29.
2. Specify a value relative to the current time. For example, 1 day ago or 5 hours ago.
3. Specify a date, or date and time range. For example, Nov 14 to Nov 15 or Nov 14 12:00 to Nov 14 23:59. Ranges can also be relative to the current time. For example, Yesterday 10am to Yesterday 11am.





If you get a “Your request is taking longer than expected, try refreshing your browser in a bit as we try to catch up” error message, the timeframe you specified might not have any available data. Change your timeframe and retry.





 Step 8: Create dashboard 

A dashboard provides interactive graphs that help you monitor your app. For example, graphs can help you analyze patterns and trends over a period of time.

The following will help you create a dashboard.



1. [Make sure you are logged in to the IBM Cloud and have accessed the IBM Log Analysis web UI](https://cloud.ibm.com/docs/log-analysis?topic=log-analysis-tutorial-use-logdnaLA-launch-ui).
2. Click the Boards icon ![Boards icon](https://cloud.ibm.com/docs-content/v1/content/f61dbc5d84bf0c89e477a05cab04c72f429e1b7a/log-analysis/images/boards.png).
3. Click NEW BOARD.
4. Click Add Graph.