Skip to content

Commit

Permalink
Include stack trace when failed to send metrics to Stackdriver (#1269)
Browse files Browse the repository at this point in the history
Also add successful debug logging of how many time series sent.
  • Loading branch information
izeye authored and shakuzen committed Apr 3, 2019
1 parent ff86e92 commit ac92f69
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,13 @@ protected void publish() {
.build();

if (logger.isTraceEnabled()) {
logger.trace("publishing batch to stackdriver:\n{}", request);
logger.trace("publishing batch to Stackdriver:\n{}", request);
}

client.createTimeSeries(request);
logger.debug("successfully sent {} TimeSeries to Stackdriver", partition.size());
} catch (ApiException e) {
logger.warn("failed to send metrics to stackdriver: {}", e.getCause().getMessage());
logger.warn("failed to send metrics to Stackdriver", e);
}
}
}
Expand Down Expand Up @@ -368,7 +369,7 @@ private void createMetricDescriptorIfNecessary(MetricServiceClient client, Meter
client.createMetricDescriptor(request);
verifiedDescriptors.add(id.getName());
} catch (ApiException e) {
logger.warn("failed to create metric descriptor in stackdriver for meter " + id + " {}", e.getCause().getMessage());
logger.warn("failed to create metric descriptor in Stackdriver for meter " + id, e);
}
}
}
Expand Down

0 comments on commit ac92f69

Please sign in to comment.