<p>I want to set <code>scrape_interval</code> for the Prometheus to 15 seconds. My config below doesn't work, there is an error in the last line. I am wondering how should I config the 15 seconds <code>scrape_interval</code>?</p>
<pre><code>apiVersion: monitoring.coreos.com/v1
    kind: Prometheus
    metadata:
      name: main
    spec:
      serviceAccountName: prometheus
      replicas: 1
      version: v1.7.1
      serviceMonitorNamespaceSelector: {}
      serviceMonitorSelector:
        matchLabels:
          team: frontend
      ruleSelector:
        matchLabels:
          role: alert-rules
          prometheus: rules
      resources:
        requests:
          memory: 400Mi
    scrape_interval: 15s  ##Error in this line.
</code></pre>
<p>I got this error message when compiling the config above:</p>
<p><code>error: error validating &quot;promethus.yml&quot;: error validating data: ValidationError(Prometheus): unknown field &quot;scrape_interval&quot; in com.coreos.monitoring.v1.Prometheus; if you choose to ignore these errors, turn validation off with --validate=false</code></p>
<p>Thanks!</p>

<p><code>scrape_interval</code> is probably a parameter name in the prometheus config and not for the <code>Prometheus</code> object in k8s (which is read by prometheus-operator and used to generate actual config).</p>
<p>You can see in the <a href="https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#prometheusspec" rel="nofollow noreferrer">prometheus operator documentation</a> that the parameter you are looking for is <code>scrapeInterval</code>. Ensure correct indentation, this is supposed to be part of <code>spec:</code>.</p>
<p>Note that you do not have to change scrape interval globally. You can have per scrape target intervals defined in your ServiceMonitor objects.</p>
