Skip to content

Commit

Permalink
Revert "feat: configurable retention (#5)"
Browse files Browse the repository at this point in the history
This reverts commit d6da3f7.
  • Loading branch information
Tbaile authored Apr 3, 2024
1 parent d6da3f7 commit cd2b723
Show file tree
Hide file tree
Showing 12 changed files with 1 addition and 240 deletions.
41 changes: 0 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,47 +50,6 @@ root@leader:~# logcli query -q --no-labels -t '{nodename="leader"} | json | lin

`logcli` will use the default Loki instance of the cluster, this can be changed using the environment variable [`LOKI_ADDR`](https://grafana.com/docs/loki/latest/getting-started/logcli/#example)

## APIs

The module provides some APIs to interact with the Loki instance:

- `configure-module`
- `get-configuration`

### `configure-module`

Configure the Loki instance.

#### Parameters

- `retention_days`: The number of days to keep the logs.

#### Example

```bash
api-cli run module/loki1/configure-module '{"retention_days": 7}'
```

### `get-configuration`

Get the Loki instance configuration.

#### Example

```bash
api-cli run module/loki1/get-configuration
```

```json
{
"retention_days": 7,
"active_from": "2021-05-28T15:49:27Z+00:00",
"active_to": "2021-05-28T15:49:27Z+00:00"
}
```

Note: `active_to` field WILL miss if the instance is still active.

## Uninstall

To uninstall the instance:
Expand Down
15 changes: 0 additions & 15 deletions imageroot/actions/configure-module/10set

This file was deleted.

8 changes: 0 additions & 8 deletions imageroot/actions/configure-module/20restart

This file was deleted.

17 changes: 0 additions & 17 deletions imageroot/actions/configure-module/validate-input.json

This file was deleted.

3 changes: 0 additions & 3 deletions imageroot/actions/create-module/10env
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import agent
import os
import datetime

def genuuid():
uuid = os.popen("uuidgen")
Expand All @@ -25,5 +24,3 @@ agent.set_env('LOKI_API_AUTH_USERNAME', 'loki')
agent.set_env('LOKI_API_AUTH_PASSWORD', genuuid())
agent.set_env('LOKI_LOGS_INGRESS_TOKEN', genuuid())
agent.set_env('LOKI_HTTP_PORT', port)
agent.set_env('LOKI_RETENTION_PERIOD', '365')
agent.set_env('LOKI_ACTIVE_FROM', datetime.datetime.now().astimezone().isoformat())
20 changes: 0 additions & 20 deletions imageroot/actions/get-configuration/10get

This file was deleted.

28 changes: 0 additions & 28 deletions imageroot/actions/get-configuration/validate-output.json

This file was deleted.

1 change: 0 additions & 1 deletion imageroot/actions/restore-module/06copyenv
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@ for evar in [
"LOKI_API_AUTH_PASSWORD",
"LOKI_LOGS_INGRESS_TOKEN",
"LOKI_HTTP_PORT",
"LOKI_RETENTION_PERIOD",
]:
agent.set_env(evar, original_environment[evar])
21 changes: 0 additions & 21 deletions imageroot/events/default-instance-changed/10set

This file was deleted.

64 changes: 0 additions & 64 deletions imageroot/loki-config.yaml

This file was deleted.

5 changes: 1 addition & 4 deletions imageroot/systemd/user/loki-server.service
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ ExecStart=/usr/bin/podman run \
--replace \
--name=%N \
--volume=loki-server-data:/loki \
--volume=%S/loki-config.yaml:/etc/loki/local-config.yaml:Z \
--env=LOKI_RETENTION_PERIOD \
${LOKI_IMAGE} \
-config.file=/etc/loki/local-config.yaml \
-log.level=warn \
-config.expand-env
-log.level warn

ExecStop=/usr/bin/podman stop --ignore --cidfile %t/loki-server.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/loki-server.ctr-id
Expand Down
18 changes: 0 additions & 18 deletions imageroot/update-module.d/10config

This file was deleted.

0 comments on commit cd2b723

Please sign in to comment.