Skip to content

Commit

Permalink
Merge pull request #8 from weakcamel/add_compactor_settings
Browse files Browse the repository at this point in the history
add compactor settings to loki config
  • Loading branch information
weakcamel authored Jul 21, 2023
2 parents 3c4360f + 93f79f9 commit 3c7081d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ loki_schema_config:
period: 168h
row_shards: 16

loki_compactor_config: {}

loki_limits_config:
enforce_metric_name: false
reject_old_samples: true
Expand Down
5 changes: 3 additions & 2 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
force: true
owner: root
group: "{{ loki_user }}"
mode: 0640
mode: "0640"
backup: true
notify:
- Reload loki
when: ('loki' in loki_bins)
Expand All @@ -18,7 +19,7 @@
force: true
owner: root
group: "{{ loki_user }}"
mode: 0640
mode: "0640"
notify:
- Reload promtail
when: ('promtail' in loki_bins)
10 changes: 5 additions & 5 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
state: directory
owner: loki
group: loki
mode: 0755
mode: "0755"
with_items:
- "{{ loki_storage_dir }}"
- "{{ loki_storage_dir }}/index"
Expand All @@ -33,7 +33,7 @@
state: directory
owner: root
group: "{{ loki_group }}"
mode: 0770
mode: "0770"
with_items:
- "{{ loki_config_dir }}"

Expand All @@ -49,7 +49,7 @@
url: "https://github.com/grafana/loki/releases/download/v{{ loki_version }}/{{ item }}-linux-{{ go_arch }}.zip"
dest: "/tmp/{{ item }}-{{ loki_version }}-linux-{{ go_arch }}.zip"
checksum: "sha256:{{ __loki_bins_checksum[item] }}"
mode: 0644
mode: "0644"
register: _download_archive
until: _download_archive is succeeded
retries: 5
Expand All @@ -71,7 +71,7 @@
ansible.builtin.copy:
src: "/tmp/{{ item }}-linux-{{ go_arch }}"
dest: "/usr/local/bin/{{ item }}"
mode: 0755
mode: "0755"
owner: root
group: root
remote_src: true
Expand All @@ -85,7 +85,7 @@
dest: "/etc/systemd/system/{{ item }}.service"
owner: root
group: root
mode: 0644
mode: "0644"
notify: "Restart {{ item }}"
loop: "{{ loki_bins }}"
when: item == 'loki' or item == 'promtail'
4 changes: 4 additions & 0 deletions templates/loki.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ frontend_worker_config:
table_manager:
{{ loki_table_manager_config | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif %}
{% if loki_compactor_config %}
compactor:
{{ loki_compactor_config | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif %}
{% if loki_runtime_config != [] %}
runtime_config:
{{ loki_runtime_config | to_nice_yaml(indent=2) | indent(2, False) }}
Expand Down

0 comments on commit 3c7081d

Please sign in to comment.