<p>Our global Prometheus scrape interval on k8s is <code>60s</code>, but I want one application has <code>300s</code> scrape interval.</p>
<p>I attach the following to my pod so the metrics are <strong>scraped</strong>.</p>
<pre><code>prometheus.io/scrape: 'true'
prometheus.io/port: '{{ .Values.prometheus.port }}'
prometheus.io/path: '{{ .Values.prometheus.path }}'
</code></pre>
<p>Now I want to slow down the frequency of this application specifically, and tested with</p>
<pre><code>prometheus.io/interval: '300s'
</code></pre>
<p>However it does not work. I think it requires <code>relabel</code>, or any other suggestion?
<a href="https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml#L251" rel="nofollow noreferrer">https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml#L251</a></p>

<p>I would like to add some details. If you use the official Prometheus Helm charts, this should be in your <code>values-prometheus.yaml</code> file:</p>
<pre><code># extra scraping configs
# | is required, because extraScrapeConfigs is expected to be a string
extraScrapeConfigs: |
  - job_name: 'kubernetes-service-endpoints-scrape-every-2s'

    scrape_interval: 2s

    kubernetes_sd_configs:
      - role: endpoints

    relabel_configs:
      #Custom
      - source_labels: [__meta_kubernetes_service_annotation_example_com_scrape_every_2s]
        action: keep
        regex: true

      # Boilerplate
      - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scheme]
        action: replace
        target_label: __scheme__
        regex: (https?)
      - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_path]
        action: replace
        target_label: __metrics_path__
        regex: (.+)
      - source_labels: [__address__, __meta_kubernetes_service_annotation_prometheus_io_port]
        action: replace
        target_label: __address__
        regex: ([^:]+)(?::\d+)?;(\d+)
        replacement: $1:$2
      - action: labelmap
        regex: __meta_kubernetes_service_label_(.+)
      - source_labels: [__meta_kubernetes_namespace]
        action: replace
        target_label: kubernetes_namespace
      - source_labels: [__meta_kubernetes_service_name]
        action: replace
        target_label: kubernetes_name
      - source_labels: [__meta_kubernetes_pod_node_name]
        action: replace
        target_label: kubernetes_node
</code></pre>
<p>To upgrade the existing(default) installation:</p>
<pre><code>helm upgrade prometheus --values values-prometheus.yaml stable/prometheus
</code></pre>
<p>On the service or the pod you can now add these annotations:</p>
<pre><code>prometheus.io/path: /metrics
prometheus.io/port: &quot;9090&quot;
example.com/scrape_every_2s: &quot;true&quot;
</code></pre>
<p>Remove the original <code>prometheus.io/scrape: &quot;true&quot;</code>, because otherwise your service will show up as two separate Prometheus targets, which is probably not what you want.</p>
