Open peerst opened 5 years ago
Measurement name is set globally for each handler. If we want to send SASL reports or other OTP metadata (like memory statistics) we might want use different measurement names for different categories of events.
For e.g. a supervisor crash we get this data:
dgram_logger:log(#{level => error,
meta =>
#{domain => [otp,sasl],
error_logger => #{tag => error_report,type => supervisor_report},
file => "supervisor.erl",gl => <0.223.0>,line => 701,
logger_formatter => #{title => "SUPERVISOR REPORT"},
mfa => {supervisor,do_restart,3},
pid => <0.225.0>,report_cb => fun logger:format_otp_report/1,
time => 1569603760792635},
msg =>
{report,#{label => {supervisor,child_terminated},
report =>
[{supervisor,{local,ssh_sup}},
{errorContext,child_terminated},
{reason,killed},
{offender,[{pid,<0.294.0>},
{id,sshc_sup},
{mfargs,{sshc_sup,start_link,[]}},
{restart_type,permanent},
{shutdown,infinity},
{child_type,supervisor}]}]}}},#{config =>
#{host => {127,0,0,1},
measurement => <<"sol">>,pid => <0.281.0>,port => 8089,
send_timestamp => true,sock => #Port<0.14>},
formatter => {logger_formatter,#{}},
id => foo,module => dgram_logger})
We need to decide if we should override measurement name (or make it configurable per event type), what should be tags and what should be fields.
When we not only get progress reports but a crash dump the formatting functions can't deal with the fact that the passed list is not of the format
[{K1, V1}, {K2, V2}, ...]
but contains a nested list like: