<p dir="auto">In OnheapIncrementalIndex::addToFacts(...), when we get a new fact, we will first add the mapping from key to fact's index, then we do aggregate. It will cause query saw some unaggregated metrics with initial value, and sometimes may cause some weird situations. Like if we use LongMax for build but use LongSum for query, then the result may add LongMax's initial value which is LONG.MIN_VALUE.</p>
<p dir="auto">BTW, do we need to deal with this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="      final Integer prev = facts.putIfAbsent(key, rowIndex);
      if (null == prev) {
        numEntries.incrementAndGet();
      } else {
        // We lost a race
        aggs = concurrentGet(prev);
        // Free up the misfire
        concurrentRemove(rowIndex);
        // This is expected to occur ~80% of the time in the worst scenarios
      }"><pre class="notranslate"><code class="notranslate">      final Integer prev = facts.putIfAbsent(key, rowIndex);
      if (null == prev) {
        numEntries.incrementAndGet();
      } else {
        // We lost a race
        aggs = concurrentGet(prev);
        // Free up the misfire
        concurrentRemove(rowIndex);
        // This is expected to occur ~80% of the time in the worst scenarios
      }
</code></pre></div>
<p dir="auto">I don't find any multi-thread adds for IncremetalIndex.</p>
<h3 dir="auto">Affected Version</h3>
<p dir="auto">0.15.1 RC2</p>
<h3 dir="auto">Description</h3>
<p dir="auto">CSV of Results:<br>
<a href="https://github.com/apache/incubator-druid/files/3484553/query-943282d6-3b66-4881-8080-355b09600870.zip">query-943282d6-3b66-4881-8080-355b09600870.zip</a></p>
<p dir="auto">Note that there are 2 rows for timestamp <code class="notranslate">2019-08-09T02:38:00.000Z</code>, even though the dimensions have the exact same value. In fact, for some reason, the rows are fully duplicated for that time period.</p>
<p dir="auto">This reflects in charts as values are doubled and it happens pretty often. We noticed it when we saw random spikes in charts when using the aggregated data source. These spikes happen whenever druid duplicates the rows</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3190176/62751456-95664600-ba18-11e9-9588-dab0e23fcd6a.png"><img src="https://user-images.githubusercontent.com/3190176/62751456-95664600-ba18-11e9-9588-dab0e23fcd6a.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">SQL</p>
<div class="highlight highlight-source-sql notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="SELECT *
 FROM &quot;kube-metrics-minute&quot; 
 WHERE accountid='52c7e28eebb26a86fb1505b5' AND  
 &quot;__time&quot; &gt;= TIMESTAMP '2019-08-09 02:37:00' AND &quot;__time&quot; &lt; TIMESTAMP '2019-08-09 02:40:00'  
 AND cluster='ds' AND etype='container' AND namespace='default' AND name='app-alertproc' AND pod='alertproc-deployment-65f59b6b8-gc57m' "><pre class="notranslate"><span class="pl-k">SELECT</span> <span class="pl-k">*</span>
 <span class="pl-k">FROM</span> <span class="pl-s"><span class="pl-pds">"</span>kube-metrics-minute<span class="pl-pds">"</span></span> 
 <span class="pl-k">WHERE</span> accountid<span class="pl-k">=</span><span class="pl-s"><span class="pl-pds">'</span>52c7e28eebb26a86fb1505b5<span class="pl-pds">'</span></span> <span class="pl-k">AND</span>  
 <span class="pl-s"><span class="pl-pds">"</span>__time<span class="pl-pds">"</span></span> <span class="pl-k">&gt;=</span> <span class="pl-k">TIMESTAMP</span> <span class="pl-s"><span class="pl-pds">'</span>2019-08-09 02:37:00<span class="pl-pds">'</span></span> <span class="pl-k">AND</span> <span class="pl-s"><span class="pl-pds">"</span>__time<span class="pl-pds">"</span></span> <span class="pl-k">&lt;</span> <span class="pl-k">TIMESTAMP</span> <span class="pl-s"><span class="pl-pds">'</span>2019-08-09 02:40:00<span class="pl-pds">'</span></span>  
 <span class="pl-k">AND</span> cluster<span class="pl-k">=</span><span class="pl-s"><span class="pl-pds">'</span>ds<span class="pl-pds">'</span></span> <span class="pl-k">AND</span> etype<span class="pl-k">=</span><span class="pl-s"><span class="pl-pds">'</span>container<span class="pl-pds">'</span></span> <span class="pl-k">AND</span> namespace<span class="pl-k">=</span><span class="pl-s"><span class="pl-pds">'</span>default<span class="pl-pds">'</span></span> <span class="pl-k">AND</span> name<span class="pl-k">=</span><span class="pl-s"><span class="pl-pds">'</span>app-alertproc<span class="pl-pds">'</span></span> <span class="pl-k">AND</span> pod<span class="pl-k">=</span><span class="pl-s"><span class="pl-pds">'</span>alertproc-deployment-65f59b6b8-gc57m<span class="pl-pds">'</span></span> </pre></div>
<p dir="auto">Generated query (shown in router web console)</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;queryType&quot;: &quot;scan&quot;,
  &quot;dataSource&quot;: {
    &quot;type&quot;: &quot;table&quot;,
    &quot;name&quot;: &quot;kube-metrics-minute&quot;
  },
  &quot;intervals&quot;: {
    &quot;type&quot;: &quot;intervals&quot;,
    &quot;intervals&quot;: [
      &quot;2019-08-09T02:37:00.000Z/2019-08-09T02:40:00.000Z&quot;
    ]
  },
  &quot;virtualColumns&quot;: [],
  &quot;resultFormat&quot;: &quot;compactedList&quot;,
  &quot;batchSize&quot;: 20480,
  &quot;limit&quot;: 9223372036854776000,
  &quot;order&quot;: &quot;none&quot;,
  &quot;filter&quot;: {
    &quot;type&quot;: &quot;and&quot;,
    &quot;fields&quot;: [
      {
        &quot;type&quot;: &quot;selector&quot;,
        &quot;dimension&quot;: &quot;accountid&quot;,
        &quot;value&quot;: &quot;52c7e28eebb26a86fb1505b5&quot;,
        &quot;extractionFn&quot;: null
      },
      {
        &quot;type&quot;: &quot;selector&quot;,
        &quot;dimension&quot;: &quot;cluster&quot;,
        &quot;value&quot;: &quot;ds&quot;,
        &quot;extractionFn&quot;: null
      },
      {
        &quot;type&quot;: &quot;selector&quot;,
        &quot;dimension&quot;: &quot;etype&quot;,
        &quot;value&quot;: &quot;container&quot;,
        &quot;extractionFn&quot;: null
      },
      {
        &quot;type&quot;: &quot;selector&quot;,
        &quot;dimension&quot;: &quot;namespace&quot;,
        &quot;value&quot;: &quot;default&quot;,
        &quot;extractionFn&quot;: null
      },
      {
        &quot;type&quot;: &quot;selector&quot;,
        &quot;dimension&quot;: &quot;name&quot;,
        &quot;value&quot;: &quot;app-alertproc&quot;,
        &quot;extractionFn&quot;: null
      },
      {
        &quot;type&quot;: &quot;selector&quot;,
        &quot;dimension&quot;: &quot;pod&quot;,
        &quot;value&quot;: &quot;alertproc-deployment-65f59b6b8-gc57m&quot;,
        &quot;extractionFn&quot;: null
      }
    ]
  },
  &quot;columns&quot;: [
    &quot;__time&quot;,
    &quot;accountid&quot;,
    &quot;alloc_cpu&quot;,
    &quot;alloc_mem&quot;,
    &quot;alloc_pods&quot;,
    &quot;cap_cpu&quot;,
    &quot;cap_mem&quot;,
    &quot;cap_pods&quot;,
    &quot;cluster&quot;,
    &quot;count&quot;,
    &quot;cpu&quot;,
    &quot;etype&quot;,
    &quot;image&quot;,
    &quot;labels&quot;,
    &quot;lim_cpu&quot;,
    &quot;lim_mem&quot;,
    &quot;mem_limit&quot;,
    &quot;mem_used&quot;,
    &quot;name&quot;,
    &quot;namespace&quot;,
    &quot;node&quot;,
    &quot;node_pool&quot;,
    &quot;owner&quot;,
    &quot;owner_kind&quot;,
    &quot;pod&quot;,
    &quot;req_cpu&quot;,
    &quot;req_mem&quot;,
    &quot;rxBytes&quot;,
    &quot;txBytes&quot;
  ],
  &quot;legacy&quot;: false,
  &quot;context&quot;: {
    &quot;sqlQueryId&quot;: &quot;f39f0b78-bb97-4c81-b9dd-7e0e2abf0b46&quot;
  },
  &quot;descending&quot;: false,
  &quot;granularity&quot;: {
    &quot;type&quot;: &quot;all&quot;
  }
}"><pre class="notranslate"><span class="pl-kos">{</span>
  <span class="pl-s">"queryType"</span>: <span class="pl-s">"scan"</span><span class="pl-kos">,</span>
  <span class="pl-s">"dataSource"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"type"</span>: <span class="pl-s">"table"</span><span class="pl-kos">,</span>
    <span class="pl-s">"name"</span>: <span class="pl-s">"kube-metrics-minute"</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-s">"intervals"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"type"</span>: <span class="pl-s">"intervals"</span><span class="pl-kos">,</span>
    <span class="pl-s">"intervals"</span>: <span class="pl-kos">[</span>
      <span class="pl-s">"2019-08-09T02:37:00.000Z/2019-08-09T02:40:00.000Z"</span>
    <span class="pl-kos">]</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-s">"virtualColumns"</span>: <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
  <span class="pl-s">"resultFormat"</span>: <span class="pl-s">"compactedList"</span><span class="pl-kos">,</span>
  <span class="pl-s">"batchSize"</span>: <span class="pl-c1">20480</span><span class="pl-kos">,</span>
  <span class="pl-s">"limit"</span>: <span class="pl-c1">9223372036854776000</span><span class="pl-kos">,</span>
  <span class="pl-s">"order"</span>: <span class="pl-s">"none"</span><span class="pl-kos">,</span>
  <span class="pl-s">"filter"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"type"</span>: <span class="pl-s">"and"</span><span class="pl-kos">,</span>
    <span class="pl-s">"fields"</span>: <span class="pl-kos">[</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"selector"</span><span class="pl-kos">,</span>
        <span class="pl-s">"dimension"</span>: <span class="pl-s">"accountid"</span><span class="pl-kos">,</span>
        <span class="pl-s">"value"</span>: <span class="pl-s">"52c7e28eebb26a86fb1505b5"</span><span class="pl-kos">,</span>
        <span class="pl-s">"extractionFn"</span>: <span class="pl-c1">null</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"selector"</span><span class="pl-kos">,</span>
        <span class="pl-s">"dimension"</span>: <span class="pl-s">"cluster"</span><span class="pl-kos">,</span>
        <span class="pl-s">"value"</span>: <span class="pl-s">"ds"</span><span class="pl-kos">,</span>
        <span class="pl-s">"extractionFn"</span>: <span class="pl-c1">null</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"selector"</span><span class="pl-kos">,</span>
        <span class="pl-s">"dimension"</span>: <span class="pl-s">"etype"</span><span class="pl-kos">,</span>
        <span class="pl-s">"value"</span>: <span class="pl-s">"container"</span><span class="pl-kos">,</span>
        <span class="pl-s">"extractionFn"</span>: <span class="pl-c1">null</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"selector"</span><span class="pl-kos">,</span>
        <span class="pl-s">"dimension"</span>: <span class="pl-s">"namespace"</span><span class="pl-kos">,</span>
        <span class="pl-s">"value"</span>: <span class="pl-s">"default"</span><span class="pl-kos">,</span>
        <span class="pl-s">"extractionFn"</span>: <span class="pl-c1">null</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"selector"</span><span class="pl-kos">,</span>
        <span class="pl-s">"dimension"</span>: <span class="pl-s">"name"</span><span class="pl-kos">,</span>
        <span class="pl-s">"value"</span>: <span class="pl-s">"app-alertproc"</span><span class="pl-kos">,</span>
        <span class="pl-s">"extractionFn"</span>: <span class="pl-c1">null</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"selector"</span><span class="pl-kos">,</span>
        <span class="pl-s">"dimension"</span>: <span class="pl-s">"pod"</span><span class="pl-kos">,</span>
        <span class="pl-s">"value"</span>: <span class="pl-s">"alertproc-deployment-65f59b6b8-gc57m"</span><span class="pl-kos">,</span>
        <span class="pl-s">"extractionFn"</span>: <span class="pl-c1">null</span>
      <span class="pl-kos">}</span>
    <span class="pl-kos">]</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-s">"columns"</span>: <span class="pl-kos">[</span>
    <span class="pl-s">"__time"</span><span class="pl-kos">,</span>
    <span class="pl-s">"accountid"</span><span class="pl-kos">,</span>
    <span class="pl-s">"alloc_cpu"</span><span class="pl-kos">,</span>
    <span class="pl-s">"alloc_mem"</span><span class="pl-kos">,</span>
    <span class="pl-s">"alloc_pods"</span><span class="pl-kos">,</span>
    <span class="pl-s">"cap_cpu"</span><span class="pl-kos">,</span>
    <span class="pl-s">"cap_mem"</span><span class="pl-kos">,</span>
    <span class="pl-s">"cap_pods"</span><span class="pl-kos">,</span>
    <span class="pl-s">"cluster"</span><span class="pl-kos">,</span>
    <span class="pl-s">"count"</span><span class="pl-kos">,</span>
    <span class="pl-s">"cpu"</span><span class="pl-kos">,</span>
    <span class="pl-s">"etype"</span><span class="pl-kos">,</span>
    <span class="pl-s">"image"</span><span class="pl-kos">,</span>
    <span class="pl-s">"labels"</span><span class="pl-kos">,</span>
    <span class="pl-s">"lim_cpu"</span><span class="pl-kos">,</span>
    <span class="pl-s">"lim_mem"</span><span class="pl-kos">,</span>
    <span class="pl-s">"mem_limit"</span><span class="pl-kos">,</span>
    <span class="pl-s">"mem_used"</span><span class="pl-kos">,</span>
    <span class="pl-s">"name"</span><span class="pl-kos">,</span>
    <span class="pl-s">"namespace"</span><span class="pl-kos">,</span>
    <span class="pl-s">"node"</span><span class="pl-kos">,</span>
    <span class="pl-s">"node_pool"</span><span class="pl-kos">,</span>
    <span class="pl-s">"owner"</span><span class="pl-kos">,</span>
    <span class="pl-s">"owner_kind"</span><span class="pl-kos">,</span>
    <span class="pl-s">"pod"</span><span class="pl-kos">,</span>
    <span class="pl-s">"req_cpu"</span><span class="pl-kos">,</span>
    <span class="pl-s">"req_mem"</span><span class="pl-kos">,</span>
    <span class="pl-s">"rxBytes"</span><span class="pl-kos">,</span>
    <span class="pl-s">"txBytes"</span>
  <span class="pl-kos">]</span><span class="pl-kos">,</span>
  <span class="pl-s">"legacy"</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
  <span class="pl-s">"context"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"sqlQueryId"</span>: <span class="pl-s">"f39f0b78-bb97-4c81-b9dd-7e0e2abf0b46"</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-s">"descending"</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
  <span class="pl-s">"granularity"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"type"</span>: <span class="pl-s">"all"</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Supervisor task spec:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;type&quot;: &quot;kafka&quot;,
  &quot;dataSchema&quot;: {
    &quot;dataSource&quot;: &quot;kube-metrics-minute&quot;,
    &quot;parser&quot;: {
      &quot;type&quot;: &quot;string&quot;,
      &quot;parseSpec&quot;: {
        &quot;format&quot;: &quot;json&quot;,
        &quot;timestampSpec&quot;: {
          &quot;column&quot;: &quot;timestamp&quot;,
          &quot;format&quot;: &quot;auto&quot;
        },
        &quot;dimensionsSpec&quot;: {
          &quot;dimensions&quot;: [
            &quot;accountid&quot;,
            &quot;cluster&quot;,
            &quot;name&quot;,
            &quot;namespace&quot;,
            &quot;etype&quot;,
            &quot;labels&quot;,
            &quot;owner&quot;,
            &quot;owner_kind&quot;,
            &quot;node&quot;,
            &quot;image&quot;,
            &quot;pod&quot;,
            &quot;node_pool&quot;
          ]
        }
      }
    },
    &quot;metricsSpec&quot;: [
      {
        &quot;name&quot;: &quot;count&quot;,
        &quot;type&quot;: &quot;count&quot;
      },
      {
        &quot;name&quot;: &quot;req_cpu&quot;,
        &quot;fieldName&quot;: &quot;req_cpu&quot;,
        &quot;type&quot;: &quot;floatMax&quot;
      },
      {
        &quot;name&quot;: &quot;req_mem&quot;,
        &quot;fieldName&quot;: &quot;req_mem&quot;,
        &quot;type&quot;: &quot;longMax&quot;
      },
      {
        &quot;name&quot;: &quot;lim_cpu&quot;,
        &quot;fieldName&quot;: &quot;lim_cpu&quot;,
        &quot;type&quot;: &quot;floatMax&quot;
      },
      {
        &quot;name&quot;: &quot;lim_mem&quot;,
        &quot;fieldName&quot;: &quot;lim_mem&quot;,
        &quot;type&quot;: &quot;longMax&quot;
      },
      {
        &quot;name&quot;: &quot;cap_cpu&quot;,
        &quot;fieldName&quot;: &quot;cap_cpu&quot;,
        &quot;type&quot;: &quot;floatMax&quot;
      },
      {
        &quot;name&quot;: &quot;cap_mem&quot;,
        &quot;fieldName&quot;: &quot;cap_mem&quot;,
        &quot;type&quot;: &quot;longMax&quot;
      },
      {
        &quot;name&quot;: &quot;cap_pods&quot;,
        &quot;fieldName&quot;: &quot;cap_pods&quot;,
        &quot;type&quot;: &quot;floatMax&quot;
      },
      {
        &quot;name&quot;: &quot;alloc_cpu&quot;,
        &quot;fieldName&quot;: &quot;alloc_cpu&quot;,
        &quot;type&quot;: &quot;floatMax&quot;
      },
      {
        &quot;name&quot;: &quot;alloc_mem&quot;,
        &quot;fieldName&quot;: &quot;alloc_mem&quot;,
        &quot;type&quot;: &quot;longMax&quot;
      },
      {
        &quot;name&quot;: &quot;alloc_pods&quot;,
        &quot;fieldName&quot;: &quot;alloc_pods&quot;,
        &quot;type&quot;: &quot;floatMax&quot;
      },
      {
        &quot;name&quot;: &quot;cpu&quot;,
        &quot;fieldName&quot;: &quot;cpu&quot;,
        &quot;type&quot;: &quot;doubleMax&quot;
      },
      {
        &quot;name&quot;: &quot;rxBytes&quot;,
        &quot;fieldName&quot;: &quot;rxBytes&quot;,
        &quot;type&quot;: &quot;longMax&quot;
      },
      {
        &quot;name&quot;: &quot;txBytes&quot;,
        &quot;fieldName&quot;: &quot;txBytes&quot;,
        &quot;type&quot;: &quot;longMax&quot;
      },
      {
        &quot;name&quot;: &quot;mem_used&quot;,
        &quot;fieldName&quot;: &quot;mem_used&quot;,
        &quot;type&quot;: &quot;longMax&quot;
      },
      {
        &quot;name&quot;: &quot;mem_limit&quot;,
        &quot;fieldName&quot;: &quot;mem_limit&quot;,
        &quot;type&quot;: &quot;longMax&quot;
      }
    ],
    &quot;granularitySpec&quot;: {
      &quot;type&quot;: &quot;uniform&quot;,
      &quot;segmentGranularity&quot;: {&quot;type&quot;: &quot;period&quot;, &quot;period&quot;: &quot;PT4H&quot;},
      &quot;queryGranularity&quot;: &quot;MINUTE&quot;
    }
  },
  &quot;tuningConfig&quot;: {
    &quot;type&quot;: &quot;kafka&quot;,
    &quot;maxRowsPerSegment&quot;: 5000000
  },
  &quot;ioConfig&quot;: {
    &quot;topic&quot;: &quot;kube-metrics&quot;,
    &quot;consumerProperties&quot;: {
      &quot;bootstrap.servers&quot;: &quot;xx&quot;
    },
    &quot;taskCount&quot;: 1,
    &quot;replicas&quot;: 2,
    &quot;taskDuration&quot;: &quot;PT4H&quot;
  }
}
"><pre class="notranslate"><span class="pl-kos">{</span>
  <span class="pl-s">"type"</span>: <span class="pl-s">"kafka"</span><span class="pl-kos">,</span>
  <span class="pl-s">"dataSchema"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"dataSource"</span>: <span class="pl-s">"kube-metrics-minute"</span><span class="pl-kos">,</span>
    <span class="pl-s">"parser"</span>: <span class="pl-kos">{</span>
      <span class="pl-s">"type"</span>: <span class="pl-s">"string"</span><span class="pl-kos">,</span>
      <span class="pl-s">"parseSpec"</span>: <span class="pl-kos">{</span>
        <span class="pl-s">"format"</span>: <span class="pl-s">"json"</span><span class="pl-kos">,</span>
        <span class="pl-s">"timestampSpec"</span>: <span class="pl-kos">{</span>
          <span class="pl-s">"column"</span>: <span class="pl-s">"timestamp"</span><span class="pl-kos">,</span>
          <span class="pl-s">"format"</span>: <span class="pl-s">"auto"</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span>
        <span class="pl-s">"dimensionsSpec"</span>: <span class="pl-kos">{</span>
          <span class="pl-s">"dimensions"</span>: <span class="pl-kos">[</span>
            <span class="pl-s">"accountid"</span><span class="pl-kos">,</span>
            <span class="pl-s">"cluster"</span><span class="pl-kos">,</span>
            <span class="pl-s">"name"</span><span class="pl-kos">,</span>
            <span class="pl-s">"namespace"</span><span class="pl-kos">,</span>
            <span class="pl-s">"etype"</span><span class="pl-kos">,</span>
            <span class="pl-s">"labels"</span><span class="pl-kos">,</span>
            <span class="pl-s">"owner"</span><span class="pl-kos">,</span>
            <span class="pl-s">"owner_kind"</span><span class="pl-kos">,</span>
            <span class="pl-s">"node"</span><span class="pl-kos">,</span>
            <span class="pl-s">"image"</span><span class="pl-kos">,</span>
            <span class="pl-s">"pod"</span><span class="pl-kos">,</span>
            <span class="pl-s">"node_pool"</span>
          <span class="pl-kos">]</span>
        <span class="pl-kos">}</span>
      <span class="pl-kos">}</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-s">"metricsSpec"</span>: <span class="pl-kos">[</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"name"</span>: <span class="pl-s">"count"</span><span class="pl-kos">,</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"count"</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"name"</span>: <span class="pl-s">"req_cpu"</span><span class="pl-kos">,</span>
        <span class="pl-s">"fieldName"</span>: <span class="pl-s">"req_cpu"</span><span class="pl-kos">,</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"floatMax"</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"name"</span>: <span class="pl-s">"req_mem"</span><span class="pl-kos">,</span>
        <span class="pl-s">"fieldName"</span>: <span class="pl-s">"req_mem"</span><span class="pl-kos">,</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"longMax"</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"name"</span>: <span class="pl-s">"lim_cpu"</span><span class="pl-kos">,</span>
        <span class="pl-s">"fieldName"</span>: <span class="pl-s">"lim_cpu"</span><span class="pl-kos">,</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"floatMax"</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"name"</span>: <span class="pl-s">"lim_mem"</span><span class="pl-kos">,</span>
        <span class="pl-s">"fieldName"</span>: <span class="pl-s">"lim_mem"</span><span class="pl-kos">,</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"longMax"</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"name"</span>: <span class="pl-s">"cap_cpu"</span><span class="pl-kos">,</span>
        <span class="pl-s">"fieldName"</span>: <span class="pl-s">"cap_cpu"</span><span class="pl-kos">,</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"floatMax"</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"name"</span>: <span class="pl-s">"cap_mem"</span><span class="pl-kos">,</span>
        <span class="pl-s">"fieldName"</span>: <span class="pl-s">"cap_mem"</span><span class="pl-kos">,</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"longMax"</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"name"</span>: <span class="pl-s">"cap_pods"</span><span class="pl-kos">,</span>
        <span class="pl-s">"fieldName"</span>: <span class="pl-s">"cap_pods"</span><span class="pl-kos">,</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"floatMax"</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"name"</span>: <span class="pl-s">"alloc_cpu"</span><span class="pl-kos">,</span>
        <span class="pl-s">"fieldName"</span>: <span class="pl-s">"alloc_cpu"</span><span class="pl-kos">,</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"floatMax"</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"name"</span>: <span class="pl-s">"alloc_mem"</span><span class="pl-kos">,</span>
        <span class="pl-s">"fieldName"</span>: <span class="pl-s">"alloc_mem"</span><span class="pl-kos">,</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"longMax"</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"name"</span>: <span class="pl-s">"alloc_pods"</span><span class="pl-kos">,</span>
        <span class="pl-s">"fieldName"</span>: <span class="pl-s">"alloc_pods"</span><span class="pl-kos">,</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"floatMax"</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"name"</span>: <span class="pl-s">"cpu"</span><span class="pl-kos">,</span>
        <span class="pl-s">"fieldName"</span>: <span class="pl-s">"cpu"</span><span class="pl-kos">,</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"doubleMax"</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"name"</span>: <span class="pl-s">"rxBytes"</span><span class="pl-kos">,</span>
        <span class="pl-s">"fieldName"</span>: <span class="pl-s">"rxBytes"</span><span class="pl-kos">,</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"longMax"</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"name"</span>: <span class="pl-s">"txBytes"</span><span class="pl-kos">,</span>
        <span class="pl-s">"fieldName"</span>: <span class="pl-s">"txBytes"</span><span class="pl-kos">,</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"longMax"</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"name"</span>: <span class="pl-s">"mem_used"</span><span class="pl-kos">,</span>
        <span class="pl-s">"fieldName"</span>: <span class="pl-s">"mem_used"</span><span class="pl-kos">,</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"longMax"</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-s">"name"</span>: <span class="pl-s">"mem_limit"</span><span class="pl-kos">,</span>
        <span class="pl-s">"fieldName"</span>: <span class="pl-s">"mem_limit"</span><span class="pl-kos">,</span>
        <span class="pl-s">"type"</span>: <span class="pl-s">"longMax"</span>
      <span class="pl-kos">}</span>
    <span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-s">"granularitySpec"</span>: <span class="pl-kos">{</span>
      <span class="pl-s">"type"</span>: <span class="pl-s">"uniform"</span><span class="pl-kos">,</span>
      <span class="pl-s">"segmentGranularity"</span>: <span class="pl-kos">{</span><span class="pl-s">"type"</span>: <span class="pl-s">"period"</span><span class="pl-kos">,</span> <span class="pl-s">"period"</span>: <span class="pl-s">"PT4H"</span><span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-s">"queryGranularity"</span>: <span class="pl-s">"MINUTE"</span>
    <span class="pl-kos">}</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-s">"tuningConfig"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"type"</span>: <span class="pl-s">"kafka"</span><span class="pl-kos">,</span>
    <span class="pl-s">"maxRowsPerSegment"</span>: <span class="pl-c1">5000000</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-s">"ioConfig"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"topic"</span>: <span class="pl-s">"kube-metrics"</span><span class="pl-kos">,</span>
    <span class="pl-s">"consumerProperties"</span>: <span class="pl-kos">{</span>
      <span class="pl-s">"bootstrap.servers"</span>: <span class="pl-s">"xx"</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-s">"taskCount"</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span>
    <span class="pl-s">"replicas"</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span>
    <span class="pl-s">"taskDuration"</span>: <span class="pl-s">"PT4H"</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>