メトリック定義でのワイルドカードの使用
関連ページ:
Custom Dashboard ウィジェットまたは Health Rule では、ワイルドカードを使用して、複数のハードウェアエンティティやメモリプールなど、複数のエンティティにまたがって評価するメトリックを指定できます。
メトリック階層のモバイル、Hardware Resources、JVM、CLR の各ブランチ内のメトリックと、「拡張機能とカスタムメトリック」で説明されているモニタリング拡張機能を使用して作成されたカスタムメトリックは、ワイルドカード機能に対応しています。
ワイルドカードを使用するには、以下を行います。
- 表示したいメトリックの相対メトリックパスを定義します。そのためには、メトリックブラウザから完全なメトリックパスを取得してそのパスを切り取る必要があります。
- 相対メトリックパスに変更を加えて複数のエンティティに適用します。
- 構成しているウィジェットまたは正常性ルールのメトリックセレクタに、変更を加えた相対パスを貼り付けます。
相対メトリックパスの定義
メトリックパスは、特定のメトリックのパイプで区切られたパスです。コントローラ UI では、メトリックブラウザでメトリックにカーソルを合わせると完全なメトリックパスが表示されます。メトリックを右クリックすると [Copy Full Path] オプションが表示されます。
相対メトリックパスを定義するには、完全なメトリックパスの左端部分を切り取ります。
特定のユースケースに対してどの程度切り取るかを知るには、セットアップしているウィジェットまたは正常性ルール構成の [Metric Selection] パネルで埋め込みメトリックブラウザを確認します。このセレクタに到達する時点までに、選択したいメトリックのアプリケーション、ティア、またはノードは構成されているはずです。
相対メトリックパスの最初のセグメントとして [Metric Selection] パネルのカテゴリを使用し、完全なメトリックパスのうち、そのセグメントより前に来るすべての部分を切り取ります。この例では、最初のセグメントは [分析データ収集時間(Analytics Data Collection Time)]、[分析方法評価時間(Analytics Method Evaluation Time)]、[分析スタックトレースキャプチャ時間(Analytics Stack Trace Capture Time)]、または [平均絵ンドツーエンド遅延(Average End to End Latency)] になります。
前出の例に従うと、メトリックブラウザからコピーした完全なメトリックパスは Application Infrastructure Performance|ECommerce Server|Hardware Resources|Disks|dev-dm-1|% CPU Time です。
埋め込みメトリックブラウザでの表示は [ハードウェアリソース(Hardware Resources)] から始まるため、[メトリックの選択(Metric Selection)] パネルで選択されているカテゴリ(この例では [ハードウェアリソース(Hardware Resources)])より左に来るすべての部分を切り取ります。
相対メトリックパス:Hardware Resources|Disks|dev-dm-1|% CPU Time
メトリックブラウザからコピーされた完全なメトリックパスが Application Infrastructure Performance|ECommerce Server|Individual Nodes|ECommerceAppNode|Hardware Resources|Disks|dev-dm-1|% CPU Time. のようになる、別の例を考えてみましょう。
Hardware Resources の左に来るすべての部分を切り取った後の相対メトリックパスは、Hardware Resources|Disks|dev-dm-1|% CPU Time です。
Modify the Relative Metric Path
Replace a single segment in the relative metric path with an asterisk to indicate that the metric should be evaluated for all the entities represented by that segment.
Exact match one wildcard * to one level of directory option. Otherwise multiple asterisks in a single metric path are not supported.
For example:
The relative metric path is: Hardware Resources|Disks|dev-dm-1|% CPU Time, and you want to display or create a health rule condition on the % CPU time for all of the disks in that tier or node.
Substitute the asterisk for the disk name as: Hardware Resources|Disks|*|% CPU Time.
Exact match one wildcard * to one level of directory option.
Configure the Metric for Multiple Entities
In the Metric Selection panel for the dashboard widget or health rule, you can configure metric for multiple entries.
To configure the metric for multiple entities:
- Select Specify Relative Metric Path on the bottom of the Metric Selection panel.
- Paste the modified, wild-carded relative metric path and click Select Metric.
Enforce Strict Pattern Matching in Relative Path
In the Metric Selection Panel for a health rule, select the Exact match one wildcard * to one level of directory option to enforce a strict matching pattern in the relative metric path. By default, this option is not selected and the number of pipe symbols in the metric path is not considered. Therefore, all the results are fetched that matches the starting and ending path of the metric.
For example, if you specify the following relative metric:
Custom Metrics| WebsphereMQ-2|*|Status
The * wildcard replaces only one string between the two pipes in the actual metric path. The health rule evaluates only on the following actual metric path:
Custom Metrics| WebsphereMQ-2|UXSOAGWSG51.QM1|Status
and excludes the paths such as:
-
Custom Metrics| WebsphereMQ-2|UXSOAGWSG51.QM1|Channels|SOASG.TLMRP|Status -
Custom Metrics| WebsphereMQ-2|UXSOAGWSG51.QM2|Channels|SOASG.TLMRP2|OIRDFF.SEEP|Status
By default, you can use a maximum of four wildcards * in the relative metric path. For example, the metric path Hardware *| *|*|* represents the actual path such as Hardware Resources|Network|en0|Outgoing KB.
For increasing the default number of wildcards allowed in the relative metric path, configure the following flag in the admin.jsp page:
appdynamics.controller.alerting.max.wildcard.entries = 4
Examples
The following table list a few examples of the allowed wildcard patterns in the relative path:
| Wildcard Pattern | Result |
|---|---|
|
Single wildcard:
|
|
|
Consecutive multiple wildcards:
|
|
|
Non-Consecutive multiple wildcards:
|
|
|
End of Path wildcard:
|
|
|
Start of path wildcard:
|
|
|
As a part of the string:
|
|
|
Four wildcards in the path:
|
|
Verify the Metric Specification
When you configure a relative metric specification for multiple similar entities in a custom dashboard, multiple metrics display in the widget.
Wildcards Replace Entire Path Segments
An asterisk replaces the entire segment in the path. You cannot use it to replace only a portion of a string because they are used in regular expressions.
For example, the following usage in an attempt to get the ART for all the business transactions beginning with View is not valid and not supported:
Business Transaction Performance|Business Transactions|ECommerce Server|View*|Average Response Time (ms).
Specify Average Response Time (ms) to get ART for all the business transactions on the ECommerce Server.
Colons in the Metric Path
The colon, if any, in the metric path is translated into a pipe. Only one segment is allowed between pipes. The colons and pipes can be used interchangeably.
For example:
The colon in the metric path, Application Infrastructure Performance|ECommerce Server|JVM|Memory:Heap|Committed (MB) is translated to Application Infrastructure Performance|ECommerce Server|JVM|Memory|Heap|Committed (MB).
For the relative metric path, to get metrics for both heap committed and non-heap committed, specify JVM|Memory|*|Committed (MB). Do not specify JVM|*|Committed (MB).