anchor.diff:  get(#op_req{client = Cl, data = Data, gri = #gri{id = SpaceId, aspect = space}}, _) ->
       Metric = binary_to_atom(maps:get(<<"metric">>, Data), utf8),
       Step = binary_to_atom(maps:get(<<"step">>, Data, ?DEFAULT_STEP), utf8),
  -    get_metric(
  -        Cl#client.id, SpaceId,
  -        space, SpaceId,
  -        undefined, undefined,
  -        Metric, Step
  -    );
  +    get_metric(Cl#client.id, SpaceId, undefined, Metric, Step);
   
   get(#op_req{client = Cl, data = Data, gri = #gri{id = SpaceId, aspect = {user, UserId}}}, _) ->
       Metric = binary_to_atom(maps:get(<<"metric">>, Data), utf8),
       Step = binary_to_atom(maps:get(<<"step">>, Data, ?DEFAULT_STEP), utf8),
  -    get_metric(
  -        Cl#client.id, SpaceId,
  -        space, SpaceId,
  -        user, UserId,
  -        Metric, Step
  -    );
  +    get_metric(Cl#client.id, SpaceId, UserId, Metric, Step);
   
   get(_, _) ->
       ?ERROR_NOT_SUPPORTED.
  
positive.code: %% 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
  ) ->
      MonitoringId = #monitoring_id{
          main_subject_type = SubjectType,
          main_subject_id = SubjectId,
          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
  ) ->
      MonitoringId = #monitoring_id{
          main_subject_type = SubjectType,
          main_subject_id = SubjectId,
          metric_type = MetricType,
          secondary_subject_id = SecondarySubjectId,
          secondary_subject_type = SecondarySubjectType,
          provider_id = ProviderId
      },
      worker_proxy:call(monitoring_worker, {export, MonitoringId, Step, Format}).
  
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">>).
  
  