Exemplo n.º 1
0
    // Set initial value for metricId for early transition cases
    const config = {
      startStamp,
      endStamp,
      bucketSize,
      bucketUnit,
      baseEnd,
      baseStart,
      exploreDimensions,
      filters: filtersRaw ? makeFilterString(filtersRaw) : ''
    };

    // Load endpoints for projected metrics. TODO: consolidate into CP if duplicating this logic
    const anomalyDataUrl = getAnomalyDataUrl(startStamp, endStamp);
    const metricsUrl = selfServeApiCommon.metricAutoComplete(metricName);
    const anomaliesUrl = `/dashboard/anomaly-function/${alertId}/anomalies?${dateParams}&useNotified=true`;
    let anomalyPromiseHash = {
      projectedMttd: 0,
      metricsByName: [],
      anomalyIds: []
    };

    // If replay still pending, load placeholders for this data.
    if (isReplayDone) {
      anomalyPromiseHash = {
        projectedMttd: 0, // In overview mode, no projected MTTD value is needed
        metricsByName: fetch(metricsUrl).then(checkStatus),
        anomalyIds: fetch(anomaliesUrl).then(checkStatus)
      };
    }
Exemplo n.º 2
0
 searchMetricsList: task(function* (metric) {
   yield timeout(600);
   const url = selfServeApiCommon.metricAutoComplete(metric);
   return fetch(url).then(checkStatus);
 }),
Exemplo n.º 3
0
import { selfServeApiCommon } from 'thirdeye-frontend/utils/api/self-serve';

/**
 * Endpoints for entity mapping modal
 */
export const entityMappingApi = {
  createUrl: `/entityMapping/create`,
  deleteUrl: `/entityMapping/delete`,
  getRelatedEntitiesUrl: `/entityMapping/view/fromURN`,
  getDatasetsUrl: `/data/datasets`,
  getServicesUrl: `/external/services/all`,
  metricAutoCompleteUrl(str) {
    return selfServeApiCommon.metricAutoComplete(str);
  },
  getRelatedEntitiesDataUrl(urns) {
    return `/rootcause/raw?framework=identity&urns=${urns}`;
  }
};

export default entityMappingApi;
Exemplo n.º 4
0
    return metric
    && metric.subDimensionContributionMap['All'].currentValues
    && metric.subDimensionContributionMap['All'].currentValues.reduce((total, val) => {
      return total + val;
    }, 0);
  },

  /**
   * Fetches an alert function record by Id.
   * Use case: show me the names of all functions monitored by a given alert group.
   * @method fetchFunctionById
   * @param {Number} functionId - Id for the selected alert function
   * @return {Promise}
   */
  fetchFunctionById(functionId) {
    const url = selfServeApiCommon.alertById(functionId);
    return fetch(url).then(checkStatus);
  },

  /**
   * Fetches an alert function record by name.
   * Use case: when user names an alert, make sure no duplicate already exists.
   * @method fetchAnomalyByName
   * @param {String} functionName - name of alert or function
   * @return {Promise}
   */
  fetchAlertsByName(functionName) {
    const url = selfServeApiCommon.alertAutoComplete(functionName);
    return fetch(url).then(checkStatus);
  },