Skip to content

Commit

Permalink
feat: add var that enables compactor retention (#62)
Browse files Browse the repository at this point in the history
* feat: add var that enables compactor retention

* docs(terraform-docs): generate docs and write to README.adoc

* refactor: use more lighter variable for retention

* docs(terraform-docs): generate docs and write to README.adoc

* feat: call retention var in submodules

* feat: set retention period in day

* docs(terraform-docs): generate docs and write to README.adoc

* feat: set retention enabled to yes

---------

Co-authored-by: omohammed95 <[email protected]>
  • Loading branch information
omohammed95 and omohammed95 authored Jun 9, 2023
1 parent 80167b7 commit 88617bd
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 5 deletions.
16 changes: 15 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ Type: `bool`

Default: `false`

==== [[input_retention]] <<input_retention,retention>>

Description: Logs retention period.To deactivate retention, pass 0s.

Type: `string`

Default: `"30d"`

=== Outputs

The following outputs are exported:
Expand Down Expand Up @@ -172,8 +180,8 @@ Description: n/a
|[[provider_null]] <<provider_null,null>> |>= 3
|[[provider_random]] <<provider_random,random>> |>= 3
|[[provider_htpasswd]] <<provider_htpasswd,htpasswd>> |>= 1
|[[provider_argocd]] <<provider_argocd,argocd>> |>= 4
|[[provider_utils]] <<provider_utils,utils>> |>= 1
|[[provider_argocd]] <<provider_argocd,argocd>> |>= 4
|===

= Resources
Expand Down Expand Up @@ -279,6 +287,12 @@ object({
|`false`
|no

|[[input_retention]] <<input_retention,retention>>
|Logs retention period.To deactivate retention, pass 0s.
|`string`
|`"30d"`
|no

|===

= Outputs
Expand Down
14 changes: 14 additions & 0 deletions aks/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ Type: `bool`

Default: `false`

==== [[input_retention]] <<input_retention,retention>>

Description: Logs retention period.To deactivate retention, pass 0s.

Type: `string`

Default: `"30d"`

=== Outputs

The following outputs are exported:
Expand Down Expand Up @@ -319,6 +327,12 @@ object({
|`false`
|no

|[[input_retention]] <<input_retention,retention>>
|Logs retention period.To deactivate retention, pass 0s.
|`string`
|`"30d"`
|no

|===

= Outputs
Expand Down
1 change: 1 addition & 0 deletions aks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ module "loki-stack" {
app_autosync = var.app_autosync
dependency_ids = var.dependency_ids

retention = var.retention
distributed_mode = var.distributed_mode
ingress = var.ingress
enable_filebeat = var.enable_filebeat
Expand Down
14 changes: 14 additions & 0 deletions eks/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ Type: `bool`

Default: `false`

==== [[input_retention]] <<input_retention,retention>>

Description: Logs retention period.To deactivate retention, pass 0s.

Type: `string`

Default: `"30d"`

=== Outputs

The following outputs are exported:
Expand Down Expand Up @@ -279,6 +287,12 @@ object({
|`false`
|no

|[[input_retention]] <<input_retention,retention>>
|Logs retention period.To deactivate retention, pass 0s.
|`string`
|`"30d"`
|no

|===

= Outputs
Expand Down
1 change: 1 addition & 0 deletions eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module "loki-stack" {
app_autosync = var.app_autosync
dependency_ids = var.dependency_ids

retention = var.retention
distributed_mode = var.distributed_mode
ingress = var.ingress
enable_filebeat = var.enable_filebeat
Expand Down
14 changes: 14 additions & 0 deletions kind/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ Type: `bool`

Default: `false`

==== [[input_retention]] <<input_retention,retention>>

Description: Logs retention period.To deactivate retention, pass 0s.

Type: `string`

Default: `"30d"`

=== Outputs

The following outputs are exported:
Expand Down Expand Up @@ -281,6 +289,12 @@ object({
|`false`
|no

|[[input_retention]] <<input_retention,retention>>
|Logs retention period.To deactivate retention, pass 0s.
|`string`
|`"30d"`
|no

|===

= Outputs
Expand Down
1 change: 1 addition & 0 deletions kind/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module "loki-stack" {
app_autosync = var.app_autosync
dependency_ids = var.dependency_ids

retention = var.retention
distributed_mode = var.distributed_mode
ingress = var.ingress
enable_filebeat = var.enable_filebeat
Expand Down
7 changes: 3 additions & 4 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ locals {
}
}
compactor = {
retention_delete_delay = "1h"
retention_enabled = false
retention_enabled = true
}
ingester = {
lifecycler = {
Expand All @@ -85,10 +84,10 @@ locals {
ingestion_rate_mb = 10
max_chunks_per_query = 0
max_entries_limit_per_query = 0
max_query_length = "9000h"
max_query_length = var.retention
max_query_parallelism = 6
per_stream_rate_limit = "10MB"
retention_period = "9000h"
retention_period = var.retention
}
querier = {
max_concurrent = 2
Expand Down
11 changes: 11 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,14 @@ variable "enable_filebeat" {
type = bool
default = false
}

variable "retention" {
description = "Logs retention period.To deactivate retention, pass 0s."
type = string
default = "30d"

validation {
condition = var.retention != null
error_message = "Variable must not be null."
}
}

0 comments on commit 88617bd

Please sign in to comment.