Guest User

Issue with ceilometer transformers

a guest
Oct 25th, 2016
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.84 KB | None | 0 0
  1.    - name: cpu_source
  2.       interval: 600
  3.       meters:
  4.          - "cpu"
  5.       sinks:
  6.          - cpu_sink
  7.           - cpu_delta_sink
  8.  
  9.     - name: memory_source
  10.       interval: 600
  11.       meters:
  12.          - "memory.resident"
  13.           - "memory.usage"
  14.       sinks:
  15.          - memory_sink
  16.  
  17.     - name: health_source
  18.       interval: 600
  19.       meters:
  20.          - "cpu"
  21.           - "memory.resident"
  22.           - "memory.usage"
  23.       sinks:
  24.          - health_sink
  25.  
  26. /********************************************************//
  27.  
  28.     - name: cpu_sink
  29.       transformers:
  30.           - name: "rate_of_change"
  31.             parameters:
  32.                 target:
  33.                     name: "cpu_util"
  34.                     unit: "%"
  35.                     type: "gauge"
  36.                     scale: "100.0 / (10**9 * (resource_metadata.cpu_number or 1))"
  37.       publishers:
  38.          - notifier://
  39.  
  40.     - name: memory_sink
  41.       transformers:
  42.           - name: "arithmetic"
  43.             parameters:
  44.                 target:
  45.                     name: "memory_util"
  46.                     unit: "%"
  47.                     type: "gauge"
  48.                     expr: "100.0 * $(memory.usage) / $(memory.resident)"
  49.       publishers:
  50.          - notifier://
  51.  
  52. # This produces cpu_util & memory_util metric properly
  53.  
  54.     - name: cpu_memory_sink
  55.       transformers:
  56.           - name: "rate_of_change"
  57.             parameters:
  58.                 source:
  59.                     map_from:
  60.                         name: cpu
  61.                         unit: "cycles"
  62.                 target:
  63.                     map_to:
  64.                         name: "cpu_util_aux"
  65.                         unit: "%"
  66.                     type: "gauge"
  67.                     scale: "100.0 / (10**9 * (resource_metadata.cpu_number or 1))"
  68.           - name: "arithmetic"
  69.             parameters:
  70.                 target:
  71.                     name: "memory_util_aux"
  72.                     unit: "%"
  73.                     type: "gauge"
  74.                     expr: "100.0 * $(memory.usage) / $(memory.resident)"
  75.           - name: "arithmetic"
  76.             parameters:
  77.                 target:
  78.                     name: "health"
  79.                     unit: "%"
  80.                     type: "gauge"
  81.                     expr: "($(memory_util_aux) + $(cpu_util_aux)) / 2"
  82.       publishers:
  83.          - notifier://
  84.  
  85.  
  86. # But when we try to perform multiple transformers like this, the results are incorrect, cpu_util_aux returns similar values to cpu_util, but for memory_util_aux, in most of cases on the ceilometer-agent-compute.log we are seeing this:
  87.  
  88. # "2016-10-25 12:56:44.007 22075 DEBUG ceilometer.pipeline [-] Pipeline health_sink: Transform sample None from 2 transformer _publish_samples /usr/local/lib/python2.7/dist-packages/ceilometer/pipeline.py:401"
  89.  
  90. # And in the very few cases it shows some results the values are not the same than memory_util, even negative values are shown:
  91.  
  92. # 2016-10-25 12:56:44.012 22075 DEBUG ceilometer.pipeline [-] Pipeline health_sink: Transform sample <name: memory_util_aux, volume: -0.0 [..]
  93. # 2016-10-25 12:46:44.179 22075 DEBUG ceilometer.pipeline [-] Pipeline health_sink: Transform sample <name: memory_util_aux, volume: -49.9165275459 [..]
  94. # 2016-10-25 12:36:46.144 22075 DEBUG ceilometer.pipeline [-] Pipeline health_sink: Transform sample <name: memory_util_aux, volume: -550.0 [..]
  95.  
  96. # For the third transformer we dont get any results, since in most cases we are not getting a proper result in #2 calculating memory_util.
  97.  
  98. #In the collector we checked the logs, and we always get only the last transformer valid value, in this scenario cpu_util_aux and some memory_util_aux, not both, if 2nd transformer fails we get the 1st transformer, but even if all 3 would run fine only the last one will get in the collector so we are forced to get cpu_util and memory_util in separated sinks.
Add Comment
Please, Sign In to add comment