Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: New name

This article describes how to run health check and check logs and statistics for Hermod

Expandall

Expand
titleView application information
  1. To check that Hermod is alive, and view the running instance id and version, use the following command. Make sure to use the correct port:


    Code Block
    titleExample: Health check
    GET https://my-hermod-server:20400/<contextPath>/info
     
    Response 200 OK
    Body
    {
       "id":"hermod.6d99c1",
       "build":{
          "version":"2.0.0.RELEASE",
          "artifact":"cod-hermod",
          "name":"Cod Hermod",
          "group":"com.nexusgroup.cod.hermod",
          "time":1497432675000
       }
    }



Expand
titleCheck application health
  1. To check health information and status for the running Hermod, use the following command. Make sure to use the correct port

    Code Block
    titleExample: Health check
    GET https://my-hermod-server:20400/<contextPath>/health
    
    {
      "status":"UP",
      "diskSpace":{
         "status":"UP",
         "total":15442378752,
         "free":2757484544,
         "threshold":10485760
      },
      "db":{
         "status":"UP",
         "database":"PostgreSQL",
         "hello":1
      },  
    
      "configServer":{
         "status":"UP",
      },
      "hystrix":{     
         "status":"UP" 
      }
    }


These are the built-in statuses:

Status

DOWN

OUT_OF_SERVICE

UP

UNKNOWN



Expand
titleCheck logs
  1. To check the logs:

    Code Block
    languagetext
    titleExample: Check logs
    # Login to the host
    ssh user@machine
    su - docker
     
    # Check logs
    cd compose/hermod
    docker-compose logs -f --tail=100



Expand
titleCheck metrics

Hermod stores metrics since the last restart. These can be viewed via a http request.

  1. To view the Hermod metrics:

    Code Block
    languagetext
    titleExample: Check metrics
    # Find the current port for an Hermod instance (33700 in this case)
    docker-compose ps | grep hermod_hermod
    hermod_hermod_1            ./fatjar-entrypoint.sh app ...   Up      0.0.0.0:33700->20400/tcp
     
    # Use curl to get metrics (You can use https://jsonformatter.curiousconcept.com/ to format the output)
    curl  http://localhost:33600/<contextPath>/metrics
     
    {
       "mem":673568,
       "mem.free":336830,
       "processors":2,
       "instance.uptime":57997012,
       "uptime":58006488,
       "systemload.average":0.0,
       "heap.committed":579072,
       "heap.init":112640,
       "heap.used":242241,
       "heap":1585664,
       "nonheap.committed":96768,
       "nonheap.init":2496,
       "nonheap.used":94496,
       "nonheap":0,
       "threads.peak":50,
       "threads.daemon":23,
       "threads.totalStarted":2493,
       "threads":49,
       "classes":10343,
       "classes.loaded":10343,
       "classes.unloaded":0,
       "gc.ps_scavenge.count":22,
       "gc.ps_scavenge.time":294,
       "gc.ps_marksweep.count":2,
       "gc.ps_marksweep.time":142,
       ...
    }