From b444ea5b7e36de5fda9065604fab894797f78888 Mon Sep 17 00:00:00 2001 From: Jordan Rushing Date: Mon, 20 Sep 2021 15:53:45 -0500 Subject: [PATCH 01/18] Add DroneCI pipeline stage to validate loki example configs; create example configuration files --- .drone/drone.jsonnet | 9 +++++ .drone/drone.yml | 20 +++++++++- .../examples/cassandra-index.yaml | 20 ++++++++++ .../examples/complete-local-config.yaml | 37 +++++++++++++++++++ .../examples/google-cloud-storage-config.yaml | 16 ++++++++ 5 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 docs/sources/configuration/examples/cassandra-index.yaml create mode 100644 docs/sources/configuration/examples/complete-local-config.yaml create mode 100644 docs/sources/configuration/examples/google-cloud-storage-config.yaml diff --git a/.drone/drone.jsonnet b/.drone/drone.jsonnet index 65884bdbd229..1f3d6aa2e237 100644 --- a/.drone/drone.jsonnet +++ b/.drone/drone.jsonnet @@ -286,6 +286,15 @@ local manifest(apps) = pipeline('manifest') { }, ], }, + pipeline('validate-example-configs') { + workspace: { + base: '/src', + path: 'loki', + }, + steps: [ + run('validate provided example configuration files', ['echo "Hello, World"']) + ], + }, ] + [ multiarch_image(arch) for arch in archs diff --git a/.drone/drone.yml b/.drone/drone.yml index 8108b45df82f..4034fc8b87e5 100644 --- a/.drone/drone.yml +++ b/.drone/drone.yml @@ -46,6 +46,24 @@ steps: commands: - apk add make bash && make lint-scripts +--- +kind: pipeline +name: validate-example-configs + +platform: + os: linux + arch: amd64 + +workspace: + base: /src + path: loki + +steps: +- name: validate provided example configuration files + image: grafana/loki-build-image:0.17.0 + commands: + - echo "Hello, World" + --- kind: pipeline name: docker-amd64 @@ -973,6 +991,6 @@ get: --- kind: signature -hmac: b70be41d1a7f91c11af945a34bdbdc7a4f7613cf830c13f5438dba0bf33a1ec5 +hmac: 384fb788a2ab1e26b8c0eacb7a455508beaf70d4d14b313ddcdebb6ffc0d9b69 ... diff --git a/docs/sources/configuration/examples/cassandra-index.yaml b/docs/sources/configuration/examples/cassandra-index.yaml new file mode 100644 index 000000000000..97c5b65109bc --- /dev/null +++ b/docs/sources/configuration/examples/cassandra-index.yaml @@ -0,0 +1,20 @@ +schema_config: + configs: + - from: 2020-05-15 + store: cassandra + object_store: filesystem + schema: v11 + index: + prefix: cassandra_table + period: 168h + +storage_config: + cassandra: + username: cassandra + password: cassandra + addresses: 127.0.0.1 + auth: true + keyspace: lokiindex + + filesystem: + directory: /tmp/loki/chunks \ No newline at end of file diff --git a/docs/sources/configuration/examples/complete-local-config.yaml b/docs/sources/configuration/examples/complete-local-config.yaml new file mode 100644 index 000000000000..16942b969466 --- /dev/null +++ b/docs/sources/configuration/examples/complete-local-config.yaml @@ -0,0 +1,37 @@ +auth_enabled: false + +server: + http_listen_port: 3100 + +ingester: + lifecycler: + address: 127.0.0.1 + ring: + kvstore: + store: inmemory + replication_factor: 1 + final_sleep: 0s + chunk_idle_period: 5m + chunk_retain_period: 30s + +schema_config: + configs: + - from: 2020-05-15 + store: boltdb + object_store: filesystem + schema: v11 + index: + prefix: index_ + period: 168h + +storage_config: + boltdb: + directory: /tmp/loki/index + + filesystem: + directory: /tmp/loki/chunks + +limits_config: + enforce_metric_name: false + reject_old_samples: true + reject_old_samples_max_age: 168h diff --git a/docs/sources/configuration/examples/google-cloud-storage-config.yaml b/docs/sources/configuration/examples/google-cloud-storage-config.yaml new file mode 100644 index 000000000000..523171e40039 --- /dev/null +++ b/docs/sources/configuration/examples/google-cloud-storage-config.yaml @@ -0,0 +1,16 @@ +schema_config: + configs: + - from: 2020-05-15 + store: bigtable + object_store: gcs + schema: v11 + index: + prefix: loki_index_ + period: 168h + +storage_config: + bigtable: + instance: BIGTABLE_INSTANCE + project: BIGTABLE_PROJECT + gcs: + bucket_name: GCS_BUCKET_NAME \ No newline at end of file From fad3ff78ad6fb51aa306b6fe91b6c25d128501be Mon Sep 17 00:00:00 2001 From: Jordan Rushing Date: Mon, 20 Sep 2021 16:08:29 -0500 Subject: [PATCH 02/18] Actually run loki in the validate-example-configurations pipeline stage --- .drone/drone.jsonnet | 2 +- .drone/drone.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone/drone.jsonnet b/.drone/drone.jsonnet index 1f3d6aa2e237..7405566694ac 100644 --- a/.drone/drone.jsonnet +++ b/.drone/drone.jsonnet @@ -292,7 +292,7 @@ local manifest(apps) = pipeline('manifest') { path: 'loki', }, steps: [ - run('validate provided example configuration files', ['echo "Hello, World"']) + run('validate provided example configuration files', ['docker run --rm grafana/loki:main-%s-amd64 -version' % '$(./tools/image-tag)']) ], }, ] + [ diff --git a/.drone/drone.yml b/.drone/drone.yml index 4034fc8b87e5..3bebee040d5f 100644 --- a/.drone/drone.yml +++ b/.drone/drone.yml @@ -62,7 +62,7 @@ steps: - name: validate provided example configuration files image: grafana/loki-build-image:0.17.0 commands: - - echo "Hello, World" + - docker run --rm grafana/loki:main-$(./tools/image-tag)-amd64 -version --- kind: pipeline @@ -991,6 +991,6 @@ get: --- kind: signature -hmac: 384fb788a2ab1e26b8c0eacb7a455508beaf70d4d14b313ddcdebb6ffc0d9b69 +hmac: 12b5e8a892b9a0432ad83b6a0d060eea5b367bb0a82e9f72eba61282185d9ca1 ... From 768e96b8b426de1a5fa971819a6528dfa2435ca2 Mon Sep 17 00:00:00 2001 From: Jordan Rushing Date: Mon, 20 Sep 2021 16:24:06 -0500 Subject: [PATCH 03/18] Change method for running loki binary --- .drone/drone.jsonnet | 3 ++- .drone/drone.yml | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.drone/drone.jsonnet b/.drone/drone.jsonnet index 7405566694ac..1d8389facbd0 100644 --- a/.drone/drone.jsonnet +++ b/.drone/drone.jsonnet @@ -292,7 +292,8 @@ local manifest(apps) = pipeline('manifest') { path: 'loki', }, steps: [ - run('validate provided example configuration files', ['docker run --rm grafana/loki:main-%s-amd64 -version' % '$(./tools/image-tag)']) + make('loki', container=false) { depends_on: ['clone'] }, + run('validate provided example configuration files', ['ls', './cmd/loki/loki -version']) ], }, ] + [ diff --git a/.drone/drone.yml b/.drone/drone.yml index 3bebee040d5f..b1852fdc1cb0 100644 --- a/.drone/drone.yml +++ b/.drone/drone.yml @@ -59,10 +59,18 @@ workspace: path: loki steps: +- name: loki + image: grafana/loki-build-image:0.17.0 + commands: + - make BUILD_IN_CONTAINER=false loki + depends_on: + - clone + - name: validate provided example configuration files image: grafana/loki-build-image:0.17.0 commands: - - docker run --rm grafana/loki:main-$(./tools/image-tag)-amd64 -version + - ls + - ./cmd/loki/loki -version --- kind: pipeline @@ -991,6 +999,6 @@ get: --- kind: signature -hmac: 12b5e8a892b9a0432ad83b6a0d060eea5b367bb0a82e9f72eba61282185d9ca1 +hmac: 335c81b9dc5edfcd8674b5df6713206639dbf61ffed51bf8551d3a6e1a52b629 ... From 6db58d74e09532006c8d75d98e46f19f5b36f65d Mon Sep 17 00:00:00 2001 From: Jordan Rushing Date: Mon, 20 Sep 2021 16:28:35 -0500 Subject: [PATCH 04/18] Add step dependency for config validation pipeline stage --- .drone/drone.jsonnet | 2 +- .drone/drone.yml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.drone/drone.jsonnet b/.drone/drone.jsonnet index 1d8389facbd0..48242a9c0343 100644 --- a/.drone/drone.jsonnet +++ b/.drone/drone.jsonnet @@ -293,7 +293,7 @@ local manifest(apps) = pipeline('manifest') { }, steps: [ make('loki', container=false) { depends_on: ['clone'] }, - run('validate provided example configuration files', ['ls', './cmd/loki/loki -version']) + run('validate provided example configuration files', ['ls', './cmd/loki/loki -version']) { depends_on: ['loki'] }, ], }, ] + [ diff --git a/.drone/drone.yml b/.drone/drone.yml index b1852fdc1cb0..6758bfe5eee3 100644 --- a/.drone/drone.yml +++ b/.drone/drone.yml @@ -71,6 +71,8 @@ steps: commands: - ls - ./cmd/loki/loki -version + depends_on: + - loki --- kind: pipeline @@ -999,6 +1001,6 @@ get: --- kind: signature -hmac: 335c81b9dc5edfcd8674b5df6713206639dbf61ffed51bf8551d3a6e1a52b629 +hmac: 30973ad4b8577e27782938633e80d324068e4938210e4ea88049d2f18f09dc7d ... From 12cdfaf6c425e062a7e9090f474c2625766902fe Mon Sep 17 00:00:00 2001 From: Jordan Rushing Date: Mon, 20 Sep 2021 16:38:38 -0500 Subject: [PATCH 05/18] Actually loop over example configs and verify them! --- .drone/drone.jsonnet | 2 +- .drone/drone.yml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.drone/drone.jsonnet b/.drone/drone.jsonnet index 48242a9c0343..ff5a823e7baf 100644 --- a/.drone/drone.jsonnet +++ b/.drone/drone.jsonnet @@ -293,7 +293,7 @@ local manifest(apps) = pipeline('manifest') { }, steps: [ make('loki', container=false) { depends_on: ['clone'] }, - run('validate provided example configuration files', ['ls', './cmd/loki/loki -version']) { depends_on: ['loki'] }, + run('validate provided example configuration files', ['for f in ./docs/sources/configuration/examples/*.yaml; do echo "Validating provided example config: $f" && ./cmd/loki/loki -config.file=$f -verify-config || exit 1; done']) { depends_on: ['loki'] }, ], }, ] + [ diff --git a/.drone/drone.yml b/.drone/drone.yml index 6758bfe5eee3..c6757b91320d 100644 --- a/.drone/drone.yml +++ b/.drone/drone.yml @@ -69,8 +69,7 @@ steps: - name: validate provided example configuration files image: grafana/loki-build-image:0.17.0 commands: - - ls - - ./cmd/loki/loki -version + - "for f in ./docs/sources/configuration/examples/*.yaml; do echo \"Validating provided example config: $f\" && ./cmd/loki/loki -config.file=$f -verify-config || exit 1; done" depends_on: - loki @@ -1001,6 +1000,6 @@ get: --- kind: signature -hmac: 30973ad4b8577e27782938633e80d324068e4938210e4ea88049d2f18f09dc7d +hmac: 240486a8797126889051bfd3658b22f3a04d4a814161847db4ed334e7561bf99 ... From 681d103f14a20254c52a1c034813a322fc9d3dbe Mon Sep 17 00:00:00 2001 From: Jordan Rushing Date: Mon, 20 Sep 2021 16:40:15 -0500 Subject: [PATCH 06/18] Push bad config to test failing builds --- docs/sources/configuration/examples/complete-local-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/configuration/examples/complete-local-config.yaml b/docs/sources/configuration/examples/complete-local-config.yaml index 16942b969466..9ae6aef6a61a 100644 --- a/docs/sources/configuration/examples/complete-local-config.yaml +++ b/docs/sources/configuration/examples/complete-local-config.yaml @@ -12,7 +12,7 @@ ingester: replication_factor: 1 final_sleep: 0s chunk_idle_period: 5m - chunk_retain_period: 30s + chunk_retrain_period: 30s schema_config: configs: From 17dd3f9a49a20bb7c97c9b08f047597a27386498 Mon Sep 17 00:00:00 2001 From: Jordan Rushing Date: Mon, 20 Sep 2021 17:10:29 -0500 Subject: [PATCH 07/18] Create remaining example configs --- .drone/drone.jsonnet | 1 + .../examples/almost-zero-dependency.yaml | 70 +++++++++++++++++++ .../examples/aws-basic-config-no-creds.yaml | 16 +++++ .../examples/aws-basic-config.yaml | 14 ++++ .../examples/cassandra-index.yaml | 2 + .../examples/complete-local-config.yaml | 2 +- .../examples/example-schema-config.yaml | 20 ++++++ .../examples/google-cloud-storage-config.yaml | 2 + .../examples/s3-compatible-apis.yaml | 17 +++++ .../examples/s3-expanded-config.yaml | 25 +++++++ 10 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 docs/sources/configuration/examples/almost-zero-dependency.yaml create mode 100644 docs/sources/configuration/examples/aws-basic-config-no-creds.yaml create mode 100644 docs/sources/configuration/examples/aws-basic-config.yaml create mode 100644 docs/sources/configuration/examples/example-schema-config.yaml create mode 100644 docs/sources/configuration/examples/s3-compatible-apis.yaml create mode 100644 docs/sources/configuration/examples/s3-expanded-config.yaml diff --git a/.drone/drone.jsonnet b/.drone/drone.jsonnet index ff5a823e7baf..50b94cb0fa9b 100644 --- a/.drone/drone.jsonnet +++ b/.drone/drone.jsonnet @@ -286,6 +286,7 @@ local manifest(apps) = pipeline('manifest') { }, ], }, + # Build Loki and use the `-verify-config` flag on all example configurations pipeline('validate-example-configs') { workspace: { base: '/src', diff --git a/docs/sources/configuration/examples/almost-zero-dependency.yaml b/docs/sources/configuration/examples/almost-zero-dependency.yaml new file mode 100644 index 000000000000..d0ead87c0618 --- /dev/null +++ b/docs/sources/configuration/examples/almost-zero-dependency.yaml @@ -0,0 +1,70 @@ +# This is a configuration to deploy Loki depending only on a storage solution +# e.g. an S3-compatible API like minio. +# The ring configuration is based on the gossip memberlist and the index is shipped to storage +# via Single Store (boltdb-shipper) + +auth_enabled: false + +server: + http_listen_port: 3100 + +distributor: + ring: + kvstore: + store: memberlist + +ingester: + lifecycler: + ring: + kvstore: + store: memberlist + replication_factor: 1 + final_sleep: 0s + chunk_idle_period: 5m + chunk_retain_period: 30s + +memberlist: + abort_if_cluster_join_fails: false + + # Expose this port on all distributor, ingester + # and querier replicas. + bind_port: 7946 + + # You can use a headless k8s service for all distributor, + # ingester and querier components. + join_members: + - loki-gossip-ring.loki.svc.cluster.local:7946 + + max_join_backoff: 1m + max_join_retries: 10 + min_join_backoff: 1s + +schema_config: + configs: + - from: 2020-05-15 + store: boltdb-shipper + object_store: s3 + schema: v11 + index: + prefix: index_ + period: 24h + +storage_config: + boltdb_shipper: + active_index_directory: /loki/index + cache_location: /loki/index_cache + shared_store: s3 + + aws: + s3: s3://access_key:secret_access_key@custom_endpoint/bucket_name + s3forcepathstyle: true + +limits_config: + enforce_metric_name: false + reject_old_samples: true + reject_old_samples_max_age: 168h + +compactor: + working_directory: /data/compactor + shared_store: s3 + compaction_interval: 5m \ No newline at end of file diff --git a/docs/sources/configuration/examples/aws-basic-config-no-creds.yaml b/docs/sources/configuration/examples/aws-basic-config-no-creds.yaml new file mode 100644 index 000000000000..42f4da3b4832 --- /dev/null +++ b/docs/sources/configuration/examples/aws-basic-config-no-creds.yaml @@ -0,0 +1,16 @@ +# If you don't wish to hard-code S3 credentials you can also configure an EC2 +# instance role by changing the `storage_config` section + +schema_config: + configs: + - from: 2020-05-15 + store: aws + object_store: s3 + schema: v11 + index: + prefix: loki_ +storage_config: + aws: + s3: s3://region/bucket_name + dynamodb: + dynamodb_url: dynamodb://region \ No newline at end of file diff --git a/docs/sources/configuration/examples/aws-basic-config.yaml b/docs/sources/configuration/examples/aws-basic-config.yaml new file mode 100644 index 000000000000..b64b0967b59f --- /dev/null +++ b/docs/sources/configuration/examples/aws-basic-config.yaml @@ -0,0 +1,14 @@ +# This is a partial config that uses S3 for chunk storage and DynamoDB for index storage +schema_config: + configs: + - from: 2020-05-15 + store: aws + object_store: s3 + schema: v11 + index: + prefix: loki_ +storage_config: + aws: + s3: s3://access_key:secret_access_key@region/bucket_name + dynamodb: + dynamodb_url: dynamodb://access_key:secret_access_key@region \ No newline at end of file diff --git a/docs/sources/configuration/examples/cassandra-index.yaml b/docs/sources/configuration/examples/cassandra-index.yaml index 97c5b65109bc..c01ff1facf32 100644 --- a/docs/sources/configuration/examples/cassandra-index.yaml +++ b/docs/sources/configuration/examples/cassandra-index.yaml @@ -1,3 +1,5 @@ +# This is a partial config that uses the local filesystem for chunk storage and Cassandra for index storage + schema_config: configs: - from: 2020-05-15 diff --git a/docs/sources/configuration/examples/complete-local-config.yaml b/docs/sources/configuration/examples/complete-local-config.yaml index 9ae6aef6a61a..16942b969466 100644 --- a/docs/sources/configuration/examples/complete-local-config.yaml +++ b/docs/sources/configuration/examples/complete-local-config.yaml @@ -12,7 +12,7 @@ ingester: replication_factor: 1 final_sleep: 0s chunk_idle_period: 5m - chunk_retrain_period: 30s + chunk_retain_period: 30s schema_config: configs: diff --git a/docs/sources/configuration/examples/example-schema-config.yaml b/docs/sources/configuration/examples/example-schema-config.yaml new file mode 100644 index 000000000000..c4e551de36a8 --- /dev/null +++ b/docs/sources/configuration/examples/example-schema-config.yaml @@ -0,0 +1,20 @@ +configs: + # Starting from 2018-04-15 Loki should store indexes on Cassandra + # using weekly periodic tables and chunks on filesystem. + # The index tables will be prefixed with "index_". + - from: "2018-04-15" + store: cassandra + object_store: filesystem + schema: v11 + index: + period: 168h + prefix: index_ + + # Starting from 2020-6-15 we moved from filesystem to AWS S3 for storing the chunks. + - from: "2020-06-15" + store: cassandra + object_store: s3 + schema: v11 + index: + period: 168h + prefix: index_ \ No newline at end of file diff --git a/docs/sources/configuration/examples/google-cloud-storage-config.yaml b/docs/sources/configuration/examples/google-cloud-storage-config.yaml index 523171e40039..f4c909f3a0a9 100644 --- a/docs/sources/configuration/examples/google-cloud-storage-config.yaml +++ b/docs/sources/configuration/examples/google-cloud-storage-config.yaml @@ -1,3 +1,5 @@ +# This is a partial config that uses GCS for chunk storage and BigTable for index storage + schema_config: configs: - from: 2020-05-15 diff --git a/docs/sources/configuration/examples/s3-compatible-apis.yaml b/docs/sources/configuration/examples/s3-compatible-apis.yaml new file mode 100644 index 000000000000..a3e5835e7c98 --- /dev/null +++ b/docs/sources/configuration/examples/s3-compatible-apis.yaml @@ -0,0 +1,17 @@ +# S3-compatible APIs (e.g. Ceph Object Storage with an S3-compatible API) can be used. +# If the API supports path-style URL rather than virtual hosted bucket addressing, +# configure the URL in `storage_config` with the custom endpoint + +schema_config: + configs: + - from: 2020-05-15 + store: aws + object_store: s3 + schema: v11 + index: + prefix: loki_ +storage_config: + aws: + s3: s3://access_key:secret_access_key@region/bucket_name + dynamodb: + dynamodb_url: dynamodb://access_key:secret_access_key@region \ No newline at end of file diff --git a/docs/sources/configuration/examples/s3-expanded-config.yaml b/docs/sources/configuration/examples/s3-expanded-config.yaml new file mode 100644 index 000000000000..252a199637b8 --- /dev/null +++ b/docs/sources/configuration/examples/s3-expanded-config.yaml @@ -0,0 +1,25 @@ +# S3 config now supports expanded config. +# Either `s3` endpoint URL can be used or expanded config can be used + +schema_config: + configs: + - from: 2020-05-15 + store: aws + object_store: s3 + schema: v11 + index: + prefix: loki_ +storage_config: + aws: + bucketnames: bucket_name1, bucket_name2 + endpoint: s3.endpoint.com + region: s3_region + access_key_id: s3_access_key_id + secret_access_key: s3_secret_access_key + insecure: false + sse_encryption: false + http_config: + idle_conn_timeout: 90s + response_header_timeout: 0s + insecure_skip_verify: false + s3forcepathstyle: true \ No newline at end of file From b5f6a181b64f4333c3bfabc6252d3029dc39577d Mon Sep 17 00:00:00 2001 From: Jordan Rushing Date: Mon, 20 Sep 2021 17:17:16 -0500 Subject: [PATCH 08/18] Fix provided example loki configs --- .../configuration/examples/aws-basic-config.yaml | 1 + .../configuration/examples/example-schema-config.yaml | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/sources/configuration/examples/aws-basic-config.yaml b/docs/sources/configuration/examples/aws-basic-config.yaml index b64b0967b59f..a709c905acc4 100644 --- a/docs/sources/configuration/examples/aws-basic-config.yaml +++ b/docs/sources/configuration/examples/aws-basic-config.yaml @@ -1,4 +1,5 @@ # This is a partial config that uses S3 for chunk storage and DynamoDB for index storage + schema_config: configs: - from: 2020-05-15 diff --git a/docs/sources/configuration/examples/example-schema-config.yaml b/docs/sources/configuration/examples/example-schema-config.yaml index c4e551de36a8..dc7d4156b1f4 100644 --- a/docs/sources/configuration/examples/example-schema-config.yaml +++ b/docs/sources/configuration/examples/example-schema-config.yaml @@ -1,7 +1,10 @@ -configs: - # Starting from 2018-04-15 Loki should store indexes on Cassandra - # using weekly periodic tables and chunks on filesystem. - # The index tables will be prefixed with "index_". +# Additional example schema configs for Cassandra + +schema_config: + configs: + # Starting from 2018-04-15 Loki should store indexes on Cassandra + # using weekly periodic tables and chunks on filesystem. + # The index tables will be prefixed with "index_". - from: "2018-04-15" store: cassandra object_store: filesystem From 3509e273f71a08ded29bc82e0af824c8204313b3 Mon Sep 17 00:00:00 2001 From: Jordan Rushing Date: Mon, 20 Sep 2021 20:26:36 -0500 Subject: [PATCH 09/18] Use make target to validate example configs --- .drone/drone.jsonnet | 11 +---------- .drone/drone.yml | 19 +++---------------- Makefile | 3 +++ 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/.drone/drone.jsonnet b/.drone/drone.jsonnet index 50b94cb0fa9b..07eb7fc51a5a 100644 --- a/.drone/drone.jsonnet +++ b/.drone/drone.jsonnet @@ -284,17 +284,8 @@ local manifest(apps) = pipeline('manifest') { image: 'koalaman/shellcheck-alpine:stable', commands: ['apk add make bash && make lint-scripts'], }, - ], - }, - # Build Loki and use the `-verify-config` flag on all example configurations - pipeline('validate-example-configs') { - workspace: { - base: '/src', - path: 'loki', - }, - steps: [ make('loki', container=false) { depends_on: ['clone'] }, - run('validate provided example configuration files', ['for f in ./docs/sources/configuration/examples/*.yaml; do echo "Validating provided example config: $f" && ./cmd/loki/loki -config.file=$f -verify-config || exit 1; done']) { depends_on: ['loki'] }, + make('validate-example-configs', container=false) { depends_on: ['loki'] }, ], }, ] + [ diff --git a/.drone/drone.yml b/.drone/drone.yml index c6757b91320d..948a468ae721 100644 --- a/.drone/drone.yml +++ b/.drone/drone.yml @@ -46,19 +46,6 @@ steps: commands: - apk add make bash && make lint-scripts ---- -kind: pipeline -name: validate-example-configs - -platform: - os: linux - arch: amd64 - -workspace: - base: /src - path: loki - -steps: - name: loki image: grafana/loki-build-image:0.17.0 commands: @@ -66,10 +53,10 @@ steps: depends_on: - clone -- name: validate provided example configuration files +- name: validate-example-configs image: grafana/loki-build-image:0.17.0 commands: - - "for f in ./docs/sources/configuration/examples/*.yaml; do echo \"Validating provided example config: $f\" && ./cmd/loki/loki -config.file=$f -verify-config || exit 1; done" + - make BUILD_IN_CONTAINER=false validate-example-configs depends_on: - loki @@ -1000,6 +987,6 @@ get: --- kind: signature -hmac: 240486a8797126889051bfd3658b22f3a04d4a814161847db4ed334e7561bf99 +hmac: b86209659200c59388bec4ba2706d95f2514e1b34a91a85d2547143aae735e19 ... diff --git a/Makefile b/Makefile index 69c65985483e..42a0334ab5e3 100644 --- a/Makefile +++ b/Makefile @@ -635,3 +635,6 @@ format: -type f -name '*.go' -exec gofmt -w -s {} \; find . $(DONT_FIND) -name '*.pb.go' -prune -o -name '*.y.go' -prune -o -name '*.rl.go' -prune -o \ -type f -name '*.go' -exec goimports -w -local github.com/grafana/loki {} \; + +validate-example-configs: loki + for f in ./docs/sources/configuration/examples/*.yaml; do echo "Validating provided example config: $$f" && ./cmd/loki/loki -config.file=$$f -verify-config || exit 1; done From 02fbf82b26f05b1dd8df5fef08e1a03b7ebafe80 Mon Sep 17 00:00:00 2001 From: Jordan Rushing Date: Thu, 7 Oct 2021 17:56:08 -0500 Subject: [PATCH 10/18] Add make target to generate a new example configuration doc; add make target for CI to verify doc is re-generated upon changes to example configs --- Makefile | 20 ++ docs/sources/configuration/examples.md | 312 ++++++++++++++----------- 2 files changed, 194 insertions(+), 138 deletions(-) diff --git a/Makefile b/Makefile index 42a0334ab5e3..b01c43f0fbc5 100644 --- a/Makefile +++ b/Makefile @@ -636,5 +636,25 @@ format: find . $(DONT_FIND) -name '*.pb.go' -prune -o -name '*.y.go' -prune -o -name '*.rl.go' -prune -o \ -type f -name '*.go' -exec goimports -w -local github.com/grafana/loki {} \; +# Validate the example configurations that we provide in ./docs/sources/configuration/examples validate-example-configs: loki for f in ./docs/sources/configuration/examples/*.yaml; do echo "Validating provided example config: $$f" && ./cmd/loki/loki -config.file=$$f -verify-config || exit 1; done + +# Dynamically generate ./docs/sources/configuration/examples.md using the example configs that we provide. +# This target should be run if any of our example configs change. +generate-example-config-doc: validate-example-configs + echo "Removing existing doc at loki/docs/configuration/examples.md and re-generating. . ." + # Title and Heading + echo -e "---\ntitle: Examples\n---\n # Loki Configuration Examples" > ./docs/sources/configuration/examples.md + # Append each configuration and its file name to examples.md + for f in ./docs/sources/configuration/examples/*.yaml; do echo -e "\n## $$(basename $$f)\n\n\`\`\`yaml\n$$(cat $$f)\n\`\`\`\n" >> ./docs/sources/configuration/examples.md; done + +# Fail our CI build if changes are made to example configurations but our doc is not updated +check-example-config-doc: + @if (git diff --exit-code ./docs/sources/configuation/examples/*) && ! (git diff --exit-code ./docs/sources/configuration/examples.md); then \ + echo -e "\nChanges found in generated example configuration doc"; \ + echo "Run 'make generate-example-config-doc' and commit the changes to fix this error."; \ + echo "If you are actively developing these files you can ignore this error"; \ + echo -e "(Don't forget to check in the generated files when finished)\n"; \ + exit 1; \ + fi \ No newline at end of file diff --git a/docs/sources/configuration/examples.md b/docs/sources/configuration/examples.md index 939c1aa2a2e1..ad0db8dc5e3d 100644 --- a/docs/sources/configuration/examples.md +++ b/docs/sources/configuration/examples.md @@ -1,109 +1,111 @@ --- title: Examples --- -# Grafana Loki Configuration Examples + # Loki Configuration Examples -## Complete Local configuration +## almost-zero-dependency.yaml ```yaml +# This is a configuration to deploy Loki depending only on a storage solution +# e.g. an S3-compatible API like minio. +# The ring configuration is based on the gossip memberlist and the index is shipped to storage +# via Single Store (boltdb-shipper) + auth_enabled: false server: http_listen_port: 3100 +distributor: + ring: + kvstore: + store: memberlist + ingester: lifecycler: - address: 127.0.0.1 ring: kvstore: - store: inmemory + store: memberlist replication_factor: 1 final_sleep: 0s chunk_idle_period: 5m chunk_retain_period: 30s +memberlist: + abort_if_cluster_join_fails: false + + # Expose this port on all distributor, ingester + # and querier replicas. + bind_port: 7946 + + # You can use a headless k8s service for all distributor, + # ingester and querier components. + join_members: + - loki-gossip-ring.loki.svc.cluster.local:7946 + + max_join_backoff: 1m + max_join_retries: 10 + min_join_backoff: 1s + schema_config: configs: - from: 2020-05-15 - store: boltdb - object_store: filesystem + store: boltdb-shipper + object_store: s3 schema: v11 index: prefix: index_ - period: 168h + period: 24h storage_config: - boltdb: - directory: /tmp/loki/index + boltdb_shipper: + active_index_directory: /loki/index + cache_location: /loki/index_cache + shared_store: s3 - filesystem: - directory: /tmp/loki/chunks + aws: + s3: s3://access_key:secret_access_key@custom_endpoint/bucket_name + s3forcepathstyle: true limits_config: enforce_metric_name: false reject_old_samples: true reject_old_samples_max_age: 168h +compactor: + working_directory: /data/compactor + shared_store: s3 + compaction_interval: 5m ``` -## Google Cloud Storage -This is partial config that uses GCS and Bigtable for the chunk and index -stores, respectively. +## aws-basic-config-no-creds.yaml ```yaml -schema_config: - configs: - - from: 2020-05-15 - store: bigtable - object_store: gcs - schema: v11 - index: - prefix: loki_index_ - period: 168h - -storage_config: - bigtable: - instance: BIGTABLE_INSTANCE - project: BIGTABLE_PROJECT - gcs: - bucket_name: GCS_BUCKET_NAME -``` - -## Cassandra Index +# If you don't wish to hard-code S3 credentials you can also configure an EC2 +# instance role by changing the `storage_config` section -This is a partial config that uses the local filesystem for chunk storage and -Cassandra for the index storage: - -```yaml schema_config: configs: - from: 2020-05-15 - store: cassandra - object_store: filesystem + store: aws + object_store: s3 schema: v11 index: - prefix: cassandra_table - period: 168h - + prefix: loki_ storage_config: - cassandra: - username: cassandra - password: cassandra - addresses: 127.0.0.1 - auth: true - keyspace: lokiindex - - filesystem: - directory: /tmp/loki/chunks + aws: + s3: s3://region/bucket_name + dynamodb: + dynamodb_url: dynamodb://region ``` -## AWS -This is a partial config that uses S3 for chunk storage and DynamoDB for the -index storage: +## aws-basic-config.yaml ```yaml +# This is a partial config that uses S3 for chunk storage and DynamoDB for index storage + schema_config: configs: - from: 2020-05-15 @@ -119,57 +121,36 @@ storage_config: dynamodb_url: dynamodb://access_key:secret_access_key@region ``` -If you don't wish to hard-code S3 credentials, you can also configure an EC2 -instance role by changing the `storage_config` section: - -```yaml -storage_config: - aws: - s3: s3://region/bucket_name - dynamodb: - dynamodb_url: dynamodb://region -``` -### S3-compatible APIs - -S3-compatible APIs (e.g. Ceph Object Storage with an S3-compatible API) can be -used. If the API supports path-style URL rather than virtual hosted bucket -addressing, configure the URL in `storage_config` with the custom endpoint: +## cassandra-index.yaml ```yaml -storage_config: - aws: - s3: s3://access_key:secret_access_key@custom_endpoint/bucket_name - s3forcepathstyle: true -``` - -### S3 Expanded Config +# This is a partial config that uses the local filesystem for chunk storage and Cassandra for index storage -S3 config now supports expanded config. Either `s3` endpoint URL can be used -or expanded config can be used. +schema_config: + configs: + - from: 2020-05-15 + store: cassandra + object_store: filesystem + schema: v11 + index: + prefix: cassandra_table + period: 168h -```yaml storage_config: - aws: - bucketnames: bucket_name1, bucket_name2 - endpoint: s3.endpoint.com - region: s3_region - access_key_id: s3_access_key_id - secret_access_key: s3_secret_access_key - insecure: false - sse_encryption: false - http_config: - idle_conn_timeout: 90s - response_header_timeout: 0s - insecure_skip_verify: false - s3forcepathstyle: true + cassandra: + username: cassandra + password: cassandra + addresses: 127.0.0.1 + auth: true + keyspace: lokiindex + + filesystem: + directory: /tmp/loki/chunks ``` -## Almost zero dependencies setup -This is a configuration to deploy Loki depending only on storage solution, e.g. an -S3-compatible API like minio. The ring configuration is based on the gossip memberlist -and the index is shipped to storage via [Single Store (boltdb-shipper)](../../operations/storage/boltdb-shipper/). +## complete-local-config.yaml ```yaml auth_enabled: false @@ -177,75 +158,51 @@ auth_enabled: false server: http_listen_port: 3100 -distributor: - ring: - kvstore: - store: memberlist - ingester: lifecycler: + address: 127.0.0.1 ring: kvstore: - store: memberlist + store: inmemory replication_factor: 1 final_sleep: 0s chunk_idle_period: 5m chunk_retain_period: 30s -memberlist: - abort_if_cluster_join_fails: false - - # Expose this port on all distributor, ingester - # and querier replicas. - bind_port: 7946 - - # You can use a headless k8s service for all distributor, - # ingester and querier components. - join_members: - - loki-gossip-ring.loki.svc.cluster.local:7946 - - max_join_backoff: 1m - max_join_retries: 10 - min_join_backoff: 1s - schema_config: configs: - from: 2020-05-15 - store: boltdb-shipper - object_store: s3 + store: boltdb + object_store: filesystem schema: v11 index: prefix: index_ - period: 24h + period: 168h storage_config: - boltdb_shipper: - active_index_directory: /loki/index - cache_location: /loki/index_cache - shared_store: s3 + boltdb: + directory: /tmp/loki/index - aws: - s3: s3://access_key:secret_access_key@custom_endpoint/bucket_name - s3forcepathstyle: true + filesystem: + directory: /tmp/loki/chunks limits_config: enforce_metric_name: false reject_old_samples: true reject_old_samples_max_age: 168h - -compactor: - working_directory: /data/compactor - shared_store: s3 - compaction_interval: 5m ``` -## schema_config + +## example-schema-config.yaml ```yaml -configs: - # Starting from 2018-04-15 Loki should store indexes on Cassandra - # using weekly periodic tables and chunks on filesystem. - # The index tables will be prefixed with "index_". +# Additional example schema configs for Cassandra + +schema_config: + configs: + # Starting from 2018-04-15 Loki should store indexes on Cassandra + # using weekly periodic tables and chunks on filesystem. + # The index tables will be prefixed with "index_". - from: "2018-04-15" store: cassandra object_store: filesystem @@ -263,3 +220,82 @@ configs: period: 168h prefix: index_ ``` + + +## google-cloud-storage-config.yaml + +```yaml +# This is a partial config that uses GCS for chunk storage and BigTable for index storage + +schema_config: + configs: + - from: 2020-05-15 + store: bigtable + object_store: gcs + schema: v11 + index: + prefix: loki_index_ + period: 168h + +storage_config: + bigtable: + instance: BIGTABLE_INSTANCE + project: BIGTABLE_PROJECT + gcs: + bucket_name: GCS_BUCKET_NAME +``` + + +## s3-compatible-apis.yaml + +```yaml +# S3-compatible APIs (e.g. Ceph Object Storage with an S3-compatible API) can be used. +# If the API supports path-style URL rather than virtual hosted bucket addressing, +# configure the URL in `storage_config` with the custom endpoint + +schema_config: + configs: + - from: 2020-05-15 + store: aws + object_store: s3 + schema: v11 + index: + prefix: loki_ +storage_config: + aws: + s3: s3://access_key:secret_access_key@region/bucket_name + dynamodb: + dynamodb_url: dynamodb://access_key:secret_access_key@region +``` + + +## s3-expanded-config.yaml + +```yaml +# S3 config now supports expanded config. +# Either `s3` endpoint URL can be used or expanded config can be used + +schema_config: + configs: + - from: 2020-05-15 + store: aws + object_store: s3 + schema: v11 + index: + prefix: loki_ +storage_config: + aws: + bucketnames: bucket_name1, bucket_name2 + endpoint: s3.endpoint.com + region: s3_region + access_key_id: s3_access_key_id + secret_access_key: s3_secret_access_key + insecure: false + sse_encryption: false + http_config: + idle_conn_timeout: 90s + response_header_timeout: 0s + insecure_skip_verify: false + s3forcepathstyle: true +``` + From aaba9fb67c1d655eba51b89c1bf63076e262c84c Mon Sep 17 00:00:00 2001 From: Jordan Rushing Date: Thu, 7 Oct 2021 18:02:46 -0500 Subject: [PATCH 11/18] Update CI to check the generated example config doc --- .drone/drone.jsonnet | 1 + .drone/drone.yml | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.drone/drone.jsonnet b/.drone/drone.jsonnet index 07eb7fc51a5a..e394e979436c 100644 --- a/.drone/drone.jsonnet +++ b/.drone/drone.jsonnet @@ -286,6 +286,7 @@ local manifest(apps) = pipeline('manifest') { }, make('loki', container=false) { depends_on: ['clone'] }, make('validate-example-configs', container=false) { depends_on: ['loki'] }, + make('check-example-config-doc', container=false) { depends_on: ['clone'] }, ], }, ] + [ diff --git a/.drone/drone.yml b/.drone/drone.yml index 948a468ae721..bb46d9269376 100644 --- a/.drone/drone.yml +++ b/.drone/drone.yml @@ -60,6 +60,13 @@ steps: depends_on: - loki +- name: check-example-config-doc + image: grafana/loki-build-image:0.17.0 + commands: + - make BUILD_IN_CONTAINER=false check-example-config-doc + depends_on: + - clone + --- kind: pipeline name: docker-amd64 @@ -987,6 +994,6 @@ get: --- kind: signature -hmac: b86209659200c59388bec4ba2706d95f2514e1b34a91a85d2547143aae735e19 +hmac: f1681daaa15376eb15eae5dd623a3ec19544b0447506aba2d59a92f0fd8fee49 ... From f50ab96c4bb4e914da00e5a315251246e6fff538 Mon Sep 17 00:00:00 2001 From: Jordan Rushing Date: Thu, 7 Oct 2021 18:24:44 -0500 Subject: [PATCH 12/18] Clean up Makefile --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b01c43f0fbc5..90846fa46266 100644 --- a/Makefile +++ b/Makefile @@ -636,6 +636,10 @@ format: find . $(DONT_FIND) -name '*.pb.go' -prune -o -name '*.y.go' -prune -o -name '*.rl.go' -prune -o \ -type f -name '*.go' -exec goimports -w -local github.com/grafana/loki {} \; +################### +# Example Configs # +################### + # Validate the example configurations that we provide in ./docs/sources/configuration/examples validate-example-configs: loki for f in ./docs/sources/configuration/examples/*.yaml; do echo "Validating provided example config: $$f" && ./cmd/loki/loki -config.file=$$f -verify-config || exit 1; done @@ -657,4 +661,4 @@ check-example-config-doc: echo "If you are actively developing these files you can ignore this error"; \ echo -e "(Don't forget to check in the generated files when finished)\n"; \ exit 1; \ - fi \ No newline at end of file + fi From b1a541bf6aee4330f7d0bf89f748a4ef007e8b8e Mon Sep 17 00:00:00 2001 From: Jordan Rushing Date: Fri, 8 Oct 2021 13:17:21 -0500 Subject: [PATCH 13/18] Mark new example config validation make targets as phony; fix conditional for config example doc checking --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 90846fa46266..276b65b3a732 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ .PHONY: bigtable-backup, push-bigtable-backup .PHONY: benchmark-store, drone, check-mod .PHONY: migrate migrate-image lint-markdown ragel +.PHONY: validate-example-configs generate-example-config-doc check-example-config-doc SHELL = /usr/bin/env bash @@ -654,8 +655,8 @@ generate-example-config-doc: validate-example-configs for f in ./docs/sources/configuration/examples/*.yaml; do echo -e "\n## $$(basename $$f)\n\n\`\`\`yaml\n$$(cat $$f)\n\`\`\`\n" >> ./docs/sources/configuration/examples.md; done # Fail our CI build if changes are made to example configurations but our doc is not updated -check-example-config-doc: - @if (git diff --exit-code ./docs/sources/configuation/examples/*) && ! (git diff --exit-code ./docs/sources/configuration/examples.md); then \ +check-example-config-doc: generate-example-config-doc + @if (git diff --exit-code ./docs/sources/configuration/examples.md); then \ echo -e "\nChanges found in generated example configuration doc"; \ echo "Run 'make generate-example-config-doc' and commit the changes to fix this error."; \ echo "If you are actively developing these files you can ignore this error"; \ From 022e0a3320732ed2e8cce815c56226dcfe6d8fb3 Mon Sep 17 00:00:00 2001 From: Jordan Rushing Date: Fri, 8 Oct 2021 13:26:29 -0500 Subject: [PATCH 14/18] Fix conditional --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 276b65b3a732..234d0605973e 100644 --- a/Makefile +++ b/Makefile @@ -656,7 +656,7 @@ generate-example-config-doc: validate-example-configs # Fail our CI build if changes are made to example configurations but our doc is not updated check-example-config-doc: generate-example-config-doc - @if (git diff --exit-code ./docs/sources/configuration/examples.md); then \ + @if ! (git diff --exit-code ./docs/sources/configuration/examples.md); then \ echo -e "\nChanges found in generated example configuration doc"; \ echo "Run 'make generate-example-config-doc' and commit the changes to fix this error."; \ echo "If you are actively developing these files you can ignore this error"; \ From 0e80af5def9c730757235eb02408f1249ccc0ca5 Mon Sep 17 00:00:00 2001 From: Jordan Rushing Date: Fri, 8 Oct 2021 13:33:21 -0500 Subject: [PATCH 15/18] Remove redundant step in generate-example-config-doc phony make target --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 234d0605973e..2a65a1867bda 100644 --- a/Makefile +++ b/Makefile @@ -647,7 +647,7 @@ validate-example-configs: loki # Dynamically generate ./docs/sources/configuration/examples.md using the example configs that we provide. # This target should be run if any of our example configs change. -generate-example-config-doc: validate-example-configs +generate-example-config-doc: echo "Removing existing doc at loki/docs/configuration/examples.md and re-generating. . ." # Title and Heading echo -e "---\ntitle: Examples\n---\n # Loki Configuration Examples" > ./docs/sources/configuration/examples.md From 89fcada34fb38f99707e4fad15419ceed56d939d Mon Sep 17 00:00:00 2001 From: Karen Miller Date: Fri, 8 Oct 2021 13:11:44 -0700 Subject: [PATCH 16/18] Add a correction to PR 4358 --- .../configuration/examples/almost-zero-dependency.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sources/configuration/examples/almost-zero-dependency.yaml b/docs/sources/configuration/examples/almost-zero-dependency.yaml index d0ead87c0618..4204f74f412c 100644 --- a/docs/sources/configuration/examples/almost-zero-dependency.yaml +++ b/docs/sources/configuration/examples/almost-zero-dependency.yaml @@ -1,5 +1,5 @@ # This is a configuration to deploy Loki depending only on a storage solution -# e.g. an S3-compatible API like minio. +# e.g. an S3-compatible API like MinIO. # The ring configuration is based on the gossip memberlist and the index is shipped to storage # via Single Store (boltdb-shipper) @@ -67,4 +67,4 @@ limits_config: compactor: working_directory: /data/compactor shared_store: s3 - compaction_interval: 5m \ No newline at end of file + compaction_interval: 5m From a76a861f42cdbd3dea7134963133ebe2aaabfdde Mon Sep 17 00:00:00 2001 From: JordanRushing Date: Fri, 8 Oct 2021 16:06:54 -0500 Subject: [PATCH 17/18] Improve grammar and add newlines in example configuration descriptions Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com> --- .../configuration/examples/almost-zero-dependency.yaml | 2 +- .../configuration/examples/aws-basic-config-no-creds.yaml | 3 ++- docs/sources/configuration/examples/aws-basic-config.yaml | 5 +++-- docs/sources/configuration/examples/cassandra-index.yaml | 3 ++- .../configuration/examples/example-schema-config.yaml | 5 +++-- .../examples/google-cloud-storage-config.yaml | 5 +++-- .../sources/configuration/examples/s3-compatible-apis.yaml | 7 ++++--- .../sources/configuration/examples/s3-expanded-config.yaml | 7 ++++--- 8 files changed, 22 insertions(+), 15 deletions(-) diff --git a/docs/sources/configuration/examples/almost-zero-dependency.yaml b/docs/sources/configuration/examples/almost-zero-dependency.yaml index 4204f74f412c..c82a3abf8929 100644 --- a/docs/sources/configuration/examples/almost-zero-dependency.yaml +++ b/docs/sources/configuration/examples/almost-zero-dependency.yaml @@ -1,5 +1,5 @@ # This is a configuration to deploy Loki depending only on a storage solution -# e.g. an S3-compatible API like MinIO. +# for example, an S3-compatible API like MinIO. # The ring configuration is based on the gossip memberlist and the index is shipped to storage # via Single Store (boltdb-shipper) diff --git a/docs/sources/configuration/examples/aws-basic-config-no-creds.yaml b/docs/sources/configuration/examples/aws-basic-config-no-creds.yaml index 42f4da3b4832..98f352f6d3fb 100644 --- a/docs/sources/configuration/examples/aws-basic-config-no-creds.yaml +++ b/docs/sources/configuration/examples/aws-basic-config-no-creds.yaml @@ -13,4 +13,5 @@ storage_config: aws: s3: s3://region/bucket_name dynamodb: - dynamodb_url: dynamodb://region \ No newline at end of file + dynamodb_url: dynamodb://region + \ No newline at end of file diff --git a/docs/sources/configuration/examples/aws-basic-config.yaml b/docs/sources/configuration/examples/aws-basic-config.yaml index a709c905acc4..0d69a7182ff7 100644 --- a/docs/sources/configuration/examples/aws-basic-config.yaml +++ b/docs/sources/configuration/examples/aws-basic-config.yaml @@ -1,4 +1,4 @@ -# This is a partial config that uses S3 for chunk storage and DynamoDB for index storage +# This partial configuration uses S3 for chunk storage and uses DynamoDB for index storage schema_config: configs: @@ -12,4 +12,5 @@ storage_config: aws: s3: s3://access_key:secret_access_key@region/bucket_name dynamodb: - dynamodb_url: dynamodb://access_key:secret_access_key@region \ No newline at end of file + dynamodb_url: dynamodb://access_key:secret_access_key@region + \ No newline at end of file diff --git a/docs/sources/configuration/examples/cassandra-index.yaml b/docs/sources/configuration/examples/cassandra-index.yaml index c01ff1facf32..03b37682a9d1 100644 --- a/docs/sources/configuration/examples/cassandra-index.yaml +++ b/docs/sources/configuration/examples/cassandra-index.yaml @@ -19,4 +19,5 @@ storage_config: keyspace: lokiindex filesystem: - directory: /tmp/loki/chunks \ No newline at end of file + directory: /tmp/loki/chunks + \ No newline at end of file diff --git a/docs/sources/configuration/examples/example-schema-config.yaml b/docs/sources/configuration/examples/example-schema-config.yaml index dc7d4156b1f4..618f8dafe442 100644 --- a/docs/sources/configuration/examples/example-schema-config.yaml +++ b/docs/sources/configuration/examples/example-schema-config.yaml @@ -1,4 +1,4 @@ -# Additional example schema configs for Cassandra +# Additional example schema configuration for Cassandra schema_config: configs: @@ -20,4 +20,5 @@ schema_config: schema: v11 index: period: 168h - prefix: index_ \ No newline at end of file + prefix: index_ + \ No newline at end of file diff --git a/docs/sources/configuration/examples/google-cloud-storage-config.yaml b/docs/sources/configuration/examples/google-cloud-storage-config.yaml index f4c909f3a0a9..c76d90dac24e 100644 --- a/docs/sources/configuration/examples/google-cloud-storage-config.yaml +++ b/docs/sources/configuration/examples/google-cloud-storage-config.yaml @@ -1,4 +1,4 @@ -# This is a partial config that uses GCS for chunk storage and BigTable for index storage +# This partial configuration uses GCS for chunk storage and uses BigTable for index storage schema_config: configs: @@ -15,4 +15,5 @@ storage_config: instance: BIGTABLE_INSTANCE project: BIGTABLE_PROJECT gcs: - bucket_name: GCS_BUCKET_NAME \ No newline at end of file + bucket_name: GCS_BUCKET_NAME + \ No newline at end of file diff --git a/docs/sources/configuration/examples/s3-compatible-apis.yaml b/docs/sources/configuration/examples/s3-compatible-apis.yaml index a3e5835e7c98..6631cbb119a0 100644 --- a/docs/sources/configuration/examples/s3-compatible-apis.yaml +++ b/docs/sources/configuration/examples/s3-compatible-apis.yaml @@ -1,5 +1,5 @@ -# S3-compatible APIs (e.g. Ceph Object Storage with an S3-compatible API) can be used. -# If the API supports path-style URL rather than virtual hosted bucket addressing, +# S3-compatible APIs such as Ceph Object Storage with an S3-compatible API, can be used. +# If the API supports path-style URLs rather than virtual hosted bucket addressing, # configure the URL in `storage_config` with the custom endpoint schema_config: @@ -14,4 +14,5 @@ storage_config: aws: s3: s3://access_key:secret_access_key@region/bucket_name dynamodb: - dynamodb_url: dynamodb://access_key:secret_access_key@region \ No newline at end of file + dynamodb_url: dynamodb://access_key:secret_access_key@region + \ No newline at end of file diff --git a/docs/sources/configuration/examples/s3-expanded-config.yaml b/docs/sources/configuration/examples/s3-expanded-config.yaml index 252a199637b8..a407ade3c65c 100644 --- a/docs/sources/configuration/examples/s3-expanded-config.yaml +++ b/docs/sources/configuration/examples/s3-expanded-config.yaml @@ -1,5 +1,5 @@ -# S3 config now supports expanded config. -# Either `s3` endpoint URL can be used or expanded config can be used +# S3 configuration supports an expanded configuration. +# Either an `s3` endpoint URL can be used, or an expanded configuration can be used. schema_config: configs: @@ -22,4 +22,5 @@ storage_config: idle_conn_timeout: 90s response_header_timeout: 0s insecure_skip_verify: false - s3forcepathstyle: true \ No newline at end of file + s3forcepathstyle: true + \ No newline at end of file From f0954dfd0cf1ee168da81bf2062904336835c9e5 Mon Sep 17 00:00:00 2001 From: Jordan Rushing Date: Fri, 8 Oct 2021 16:11:09 -0500 Subject: [PATCH 18/18] Regenerate examples.md --- docs/sources/configuration/examples.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/docs/sources/configuration/examples.md b/docs/sources/configuration/examples.md index ad0db8dc5e3d..0a54ff7e9170 100644 --- a/docs/sources/configuration/examples.md +++ b/docs/sources/configuration/examples.md @@ -7,7 +7,7 @@ title: Examples ```yaml # This is a configuration to deploy Loki depending only on a storage solution -# e.g. an S3-compatible API like minio. +# for example, an S3-compatible API like MinIO. # The ring configuration is based on the gossip memberlist and the index is shipped to storage # via Single Store (boltdb-shipper) @@ -98,13 +98,14 @@ storage_config: s3: s3://region/bucket_name dynamodb: dynamodb_url: dynamodb://region + ``` ## aws-basic-config.yaml ```yaml -# This is a partial config that uses S3 for chunk storage and DynamoDB for index storage +# This partial configuration uses S3 for chunk storage and uses DynamoDB for index storage schema_config: configs: @@ -119,6 +120,7 @@ storage_config: s3: s3://access_key:secret_access_key@region/bucket_name dynamodb: dynamodb_url: dynamodb://access_key:secret_access_key@region + ``` @@ -147,6 +149,7 @@ storage_config: filesystem: directory: /tmp/loki/chunks + ``` @@ -196,7 +199,7 @@ limits_config: ## example-schema-config.yaml ```yaml -# Additional example schema configs for Cassandra +# Additional example schema configuration for Cassandra schema_config: configs: @@ -219,13 +222,14 @@ schema_config: index: period: 168h prefix: index_ + ``` ## google-cloud-storage-config.yaml ```yaml -# This is a partial config that uses GCS for chunk storage and BigTable for index storage +# This partial configuration uses GCS for chunk storage and uses BigTable for index storage schema_config: configs: @@ -243,14 +247,15 @@ storage_config: project: BIGTABLE_PROJECT gcs: bucket_name: GCS_BUCKET_NAME + ``` ## s3-compatible-apis.yaml ```yaml -# S3-compatible APIs (e.g. Ceph Object Storage with an S3-compatible API) can be used. -# If the API supports path-style URL rather than virtual hosted bucket addressing, +# S3-compatible APIs such as Ceph Object Storage with an S3-compatible API, can be used. +# If the API supports path-style URLs rather than virtual hosted bucket addressing, # configure the URL in `storage_config` with the custom endpoint schema_config: @@ -266,14 +271,15 @@ storage_config: s3: s3://access_key:secret_access_key@region/bucket_name dynamodb: dynamodb_url: dynamodb://access_key:secret_access_key@region + ``` ## s3-expanded-config.yaml ```yaml -# S3 config now supports expanded config. -# Either `s3` endpoint URL can be used or expanded config can be used +# S3 configuration supports an expanded configuration. +# Either an `s3` endpoint URL can be used, or an expanded configuration can be used. schema_config: configs: @@ -297,5 +303,6 @@ storage_config: response_header_timeout: 0s insecure_skip_verify: false s3forcepathstyle: true + ```