public_org/build/default~lokiPlugin~prometheusPlugin.aae40212254ed8359ce4.js
/**
 * Adds metadata for synthetic metrics for which the API does not provide metadata.
 * See https://github.com/grafana/grafana/issues/22337 for details.
 *
 * @param metadata HELP and TYPE metadata from /api/v1/metadata
 */
Adds metadata for synthetic metrics for which the API does not provide metadata.

@param metadata HELP and TYPE metadata from /api/v1/metadata
Adds metadata for synthetic metrics for which the API does not provide metadata . @param metadata HELP and TYPE metadata from / api / v1 / metadata
function fixSummariesMetadata(metadata) {
  if (!metadata) {
    return metadata;
  }
  var summaryMetadata = {};
  for (var metric in metadata) {
    var item = metadata[metric][0];
    if (item.type === 'summary') {
      summaryMetadata["".concat(metric, "_count")] = [{
        type: 'counter',
        help: "Count of events that have been observed for the base metric (".concat(item.help, ")")
      }];
      summaryMetadata["".concat(metric, "_sum")] = [{
        type: 'counter',
        help: "Total sum of all observed values for the base metric (".concat(item.help, ")")
      }];
    }
  }
  return _objectSpread({}, metadata, {}, summaryMetadata);
}
function fixSummariesMetadata ( metadata ) { if ( ! metadata ) { return metadata ; } var summaryMetadata = { } ; for ( var metric in metadata ) { var item = metadata [ metric ] [ 0 ] ; if ( item . type === 'summary' ) { summaryMetadata [ "" . concat ( metric , "_count" ) ] = [ { type : 'counter' , help : "Count of events that have been observed for the base metric (" . concat ( item . help , ")" ) } ] ; summaryMetadata [ "" . concat ( metric , "_sum" ) ] = [ { type : 'counter' , help : "Total sum of all observed values for the base metric (" . concat ( item . help , ")" ) } ] ; } } return _objectSpread ( { } , metadata , { } , summaryMetadata ) ; }
Adds metadata for synthetic metrics for which the API does not provide metadata.
Adds metadata for synthetic metrics for which the API does not provide metadata .