vania-janet/multiturn-rag-retrieval-data huggingface dataset:
To advance to the dashboard selection menu, select Next and then Skip on the Choosing an installation method page. Accept the prompts that follow. You can then select the IBM Event Streams or IBM Event Streams (Enterprise) dashboard, depending on the plan that you use.







 Enabling enhanced Event Streams metrics 

The enhanced Event Streams metrics consist of three groups; topic, partition and consumers. You can opt in to either one, two, or all. The metrics available are described in the [topic](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-metricsmetrics-topic), [partition](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-metricsmetrics-partition) and [consumers](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-metricsmetrics-consumers) tables.

Enabling enhanced metrics introduces more global gauge metrics and therefore increases the costs.

Before you can start to use enhanced Event Streams metrics, you must first enable them by completing the following step:



* Run the following command to update the service instance to start using enhanced metrics:

ibmcloud resource service-instance-update <instance-name> -p '{"metrics":["topic","partition","consumers"]}'



When enhanced metrics are enabled, depending on the selection, the following new dashboards are available; IBM Event Streams(Topic), IBM Event Streams(Partitions) and IBM Event Streams(Consumers).

To opt out of enhanced metrics, run the following command:

ibmcloud resource service-instance-update <instance-name> -p '{"metrics":[]}'

Dashboards are available only after metrics started to be recorded; it might take a few minutes to initialize.







 Event Streams metrics cost information 

Before you opt in to using Monitoring metrics, be aware of the cost of doing so. The estimated cost depends on the following considerations:



* The Event Streams plan that you use.
* How many unique time series are sent for each plan.
* The number of topics that you created.
For data that is read and written, it is important to understand if the operations are read-heavy, write-heavy, or balanced.

Determine the frequency that your data is accessed.
: Hot data: Data that is accessed frequently. Common use cases are web or mobile apps.
: Cool or warm data: Data that is accessed infrequently, such as once a month or less. Common use cases are archives, short-term data retention, or disaster recovery.
: Cold data: Data that is rarely accessed, if at all. Common use cases are archives, long-term backups, historical data.
: Frozen data: Data that is not accessed and that you need to keep due to legal reasons.

If you can't predict the frequency or the frequency does not follow a strict pattern, determine whether your workloads are read-heavy, write-heavy, or balanced. Then, look at the storage option that fits your workload and investigate what storage tier gives you the flexibility that you need. For example, IBM Cloud Object Storage provides a flex storage class that considers how frequent data is accessed in a month and takes into account this measurement to optimize your monthly billing.

Investigate if your data must be shared across multiple app instances, zones, or regions.
: Access across pods: When you use Kubernetes persistent volumes to access your storage, you can determine the number of pods that can mount the volume at the same time. Some storage solutions can be accessed by one pod at a time only. With other storage solutions, you can share volume across multiple pods.
: Access across zones and regions: You might require your data to be accessible across zones or regions. Some storage solutions, such as file and block storage, are data center-specific and can't be shared across zones in a multizone cluster setup.

If you want to make your data accessible across zones or regions, make sure to consult your legal department to verify that your data can be stored in multiple zones or a different country.

Understand other storage characteristics that impact your choice.
: Consistency: The guarantee that a read operation returns the latest version of a file.
Building custom applications with the API 

Use the Discovery API to build a custom application or component that searches your data.



 Service API Versioning 

API requests require a version parameter that takes a date in the format version=YYYY-MM-DD. Whenever a backwards-incompatible API change occurs, a new minor version of the API is released.

Send the version parameter with every API request. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.

The current version is 2023-03-31.





 Getting your project ID IBM Cloud 

This information applies to IBM Cloud only.

To use the API, you must construct the URL to use in your requests. Many of the API methods require the project ID.



1. From the [IBM Cloud Resource list](https://cloud.ibm.com/resources), expand AI/Machine Learning, and then find the service page for your Discovery service instance.
2. From the Credentials section, copy the URL. You specify this value as the {url} in your API requests.
3. While you're on this page, copy the API key. You specify this value as the {apikey}.
4. Open your project in Discovery, and then go to the Integrate and deploy > API Information page.
5. Copy the project ID. You specify this value as the {project_id}.

If you're using a Content Mining project, stay on the Share Link page. From the web browser's location field, copy the URL starting with /projects. For example, projects/a8ce5fed-7f33-4405-aa4b-88ffba322712/deploy/beta. The ID that is specified after the /projects/ segment of the URL is your project ID.
6. Construct a request URL by using the IDs you copied.

For example, the following request lists the collections in the project:
To monitor platform metrics, check that the IBM Cloud Monitoring instance is provisioned in the same region where the IBM Cloud instance is provisioned.





 Viewing metrics 

To monitor App Configuration metrics, you must launch the IBM Cloud Monitoring web UI instance that is enabled for platform metrics in the region where your App Configuration instance is available.



 Launch IBM Cloud Monitoring web UI from the App Configuration dashboard 



1. Log in to IBM Cloud. The IBM Cloud dashboard opens.
2. Click View all in the Resource summary section of the dashboard.
3. In the Services section, click the App Configuration instance that you plan to monitor. The App Configuration UI Getting Started page opens.
4. Click the Actions menu, and select Monitoring.
5. A new tab in your browser opens and displays the default dashboard that is named IBM Cloud App Configuration within the context of your App Configuration instance.

Zoom

![UI for Getting Started](https://cloud.ibm.com/docs-content/v1/content/f3dada89f147af3b88388a2218ddbf64b3c41e5f/app-configuration/images/ac-monitor-dashboard.png)

Figure 1. Set up monitoring









 Access your IBM Cloud Monitoring metrics 



1. Launch the [IBM Cloud Monitoring web UI](https://cloud.ibm.com/docs/monitoring?topic=monitoring-launch) from the Observability page.
2. Click DASHBOARDS.
3. In the Default Dashboards section, expand IBM.
4. Choose the App Configuration dashboard from the list.

Access your deployment's monitoring dashboard from IBM Cloud Monitoring, it's in the sidebar, under IBM.

Next, change the scope or make a copy of the default dashboard to monitor an App Configuration service instance.

Zoom

!
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 functionality.

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 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. You must 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](https://cloud.ibm.com/observe/monitoring).
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.
However, it is included for previous billing periods, which you can view by selecting an earlier month from the Time frame menu. For more information, see [Viewing usage for your classic infrastructure resources](https://cloud.ibm.com/docs/billing-usage?topic=billing-usage-infra-usage).
3. To view usage within an account group, click the account group name in the table or in the Enterprise level menu. Similar to the enterprise level, usage is broken down by the account and account group.

If an account group doesn't contain any accounts, it isn't displayed on the Usage page.
4. To view usage by resource, go to the account level by clicking through account groups in the table or selecting the account from the Enterprise level menu. Costs for each type of resource that was used during the time frame are displayed.

From the enterprise account, you can't view usage data for the resource plan or instance because it requires access within the account. If you're a user in the account, switch to the account to view this data. You need billing access to the resources and services in the account as described in [Viewing your usage](https://cloud.ibm.com/docs/billing-usage?topic=billing-usage-viewingusage).



Only data for usage that is incurred by accounts in the enterprise is displayed in the enterprise account. To view usage from before an account was added to the enterprise, log in to that account and select the relevant time frame.





 Viewing enterprise usage by using the CLI 

You can get a report of usage for the enterprise, an account group, or a specific account.



1. Log in, and select the enterprise account.

ibmcloud login
2. If you want to view usage for a specific account group or account, find the name or ID by running the ibmcloud enterprise command.

For example, the following command displays all account groups in an enterprise.

ibmcloud enterprise account-groups --recursive
3. View usage by running the ibmcloud billing command as shown in the following examples.



* View usage for the entire enterprise for the current month.

ibmcloud billing enterprise-usage
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 



Each row of the Account Resource Usage section represents the aggregated usage of a service plan metric for all the resource instances in the account.







 Exporting your instance .csv report by using the API 

The following examples show queries that you can use to download your instance CSV report:

curl -X GET -H "Authorization: {iam_token}" "{base_url}/v4/accounts/{account_id}/resource_instances/usage/{month}?format=csv"



 Understanding .csv table headings and API parameters for instances 

The following table shows the correlation between the heading titles in your .csv report and API parameters. For more information about JSON report fields, see [Usage Reports: Get resource instance usage in an account](https://cloud.ibm.com/apidocs/metering-reportingget-resource-usage-account).

Account Metadata

Account Instance Usage



Table 2. Account instance CSV header titles and descriptions for account metadata

 .csv Header Description 

 Account Owner ID ID of the account 
 Account Name Name of the 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 



Each row of the Account Instance Usage section represents an instance usage of a specific metric in a service plan.









 Viewing your usage by using the CLI 

As an alternative to the console, you can view your usage by using the IBM Cloud command-line interface (CLI). Use the following commands to retrieve resource usage and billing information.



1. Log in, and select the account.

ibmcloud login
2. View usage by running the ibmcloud billing command as shown in the following examples.



* View usage for the current month.

ibmcloud billing account-usage [-d YYYY-MM] [--output FORMAT] [-q, --quiet]
[Settings section](https://cloud.ibm.com/docs-content/v1/content/220cdcbf6f4421bd7fee83fd1028048dba3f16c8/monitoring/platform/images/sysdig-platform-12.png)

Settings
3. Select Teams. Then, select a team where you want to restrict access to the platform metrics.
4. In the Visibility section, select Platform metrics.
5. Select the attribute ibm_resource_group_id to segment data by resource group.

Zoom

![Resource group segmentation](https://cloud.ibm.com/docs-content/v1/content/220cdcbf6f4421bd7fee83fd1028048dba3f16c8/monitoring/platform/images/sysdig-platform-14.png)

Resource group segment
6. Select 1 or more resource groups for which you want the data to be visible to users that are members of this team.
7. Add additional global attributes. Other attributes are available per IBM Cloud service. In the [Cloud services](https://cloud.ibm.com/docs/monitoring?topic=monitoring-cloud_services) topic, identify the service that you want to monitor and navigate the the More info section. Look for the section Attributes for segmentation to get the list of attributes that you can use to segment metrics for that service.
8. Click Save.







 Limiting access to platform metrics by instance 

Complete the following steps:



1. [Launch the monitoring UI](https://cloud.ibm.com/docs/monitoring?topic=monitoring-launch).
2. Navigate to the Settings section.

Zoom

![Settings section](https://cloud.ibm.com/docs-content/v1/content/220cdcbf6f4421bd7fee83fd1028048dba3f16c8/monitoring/platform/images/sysdig-platform-12.png)
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"
},
For instance, if the true time granularity of a time series is in seconds, then forward and reverse mapping of the time stamps 09:00:01 and 09:00:02 (to be read as hh:mm:ss) to a time tick of one minute would result in the time stamps 09:00:00 and 09:00:00 respectively. In this example, a time series, whose granularity is in seconds, is being mapped to minutes and thus the reverse mapping looses information. However, if the mapped granularity is higher than the granularity of the input time series (more specifically, if the time series granularity is an integral multiple of the mapped granularity) then the forward + reverse projection is guaranteed to be lossless. For example, mapping a time series, whose granularity is in minutes, to seconds and reverse projecting it to minutes would result in lossless reconstruction of the timestamps.



 Setting TRS 

When a time series is created, it is associated with a TRS (or None if no TRS is specified). If the TRS is None, then the numeric values cannot be mapped to timestamps. Note that TRS can only be set on a time series at construction time. The reason is that a time series by design is an immutable object. Immutability comes in handy when the library is used in multi-threaded environments or in distributed computing environments such as Apache Spark. While a TRS can be set only at construction time, it can be changed using the with_trs method as described in the next section. with_trs produces a new time series and thus has no impact on immutability.

Let us consider a simple time series created from an in-memory list:

values = [1.0, 2.0, 4.0]
x = tspy.time_series(values)
x

This returns:

TimeStamp: 0 Value: 1.0
TimeStamp: 1 Value: 2.0
TimeStamp: 2 Value: 4.0

At construction time, the time series can be associated with a TRS.
* Replace <apikey> with an IBM Cloud [IAM API key token](https://cloud.ibm.com/docs/monitoring?topic=monitoring-api_token).
* Replace <instance_id> with the ID of your Monitoring instance.
* Replace the metrics field with the JSON array of metrics that you want to extract. The example metric is cpu.cores.used.



from sdcclient import IbmAuthHelper, SdMonitorClient
endpoint = "https://<region>.monitoring.cloud.ibm.com"
apikey = "<apikey>"
instanceID = "<instance_id>"
ibm_headers = IbmAuthHelper.get_headers(endpoint, apikey, instanceID)
sdclient = SdMonitorClient(sdc_url=endpoint, custom_headers=ibm_headers)
metrics = [
{
"id": "cpu.cores.used",
"aggregations": {
"time": "avg",
"group": "sum"
}
}
]
filter = None
start = -120
end = 0
sampling = 60
ok, res = sdclient.get_data(metrics, start, end, sampling, filter=filter, datasource_type = "container")
print(ok)
print(res)
return res
Show more





 Sample: Extract notifications from Monitoring to Event Streams with the Event Streams REST API 



1. [Create an Event Streams instance](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-getting_started).



* From the pricing plans, select an Enterprise Plan.
* If necessary, set up an [Authorization in IAM](https://cloud.ibm.com/iam/authorizations) for Event Streams to target a KMS provider such as Key Protect, and refresh the page.
* For the Service Endpoint, select an option with a Private network.



2.
On the Monitoring provisioning page, complete the steps in [Provisioning an instance](https://cloud.ibm.com/docs/monitoring?topic=monitoring-provision) to order a Monitoring instance and enable the automatic platform metrics collection.







 Viewing platform metrics for your virtual data center 

After you order your Monitoring instance, you can view the platform metrics in the Monitoring console.



1. In the VMware Shared table, select the virtual data center for which you want to view platform metrics.
2. From the virtual data center details page, click the Actions menu and click Monitoring. The Monitoring dashboard displays the metrics for the associated instance.







 VMware Shared metrics 

VMware Shared provides the following metrics for the default dashboard:



* vCPU usage
* vCPU allocation
* Memory usage
* Memory allocation
* Storage usage



Metrics updates can be delayed by up to 60 minutes.





 Customizing your VMware Shared dashboard 

You can optionally customize your dashboard.



1. In the Monitoring console, click Dashboards from the left navigation pane.
2. Click the IBM menu and click VMware Shared.
3. Customize your dashboard. For more information, see [Dashboards](https://cloud.ibm.com/docs/monitoring?topic=monitoring-monitoringmonitoring_dashboards).







 Related links 



* [IBM Cloud Monitoring getting started tutorial](https://cloud.ibm.com/docs/monitoring?topic=monitoring-getting-started)
Monitoring activity through the UI 

You can monitor activity in your account through the IBM Cloud Activity Tracker web UI by using views, dashboards, and screens. You can also export sets of events to analyze them in a different context. You can be notified if specific events are generated in your account.

There is 1 instance of the IBM Cloud Activity Tracker service per location. Therefore, to monitor activity in your account, you might need to view and analyze events through different IBM Cloud Activity Tracker instances.

In the IBM Cloud, you can click the Menu icon ![Menu icon](https://cloud.ibm.com/docs-content/v1/content/6f3c07c34058f637b1c86044ca4f9b24214330a7/icons/icon_hamburger.svg) > Observability > Activity Tracker to see the dashboard where all the instances that are provisioned in the account are listed.

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

You can select the events 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.

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 events within your retention period. Different [service plans](https://cloud.ibm.com/docs/activity-tracker?topic=activity-tracker-service_plan) have different retention periods.



 Monitoring global and location-based events 

Events can be classified as global or location-based. The type of event determines where you monitor events.