Health checks can only see the direct message of the throwable. When we
catch and re-wrap exceptions, we have to be careful not to throw away
the only thing that tells us what's wrong.
Ex before we hid the actual exception by guessing what the problem was.
Now, we can at least see what it is.
$ curl -s localhost:9411/health
{"status":"DOWN","zipkin":{"status":"DOWN","details":{"ElasticsearchStorage{initialEndpoints=aws://ap-southeast-1/zipkin-5, index=zipkin}":{"status":"DOWN","details":{"error":"java.lang.RuntimeException: couldn't lookup AWS ES domain endpoint: Unable to load AWS credentials from any provider in the chain: [EnvironmentVariableCredentialsProvider: Unable to load AWS credentials from environment variables (AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY) and AWS_SECRET_KEY (or AWS_SECRET_ACCESS_KEY)), SystemPropertiesCredentialsProvider: Unable to load AWS credentials from Java system properties (aws.accessKeyId and aws.secretKey), com.amazonaws.auth.profile.ProfileCredentialsProvider@6aa41445: profile file cannot be null, com.amazonaws.auth.EC2ContainerCredentialsProviderWrapper@53ec57e2: Unable to load credentials from service endpoint]"}}}}}
Health checks can only see the direct message of the throwable. When we catch and re-wrap exceptions, we have to be careful not to throw away the only thing that tells us what's wrong.
Ex before we hid the actual exception by guessing what the problem was. Now, we can at least see what it is.