5.3 Add metric for Trend Viewing and Alerting
You can add metrics for JP1/IM - Agent trending and alerting.
see Section 9.5.1 (3) "Returning a list of metric" and Section 9.5.1 (4) "Returning Trend Data" in JP1/Integrated Management 3 - Manager Overview and System Design Guide manual and Section 9.5.3 (4) performance data monitoring notification function in JP1/Integrated Management 3 - Manager Overview and System Design Guide manual.
The configuration steps for adding metrics are as follows:
-
Exporter Settings
If Exporter has not collected metric you want to add, configure the settings to collect them. Different Exporters are configured differently. For more information, see "9.5.3(2)(c) Blackbox exporter," "9.5.3(2)(d) Node exporter," "9.5.3(2)(e)Windows exporter," and "9.5.3(2)(f) Yet another cloudwatch exporter" in JP1/Integrated Management 3 - Manager Overview and System Design Guide documentation.
Restart Exporter after configuring the settings. (For Blackbox exporter, you can perform a reload instead of a reboot.)
-
Edit the Prometheus configuration file
In scrape defnition of Prometheus configuration file (jpc_prometheus_server.yml), change the metric_relabel_configs settings to ensure that metric of Exporter used by PromQL expression is not removed. Specifically, metric_relabel_configs the new metric name to be used by the Exporter where the importer's metric names are listed in the next regex. If it has already been added, no additional is required.
Here is an example of adding the "aws_ec2_network_in_average" metric in the Yet another cloudwatch exporter (add an underline):
- job_name: 'jpc_cloudwatch' ... metric_relabel_configs: ... - source_labels: ['__name__','jp1_pc_nodelabel'] regex: '(aws_ec2_network_in_average|aws_ec2_cpuutilization_average|...);.+$' action: 'keep'For more information about Prometheus configuration file, see "Prometheus configuration file (jpc_prometheus_server.yml)" (2. Definition File) in "JP1/Integrated Management 3 - Manager Command, Definition File, and API Reference" manual.
-
Edit the alert configuration file (if you want to add metrics to be handled by the alert)
Add a metric to the alert definition in the alert configuration file and write a PromQL statement using the added metric in the expression of the alert.
For more information about alert configuration file, see "JP1/Integrated Management 3 - Manager Command, Definition File, and API Reference" manual, "alert configuration file (jpc_alerting_rules.yml)" (2. Definition File)".
-
Restarting or reloading the Prometheus server service
Restart or reload the Services of the Prometheus server on the host where you edited the Prometheus configuration file and the alert configuration file.
-
Edit the metric definition file (if you want to add metrics to be handled in the trend display)
The return function of the metric list returns the metric defined in the metric definition file. The metric definition file exists for each Exporter. Check the Exporter of the IM management node to which you want to add the metric, and add the metric definition to the metric definition file for the exporter.
For more information about metric definition file, see "JP1/Integrated Management 3 - Manager Command, Definition File, and API Reference" manual, "metric Definition File in the respective Exporter" (2. Definition File).
After editing the metric definition file, the information in the updated metric definition file is reflected when you perform one of the following operations:
-
Redeappe the Trends tab in the Integrated Operations Viewer
-
Refresh [Dashboard] in integrated operation viewer
-
Run the JP1/IM - Manager Metrics List Acquisition API
-
Run JP1/IM - Manager Time Series Data Acquisition API
-