anchor.diff:      produce_stats().
   
   register_stats() ->
  -    [register_stat(Stat) || Stat <- stats()].
  +    [register_stat({?APP, Name}, Type) || {Name, Type} <- stats()].
   
   %% @doc Update the given stat
   update(vnode_get) ->
  -    folsom_metrics:notify_existing_metric(riak_kv_vnode_gets, 1, meter);
  +    folsom_metrics:notify_existing_metric({?APP, vnode_gets}, 1, meter);
   update(vnode_put) ->
  -    folsom_metrics:notify_existing_metric(riak_kv_vnode_puts, 1, meter);
  +    folsom_metrics:notify_existing_metric({?APP, vnode_puts}, 1, meter);
   update(vnode_index_read) ->
  -    folsom_metrics:notify_existing_metric(riak_kv_vnode_index_reads, 1, meter);
  +    folsom_metrics:notify_existing_metric({?APP, vnode_index_reads}, 1, meter);
   update({vnode_index_write, PostingsAdded, PostingsRemoved}) ->
  -    folsom_metrics:notify_existing_metric(riak_kv_vnode_index_writes, 1, meter),
  -    folsom_metrics:notify_existing_metric(riak_kv_vnode_index_writes_postings, PostingsAdded, meter),
  -    folsom_metrics:notify_existing_metric(riak_kv_vnode_index_deletes_postings, PostingsRemoved, meter);
  +    folsom_metrics:notify_existing_metric({?APP, vnode_index_writes}, 1, meter),
  +    folsom_metrics:notify_existing_metric({?APP, vnode_index_writes_postings}, PostingsAdded, meter),
  +    folsom_metrics:notify_existing_metric({?APP, vnode_index_deletes_postings}, PostingsRemoved, meter);
   update({vnode_index_delete, Postings}) ->
  -    folsom_metrics:notify_existing_metric(riak_kv_vnode_index_deletes, Postings, meter),
  -    folsom_metrics:notify_existing_metric(riak_kv_vnode_index_deletes_postings, Postings, meter);
  +    folsom_metrics:notify_existing_metric({?APP, vnode_index_deletes}, Postings, meter),
  +    folsom_metrics:notify_existing_metric({?APP, vnode_index_deletes_postings}, Postings, meter);
   update({get_fsm, Bucket, Microsecs, undefined, undefined, PerBucket}) ->
  -    folsom_metrics:notify_existing_metric(riak_kv_node_gets_total, {inc, 1}, counter),
  -    folsom_metrics:notify_existing_metric(riak_kv_node_get_fsm_time, Microsecs, histogram),
  +    folsom_metrics:notify_existing_metric({?APP, node_gets_total}, {inc, 1}, counter),
  +    folsom_metrics:notify_existing_metric({?APP, node_get_fsm_time}, Microsecs, histogram),
       do_get_bucket(PerBucket, {Bucket, Microsecs, undefined, undefined});
   update({get_fsm, Bucket, Microsecs, NumSiblings, ObjSize, PerBucket}) ->
  -    folsom_metrics:notify_existing_metric(riak_kv_node_gets_total, {inc, 1}, counter),
  -    folsom_metrics:notify_existing_metric(riak_kv_node_get_fsm_time, Microsecs, histogram),
  -    folsom_metrics:notify_existing_metric(riak_kv_node_get_fsm_siblings, NumSiblings, histogram),
  -    folsom_metrics:notify_existing_metric(riak_kv_node_get_fsm_objsize, ObjSize, histogram),
  +    folsom_metrics:notify_existing_metric({?APP, node_gets_total}, {inc, 1}, counter),
  +    folsom_metrics:notify_existing_metric({?APP, node_get_fsm_time}, Microsecs, histogram),
  +    folsom_metrics:notify_existing_metric({?APP, node_get_fsm_siblings}, NumSiblings, histogram),
  +    folsom_metrics:notify_existing_metric({?APP, node_get_fsm_objsize}, ObjSize, histogram),
       do_get_bucket(PerBucket, {Bucket, Microsecs, NumSiblings, ObjSize});
   update({put_fsm_time, Bucket,  Microsecs, PerBucket}) ->
  -    folsom_metrics:notify_existing_metric(riak_kv_node_puts_total, {inc, 1}, counter),
  -    folsom_metrics:notify_existing_metric(riak_kv_node_put_fsm_time, Microsecs, histogram),
  +    folsom_metrics:notify_existing_metric({?APP, node_puts_total}, {inc, 1}, counter),
  +    folsom_metrics:notify_existing_metric({?APP, node_put_fsm_time}, Microsecs, histogram),
       do_put_bucket(PerBucket, {Bucket, Microsecs});
   update(pbc_connect) ->
  -    folsom_metrics:notify_existing_metric(riak_kv_pbc_connects_active, {inc, 1}, counter),
  -    folsom_metrics:notify_existing_metric(riak_kv_pbc_connects, 1, meter);
  +    folsom_metrics:notify_existing_metric({?APP, pbc_connects_active}, {inc, 1}, counter),
  +    folsom_metrics:notify_existing_metric({?APP, pbc_connects}, 1, meter);
   update(pbc_disconnect) ->
  -    folsom_metrics:notify_existing_metric(riak_kv_pbc_connects_active, {dec, 1}, counter);
  +    folsom_metrics:notify_existing_metric({?APP, pbc_connects_active}, {dec, 1}, counter);
   update(read_repairs) ->
  -    folsom_metrics:notify_existing_metric(riak_kv_read_repairs, 1, meter);
  +    folsom_metrics:notify_existing_metric({?APP, read_repairs}, 1, meter);
   update(coord_redir) ->
  -    folsom_metrics:notify_existing_metric(riak_kv_coord_redirs_total, {inc, 1}, counter);
  +    folsom_metrics:notify_existing_metric({?APP, coord_redirs_total}, {inc, 1}, counter);
   update(mapper_start) ->
  -    folsom_metrics:notify_existing_metric(riak_kv_mapper_count, {inc, 1}, counter);
  +    folsom_metrics:notify_existing_metric({?APP, mapper_count}, {inc, 1}, counter);
   update(mapper_end) ->
  -    folsom_metrics:notify_existing_metric(riak_kv_mapper_count, {dec, 1}, counter);
  +    folsom_metrics:notify_existing_metric({?APP, mapper_count}, {dec, 1}, counter);
   update(precommit_fail) ->
  -    folsom_metrics:notify_existing_metric(riak_kv_precommit_fail, {inc, 1}, counter);
  +    folsom_metrics:notify_existing_metric({?APP, precommit_fail}, {inc, 1}, counter);
   update(postcommit_fail) ->
  -    folsom_metrics:notify_existing_metric(riak_kv_postcommit_fail, {inc, 1}, counter).
  +    folsom_metrics:notify_existing_metric({?APP, postcommit_fail}, {inc, 1}, counter).
   
   %% private
   %%  per bucket get_fsm stats
  
positive.code:     ok;
  do_put_bucket(true, {Bucket, Microsecs}=Args) ->
      BucketAtom = binary_to_atom(Bucket, latin1),
      case (catch folsom_metrics:notify_existing_metric(join(riak_kv_node_puts_total, BucketAtom), {inc, 1}, counter)) of
          ok ->
              folsom_metrics:notify_existing_metric(join(riak_kv_node_put_fsm_time, BucketAtom), Microsecs, histogram);
          {'EXIT', _} ->
              register_stat({join(riak_kv_node_puts_total, BucketAtom), counter}),
              register_stat({join(riak_kv_node_put_fsm_time, BucketAtom), histogram}),
              do_put_bucket(true, Args)
      end.
  
  
negative.code:     ok;
  do_get_bucket(true, {Bucket, Microsecs, NumSiblings, ObjSize}=Args) ->
      BucketAtom = binary_to_atom(Bucket, latin1),
      case (catch folsom_metrics:notify_existing_metric({?APP, join(node_gets_total, BucketAtom)}, {inc, 1}, counter)) of
          ok ->
              [folsom_metrics:notify_existing_metric({?APP, join(Stat, BucketAtom)}, Arg, histogram)
               || {Stat, Arg} <- [{node_get_fsm_time, Microsecs},
                                  {node_get_fsm_siblings, NumSiblings},
                                  {node_get_fsm_objsize, ObjSize}], Arg /= undefined];
          {'EXIT', _} ->
              folsom_metrics:new_counter({?APP, join(node_gets_total, BucketAtom)}),
              [register_stat({?APP, join(Stat, BucketAtom)}, histogram) || Stat <- [node_get_fsm_time,
                                                                                    node_get_fsm_siblings,
                                                                                    node_get_fsm_objsize]],
              do_get_bucket(true, Args)
      end.
  
  