← Back to team overview

graphite-dev team mailing list archive

Re: [Question #282148]: Megacarbon Aggregator Missing AGGREGATION_WRITE_BACK_FREQUENCY Configuration Setting

 

Question #282148 on Graphite changed:
https://answers.launchpad.net/graphite/+question/282148

Kieran Girvan gave more information on the question:
OK I've made some progress on this, looks like this configuration
setting is expected to be set here:

#/opt/graphite/conf/carbon-daemons/relay/aggregation.conf
AGGREGATION_WRITE_BACK_FREQUENCY = 10

Having set this configuration option and restarted the relay daemon I
received the following error in the console.log:

22/01/2016 06:26:47 :: Unhandled Error
Traceback (most recent call last):
  File "/opt/graphite/lib/carbon/protocols.py", line 74, in lineReceived
    self.metricReceived(metric, datapoint)
  File "/opt/graphite/lib/carbon/protocols.py", line 60, in metricReceived
    events.metricReceived(metric, datapoint)
  File "/opt/graphite/lib/carbon/events.py", line 20, in __call__
    handler(*args, **kwargs)
  File "/opt/graphite/lib/carbon/pipeline.py", line 27, in run_pipeline
    run_pipeline(out_metric, out_datapoint, processors[1:])
--- <exception caught here> ---
  File "/opt/graphite/lib/carbon/pipeline.py", line 25, in run_pipeline
    for out_metric, out_datapoint in processor.process(metric, datapoint):
  File "/opt/graphite/lib/carbon/aggregator/processor.py", line 58, in process
    buffer.configure_aggregation(rule.frequency, rule.aggregation_func)
  File "/opt/graphite/lib/carbon/aggregator/buffers.py", line 57, in configure_aggregation
    self.compute_task.start(settings['AGGREGATION_WRITE_BACK_FREQUENCY'] or int(frequency), now=False)
  File "/usr/lib64/python2.7/site-packages/twisted/internet/task.py", line 196, in start
    self._scheduleFrom(self.starttime)
  File "/usr/lib64/python2.7/site-packages/twisted/internet/task.py", line 279, in _scheduleFrom
    self.call = self.clock.callLater(howLong(), self)
  File "/usr/lib64/python2.7/site-packages/twisted/internet/task.py", line 265, in howLong
    untilNextInterval = 10 - (runningFor % self.interval)
exceptions.TypeError: unsupported operand type(s) for %: 'float' and 'str'

Looks to be an issue with the configuration value not being parsed as an
integer within the buffers.py

Line 57 of this python script had the following declaration parsing in
the AGGREGATION_WRITE_BACK_FREQUENCY configuration setting:

self.compute_task.start(settings['AGGREGATION_WRITE_BACK_FREQUENCY'] or
int(frequency), now=False)]]

I made a small change to this python script to cast the configuration
setting as an integer.

self.compute_task.start(int(settings['AGGREGATION_WRITE_BACK_FREQUENCY'])
or int(frequency), now=False)

The aggregation now works.

I'm not sure if this is the best way to fix this possible bug or if I'm
setting the configuration incorrectly in the first place.

-- 
You received this question notification because your team graphite-dev
is an answer contact for Graphite.