lib/alephant/sequencer/sequencer.rb in alephant-sequencer-1.2.0 vs lib/alephant/sequencer/sequencer.rb in alephant-sequencer-1.2.1
- old
+ new
@@ -32,11 +32,14 @@
block.call if (sequential || keep_all)
if sequential
set_last_seen(msg, last_seen_id)
else
- logger.metric(:name => "SequencerNonSequentialMessageCount", :unit => "Count", :value => 1)
+ logger.metric(
+ "SequencerNonSequentialMessageCount",
+ metric_opts
+ )
logger.info("Sequencer#sequence nonsequential message for #{ident} (last_seen_id: #{last_seen_id})")
end
end
def delete!
@@ -62,9 +65,19 @@
@sequence_table.sequence_for(key)
end
def self.sequence_id_from(msg, path)
JsonPath.on(msg.body, path).first.to_i
+ end
+
+ def metric_opts
+ {
+ :dimensions => {
+ :module => "Alephant",
+ :class => "Sequencer",
+ :function => "validate"
+ }
+ }
end
end
end
end