lib/fluent/plugin/backends/datadog_backend.rb in fluent-plugin-metricsense-0.2.8 vs lib/fluent/plugin/backends/datadog_backend.rb in fluent-plugin-metricsense-0.2.9

- old
+ new

@@ -70,14 +70,18 @@ # add seg_key as a tag to allow calculating metrics over the segment name tags.push(seg_key) end options = {} - options["tags"] = tags - options["host"] = @host if @host - options["type"] = "gauge" + options[:tags] = tags + options[:host] = @host if @host + options[:type] = "gauge" - @dog.emit_points(metric, points, options) + log.debug("datadog emit points: metric=#{metric}, points=#{points.inspect}, options=#{options.inspect}") + code, response = @dog.emit_points(metric, points, options) + if code.to_i / 100 != 2 + raise("datadog returns #{code}: #{response.inspect}") + end end end end end end