You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, all ingest errors are silently swallowed:
try:
self._post(self._batch_data(datapoints_list),
'{0}/{1}'.format(
self._endpoint,
self._INGEST_ENDPOINT_DATAPOINT_SUFFIX))
except:
_logger.exception('Posting data to SignalFx failed.')
I would like to be able to at least have a count of the types of exceptions that occur so that I can track them via other mechanisms (statsd, other internal health check code)
An approach I am using with other metric sending systems is something like this:
┆ # A mapping of error type to error count
┆ self.error_lock = threading.Lock()
┆ self.error_counters = collections.defaultdict(lambda: 0)
def inc_error(self, error_type):
┆ """Increment internal counter of errors encountered.
┆ :param error_type: str, Exception class or other descriptor of error.
┆ """
┆ with self.error_lock:
┆ ┆ self.error_counters[error_type] += 1
def reset_error_counters(self):
┆ """Reset error counters to 0 and return the previous values.
┆ :return: dict, Mapping of error type to count.
┆ """
┆ with self.error_lock:
┆ ┆ previous = self.error_counters
┆ ┆ self.error_counters = collections.defaultdict(lambda: 0)
┆ return previous
Hi (a disclaimer - I'm an employee of Splunk/SignalFx). What you propose sounds reasonable to me. I think it is a good suggestion and I'll be happy to help with reviews if you prepare a PR. Thanks!
At the moment, all ingest errors are silently swallowed:
I would like to be able to at least have a count of the types of exceptions that occur so that I can track them via other mechanisms (statsd, other internal health check code)
An approach I am using with other metric sending systems is something like this:
And then to use this in the sending code:
The text was updated successfully, but these errors were encountered: