private void setQueryParams(String metricsParam, String hostname,
                                boolean isHostMetric, String componentName) {
      // Reuse uriBuilder
      uriBuilder.removeQuery();

      if (metricsParam.length() > 0) {
        uriBuilder.setParameter("metricNames", metricsParam);
        resolvedMetricsParams = Sets.newHashSet(metricsParam.split(","));
      }

      if (hostname != null && !hostname.isEmpty()) {
        uriBuilder.setParameter("hostname", hostname);
      }

      if (isHostMetric) {
        uriBuilder.setParameter("appId", "HOST");
      } else {
        if (componentName != null && !componentName.isEmpty()
            && !componentName.equalsIgnoreCase("HOST")) {
          componentName = getTimelineAppId(componentName);
        }
        uriBuilder.setParameter("appId", componentName);
      }

      if (clusterName != null && hostProvider.isCollectorHostExternal(clusterName)) {
        uriBuilder.setParameter("instanceId", clusterName);
      }

      if (temporalInfo != null) {
        long startTime = temporalInfo.getStartTime();
        if (startTime != -1) {
          uriBuilder.setParameter("startTime", String.valueOf(startTime));
        }

        long endTime = temporalInfo.getEndTime();
        if (endTime != -1) {
          uriBuilder.setParameter("endTime", String.valueOf(endTime));
        }
      }
    }
Populate the associated resources by making a call to the Metrics
service.

@return a collection of populated resources
@throws SystemException if unable to populate the resources
ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java