anchor.diff:  %% Get RRD database for given metric.
   %% @end
   %%--------------------------------------------------------------------
  --spec get_metric_internal(rest_auth:auth(), subject_type(), subject_id(),
  -    subject_type(), subject_id(), metric_type(), step(), oneprovider:id(),
  -    format()) -> {ok, binary()} | {error, term()}.
  -get_metric_internal(
  -    _Auth, SubjectType, SubjectId, undefined, _,
  -    MetricType, Step, ProviderId, Format
  -) ->
  +-spec get_metric_internal(od_space:id(), undefined | od_user:id(),
  +    metric_type(), step(), oneprovider:id()) -> {ok, binary()} | {error, term()}.
  +get_metric_internal(SpaceId, undefined, MetricType, Step, ProviderId) ->
       MonitoringId = #monitoring_id{
  -        main_subject_type = SubjectType,
  -        main_subject_id = SubjectId,
  +        main_subject_type = space,
  +        main_subject_id = SpaceId,
           metric_type = MetricType,
           provider_id = ProviderId
       },
  -    worker_proxy:call(monitoring_worker, {export, MonitoringId, Step, Format});
  -get_metric_internal(
  -    _Auth, SubjectType, SubjectId, SecondarySubjectType, SecondarySubjectId,
  -    MetricType, Step, ProviderId, Format
  -) ->
  +    worker_proxy:call(monitoring_worker, {export, MonitoringId, Step, json});
  +get_metric_internal(SpaceId, UserId, MetricType, Step, ProviderId) ->
       MonitoringId = #monitoring_id{
  -        main_subject_type = SubjectType,
  -        main_subject_id = SubjectId,
  +        main_subject_type = space,
  +        main_subject_id = SpaceId,
           metric_type = MetricType,
  -        secondary_subject_id = SecondarySubjectId,
  -        secondary_subject_type = SecondarySubjectType,
  +        secondary_subject_type = user,
  +        secondary_subject_id = UserId,
           provider_id = ProviderId
       },
  -    worker_proxy:call(monitoring_worker, {export, MonitoringId, Step, Format}).
  +    worker_proxy:call(monitoring_worker, {export, MonitoringId, Step, json}).
  
positive.code:                 end
              end, Providers),
              {ok, Json};
          {error, not_found} ->
              throw(?ERROR_NOT_FOUND)
      end.
  
  
  
negative.code: -export([create/1, get/2, update/1, delete/1]).
  -export([authorize/2, data_signature/1]).
  
  -type metric_type() ::
      storage_quota | storage_used |
      data_access | block_access |
      remote_transfer | connected_users.
  -type step() :: '5m' | '1h' | '1d' | '1m'.
  
  -define(DEFAULT_STEP, <<"5m">>).
  
  