Skip to content

Commit

Permalink
docs: add some docs around a schema value for new installs (#12424)
Browse files Browse the repository at this point in the history
Signed-off-by: Edward Welch <[email protected]>
Co-authored-by: Dylan Guedes <[email protected]>
  • Loading branch information
slim-bean and DylanGuedes authored Apr 3, 2024
1 parent 2951b38 commit 27606a3
Showing 1 changed file with 41 additions and 15 deletions.
56 changes: 41 additions & 15 deletions docs/sources/operations/storage/schema/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,32 @@ Loki uses the defined schemas to determine which format to use when storing and

Use of a schema allows Loki to iterate over the storage layer without requiring migration of existing data.

## New Loki installs
For a new Loki install with no previous data, here is an example schema configuration with recommended values

```
schema_config:
configs:
- from: 2024-04-01
object_store: s3
store: tsdb
schema: v13
index:
prefix: index_
period: 24h
```


| Property | Description |
|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| from | for a new install, this must be a date in the past, use a recent date. Format is YYYY-MM-DD. |
| object_store | s3, azure, gcs, alibabacloud, bos, cos, swift, filesystem, or a named_store (see [StorageConfig]({{< relref "../../../configure#storage_config" >}})). |
| store | `tsdb` is the current and only recommended value for store. |
| schema | `v13` is the most recent schema and recommended value. |
| prefix: | any value without spaces is acceptable. |
| period: | must be `24h`. |


## Changing the schema

Here are items to consider when changing the schema; if schema changes are not done properly, a scenario can be created which prevents data from being read.
Expand All @@ -33,19 +59,19 @@ Here are items to consider when changing the schema; if schema changes are not d

```
schema_config:
configs:
- from: "2020-07-31"
index:
period: 24h
prefix: loki_ops_index_
object_store: gcs
schema: v11
store: tsdb
- from: "2022-01-20"
index:
period: 24h
prefix: loki_ops_index_
object_store: gcs
schema: v13
store: tsdb
configs:
- from: "2020-07-31"
index:
period: 24h
prefix: loki_ops_index_
object_store: gcs
schema: v11
store: tsdb
- from: "2022-01-20"
index:
period: 24h
prefix: loki_ops_index_
object_store: gcs
schema: v13
store: tsdb
```

0 comments on commit 27606a3

Please sign in to comment.