2. APM Monitoring Target Configuration
What This Chapter Does
It fetches the list of what is being monitored right now. It shows how the application groups
and the WAS instances, web servers, and systems beneath them are configured.
Why call it first -- the metric query API (chapter 3) takes the group
name and instance name as arguments. Those names come from here. Hard-coding the names means editing
the code every time a target is added or changed, so an integration program is better off querying
the list with this API first.
Application Group Configuration
This API returns the configuration of the OPENMARU APM monitoring targets. It returns the
application groups and, for each application group, the WAS instance configuration per machine, and
the instance configuration per machine for web servers, WAS instances, and systems.
Request
| Item | Description |
|---|
| URL | /monitoring/api/metrics/APP |
| HTTP METHOD | GET |
| Content-Type | application/json |
| Parameters | None |
Response
| Key | |
|---|
| Response Body | The content of the response JSON string is as follows. |
| APP configuration | {"applications": [{"name": "shop","uuid": null,"builtIn": true,"enable": true,"hosts": [{"ip": "192.168.23.22","type": "APP","instances": [{"name": "shop12","status": "STOPPED"}],"instanceCount": 1,"instanceIds": ["shop12"],"sortable": true},{"ip": "192.168.23.23","type": "APP","instances": [{"name": "shop22","status": "RUNNING"}],"instanceCount": 1,"instanceIds": ["shop22"],"sortable": true}],"hostIpsAsString": "192.168.23.22:192.168.23.23","hostIps": ["192.168.23.22","192.168.23.23"],"hostInstancesAsString": "shop12:shop22","hostInstances": ["shop12","shop22"],"sortable": true},… } |
Using a tool such as a JSON editor makes the object structure of the response easy to grasp, as in
the picture below.
Response Items
| Item | Type | Description |
|---|
| applications | Application Array | The application group configuration. See the Application items below |
| totalInstances | Integer | The total number of WAS instances |
| wasHostGroup | Host Array | WAS instance information per machine. See the Host items below |
| webHostGroup | Host Array | WEB instance information per machine. See the Host items below |
| sysHostGroup | Host Array | SYS instance information per machine. See the Host items below |
| sortable | Boolean | Whether sorting is possible |
Application Items
| Item | Type | Description |
|---|
| name | String | Represents the application group information |
| uuid | String | The application UUID. A value is returned only for a user-defined application; otherwise null is returned |
| builtIn | Boolean | false for a user-defined application, true for an application the system defined |
| enable | Boolean | Shows whether it is in use |
| hosts | Host Array | → See the Host items below |
| hostIpsAsString | String | Returns the host IPs as a string separated by ":" |
| hostIps | String Array | Returns the host IP list as a string array |
| hostInstancesAsString | String | Returns all instances of the host as a string separated by ":" |
| hostInstances | String Array | Returns the host's instances as a string array |
| sortable | Boolean | Whether sorting is possible |
Host Items
| Item | Type | Description |
|---|
| ip | String | Represents the application group information |
| Type | String | The type of the server. "WAS": WAS monitoring data is being collected. "SYS": system monitoring data is being collected. "WEB": web server monitoring data is being collected |
| instances | Object Array | The instances item appears only when Type is WAS or WEB |
instances[].name | String | The WAS instance name |
instances[].status | String | The state of the WAS instance -- RUNNING or STOPPED |
| instanceCount | Integer | The number of instances on this machine |
| instanceIds | String Array | A string array of the WAS instances on this machine (shown only for WAS and WEB) |
| sortable | Boolean | |