anchor.diff:                   registry_collect_callback(Fd, Registry, Collector)
                end,
     prometheus_registry:collect(Registry, Callback),
  -  file:write(Fd, io_lib:format("\n", [])),
  +  file:write(Fd, "\n"),
     {ok, Size} = ram_file:get_size(Fd),
     {ok, Str} = file:pread(Fd, 0, Size),
     ok = file:close(Fd),
  
positive.code:   ?ESCAPE_LVALUE(LValue);
  escape_label_value(LValue) when is_binary(LValue) ->
    ?ESCAPE_LVALUE(LValue);
  escape_label_value(LValue) ->
    ?ESCAPE_LVALUE(io_lib:format("~p", [LValue])).
  
  -spec sub(iodata(), string(), string()) -> string().
  sub(Str, Old, New) ->
  
negative.code: labels_string([])     -> "";
  labels_string(Labels) ->
    Fun = fun (#'LabelPair'{name=Name, value=Value}) ->
              [Name, "=\"", escape_label_value(Value), "\""]
          end,
    ["{", lists:join(",", lists:map(Fun, Labels)), "}"].
  
  emit_series(Fd, Name, Labels, undefined) ->
    LString = labels_string(Labels),
    file:write(Fd, [Name, LString, " NaN\n"]);
  emit_series(Fd, Name, Labels, Value) ->
    LString = labels_string(Labels),
    file:write(Fd, [Name, LString, " ", io_lib:format("~p", [Value]) , "\n"]).
  
  %% @private
  escape_metric_help(Help) ->
    sub(sub(Help, "\\", "\\\\\\\\"), "\n", "\\\\n").
  
  bound_to_label_value(Bound) when is_number(Bound) ->
    io_lib:format("~p", [Bound]);
  bound_to_label_value(infinity) ->
    "+Inf".
  
  