Ray's Knowledge Base
Unlock

Which View reads return dftracer metadata records

FactVerified 27 Sep 2026Holds project: dftracer-utils
Fact. A statement and the evidence for it.

Statement#

For a dftracer trace with ph="M" metadata records (such as process_name):

  • collect() returns data events only. With phase(Phase::Any) it still leaves metadata out, because collect_events drops METADATA and UNKNOWN phases after decoding.
  • phase(Phase::Metadata) returns the metadata records as rows.
  • sink_json writes the metadata records by default: an export keeps them, so a trace viewer can name threads and processes.
  • A ViewSession fold without a predicate sees what the scan emits. ViewSession::fold(f, combine) (no predicate) applies the view's own query and phase through effective_query, so it matches collect().

Compare a new read path with collect() for data rows, not with sink_json: the two differ on metadata by design.

Evidence#

  • Stage 9a test tests/trace/views/test_typed_rows.cpp, case "dftracer metadata records are left out unless selected", on a trace of 1 process_name record and 20 events: rows<T> gave 20 for the default view, 1 for phase(Metadata), and equal to collect().num_rows() (20) for phase(Any), while sink_json(...).events_matched gave 21 for both the default view and phase(Any).

Also found by searching

  • collect() with phase(Phase::Any) does not return ph=M process_name metadata records
  • my View read skips the trace metadata events but the json export includes them
  • which View reads include dftracer metadata records and how do I get them as rows
  • phase(Phase::Metadata), sink_json keeps metadata, collect_events drops METADATA UNKNOWN, fold effective_query
  • collect() does not return process_name metadata records ph=M in dftracer View
  • how do I get metadata events from a trace with phase(Phase::Metadata)
  • sink_json export includes thread and process names but collect drops them, why
  • ViewSession fold sees metadata or not, effective_query phase Any still excludes METADATA