<commit_before>global:
  <% if_p('prometheus.scrape_interval') do |scrape_interval| %>
  # How frequently to scrape targets by default.
  scrape_interval: <%= scrape_interval %>
  <% end %>

  <% if_p('prometheus.scrape_timeout') do |scrape_timeout| %>
  # How long until a scrape request times out.
  scrape_timeout: <%= scrape_timeout %>
  <% end %>

  <% if_p('prometheus.evaluation_interval') do |evaluation_interval| %>
  # How frequently to evaluate rules by default.
  evaluation_interval: <%= evaluation_interval %>
  <% end %>

  # Attach these labels to any time series or alerts when communicating with
  # external systems (federation, remote storage, Alertmanager).
  external_labels: <%= p('prometheus.external_labels', {}).to_json %>

# Rule files specifies a list of files from which rules are read.
rule_files: <%= p('prometheus.rule_files', []).push('/var/vcap/jobs/prometheus2/config/custom.rules.yml').to_json %>

# A list of scrape configurations.
scrape_configs: <%= p('prometheus.scrape_configs', []).to_json %>

# Alerting specifies settings related to the Alertmanager.
alerting:
  alert_relabel_configs: <%= p('prometheus.alert_relabel_configs', []).to_json %>
  <% if_link('alertmanager') do |alertmanager| %>
  alertmanagers:
    <% alertmanager.if_p('alertmanager.web.route_prefix') do |route_prefix| %>
    path_prefix: <%= route_prefix %>
    <% end %>
    - static_configs:
      - targets: <%= alertmanager.instances.map { |instance| "#{instance.address}:#{alertmanager.p('alertmanager.web.port')}" } %>
  <% end %>

# Settings related to the experimental remote read feature.
<% if_link('prometheus-remote-read') do |prometheus_remote_read| %>
remote_read:
  - url: http://<%= prometheus_remote_read.instances.first.address %>:<%= prometheus_remote_read.p('prometheus.web.port') %>/api/v1/read
<% end.else do %>
remote_read: <%= p('prometheus.remote_read', []).to_json %>
<% end %>

<% if_p('prometheus.remote_write') do |remote_write| %>
# Settings related to the experimental remote write feature.
remote_write: <%= remote_write.to_json %>
<% end %><commit_msg>Fix alertmanager route_prefix configuration in Prometheus config<commit_after>global:
  <% if_p('prometheus.scrape_interval') do |scrape_interval| %>
  # How frequently to scrape targets by default.
  scrape_interval: <%= scrape_interval %>
  <% end %>

  <% if_p('prometheus.scrape_timeout') do |scrape_timeout| %>
  # How long until a scrape request times out.
  scrape_timeout: <%= scrape_timeout %>
  <% end %>

  <% if_p('prometheus.evaluation_interval') do |evaluation_interval| %>
  # How frequently to evaluate rules by default.
  evaluation_interval: <%= evaluation_interval %>
  <% end %>

  # Attach these labels to any time series or alerts when communicating with
  # external systems (federation, remote storage, Alertmanager).
  external_labels: <%= p('prometheus.external_labels', {}).to_json %>

# Rule files specifies a list of files from which rules are read.
rule_files: <%= p('prometheus.rule_files', []).push('/var/vcap/jobs/prometheus2/config/custom.rules.yml').to_json %>

# A list of scrape configurations.
scrape_configs: <%= p('prometheus.scrape_configs', []).to_json %>

# Alerting specifies settings related to the Alertmanager.
alerting:
  alert_relabel_configs: <%= p('prometheus.alert_relabel_configs', []).to_json %>
  <% if_link('alertmanager') do |alertmanager| %>
  alertmanagers:
    - static_configs:
      - targets: <%= alertmanager.instances.map { |instance| "#{instance.address}:#{alertmanager.p('alertmanager.web.port')}" } %>
      <% alertmanager.if_p('alertmanager.web.route_prefix') do |route_prefix| %>
      path_prefix: <%= route_prefix %>
      <% end %>
  <% end %>

# Settings related to the experimental remote read feature.
<% if_link('prometheus-remote-read') do |prometheus_remote_read| %>
remote_read:
  - url: http://<%= prometheus_remote_read.instances.first.address %>:<%= prometheus_remote_read.p('prometheus.web.port') %>/api/v1/read
<% end.else do %>
remote_read: <%= p('prometheus.remote_read', []).to_json %>
<% end %>

<% if_p('prometheus.remote_write') do |remote_write| %>
# Settings related to the experimental remote write feature.
remote_write: <%= remote_write.to_json %>
<% end %>
{'fraction_non_alphanumeric': 0.15149376617266525, 'fraction_numerical': 0.0009409550693954364, 'mean_word_length': 5.048364153627311, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6953223', 'n_tokens_mistral': 1505, 'n_tokens_neox': 1302, 'n_words': 304}