Class: Yabeda::Hanami::Event

Inherits:
Dry::Events::Event
  • Object
show all
Defined in:
lib/yabeda/hanami/event.rb

Overview

Dry::Events::Event with added logic for Yabeda tags formatting

Instance Method Summary collapse

Instance Method Details

#durationObject



21
22
23
# File 'lib/yabeda/hanami/event.rb', line 21

def duration
  ms2s payload[:time]
end

#labelsObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/yabeda/hanami/event.rb', line 9

def labels
  @labels ||= begin
    labels = {
      method: method,
      path: path,
      status: status,
      remote_ip: remote_ip
    }
    labels.merge(payload.slice(*Yabeda.default_tags.keys - labels.keys))
  end
end