vania-janet/multiturn-rag-retrieval-data huggingface dataset:
The $__range and $__interval variables in this query automatically update as the time range is changed in the UI. For more information, see [Applying dashboard scopes to PromQL queries](https://cloud.ibm.com/docs/monitoring?topic=monitoring-promqlpromql-scope).
* Segmentation: Choose a value to segment the aggregated PromQL data, such as kubernetes_cluster_name.



7. Click Run Query.
8. Fine tune the results by configuring any additional Options, such as the units in which the data is returned and how the data is displayed.







 Applying dashboard scopes 

To scope a panel built from a PromQL query, you must use a scope variable within the query.

Two pre-defined variables exist for time-based scopes that you can specify in the query. These variables are automatically update as the time range for the dashed is changed in the UI.



* $__range: Represents the time frame that is selected in the dashboard UI. For example, you might use this variable to calculate an average for the selected time frame.
* $__interval: Represents the interval that is based on the time range that is selected in the dashboard UI. For example, you might use this variable to adapt the time range for different operations, such as the rate or average over time.



For example, say you use the following query to return the CPU used percent for all the hosts:

avg_over_time(host_cpu_used_percent[$__interval])

This query uses the $__interval variable, which scopes data to the dynamic time interval based on the time range that is selected in the dashboard UI.

You can also specify your own variables in the query to scope its output.
https://us-south.monitoring.cloud.ibm.com//default-dashboard/ibm_is_load_balancer?last=3600

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_throughput, but ibm_is_load_balancer_active_connections and ibm_is_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).
A resource group organizes 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 have no reason to share this resource selectively, use the default selection.

If your account has multiple resource groups, you can choose which group has access to this IBM Cloud Monitoring instance. By using this selective access, metrics can be available to some resource groups and not to others.
6. Select the Enable checkbox. You must select this option to receive metrics from your VPN gateway.
7. Click Create. You are taken back to the monitoring metrics home page.



Within a few minutes, your new IBM Cloud Monitoring instance displays with several configurations. 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 Open dashboard next to the service name of the IBM Cloud Monitoring instance that 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. Keep the default entries, and click through the pages until you reach the main IBM Cloud Monitoring page.
3. Open the IBM VPN for VPC Monitoring Metrics dashboard by selecting Dashboards.
4. Click Dashboard Library > IBM > VPC VPN. The default dashboard is not editable.
5. Ten main metrics in the dashboard are shown. These metrics include Gateway/Connection status, Gateway/Connection bytes input/output, and Gateway/Connection packets input/output. If you want to modify parameters and segment your metrics by VPN gateway name and VPN connection name, you must create a custom dashboard.

You can choose what time window that you'd like to see your metrics by using the time selection bar.







 Creating a custom metrics dashboard
* When you want to change the metrics that you stream, by either adding new metrics or removing metrics.
* When you must change the scope.
* To enable or disable data streaming for the configuration.



Use this method to update 1 streaming configuration that forwards a set of metrics to Event Streams.

curl --request PUT https://<ENDPOINT>/api/v1/dataStream/configs/<STREAMING_CONFIG_ID>
-H "content-type: application/json"
-H "Authorization: <TOKEN>"
-d @streaming-config.json

Where



* <ENDPOINT> represents the endpoint that is 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
* <TOKEN> API token that you use to authenticate with the Monitoring service. You must include Bearer with the token. For more information, see [Working with Monitoring API tokens](https://cloud.ibm.com/docs/monitoring?topic=monitoring-api_monitoring_token).
* <STREAMING_CONFIG_ID> represents the UUID of the streaming configuration.



A sample streaming-config.json file looks as follows:

{
"dataStreamConfig": {
"uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"enabled": true,
"name": "Streaming metrics - demo",
"emitterType": "kafka",
"emitterProperties": {
Navigate to the Dashboards section (![dashboard section](https://cloud.ibm.com/docs-content/v1/content/220cdcbf6f4421bd7fee83fd1028048dba3f16c8/monitoring/images/dashboards.png)) in the Web UI.
3. Select a custom dashboard in the My Dashboards section.
4. Select a panel where you want to change the scope of the data.
5. Click the Pencil icon ![Pencil icon](https://cloud.ibm.com/docs-content/v1/content/220cdcbf6f4421bd7fee83fd1028048dba3f16c8/monitoring/images/pencil.png). Then, in the Scope section, click Dashboard scope.

Zoom

![Panel scope](https://cloud.ibm.com/docs-content/v1/content/220cdcbf6f4421bd7fee83fd1028048dba3f16c8/monitoring/platform/images/sysdig-platform-6.png)

Panel scope
6. By default, Inherit Dashboard Scope is selected. To specify a custom scope, you must de-select this option.

In the drop-down box, enter ibm and select an attribute.

Select an operator.

Select 1 or more values.
7. In a panel, you can configure 1 or more metrics. Select Apply to All Queries if you want the scope to apply to all the metrics that are configured for the panel.



To save the scope, you must click Save at the panel level.







 Configuring an alert on a platform metric 



 Configuring an alert from a panel 

Complete the following steps to define an alert on a metric:



1. [Launch the monitoring UI](https://cloud.ibm.com/docs/monitoring?topic=monitoring-launch).
2. Verify that you have a notification channel that defines how you want to be notified.
You can back up and restore dashboards by using Python scripts or the IBM Cloud Monitoring REST API. You can also copy and share dashboards through the web UI.

For more information, see [Dashboards](https://docs.sysdig.com/en/docs/sysdig-monitor/dashboards/).





 Panels 

A panel displays a metric or group of metrics in a dashboard.

You can use any of the following panel types to visualize metrics:



* Histogram: Use a histogram panel to monitor a metric, that is segmented by a dimension or label, and understand its value across multiple segments. [Learn more](https://docs.sysdig.com/en/docs/sysdig-monitor/dashboards/configure-panels/types-of-panels/histogram/histogram).
* Timechart Panel: Use timecharts to monitor how the value of a metric changes over time. A Timechart is a graph that is produced by applying statistical aggregation to a label over an interval. The X-axis of a timechart is always time. [Learn more](https://docs.sysdig.com/en/docs/sysdig-monitor/dashboards/configure-panels/types-of-panels/timechart-panel/).
* Number Panel: Use a number panel to monitor the value of a metric. You can also use it to see the average value over a time range. [Learn more](https://docs.sysdig.com/en/docs/sysdig-monitor/dashboards/configure-panels/types-of-panels/number-panel/).
* Table Panel: Use a table panel to monitor actual values instead of visual representations. The Table panel displays metric data in tabular form. [Learn more](https://docs.sysdig.com/en/docs/sysdig-monitor/dashboards/configure-panels/types-of-panels/table-panel/).
Creating a custom metrics dashboard 

You can create your own dashboard to customize your monitoring metrics, such as viewing information and traffic about particular VPN servers.

To customize your dashboard, use the following steps:



1. Navigate to the [metrics monitoring portal](https://cloud.ibm.com/observe/monitoring).
2. Click Open Dashboard next to the service name of the IBM Cloud Monitoring instance you want to work with. You now see the dashboard.
3. Select Dashboards and click the + in the panel.
4. Select Blank dashboard and select the type of visual representation that you want.

IBM Cloud Monitoring offers eight different visualizations for your dashboard. Read the description for each visualization and choose the one that best meets your requirements.

The line View trends over time is the most frequently selected option. The following examples show a line-based visualization.
5. Configure your custom dashboard.



* In the Metrics field, enter ibm_is_vpn_server to display the IBM Cloud Monitoring VPN for VPC server metrics: ibm_is_vpn_server_health_status, ibm_is_vpn_server_active_client_count, ibm_is_vpn_server_authentication_failure_count, ibm_is_vpn_server_crl_days_expiry, ibm_is_vpn_server_data_received_bytes, and ibm_is_vpn_server_data_sent_bytes.
* You can choose a scope to display in your dashboard by clicking Edit dashboard scope. For example, you can display the metrics for a particular VPN server.
* You can also set a segment to compare metrics across the scope that you define. For example, you can look at the VPN server health status for a particular VPN server that is segmented by server name.



6. Click Save.

By default, the dashboard is named "blank dashboard". You can change the name by selecting Dashboards from the sidebar and clicking the pencil icon next to the name.
AU-8 (1) - Synchronization with Authoritative Time Source 



  Control requirements 

The information system:

AU-8 (1) (a)
:   Compares the internal information system clocks [IBM Assignment: authoritative time source: servertime.service.softlayer.com] with [IBM Assignment: at least hourly]; and

AU-8 (1) (b)
:   Synchronizes the internal system clocks to the authoritative time source when the time difference is greater than [Assignment: organization-defined time period].





  NIST supplemental guidance 

This control enhancement provides uniformity of time stamps for information systems with multiple system clocks and systems connected over a network.
Monitoring for Code Engine 

Get insight into the performance of your workloads that are deployed with IBM Cloud® Code Engine. Metrics can help you find bottlenecks or predict possible production problems.

You can use the IBM Cloud® Monitoring service to monitor your Code Engine workloads. Code Engine forwards selected information about your workloads to Monitoring so that you can monitor specific metrics such as requests, revisions, and duration.



 Set up your IBM Cloud Monitoring service instance 

To set up your Code Engine customer metrics dashboards in Monitoring, you must create a service instance and then enable Platform Metrics in the same region as the Code Engine projects 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. For more information, see [Monitoring Getting started tutorial](https://cloud.ibm.com/docs/monitoring?topic=monitoring-getting-started).

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.



You can also start monitoring from your Code Engine dashboard by selecting Launch Monitoring.





 Accessing your IBM Cloud Monitoring metrics 

To see your Code Engine customer metrics dashboards in Monitoring:



1. 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.
To understand the quality metrics, refer to [Quality metric overview](https://cloud.ibm.com/docs/ai-openscale?topic=ai-openscale-anlz_metrics)









 Step 7: Remove resources 



1. Navigate to [IBM Cloud® Resource List](https://cloud.ibm.com/resources/).
2. Under Name, enter tutorial in the search box.
3. Delete the services which you created for this tutorial.



Depending on the resource it might not be deleted immediately, but retained (by default for 7 days). You can reclaim the resource by deleting it permanently or restore it within the retention period. See this document on how to [use resource reclamation](https://cloud.ibm.com/docs/account?topic=account-resource-reclamation).





 Related content 



* [IBM Cloud Pak for Data Overview](https://dataplatform.cloud.ibm.com/docs/content/wsj/getting-started/welcome-main.html?context=analytics)
* [Automatic model creation](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/autoai-overview.html?context=analytics)
* [Machine learning & AI](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/wml-ai.html?context=analytics)
* [Watson OpenScale documentation](https://dataplatform.cloud.ibm.com/docs/content/wsj/model/getting-started.html?context=analytics)
You can also work with the IBM Cloud Monitoring instance by using the metric query API. You might want to do this if you need raw data points or want to consume your metrics from a command-line interface rather than using the IBM Cloud Monitoring dashboard.

After you create your IIBM Cloud Monitoring instance, you must collect the following two pieces of information.



* The IBM Cloud Monitoring Monitor API token
* The endpoint of your IBM Cloud Monitoring IBM Cloud Monitoring instance



To collect this information and start working with your IBM Cloud Monitoring instance using the metric query API, follow these steps:



1. Access the [Monitoring home page](https://cloud.ibm.com/observe/monitoring), and click View IBM Cloud Monitoring next to the instance you want to work with. After the IBM Cloud Monitoring dashboard shows, select your Account Profile icon on the left sidebar, then select Settings. Your account settings display.
2. Your API token is an alphanumeric string that is located in the IBM Cloud Monitoring Monitor API Token field. Click the Copy button to the right of the key to transfer it to your clipboard.

Do not share this key. Anyone who has this key has full access to your metrics.
3. To get the endpoint of your IBM Cloud Monitoring instance, navigate to your main IBM Cloud Monitoring dashboard in your browser. Then, select the URL to the dashboard, which appears similar to:

https://us-south.monitoring.cloud.ibm.com//default-dashboard/ibm_cloud_load_balancer?last=3600

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







 Managing alerts 

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

![sample](https://cloud.ibm.com/docs-content/v1/content/f61dbc5d84bf0c89e477a05cab04c72f429e1b7a/log-analysis/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-with-Sysdig?topic=Monitoring-with-Sysdig-launch).
Platform metrics for IBM Cloud Metrics Routing 

You can use the IBM Cloud® Monitoring service to monitor platform metrics that are exposed by IBM Cloud Metrics Routing. For example, you can use it to monitor how IBM Cloud Metrics Routing is routing metrics in each region where you operate.

Platform metrics are metrics that are exposed by enabled-monitoring services and the platform in IBM Cloud. You can use them to find and take action on configuration problems and possible outages.

IBM Cloud Monitoring is a cloud-native, and container-intelligence management system that you can include as part of your IBM Cloud architecture. You can use it to gain operational visibility into the performance and health of your applications, services, and platforms. It offers administrators, DevOps teams, and developers full stack telemetry with advanced features to monitor and troubleshoot, define alerts, and design custom dashboards. For more information, see [Getting started with Monitoring](https://cloud.ibm.com/docs/monitoring?topic=monitoring-getting-started).



 Collecting platform metrics 

The IBM Cloud Metrics Routing generates metrics automatically in the IBM Cloud account.

To collect platform metrics in an IBM Cloud account, choose 1 of the following options:



* Configure the Monitoring service in the IBM Cloud account

You can use Monitoring, an IAM enabled service, to collect metrics through instances that you provision in each IBM Cloud region where you operate and that you enable to collect platform metrics. For more information on how to enable platform metrics, see [Enabling platform metrics](https://cloud.ibm.com/docs/monitoring?topic=monitoring-platform_metrics_enablingplatform_metrics_enabling).

You can configure 1 instance only of the IBM Cloud Monitoring service per region to collect platform metrics in that location. For more information about supported locations, see [Locations supported by the Monitoring service](https://cloud.ibm.com/docs/monitoring?topic=monitoring-regions).

In a region, before you configure a Monitoring instance to collect platform metrics, check with the account or service administrator if another Monitoring instance has already been configured. You may not have permissions to see all Monitoring instances in the region.
Create a copy of the temnplate by clicking Create custom dashboard.
5. Edit the panel Topic bytes in per second.

![Edit panel.](https://cloud.ibm.com/docs-content/v1/content/f61dbc5d84bf0c89e477a05cab04c72f429e1b7a/log-analysis/images/streaming-topic-metric.png)
6. Customize the metric to see data per topic.

![Customize metric.](https://cloud.ibm.com/docs-content/v1/content/f61dbc5d84bf0c89e477a05cab04c72f429e1b7a/log-analysis/images/streaming-topic-metric-1.png)
7. Check that the resolution is set to 10M.



If you do not see data, do 1 of the following:



* Resend sample logs to verify that sample data is streaming.
* Check my setup to go back to the configuration panel. After you make your changes, retry the verification steps.



If you see data, click YES.

After you provision an instance of Event Streams, the Monitoring dashboard may take up to 15 mins to show.





 Step 5. Start streaming 

After you verify that sample data is reaching Event Streams, click Start stream.

Streaming may take up to 15 minutes to begin.
'quantity': 0,
},
{
'measure': 'WRITE',
'quantity': 0,
},
{
'measure': 'QUERY',
'quantity': 0,
},
{
'measure': 'GIGABYTE',
'quantity': 0,
},
]

resource_instance_usage_model = {
'resource_instance_id': resource_instance_id,
'plan_id': plan_id,
'region': region,
'start': start_time,
'end': end_time,
'measured_usage': measures,
}

response_accepted = usage_metering_service.report_resource_usage(
resource_id=resource_id,
resource_usage=[resource_instance_usage_model]).get_result()

print(json.dumps(response_accepted, indent=2))

// Report usage for a mythical resource.
// Use zero for quantities since this is only an example.
resourceInstanceUsageModel := usagemeteringv4.ResourceInstanceUsage{
ResourceInstanceID: &resourceInstanceID,
PlanID: &planID,
Region: &region,
Start: &startTime,
End: &endTime,
MeasuredUsage: []usagemeteringv4.MeasureAndQuantity{
usagemeteringv4.MeasureAndQuantity{
Measure: core.StringPtr("LOOKUP"),
Quantity: core.Int64Ptr(0),
},
usagemeteringv4.MeasureAndQuantity{
Measure: core.StringPtr("WRITE"),
Quantity: core.Int64Ptr(0),
},
usagemeteringv4.MeasureAndQuantity{
Measure: core.StringPtr("QUERY"),
Quantity: core.Int64Ptr(0),
},