vania-janet/multiturn-rag-retrieval-data huggingface dataset:
"yaxis4": [ // Hits by type 200 per day
0,
0,
0,
0
],
"yaxis5": [ // Hits by type 206 per day
0,
0,
0,
0
],
"yaxis6": [ // Hits by type 2XX per day
0,
0,
0,
0
],
"yaxis7": [ // Hits by type 302 per day
0,
0,
0,
0
],
"yaxis8": [ // Hits by type 304 per day
0,
0,
0,
0
],
"yaxis9": [ // Hits by type 3XX per day
0,
0,
0,
0
],
"yaxis10": [ // Hits by type 404 per day
0,
0,
0,
0
],
"yaxis11": [ // Hits by type 4XX per day
2,
1,
6,
4
],
"yaxis12": [ // Hits by type 5XX per day
2,
0,
0,
0
],
"yaxis13": [ // Hits by type Other per day
0,
0,
0,
0
],
"yaxis14": null,
"yaxis15": null,
"yaxis16": null,
"yaxis17": null,
"yaxis18": null,
"yaxis19": null,
"yaxis20": null
}
}
Show more





 Example code for getting real-time metrics
Monitoring operational metrics 

As a security officer, auditor, or manager, you can use the IBM Cloud Monitoring service to measure how users and applications interact with IBM® Key Protect for IBM Cloud®.

IBM Cloud Monitoring records data on the operations that occur inside of IBM Cloud. This service allows you to gain operational visibility into the performance and health of your applications, services, and platforms. You can use its advanced features to monitor and troubleshoot, define alerts based on API response codes, and design custom dashboards.

For more information regarding the Monitoring service, see the [getting started tutorial for IBM Cloud Monitoring](https://cloud.ibm.com/docs/monitoring?topic=monitoring-getting-started-monitor).



 What metrics are available? 

You can use Monitoring to track the type of API requests being made in your service instance as well as the latency of the requests.

The following contains examples of metrics that can be measured in your Monitoring dashboard:



* Total requests being made in your Key Protect instance
* Successful vs failed API requests categorized by API type
* API request latency over time
* Total API requests categorized by response code







 Before you begin 

Enabling Key Protect service metrics will add new metrics to your Monitoring instance. For information on Monitoring pricing, see [Pricing](https://cloud.ibm.com/docs/monitoring?topic=monitoring-pricing_plans).

Before you provision an instance of Monitoring, consider the following guidance:



* You will need to enable a [metrics policy](https://cloud.ibm.com/docs/key-protect?topic=key-protect-manage-monitor-metrics) in the Key Protect instance in order to retrieve operational metrics.
* Other IBM Cloud users with administrator or editor permissions can manage the 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.







 Connecting Monitoring with Key Protect 

Your dashboard will show metrics for all Key Protect instances with an enabled metrics policy.



 Configure a Monitoring instance for metrics 

To enable platform metrics in a region, complete the following steps:



1.
"size": 1,
"hits": {
"matching_results": 2,
"hits":
{
"document_id": "2bed19a9069442fd82542827ebe260d5_18329",
...
}
]
}
}
]
},
...
{
"key":"ACTON",
"maatching_results": 1,
"aggregations": ] ! ! ! ! ! ! ! ! ! ! ! ! ! !
}
...
Show more
This aggregation type performs a terminal operation. When combined with other aggregations, the output is not used as input for the next aggregation. The output is returned in a discrete group.<-- </section "id="section-top_hits-example" "> --><-- </section "id="section-top_hits" "> --><-- <section "id="section-trend" "> --> trend Detects sharp and unexpected changes in the frequency of a keyword value in a specified time period based on the past frequency changes of the keyword value.<-- <section "id="section-trend-syntax" "> --> Sytnax trend(facet:{aggregation},time_segments:{aggregation})
The first (facet) aggregation must be one of the following types of aggregations:<-- <ul> --> * term * group_by<-- </ul> -->The relevancy parameter from the term or group_by aggregation is ignored.The second (time_segments) aggregation must be an aggregation of type timeslice.You can alternatively include the following parameters:<-- <ul> --> * show_estimated_matching_results:true: Indicates whether to include the estimated_matching_results information in the result.
UI](https://cloud.ibm.com/docs-content/v1/content/bcd8b79ca2ed73bfcaefb20051f12cb6400286ab/atracker/images/platform_metrics_option_1.svg)](https://cloud.ibm.com/docs/monitoring?topic=monitoring-platform_metrics_enablingplatform_metrics_enabling_ui)[![Option 2. CLI](https://cloud.ibm.com/docs-content/v1/content/bcd8b79ca2ed73bfcaefb20051f12cb6400286ab/atracker/images/platform_metrics_option_2.svg)](https://cloud.ibm.com/docs/monitoring?topic=monitoring-platform_metrics_enablingplatform_metrics_enabling_cli)





 Viewing metrics for Activity Tracker Event Routing V2 API 

You monitor metrics in the Monitoring web UI.

To monitor Activity Tracker Event Routing metrics, you must launch the Monitoring UI for the instance that is enabled for platform metrics in the region where your target is defined. For example, if you have a target defined in US-South, you must launch the Monitoring instance in US-South that has the flag platform metrics. For more information, see [Launching the Monitoring UI from the Observability page](https://cloud.ibm.com/docs/monitoring?topic=monitoring-launchlaunch_step2).

You can use the IBM Activity Tracker Event Routing Overview predefined dashboard template to monitor Activity Tracker Event Routing in IBM Cloud.

To open the predefined Activity Tracker Event Routing template, complete the following steps from the Monitoring UI:



1. In the Monitoring UI, go to Dashboards > Dashboard templates > IBM.
2. Select IBM Activity Tracker Event Routing Overview.



You cannot modify a dashboard template. However, you can copy the template and create a custom dashboard that you can then configure.

Next, choose any of the following tasks to learn more about how to manage and work with platform metrics:
For more information, see [Locations](https://cloud.ibm.com/docs/metrics_router?topic=metrics_router-regions&interface=cli).

Take into account any corporate or industry compliance requirements such as Financial Services Validated locations, or EU-managed regions.
* Default target locations, that is, 1 or more targets in the account, that will collect metrics from supported IBM Cloud Metrics Routing locations where you have not configured how you want to collect metrics.

If you define more than 1 target, all default targets get a copy of metrics that do not have a routing rule to indicate where to collect them in the account. You can define up to 2 default targets per account.







 IAM permissions 

Ensure you have the [correct IAM permissions to configure IBM Cloud Metrics Routing settingss.](https://cloud.ibm.com/docs/metrics-router?topic=metrics-router-iam)





 CLI commands 

The following table lists the actions that you can run to manage settings:



Table 1. Settings actions by using the IBM Cloud Metrics Routing CLI

 Action Command 

 Get settings information ibmcloud metrics-router setting get 
 Update settings ibmcloud metrics-router setting update 



For more information, see [IBM Cloud Metrics Routing CLI](https://cloud.ibm.com/docs/metrics-router?topic=metrics-router-metrics-router-cli).





 API methods 

The following table lists the actions that you can run to manage settings:



Table 2. Settings actions by using the IBM Cloud Metrics Routing REST API

 Action REST API Method API_URL 

 Get settings information GET <ENDPOINT>/api/v3/settings 
 Update settings PATCH <ENDPOINT>/api/v3/settings 



For more information about the REST API, see [the settings API](https://cloud.ibm.com/apidocs/metrics-router/metrics-router-v3get-settings).



 HTTP response codes
"operator": "stringEquals",
"value": "d4b763ad0cbd4dca8dd1edb427d7a77e",
"key": "accountId"
},
{
"value": "platform_service",
"operator": "stringEquals",
"key": "serviceType"
}
]
},
"pattern": "time-based-conditions:weekly",
"rule": {
"operator": "and",
"conditions": [
{
"key": "{{environment.attributes.day_of_week}}",
"operator": "dayOfWeekAnyOf",
"value":
1,
2,
3,
4,
5
]
},
{
"key": "{{environment.attributes.current_time}}",
"operator": "timeGreaterThanOrEquals",
"value": "00:00:00+00:00"
},
{
"key": "{{environment.attributes.current_time}}",
"operator": "timeLessThanOrEquals",
"value": "23:59:59+00:00"
}
]
},
"subject": {
"attributes": [
{
"key": "iam_id",
"operator": "stringEquals",
"value": "IBMid-550000HFVV"
}
]
}
}



For more information about time-based conditions for access policies, see [Conditions in access policies](https://cloud.ibm.com/docs/account?topic=account-iam-condition-properties&interface=uipolicy-condition-properties).





 Creating a recurring time-based condition by using the API 

You can assign recurring access at a weekly cadence.
Click View plans to view all the instances of a specific type of resource.
3. To view a detailed summary of estimated charges for each instance of a specific resource type, click View details. You can also view the detailed monthly usage metrics for the selected instance.



If you have a Pay-As-You-Go account that isn't billed in US dollars or a Subscription account, the usage for all services is finalized by the 20th of the following month. If you have a Pay-As-You-Go account that is billed in US dollars, the usage for all services is finalized by the 3rd of the following month.

The account is billed for the total usage that is incurred across all groups and organizations at the end of each billing cycle. Each billing cycle lasts one month.

You can filter the usage summary by group and select the time frame for usage. The charges that are shown represent the amount that is billed to the account for that particular month.

If you select a specific organization from the Filter by group list, you can see the total usage for that organization, including any usage as part of a free tier. The free tier usage is shown as free at the account level, but not at the organizational level. When you view the organizational usage, you see the real usage for that organization, which includes both free and charged usage. All organizational usage is rolled up to the account usage after the free tier is removed.

The account owner of a billable account can set spending notifications against the total cost of the account, for runtime, services, and for individual services, excluding third-party services. For more information, see [Setting spending notifications](https://cloud.ibm.com/docs/billing-usage?topic=billing-usage-spending).







 Viewing your usage by using the API 

You can programmatically view your usage by calling the [IBM Cloud Usage Reports API](https://cloud.ibm.com/apidocs/metering-reportingget-account-usage). You can base the query in your API call on an account, org, resource group, or resource instance.

The following examples show queries that you can use to view account level usage:



* Curl
* Java
* Python
* Go
* Node
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 parameters that you can modify. These parameters are:



* The Monitor API token.
* The endpoint of your 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_is_load_balancer_active_connections, but ibm_is_load_balancer_connection_rate is also a valid option.
* 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 will return 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": [
{
The first (facet) aggregation must be one of the following types of aggregations:<-- <ul> --> * term * group_by<-- </ul> -->The relevancy parameter from the term or group_by aggregation is ignored.The second (time_segments) aggregation must be an aggregation of type timeslice.You can alternatively include the following parameters:<-- <ul> --> * show_estimated_matching_results:true: Indicates whether to include the estimated_matching_results information in the result. This field contains the number of documents that are estimated to have the term in the specified field or meet the conditions in the specified aggregation for the specified time interval in the set of documents that are returned by the query. * show_total_matching_documents:true: Indicates whether to include the total_matching_documents information in the result. This field contains the number of documents in the collection where the term is mentioned in the specified field or the condition is met.<-- </ul> -->Only one trend aggregation can be used per query request, and it cannot be combined with any other aggregations.<-- </section "id="section-trend-syntax" "> --><-- <section "id="section-trend-example" "> --> Example The following example calculates the trend indicator or trend index by using combinations of results from the following aggregations:<-- <ul> --> * term(flavor): vanilla, chocolate, mint * timeslice(date, 1month): Jan 2020, Feb 2020, Mar 2020, Apr 2020, May 2020, Jun 2020<-- </ul> --> trend( facet: aggregation(<parameter>...), time_segments: timeslice(<parameter>...)),
show_estimated_matching_results: <true_or_false>, show_total_matching_documents: <true_or_false> )
The resulting matrix can be represented in a table.<-- <table "class="row-headers comparison-table" "> -->Table 5. Trend aggregation example This table has row and column headers. The row headers identify months of the year 2020.
[Checkmark icon](https://cloud.ibm.com/docs-content/v1/content/6f3c07c34058f637b1c86044ca4f9b24214330a7/activity-tracker/images/checkmark-icon.svg) ![Checkmark icon](https://cloud.ibm.com/docs-content/v1/content/6f3c07c34058f637b1c86044ca4f9b24214330a7/activity-tracker/images/checkmark-icon.svg) 
 Analyzing logs in different contexts ![Checkmark icon](https://cloud.ibm.com/docs-content/v1/content/6f3c07c34058f637b1c86044ca4f9b24214330a7/activity-tracker/images/checkmark-icon.svg) ![Checkmark icon](https://cloud.ibm.com/docs-content/v1/content/6f3c07c34058f637b1c86044ca4f9b24214330a7/activity-tracker/images/checkmark-icon.svg) ![Checkmark icon](https://cloud.ibm.com/docs-content/v1/content/6f3c07c34058f637b1c86044ca4f9b24214330a7/activity-tracker/images/checkmark-icon.svg) ![Checkmark icon](https://cloud.ibm.com/docs-content/v1/content/6f3c07c34058f637b1c86044ca4f9b24214330a7/activity-tracker/images/checkmark-icon.svg)
Quantity: core.Int64Ptr(0),
},
usagemeteringv4.MeasureAndQuantity{
Measure: core.StringPtr("WRITE"),
Quantity: core.Int64Ptr(0),
},
usagemeteringv4.MeasureAndQuantity{
Measure: core.StringPtr("QUERY"),
Quantity: core.Int64Ptr(0),
},
usagemeteringv4.MeasureAndQuantity{
Measure: core.StringPtr("GIGABYTE"),
Quantity: core.Int64Ptr(0),
},
},
}
reportResourceUsageOptions := usageMeteringService.NewReportResourceUsageOptions(
resourceID,
[]usagemeteringv4.ResourceInstanceUsage{resourceInstanceUsageModel},
)

responseAccepted, response, err := usageMeteringService.ReportResourceUsage(reportResourceUsageOptions)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(responseAccepted, "", " ")
fmt.Println(string(b))

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

const resourceInstanceUsageModel = {
resource_instance_id: resourceInstanceId,
plan_id: planId,
region: region,
start: startTime,
end: endTime,
measured_usage: measures,
[Cloud databases dashboard in monitoring](https://cloud.ibm.com/docs-content/v1/content/e2b18e1112dc55facb736744a935365dce13849a/databases-for-enterprisedb/images/monitoring-ibm-list.png)

Figure 2. Cloud databases dashboard in monitoring



 Monitoring Availability 

IBM Cloud Monitoring 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 a 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.





 Available Metrics 



Table 1. Available Metrics

 Metric Name 

 [Blocks hit rate](https://cloud.ibm.com/docs/databases-for-enterprisedb?topic=databases-for-enterprisedb-monitoringibm_databases_for_enterprisedb_blocks_hit_rate) 
 [Blocks read rate](https://cloud.ibm.com/docs/databases-for-enterprisedb?topic=databases-for-enterprisedb-monitoringibm_databases_for_enterprisedb_blocks_read_rate) 
 [Buffers backend rate](https://cloud.ibm.com/docs/databases-for-enterprisedb?topic=databases-for-enterprisedb-monitoringibm_databases_for_enterprisedb_buffers_backend_rate) 
 [Buffers checkpoint rate](https://cloud.ibm.com/docs/databases-for-enterprisedb?topic=databases-for-enterprisedb-monitoringibm_databases_for_enterprisedb_buffers_checkpoint_rate)
From the IBM Cloud navigation menu, select Observability.
2. Select Monitoring.
3. Select View IBM Cloud Monitoring to open the dashboard.
4. From the navigation menu, select Dashboards->IBM->Cloud Functions - Customer Metrics Dashboard.



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





 Metrics available by Service Plan 

All metric names have the prefix ibm_functions_.



Table 1: Metrics Available by Plan Names

 Metric Name 

 [ibm_functions_activation](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-monitor-functionsibm_functions_activation) 
 [ibm_functions_concurrent_invocations](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-monitor-functionsibm_functions_concurrent_invocations) 
 [ibm_functions_concurrent_rate_limit](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-monitor-functionsibm_functions_concurrent_rate_limit) 
 [ibm_functions_duration](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-monitor-functionsibm_functions_duration) 
 [ibm_functions_init_time](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-monitor-functionsibm_functions_init_time) 
 [ibm_functions_status_error_application](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-monitor-functionsibm_functions_status_error_application) 
 [ibm_functions_status_error_developer](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-monitor-functionsibm_functions_status_error_developer)
To submit usage for your active service instances, call the [Usage Metering API](https://cloud.ibm.com/apidocs/usage-meteringreport-resource-usage) as shown in the following sample request. To make the API call, your metering approval request must be approved by IBM Cloud.

You can find the resource_id value, which is the Global catalog ID listed on the Brokers page in Partner Center.



* Curl
* Java
* Python
* Go
* Node



curl -X POST -H "Authorization: {iam_token}" -H "Accept: application/json" -H "Content-Type: application/json" -d "{REQUEST_BODY}" "{base_url}/v4/metering/resources/{resource_id}/usage"

// Report usage for a mythical resource.
// Use zero for quantities since this is only an example.
MeasureAndQuantity lookupMeasure = new MeasureAndQuantity.Builder()
.measure("LOOKUP")
.quantity(Long.valueOf(0))
.build();
MeasureAndQuantity writeMeasure = new MeasureAndQuantity.Builder()
.measure("WRITE")
.quantity(Long.valueOf(0))
.build();
MeasureAndQuantity queryMeasure = new MeasureAndQuantity.Builder()
.measure("QUERY")
.quantity(Long.valueOf(0))
.build();
MeasureAndQuantity gbMeasure = new MeasureAndQuantity.Builder()
.measure("GIGABYTE")
.quantity(Long.valueOf(0))
.build();
List<MeasureAndQuantity> measures = new ArrayList<>();
measures.add(lookupMeasure);
measures.add(writeMeasure);
measures.add(queryMeasure);
measures.add(gbMeasure);
From the IBM Cloud navigation menu, select Observability.
2. Select Monitoring.
3. Click Open dashboard to open the dashboard for your monitoring instance.
4. From the navigation menu, select Dashboards->IBM->IBM Code Engine Project Overview. If you don't see the Code Engine dashboard in the menu, you can start monitoring from your Code Engine application or job by selecting Launch Monitoring.
5. Select the 10M timeline or greater. Because Platform Metrics data has a 1 minute granularity, the first timeline that shows metrics is the 10M timeline.



You can also start the Monitoring dashboard at any time by selecting Monitoring from the Code Engine Action menu.

When you use the IBM Cloud Monitoring service to monitor Code Engine workloads, there can be delays before the data is processed and available in Monitoring. For example, right after you create your monitoring instance, it will take a few minutes before there is a meaningful monitoring data to display. Be aware that it might take around 5 minutes for your monitoring data to show in Monitoring.





 Metrics available for Code Engine 



Table 1: Metrics available for Code Engine

 Metric Name 

 [ibm_codeengine_application_actual_instances](https://cloud.ibm.com/docs/codeengine?topic=codeengine-monitoribm_codeengine_application_actual_instances) 
 [ibm_codeengine_application_requested_instances](https://cloud.ibm.com/docs/codeengine?topic=codeengine-monitoribm_codeengine_application_requested_instances) 
 [ibm_codeengine_application_not_ready_instances](https://cloud.ibm.com/docs/codeengine?topic=codeengine-monitoribm_codeengine_application_not_ready_instances) 
 [ibm_codeengine_application_pending_instances](https://cloud.ibm.com/docs/codeengine?topic=codeengine-monitoribm_codeengine_application_pending_instances)
1. Run the following command to list all targets. Copy the target ID of the one where you want to route the metrics.

ibmcloud metrics-router target ls
2. Run the following command to get the details of the targets where you want to route the metrics:

ibmcloud metrics-router target get --target <TARGET_ID>







 Step 2: Configure the route 

Run the following command to send all metrics from supported locations in your account to the targets identified in previous steps.

ibmcloud metrics-router route create --name route-all --rules '[{"action": "send", "targets":{"id":"11111111-1111-1111-1111-111111111111"},{"id":"22222222-2222-2222-2222-222222222222"}]}]'