project Utilities / Python Influxdb Downsample avatar

utilities/python_influxdb_downsample#18: Expand information available to recordFailures



Issue Information

Issue Type: issue
Status: opened
Reported By: btasker
Assigned To: btasker

Milestone: backlog
Created: 10-Feb-23 09:01



Description

I've started building a Grafana dashboard to display the stats exposed.

The failure count isn't currently very useful - we can see that a run has failed, but not which job failed etc.

I think it'd be worth re-visiting



Toggle State Changes

Activity


assigned to @btasker

The underlying issue is that, when we moved to batched writes (#15) we lost the ability to pass arbitrary arguments in.

We can't simply access class attributes because they might have changed by the time that a batch fails.

What we probably could do though, would be to create a new callback class:

class Callback(object):  
    def __init__(self, config, d):  
       self.job_name = "foo"
       self.downsample = d

    def error_callback(self, conf: (str, str, str), data: str, exception)
       foo

It's attributes could be updated when instantiated to keep track.

The problem with that, though, is that we'd then need a writer handle per job rather than per destination - callbacks are set when opening the API handle.