Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add some docs around a schema value for new installs #12424

Merged
merged 5 commits into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines +74 to +76
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy/ paste error?
Lines 68 - 70 are the same as lines 75 - 77, with the exception of the schema value.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind, I see what you're doing here with from and the dates.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually all this was is a change to indentation to remove the tab chars and use spaces instead which I think is better for copy pasting yaml

```
Loading