Monitor the Health Data of a Service Instance

You can monitor the health of an Oracle Java Cloud Service instance using the REST API, as described in the following procedure.

Note:

  • On accounts that are integrated with Oracle Identity Cloud Service, the identity domain ID is the Identity Cloud Service tenant name. This tenant name begins with the characters idcs-followed by a string of number and letters (for example, idcs-98888f7964454b658ac6d2f625b29030). Access the Oracle Identity Cloud Service Console in a browser to find the tenant name in the URL. You can also find the name when you sign in to your Oracle Cloud account, navigate to Identity and then select Federation.

  • The cURL command examples use the URL structure https://rest_server_url/resource-path, where rest_server_url is the REST server to contact for your identity domain. See Send Requests.

To monitor an Oracle Java Cloud Service instance:

  1. Before monitoring an Oracle Java Cloud Service instance, review the service instances that currently exist to identify the service instance you want to monitor.
    curl -i -X GET -u username:password -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/jaas/instances
    

    Specify the following options on the cURL command line:

    • -i option to include the HTTP header in the output. This option is optional.

    • -X option to indicate the type of request (GET).

    • -u option to specify the user name and password for the Oracle Java Cloud Service account for authentication.

    • -H to define a custom header, X-ID-TENANT-NAME, to identify the identity domain ID.

    The following shows an example of the response body.

    Look for the service name of the service instance you want to monitor. In this example, the service name is ExampleInstance.

    {
       "services":{
          "MyInstance":{
          ...
          },
          "ExampleInstance":{
             "serviceId":660660,
             "serviceName":"ExampleInstance",
             "serviceType":"JaaS",
             "domainName":"idcs-1ab1bffa4a9884fe1a",
             "serviceVersion":"12cRelease214",
             "releaseVersion":"12.2.1.4.180726",
             "metaVersion":"18.3.6-1809062220",
             "serviceLevel":"PAAS",
             "subscription":"HOURLY",
             "meteringFrequency":"HOURLY",
             "edition":"EE",
             "totalSSDStorage":0,
             "storageContainer":"http://container_url",
             "state":"READY",
             "serviceStateDisplayName":"Ready",
             "clone":false,
             "creator":"username",
             "creationDate":"2018-08-30T23:49:12.749+0000",
             "adminHostName":"exampleinstance-wls-1",
             ...
             "attributes":{...},
             "tags":{...},
             "components":{
                "WLS":{...},
                "OTD":{...},
             "activityLogs":[
                {
                   "activityLogId":25123117,
                   ...
                   "messages":[...]
                }
             ],
             "serviceLevelDisplayName":"Oracle Java Cloud Service",
             "editionDisplayName":"Enterprise Edition",
             "meteringFrequencyDisplayName":"Hourly",
             "jdkVersion":"1.8.0_181",
             "BACKUP_DESTINATION":"BOTH",
             "provisionEngine":"Metadata_1_0",
             "enableAdminConsoles":"true",
             "cloudStorageContainer":"http://container_url",
             "useIdentityService":"false",
             "identityTenancy":"StandardJCS",
             ...
             "allAssociations":{
                "toAssociations":[
                   {...}
                ],
                "fromAssociations":[
                ]
             },
             "region":"regionname",
             "availabilityDomain":"adname",
             "ipNetwork":"/ipnetworkname",
             "patching":{
                "currentOperation":{
                   "operation":"NONE"
                },
                "updateStatus":"NORMAL_PENDING",
                "totalAvailablePatches":2
             }
          }
       }
    }
  2. Monitor the ExampleInstance service instance by entering the following command.
    curl -i -X GET -u username:password -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/jaas/instances/ExampleInstance/healthcheck

    Specify the following options on the cURL command line:

    • -i option to include the HTTP header in the output. This option is optional.

    • -X option to indicate the type of request (GET).

    • -u option to specify the user name and password for the Oracle Java Cloud Service account for authentication.

    • -H to define a custom header, X-ID-TENANT-NAME, to identify the identity domain ID.

    For more information, see View Health Data for a Service Instance.

    The following shows an example of the response body.

    {
       "timestamp":"2018-09-13T15:58:12.862+00:00",
       "collectionTime":"2018-09-13T15:58:19.076+00:00",
       "serviceId":660660,
       "status":"UP",
       "domainName":"idcs-1ab1b980488e1a",
       "components":{
          "OTD":{
             "timestamp":"2018-09-13T15:58:12.820+00:00",
             "collectionTime":"2018-09-13T15:58:19.077+00:00",
             "serviceId":660660,
             "status":"UP",
             "vmInstances":{
                "exampleinstance-lb-1":{
                   "servers":{
                      "ExampleI-lb-1":{
                         "timestamp":"2018-09-13T15:58:12.820+00:00",
                         "collectionTime":"2018-09-13T15:58:19.079+00:00",
                         "status":"UP",
                         "serverId":229365,
                         "serverName":"ExamleI-lb-1",
                         "healthData":{
                            "request-count":{
                               "unit":"count",
                               "value":"0",
                               "displayName":"Request count"
                            },
                            "rtLast5MinAvg":{
                               "unit":"ms",
                               "value":"0",
                               "displayName":"Avg resp time 5 min"
                            },
                            "error-request-count":{
                               "unit":"count",
                               "value":"0",
                               "displayName":"Error request count"
                            },
                            "upsince":{
                               "unit":"ms",
                               "value":"2018-09-13T00:18:21.000+00:00",
                               "displayName":"Server Up since"
                            }
                         },
                         "serverType":"OTD_SERVER",
                         "statusMessage":"Running"
                      }
                   },
                   "hostName":"exampleinstance-lb-1",
                   "label":"ExampleInstance lb 1",
                   "vmId":413957
                }
             },
             "componentId":284049,
             "componentType":"OTD",
             "statusMessage":"Running"
          },
          "WLS":{
             "timestamp":"2018-09-13T15:58:09.536+00:00",
             "collectionTime":"2018-09-13T15:58:19.066+00:00",
             "serviceId":660660,
             "status":"UP",
             "vmInstances":{
                "exampleinstance-wls-1":{
                   "servers":{
                      "ExampleI_server_1":{
                         "timestamp":"2018-09-13T15:58:09.409+00:00",
                         "collectionTime":"2018-09-13T15:58:19.083+00:00",
                         "status":"UP",
                         "serverId":215556,
                         "serverName":"ExampleI_server_1",
                         "healthData":{
                            "upsince":{
                               "unit":"ms",
                               "value":"2018-09-08T21:03:43.000+00:00",
                               "displayName":"Server up since"
                            },
                            "heapmax":{
                               "unit":"MB",
                               "value":"1820.5",
                               "displayName":"Max memory"
                            },
                            "heapfree":{
                               "unit":"MB",
                               "value":"1328.96",
                               "displayName":"Free memory"
                            }
                         },
                         "serverType":"MS",
                         "statusMessage":"Running"
                      },
                      "ExampleI_adminserver":{
                         "timestamp":"2018-09-13T15:58:07.996+00:00",
                         "collectionTime":"2018-09-13T15:58:19.084+00:00",
                         "status":"UP",
                         "serverId":215555,
                         "serverName":"ExampleI_adminserver",
                         "healthData":{
                            "upsince":{
                               "unit":"ms",
                               "value":"2018-09-08T21:02:40.000+00:00",
                               "displayName":"Server up since"
                            },
                            "heapmax":{
                               "unit":"MB",
                               "value":"1365.5",
                               "displayName":"Max memory"
                            },
                            "heapfree":{
                               "unit":"MB",
                               "value":"832.95",
                               "displayName":"Free memory"
                            }
                         },
                         "serverType":"ADMIN",
                         "statusMessage":"Running"
                      }
                   },
                   "hostName":"exampleinstance-wls-1",
                   "label":"ExampleInstance wls 1",
                   "vmId":398758
                },
                "exampleinstance-wls-3":{
                   "servers":{
                      "ExampleI_server_3":{
                         "timestamp":"2018-09-13T15:58:09.512+00:00",
                         "collectionTime":"2018-09-13T15:58:19.082+00:00",
                         "status":"UP",
                         "serverId":231479,
                         "serverName":"ExampleI_server_3",
                         "healthData":{
                            "upsince":{
                               "unit":"ms",
                               "value":"2018-09-12T19:39:20.000+00:00",
                               "displayName":"Server up since"
                            },
                            "heapmax":{
                               "unit":"MB",
                               "value":"1820.5",
                               "displayName":"Max memory"
                            },
                            "heapfree":{
                               "unit":"MB",
                               "value":"1219.73",
                               "displayName":"Free memory"
                            }
                         },
                         "serverType":"MS",
                         "statusMessage":"Running"
                      }
                   },
                   "hostName":"exampleinstance-wls-3",
                   "label":"ExampleInstance wls 3",
                   "vmId":416588
                }
             },
             "componentId":284050,
             "componentType":"WLS",
             "statusMessage":"Running"
          }
       },
       "dataQuality":{
          "message":"Health data complete"
       },
       "serviceType":"JaaS",
       "serviceName":"ExampleInstance",
       "statusMessage":"Running"
    }
  3. Review the health monitoring data and take action, as required. For example:
    • For each server, review the free heap size (heapFree) and consider scaling the node if the value falls below the acceptable threshold.
    • For the Oracle Traffic Director (OTD) component, review the average request time (rtLast5MinAvg) and consider scaling the cluster if the value is above the acceptable threshold.