vania-janet/multiturn-rag-retrieval-data huggingface dataset:
For platform metrics, leave the Enable option selected.

b. If you already have a Monitoring service instance in the same region but it isn't enabled to receive platform metrics, you need to select the Monitoring service instance to receive platform metrics in the dialog box.







 Viewing metrics 

After you enable monitoring, click Launch monitoring on the Observability page of the Hyper Protect DBaaS for MongoDB dashboard to be directed to the Monitoring dashboard to view the metrics. For more information about using the Monitoring dashboard and configuring alerts, see the [Getting started tutorial](https://cloud.ibm.com/docs/monitoring?topic=monitoring-getting-started-monitorgetting-started-monitor_step5).





 Available metrics 

The table describes all the available metrics for Hyper Protect DBaaS for MongoDB.



Table 1. Hyper Protect DBaaS for MongoDB metrics

 Metric Readable name Description 

 ibm_hyperp_dbaas_mongodb_cpu_percent CPU Idle Percentage CPU idle states measured in percentage 
 ibm_hyperp_dbaas_mongodb_memory_percent Memory Usage Memory usage measured in percentage 
 ibm_hyperp_dbaas_mongodb_df_percent Database Disk Usage Disk usage measured in percentage 



If you need to view all metrics of your databases, use any other tools that you prefer to connect to your databases. For more information, see [Monitoring for MongoDB](https://docs.mongodb.com/manual/administration/monitoring/).
The alternative values are saved as an object that contains a value and confidence for each alternative time and is stored in a JSON Array. To get an alternative value, use the syntax: @sys-time.alternative.
* .calendar_type: Specifies the calendar type for the timezone in use. GREGORIAN is the only supported type.
* .granularity: Recognizes mentions of time frames. Options are hour, minute, second and instant.
* .hour: Helper method that returns the hour that is specified in the time as a numeric value.
* .interpretation: The object that is returned by your assistant which contains new fields that increase the precision of the system entity classifier. You can omit interpretation from the expression that you use to refer to its fields. For example, you can access the value of the granularity field in the interpretation object by using the shorhand syntax <? @sys-time.granularity ?>.
* .literal: Exact phrase in input that is interpreted to be the time.
* .location: Lists the index element values of the first and last letters in the text string for the phrase that is interpreted to be a time mention.
* .minute: Helper method that returns the minute value that is specified in the time.
* .part_of_day: Recognizes terms that represent the time of day, such as morning, afternoon, evening, night, or now. Also sets a time range for each part of the day. The response contains two @sys-time values, one for the start and one for the end of the time range. The entities array contains a range_link object with time-from and time-to role types. The time ranges for different parts of the day can differ by locale. For US English, morning is 6:00:00 to 12:00:00, afternoon is 12:00:00 to 18:00:00, evening is 18:00:00 to 22:00:00, and night is 22:00:00 to 23:59:59. Night ends just before midnight because otherwise it would overlap with a new day, which is measured by @sys-date.
Monitoring for Db2 on Cloud 

Get insight into your Db2 on Cloud instance. These metrics can help you find bottlenecks or predict possible production problems.

You can use the IBM Cloud® Monitoring service to monitor your Db2 on Cloud instance. Db2 on Cloud forwards selected information about your instance to Monitoring so that you can monitor specific metrics such as cpu and memory utilization.

For additional details on platform metrics, please see [Platform Metrics Introduction](https://www.ibm.com/cloud/blog/announcements/introducing-ibm-cloud-platform-metrics-for-db2-on-cloud).

Monitoring metrics are currently available for only Enterprise and Standard plans. Lite plans are currently not supported.



 Set up your Db2 on Cloud service instance 

To set up Monitoring for Db2 on Cloud, you must create a service instance and then enable Platform Metrics in the same region as the Db2 on Cloud instance that you want to monitor. If you have deployments in more than one region, you must provision Monitoring and enable platform metrics for each region.

To set up Monitoring,



1. From the IBM Cloud navigation menu, select Observability.
2. Select Monitoring.
3. Either use an existing Monitoring service instance or create a new one.
4. After the instance is ready, enable platform metrics by clicking Configure platform metrics.
5. Select a region and then a Monitoring instance from that region. If you have deployments in more than one region, you must provision Monitoring and enable platform metrics for each region.







 Accessing your IBM Cloud Monitoring metrics 

To see your Db2 on Cloud customer metrics dashboards in Monitoring:



1. From the IBM Cloud navigation menu, select Observability.
2. Select Monitoring.
3. Select View IBM Cloud Monitoring to open the dashboard.



For more information, see [Monitoring Getting started tutorial](https://cloud.ibm.com/docs/monitoring?topic=monitoring-getting-started).





 Metrics available by Service Plan 



 Metric Name
The timestamp could also be an epoch timestamp.

This approach allows the data for each device to be queried efficiently by using partitioned indexes. However, global indexes might need to be used to create views over multiple devices, for example, all devices on a specific piece of infrastructure.

For illustrative purposes, let's make the scenario a bit more complicated. Assume that the application mostly needs to read all sensor data for a specific piece of infrastructure rather than for individual devices.

In this application, you query by infrastructure item to be most efficient, so partitioning the data by piece of infrastructure makes a lot more sense than by ID. This practice would allow all the devices for a specific piece of infrastructure to be efficiently queried as a group.

For the rare queries by device, you use two approaches:



1. Build a global index that is keyed by device and query it. This approach is more effective if queries to individual devices are rare and not repeated.
2. Build a global index-mapping device to infrastructure, then issue partition queries to the infrastructure partition. This approach makes sense if repeated queries to specific devices are used as the mapping can be cached. This approach is used for this application.



Let's look at how this approach works out. Let's look at four queries:



1. Readings for all time for a piece of infrastructure.
2. Readings for today for a piece of infrastructure.
3. Readings for all time for a specific device.
4. Readings for today for a specific device.





 Creating the database 

To create a partitioned database, pass true as the partitioned argument to the database creation request:

All tutorials in this section will use readings as the example database.



* Curl
* Java
* Node
* Python
* Go



curl -X PUT "$SERVICE_URL/readings?partitioned=true"

import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.Ok;
import com.ibm.cloud.cloudant.v1.model.PutDatabaseOptions;
By Source & App displays the log line in the combined context of the app and source.
8. Click Continue in New Viewer to open the view as a new Unsaved View. Keeping multiple views can help troubleshoot problems.







 Step 7: Filtering to a specific timeframe 

You can search for events occurring in a specified timeframe.

The timeframe can be an absolute time, relative time, or a time range.



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 Views icon![Views icon](https://cloud.ibm.com/docs-content/v1/content/f61dbc5d84bf0c89e477a05cab04c72f429e1b7a/log-analysis/images/views.png).
3. Select a log view. You might want to use the [custom view you created](https://cloud.ibm.com/docs/log-analysis?topic=log-analysis-tutorial-use-logdnaLA-create-custom-view).
4. In the Jump to timeframe field ![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.
"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.

Zoom

![Launching instances](https://cloud.ibm.com/docs-content/v1/content/63322f2f3a72050206eb05ba7f590fdcb741105c/cloud-object-storage/images/SysDig-instance-management.png)

Figure 1. Launching Monitoring instances





 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.

Zoom

![Dashboard configuration](https://cloud.ibm.com/docs-content/v1/content/63322f2f3a72050206eb05ba7f590fdcb741105c/cloud-object-storage/images/SysDig-pre-built-reports.png)

Figure 2. Choose a pre-built report





 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.

Zoom

!
{
"word_alternatives":
{
"start_time": 0.03,
"alternatives":
{
"confidence": 0.96,
"word": "the"
}
],
"end_time": 0.09
},
{
"start_time": 0.09,
"alternatives":
{
"confidence": 0.96,
"word": "latest"
}
],
"end_time": 0.62
},
{
"start_time": 0.62,
"alternatives":
{
"confidence": 0.96,
"word": "weather"
}
],
"end_time": 0.87
},
{
"start_time": 0.87,
"alternatives":
{
"confidence": 0.96,
"word": "report"
}
],
"end_time": 1.5
}
],
"keywords_result": {},
"alternatives":
{
"timestamps":

"the",
0.03,
0.09
],

"latest",
0.09,
0.62
],

"weather",
0.62,
0.87
],

"report",
0.87,
1.5
]
],
"confidence": 0.99,
"transcript": "the latest weather report "
}
],
"final": true
},
{
"word_alternatives":
{
"start_time": 0.15,
"alternatives":
{
"confidence": 1.0,
"word": "a"
}
],
"end_time": 0.3
},
{
In this dashboard, you can see the number of monitoring agents that are deployed and connected to the instance, check the version of the monitoring agents, and find out how many metrics per host the agent is collecting.

In this dashboard, the panel TimeSeries Usage provides the number of time-series that are collected from each category (Prometheus, JMX, StatsD, Prometheus Remote Write and Platform Metrics). This panel uses the query sum(sysdig_ts_usage)by(metric_category) that you can also run in PromQL Explorer, in your dashboards or for alerts.

In case you need to investigate which applications or services are contributing more to the Prometheus time-series, you can use the metric scrape_series_added. This metric represents the number of time series scraped and ingested from the monitoring agent via Prometheus and includes several labels to facilitate the analysis such as kube_cluster_name, kube_namespace_name, kube_workload_name or container_name.

The following query represents the number of time series ingested from the monitoring agent via Prometheus grouped by cluster, namespace, workloads and container so you can identify those applications that are contributing more time series:

sum(scrape_series_added)by(kube_cluster_name, kube_namespace_name, kube_workload_name, container_name)
The alternative values are saved as an object that contains a value and confidence for each alternative time and is stored in a JSON Array. To get an alternative value, use the syntax: @sys-time.alternative.
* .calendar_type: Specifies the calendar type for the timezone in use. GREGORIAN is the only supported type.
* .granularity: Recognizes mentions of time frames. Options are hour, minute, second and instant.
* .hour: Helper method that returns the hour that is specified in the time as a numeric value.
* .interpretation: The property that is returned by your assistant which contains new fields that increase the precision of the system entity classifier. You can omit interpretation from the expression that you use to refer to its fields. For example, you can access the value of the granularity field in the interpretation property by using the shorhand syntax <? @sys-time.granularity ?>.
* .literal: Exact phrase in input that is interpreted to be the time.
* .location: Lists the index element values of the first and last letters in the text string for the phrase that is interpreted to be a time mention.
* .minute: Helper method that returns the minute value that is specified in the time.
* .part_of_day: Recognizes terms that represent the time of day, such as morning, afternoon, evening, night, or now. Also sets a time range for each part of the day. The response contains two @sys-time values, one for the start and one for the end of the time range. The entities array contains a range_link object with time-from and time-to role types. The time ranges for different parts of the day can differ by locale. For US English, morning is 6:00:00 to 12:00:00, afternoon is 12:00:00 to 18:00:00, evening is 18:00:00 to 22:00:00, and night is 22:00:00 to 23:59:59. Night ends just before midnight because otherwise it would overlap with a new day, which is measured by @sys-date.
A cooldown period ensures that your app does not launch new instances or stop existing instances before your app is stable. The cooldown period is specified in seconds. The default cooldown period is 300 seconds.



4. (Optional) Define Schedules to scale your app during a set time period.

You can define specific time periods when you know that your app requires different numbers of instances to handle peak loads. The schedule policy overwrites the default instance limits and sets the number of instances to the Initial Minimum Instance Count value for the scheduled period.

To define a schedule, complete the following steps. You can define multiple schedules.



1. Open Schedules.
2. Select the Time Zone where the schedule is defined.
3. Indicate whether the schedule is always in effect (recurring schedules), or is only in effect for the specified date range (specific schedules).
4. For recurring schedules, select whether the schedule is repeated weekly or monthly.
5. For recurring schedules, select the days of the week or month when the schedule applies.
6. Specify the start and end time of the schedule, the minimum number of instances to be run, the initial minimum instances, and the maximum instances that are run during the period.



During the scheduled time periods, all other autoscaling rules are still in effect.









 Importing a JSON policy file 

You can import a JSON policy file by clicking Import From JSON. See the [policy specification](https://github.com/cloudfoundry/app-autoscaler/blob/master/docs/Readme.md) for the autoscaling policy JSON format.





 Metric statistics 

After a policy is defined with autoscaling rules, you can view the metric values and metrics history for the previous 2 hours.

The metric value is not the raw data from each app instance, but the metric values averaged over all the app instances.





 Scaling history 

Use the Scaling history tab to view the autoscaling events for the past 30 days. If autoscaling attempts failed, the tab also shows the error messages.







 Managing autoscaling from the CLI
If you want to access logs for job runs that have been completed hours or days ago, then use IBM Log Analysis capabilities. Log Analysis offers various plans to control the retention period for logs. If your job runs are no longer in the system, use an IBM Log Analysis instance in the same region as your Code Engine project. See [Getting started with IBM Log Analysis](https://cloud.ibm.com/docs/log-analysis?topic=log-analysis-getting-started).

For more information about working with jobs and job runs, see [Working with jobs and job runs](https://cloud.ibm.com/docs/codeengine?topic=codeengine-job-plan).
Click the checkbox for one or more of the assistants, and then click Assign.



Keep track of when this version is deployed to an assistant and for how long. It is likely that you will want to analyze user conversations that occur between users and this specific version of the skill. You can get this information from the Analytics page. However, when you pick a data source, versions are not listed. You must choose the name of the assistant to which you deployed this version. You can then filter the metrics data to show only those conversations that occurred between the start and end dates of the time frame during which this skill version was deployed to the assistant.





 Skill version limits 

The number of versions you can create for a single skill depends on your Watson Assistant plan.



Service plan details

 Service plan Versions per skill 

 Enterprise 50 
 Premium (legacy) 50 
 Plus 10 
 Trial 10 
 Lite 0 







 Swapping skills 

If you find that an earlier version of the skill did a better job of recognizing and addressing customer needs than a later version, you can swap the skill that is linked to the assistant to use the earlier version instead.

Follow the same steps you use to [deploy a skill version](https://cloud.ibm.com/docs/assistant?topic=assistant-versionsversions-deploy) to change the version that is linked to an assistant.





 Accessing a saved version 

The only way to view a saved version is to overwrite the in-progress development version of the skill with the saved version. (But not before you have saved any work you have done in the current development version.)

You cannot edit a saved version. To achieve the same goal, you can use a saved version as the basis for a new version in which you incorporate any changes you want to make. To start development work from a saved version, overwrite the in-progress development version of the skill with the saved version.



1. Save any changes you made to the skill since the last time you created a version.

Save a version of the skill now. Otherwise, your work will be lost when you follow these steps.
2. From the version you want to edit, click the Skill actions!
[Learn more](https://cloud.ibm.com/docs/activity-tracker?topic=activity-tracker-control_usage_instance).





 Analyzing event data trends 

In IBM Cloud® Activity Tracker, you can query your auditing instance by using the Usage API and identify trends over a period of time.

You can analyze event data trends to assess the growth or decline of auditing data over time for services running in your account. You can monitor data trends to identify patterns and make predictions of how services are used in the account.

When you use the Usage API, consider the following information:



* Analyze 3 or more months worth of auditing data to identify patterns and trends.
* You can use the API to monitor the number of lines that are collected per service over a period of time.
* You can use the API to find out the top services that are driving the main load of data in a region.
* If you have exclusion rules defined, these lines are not included in the usage data response. The API reports number of lines that are ingested and not excluded via exclusion rules.



You can query data usage for up to 6 months.

[Learn more](https://cloud.ibm.com/docs/activity-tracker?topic=activity-tracker-control_usage_api).
.measure("GIGABYTE")
.quantity(Long.valueOf(0))
.build();
List<MeasureAndQuantity> measures = new ArrayList<>();
measures.add(lookupMeasure);
measures.add(writeMeasure);
measures.add(queryMeasure);
measures.add(gbMeasure);

ResourceInstanceUsage resourceInstanceUsageModel = new ResourceInstanceUsage.Builder()
.resourceInstanceId(resourceInstanceId)
.planId(planId)
.region(region)
.start(startTime)
.end(endTime)
.measuredUsage(measures)
.build();

ReportResourceUsageOptions reportResourceUsageOptions = new ReportResourceUsageOptions.Builder()
.resourceId(resourceId)
.resourceUsage(new java.util.ArrayList<ResourceInstanceUsage>(
java.util.Arrays.asList(resourceInstanceUsageModel)))
.build();

Response<ResponseAccepted> response = service.reportResourceUsage(reportResourceUsageOptions).execute();
ResponseAccepted responseAccepted = response.getResult();

System.out.println(responseAccepted);

// Report usage for a mythical resource.
// Use zero for quantities since this is only an example.
measures = [
{
'measure': 'LOOKUP',
'quantity': 0,
},
{
'measure': 'WRITE',
'quantity': 0,
},
{
'measure': 'QUERY',
'quantity': 0,
},
{
'measure': 'GIGABYTE',
'quantity': 0,
},
]

resource_instance_usage_model = {
Cooldown period (seconds) For a dynamic group, the cooldown period is the time in seconds to pause further scaling actions after scaling takes place. 







 Creating scaling policies 

For the dynamic scaling method, you define certain metrics (like CPU utilization percent) and the target utilization that you want to achieve for that metric. Together, the metric and the average target utilization, determine when your instance group needs to dynamically add or remove virtual server instances from your group.

To add scaling policies, complete the following fields on the New instance group for VPC page. If you need to add policies after your instance group is already created, see [add policies](https://cloud.ibm.com/docs/vpc?topic=vpc-managing-instance-groupcreating-target-policies).



Table 3. Scaling policies selections

 Field Value 

 Metric type Select the metric type that you want to associate with a target utilization value to use for adding or removing instances from your group. You can choose one of these metrics: CPU utilization (%), RAM utilization (%), Network in (Mbps), Network out (Mbps). You can define more than one target metric policy, but only one policy for each type of metric. 
 Average target utilization Specify the average utilization that you want to achieve for the metric that you select. This target value defines when the instance group manager needs to scale up instances or scale down instances in your group. At the end of each aggregation window, the instance group manager adds the current utilization of each instance and divides it by this target utilization value to determine the membership count. 









 Setting up auto scale with the CLI 

You can create an instance group in your IBM Cloud VPC to auto scale according to your requirements by using the IBM Cloud CLI.



 Before you begin 

Make sure that you set up your [IBM Cloud® CLI environment](https://cloud.ibm.com/docs/vpc?topic=vpc-set-up-environmentcli-prerequisites-setup) and your [IBM Cloud VPC](https://cloud.ibm.com/docs/vpc?topic=vpc-creating-a-vpc-using-cli).