title: Can't enable query logs on prometheus
body: <p>I followed this document : <a href="https://prometheus.io/docs/guides/query-log/" rel="nofollow noreferrer">https://prometheus.io/docs/guides/query-log/</a> to enable query logs on our prometheus server, so I edited the configuration as follows:</p>
  <pre><code># my global config
  global:
    scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
    evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
    query_log_file: /app/prometheus/query.log
    # scrape_timeout is set to the global default (10s).
  
  # Alertmanager configuration
  alerting:
    alertmanagers:
    - static_configs:
      - targets:
         - localhost:9093
  
  # Load rules once and periodically evaluate them according to the global evaluation_interval.
  rule_files:
    - &quot;prometheus_rules.yml&quot;
  
  # A scrape configuration containing exactly one endpoint to scrape:
  # Here it's Prometheus itself.
  scrape_configs:
    # The job name is added as a label job=&lt;job_name&gt; to any timeseries scraped from this config.
    - job_name: 'prometheus'
      scrape_timeout: 30s
      scrape_interval: 60s
      # metrics_path defaults to '/metrics'
      # scheme defaults to 'http'.
  
      static_configs:
      - targets: ['localhost:9090']
    - job_name: 'node_prometheus'
      scrape_timeout: 30s
      scrape_interval: 60s
      # metrics_path defaults to '/metrics'
      # scheme defaults to 'http'.
  
      static_configs:
      - targets: ['localhost:9100']
    - job_name: 'grafana'
  
      # metrics_path defaults to '/metrics'
      # scheme defaults to 'http'.
  
      static_configs:
  # mettre ALB grafana
      - targets: ['${grafana_dns}']
  
    - job_name: 'sqs_exporter'
      scrape_interval: 5m
      scrape_timeout: 2m
      static_configs:
      - targets: ['localhost:9434']
  
    - job_name: 'cloudwatch_exporter'
      scrape_interval: 5m
      scrape_timeout: 2m
      static_configs:
      - targets: ['localhost:9106']
  
    - job_name: '_metrics'
      metric_relabel_configs:
      relabel_configs:
       - source_labels:
         - __meta_ec2_platform
         action: keep
         regex: .*windows.*
       - action: labelmap
         regex: __meta_ec2_tag_(.*)
         replacement: \$1
      ec2_sd_configs:
        - region: ${aws_region}
          port: 9543
          role_arn: arn:aws:iam::xxxxxxxxxxxx:role/prometheus_readonly
          filters:
            - name: tag:app
              values:
                - cloudapp
        - region: ${aws_region}
          port: 9543
          role_arn: arn:aws:iam::xxxxxxxxxxxxx:role/prometheus_readonly
          filters:
            - name: tag:longcode
              values:
                - gdp_
  
    - job_name: 'cadvisor'
      static_configs:
      - targets: ['localhost:8080']
  
    - job_name: 'elasticbeanstalk_exporter'
      static_configs:
      - targets: ['localhost:9552']
  </code></pre>
  <p>Once I finish editing the configuration file I reload the prometheus conf by this command:</p>
  <pre><code>sudo killall -HUP prometheus
  </code></pre>
  <p>Then :</p>
  <pre><code>sudo systemctl status prometheus -l
  </code></pre>
  <p>Here is the error I get:</p>
  <pre><code>Jul 23 14:39:23 ip-prometheus: level=error ts=2020-07-23T14:39:23.931Z caller=main.go:583 msg=&quot;Error reloading config&quot; err=&quot;couldn't load configuration (--config.file=\&quot;/usr/local/prometheus/prometheus/prometheus.yml\&quot;): parsing YAML file /usr/local/prometheus/prometheus/prometheus.yml: yaml: unmarshal errors:\n  line 5: field query_log_file not found in type config.plain&quot;
  </code></pre>
  <p>Could you please help?</p>