### profile: details    (show-details: always, show-components: always)

--- upstream UP ---
$ curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/actuator/health
  HTTP 503
{
    "components": {
        "db": {
            "details": {
                "database": "H2",
                "validationQuery": "isValid()"
            },
            "status": "UP"
        },
        "diskSpace": {
            "details": {
                "total": 10213466112,
                "free": 3877675008,
                "threshold": 10485760,
                "path": "/tmp/work/spring-boot-demo/.",
                "exists": true
            },
            "status": "UP"
        },
        "externalApi": {
            "details": {
                "url": "http://localhost:8080/stub/upstream/ping",
                "response": "pong",
                "latencyMs": 66,
                "timeoutMs": 750
            },
            "status": "UP"
        },
        "kafka": {
            "details": {
                "bootstrap": "localhost:9092",
                "tuned": true,
                "error": "TimeoutException: null",
                "probeMs": 1500,
                "budgetMs": 1500
            },
            "status": "DOWN"
        },
        "livenessState": {
            "status": "UP"
        },
        "ordersDatabase": {
            "details": {
                "orders": 3,
                "queryMs": 0,
                "slowThresholdMs": 250
            },
            "status": "UP"
        },
        "ping": {
            "status": "UP"
        },
        "readinessState": {
            "status": "UP"
        },
        "ssl": {
            "details": {
                "expiringChains": [],
                "invalidChains": [],
                "validChains": []
            },
            "status": "UP"
        }
    },
    "groups": [
        "liveness",
        "readiness"
    ],
    "status": "DOWN"
}

--- flip the upstream to DOWN, change nothing else ---
$ curl -s -X POST 'http://localhost:8080/stub/upstream/mode?value=down'
upstream mode = DOWN
  HTTP 503
{
  "status": "DOWN",
  "externalApi": {
    "details": {
      "error": "org.springframework.web.client.HttpServerErrorException$ServiceUnavailable: 503 : \"upstream unavailable\"",
      "url": "http://localhost:8080/stub/upstream/ping",
      "latencyMs": 67,
      "timeoutMs": 750
    },
    "status": "DOWN"
  }
}

  The aggregate went DOWN and /actuator/health now answers 503. If that URL is your
  Kubernetes readiness probe, every pod in the deployment has just left the load
  balancer because a third party had a bad minute.

--- a single component, addressed directly ---
$ curl -s http://localhost:8080/actuator/health/ordersDatabase
{
    "details": {
        "orders": 3,
        "queryMs": 0,
        "slowThresholdMs": 250
    },
    "status": "UP"
}
$ curl -s http://localhost:8080/actuator/health/kafka
{
    "details": {
        "bootstrap": "localhost:9092",
        "tuned": true,
        "error": "TimeoutException: null",
        "probeMs": 1500,
        "budgetMs": 1500
    },
    "status": "DOWN"
}

--- restore ---
upstream mode = UP
