private String getTaskFailedStackTrace(URL taskAllAttemptsUrl) throws IOException, AuthenticationException {
      JsonNode firstAttempt = getTaskFirstFailedAttempt(taskAllAttemptsUrl);
      if(firstAttempt != null) {
        String stacktrace = firstAttempt.get("diagnostics").getValueAsText();
        return stacktrace;
      } else {
        return null;
      }
    }
This class implements the Fetcher for MapReduce Applications on Hadoop2
app/com/linkedin/drelephant/mapreduce/fetchers/MapReduceFetcherHadoop2.java