Skip to content

Commit

Permalink
Merge branch 'main' into poyzannur/change-tokenizer-to-work-with-seri…
Browse files Browse the repository at this point in the history
…esWithBloom
  • Loading branch information
poyzannur authored Nov 1, 2023
2 parents 91f6737 + fb6f6d2 commit 29ba897
Show file tree
Hide file tree
Showing 216 changed files with 3,045 additions and 1,578 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Fixes #<issue number>
- [ ] If the change is worth mentioning in the release notes, add `add-to-release-notes` label
- [ ] Changes that require user attention or interaction to upgrade are documented in `docs/sources/setup/upgrade/_index.md`
- [ ] For Helm chart changes bump the Helm chart version in `production/helm/loki/Chart.yaml` and update `production/helm/loki/CHANGELOG.md` and `production/helm/loki/README.md`. [Example PR](https://github.com/grafana/loki/commit/d10549e3ece02120974929894ee333d07755d213)
- [ ] If the change is deprecating or removing a configuration option, update the `deprecated-config.yaml` and `deleted-config.yaml` files respectively in the `tools/deprecated-config-checker` directory. <!-- TODO(salvacorts): Add example PR -->
- [ ] If the change is deprecating or removing a configuration option, update the `deprecated-config.yaml` and `deleted-config.yaml` files respectively in the `tools/deprecated-config-checker` directory. [Example PR](https://github.com/grafana/loki/pull/10840/commits/0d4416a4b03739583349934b96f272fb4f685d15)
3 changes: 2 additions & 1 deletion .github/workflows/helm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
python-version: 3.7

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.4.0
uses: helm/chart-testing-action@v2.6.0

- name: Run chart-testing (list-changed)
id: list-changed
Expand All @@ -72,6 +72,7 @@ jobs:
- name: Run chart-testing (lint)
run: ct lint --config "${CT_CONFIGFILE}" --check-version-increment=false
timeout-minutes: 10

- name: Create kind cluster
uses: helm/[email protected]
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ pkg/loki/wal

# nix
nix/result

# snyk
.dccache
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

##### Enhancements

* [11086](https://github.com/grafana/loki/pull/11086) **kandrew5**: Helm: Allow topologySpreadConstraints
* [11003](https://github.com/grafana/loki/pull/11003) **MichelHollands**: Add the `metrics-namespace` flag to change the namespace of metrics currently using cortex as namespace.
* [10096](https://github.com/grafana/loki/pull/10096) **aschleck**: Storage: Allow setting a constant prefix for all created keys
* [11038](https://github.com/grafana/loki/pull/11038) **kavirajk**: Remove already deprecated `store.max-look-back-period`.
* [10906](https://github.com/grafana/loki/pull/10906) **kavirajk**: Support Loki ruler to notify WAL writes to remote storage.
* [10613](https://github.com/grafana/loki/pull/10613) **ngc4579**: Helm: allow GrafanaAgent tolerations
Expand All @@ -25,11 +28,12 @@
* [10709](https://github.com/grafana/loki/pull/10709) **chaudum**/**salvacorts** Remove `ingester.max-transfer-retries` configuration option in favor of using the WAL.
* [10736](https://github.com/grafana/loki/pull/10736) **ashwanthgoli** Deprecate write dedupe cache as this is not required by the newer single store indexes (tsdb and boltdb-shipper).
* [10693](https://github.com/grafana/loki/pull/10693) **ashwanthgoli** Embedded cache: Updates the metric prefix from `querier_cache_` to `loki_embeddedcache_` and removes duplicate metrics.
* [10840](https://github.com/grafana/loki/pull/10840) **ashwanthgoli** Removes `shared_store` and `shared_store_key_prefix` from tsdb, boltdb shipper and compactor configs and their corresponding CLI flags.
* [10793](https://github.com/grafana/loki/pull/10793) **ashwanthgoli** Config: Better configuration defaults to provide a better experience for users out of the box.
* [10785](https://github.com/grafana/loki/pull/10785) **ashwanthgoli** Config: Removes `querier.worker-parallelism` and updates default value of `querier.max-concurrent` to 4.
* [10733](https://github.com/grafana/loki/pull/10733) **shantanualsi** Add support for case-insensitive logql funtions
* [10727](https://github.com/grafana/loki/pull/10727) **sandeepsukhani** Native otlp ingestion support

* [11051](https://github.com/grafana/loki/pull/11051) Refactor to not use global logger in modules
##### Fixes

##### Changes
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -831,5 +831,15 @@ dev-k3d-down:
$(MAKE) -C $(CURDIR)/tools/dev/k3d down

# Trivy is used to scan images for vulnerabilities
.PHONY: trivy
trivy: loki-image
trivy i $(IMAGE_PREFIX)/loki:$(IMAGE_TAG)

# Synk is also used to scan for vulnerabilities, and detects things that trivy might miss
.PHONY: snyk
snyk: loki-image
snyk container test $(IMAGE_PREFIX)/loki:$(IMAGE_TAG)
snyk code test

.PHONY: scan-vulnerabilities
scan-vulnerabilities: trivy snyk
6 changes: 2 additions & 4 deletions clients/pkg/promtail/targets/windows/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import (
"github.com/grafana/loki/clients/pkg/promtail/scrapeconfig"
"github.com/grafana/loki/clients/pkg/promtail/targets/target"
"github.com/grafana/loki/clients/pkg/promtail/targets/windows/win_eventlog"

util_log "github.com/grafana/loki/pkg/util/log"
)

var fs = afero.NewOsFs()
Expand Down Expand Up @@ -115,7 +113,7 @@ func (t *Target) loop() {
if err != nil {
if err != win_eventlog.ERROR_NO_MORE_ITEMS {
t.err = err
level.Error(util_log.Logger).Log("msg", "error fetching events", "err", err)
level.Error(t.logger).Log("msg", "error fetching events", "err", err)
}
break loop
}
Expand All @@ -125,7 +123,7 @@ func (t *Target) loop() {
t.handler.Chan() <- entry
if err := t.bm.save(handles[i]); err != nil {
t.err = err
level.Error(util_log.Logger).Log("msg", "error saving bookmark", "err", err)
level.Error(t.logger).Log("msg", "error saving bookmark", "err", err)
}
}
win_eventlog.Close(handles)
Expand Down
3 changes: 2 additions & 1 deletion cmd/logcli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,8 @@ func newQuery(instant bool, cmd *kingpin.CmdClause) *query.Query {
cmd.Flag("include-label", "Include labels given the provided key during output.").StringsVar(&q.ShowLabelsKey)
cmd.Flag("labels-length", "Set a fixed padding to labels").Default("0").IntVar(&q.FixedLabelsLen)
cmd.Flag("store-config", "Execute the current query using a configured storage from a given Loki configuration file.").Default("").StringVar(&q.LocalConfig)
cmd.Flag("remote-schema", "Execute the current query using a remote schema retrieved using the configured storage in the given Loki configuration file.").Default("false").BoolVar(&q.FetchSchemaFromStorage)
cmd.Flag("remote-schema", "Execute the current query using a remote schema retrieved from the configured -schema-store.").Default("false").BoolVar(&q.FetchSchemaFromStorage)
cmd.Flag("schema-store", "Store used for retrieving remote schema.").Default("").StringVar(&q.SchemaStore)
cmd.Flag("colored-output", "Show output with colored labels").Default("false").BoolVar(&q.ColoredOutput)

return q
Expand Down
5 changes: 3 additions & 2 deletions cmd/migrate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func main() {
batch := flag.Int("batchLen", 500, "Specify how many chunks to read/write in one batch")
shardBy := flag.Duration("shardBy", 6*time.Hour, "Break down the total interval into shards of this size, making this too small can lead to syncing a lot of duplicate chunks")
parallel := flag.Int("parallel", 8, "How many parallel threads to process each shard")
metricsNamespace := flag.String("metrics.namespace", "cortex", "Namespace of the generated metrics")
flag.Parse()

go func() {
Expand Down Expand Up @@ -127,7 +128,7 @@ func main() {
// Create a new registerer to avoid registering duplicate metrics
prometheus.DefaultRegisterer = prometheus.NewRegistry()
clientMetrics := storage.NewClientMetrics()
s, err := storage.NewStore(sourceConfig.StorageConfig, sourceConfig.ChunkStoreConfig, sourceConfig.SchemaConfig, limits, clientMetrics, prometheus.DefaultRegisterer, util_log.Logger)
s, err := storage.NewStore(sourceConfig.StorageConfig, sourceConfig.ChunkStoreConfig, sourceConfig.SchemaConfig, limits, clientMetrics, prometheus.DefaultRegisterer, util_log.Logger, *metricsNamespace)
if err != nil {
log.Println("Failed to create source store:", err)
os.Exit(1)
Expand All @@ -136,7 +137,7 @@ func main() {
// Create a new registerer to avoid registering duplicate metrics
prometheus.DefaultRegisterer = prometheus.NewRegistry()

d, err := storage.NewStore(destConfig.StorageConfig, destConfig.ChunkStoreConfig, destConfig.SchemaConfig, limits, clientMetrics, prometheus.DefaultRegisterer, util_log.Logger)
d, err := storage.NewStore(destConfig.StorageConfig, destConfig.ChunkStoreConfig, destConfig.SchemaConfig, limits, clientMetrics, prometheus.DefaultRegisterer, util_log.Logger, *metricsNamespace)
if err != nil {
log.Println("Failed to create destination store:", err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/querytee/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func main() {
registry := prometheus.NewRegistry()
registry.MustRegister(collectors.NewGoCollector())

i := querytee.NewInstrumentationServer(cfg.ServerMetricsPort, registry)
i := querytee.NewInstrumentationServer(cfg.ServerMetricsPort, registry, util_log.Logger)
if err := i.Start(); err != nil {
level.Error(util_log.Logger).Log("msg", "Unable to start instrumentation server", "err", err.Error())
os.Exit(1)
Expand Down
56 changes: 19 additions & 37 deletions docs/sources/configure/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ Pass the `-config.expand-env` flag at the command line to enable this way of set
# will report 503 Service Unavailable status via /ready endpoint.
# CLI flag: -shutdown-delay
[shutdown_delay: <duration> | default = 0s]

# Namespace of the metrics that in previous releases had cortex as namespace.
# CLI flag: -metrics-namespace
[metrics_namespace: <string> | default = "cortex"]
```
### server
Expand Down Expand Up @@ -2096,6 +2100,11 @@ congestion_control:
# CLI flag: -store.congestion-control.hedge.strategy
[strategy: <string> | default = ""]

# Experimental. Sets a constant prefix for all keys inserted into object
# storage. Example: loki/
# CLI flag: -store.object-prefix
[object_prefix: <string> | default = ""]

# The cache block configures the cache backend.
# The CLI flags prefix for this block configuration is: store.index-cache-read
[index_queries_cache_config: <cache_config>]
Expand All @@ -2122,17 +2131,6 @@ boltdb_shipper:
# CLI flag: -boltdb.shipper.active-index-directory
[active_index_directory: <string> | default = ""]

# Shared store for keeping index files. Supported types: gcs, s3, azure, cos,
# filesystem
# CLI flag: -boltdb.shipper.shared-store
[shared_store: <string> | default = ""]

# Prefix to add to Object Keys in Shared store. Path separator(if any) should
# always be a '/'. Prefix should never start with a separator but should
# always end with it
# CLI flag: -boltdb.shipper.shared-store.key-prefix
[shared_store_key_prefix: <string> | default = "index/"]

# Cache location for restoring index files from storage for queries
# CLI flag: -boltdb.shipper.cache-location
[cache_location: <string> | default = ""]
Expand Down Expand Up @@ -2188,17 +2186,6 @@ tsdb_shipper:
# CLI flag: -tsdb.shipper.active-index-directory
[active_index_directory: <string> | default = ""]

# Shared store for keeping index files. Supported types: gcs, s3, azure, cos,
# filesystem
# CLI flag: -tsdb.shipper.shared-store
[shared_store: <string> | default = ""]

# Prefix to add to Object Keys in Shared store. Path separator(if any) should
# always be a '/'. Prefix should never start with a separator but should
# always end with it
# CLI flag: -tsdb.shipper.shared-store.key-prefix
[shared_store_key_prefix: <string> | default = "index/"]

# Cache location for restoring index files from storage for queries
# CLI flag: -tsdb.shipper.cache-location
[cache_location: <string> | default = ""]
Expand Down Expand Up @@ -2291,19 +2278,6 @@ The `compactor` block configures the compactor component, which compacts index s
# CLI flag: -compactor.working-directory
[working_directory: <string> | default = ""]
# The shared store used for storing boltdb files. Supported types: gcs, s3,
# azure, swift, filesystem, bos, cos. If not set, compactor will be initialized
# to operate on all the object stores that contain either boltdb-shipper or tsdb
# index.
# CLI flag: -compactor.shared-store
[shared_store: <string> | default = ""]
# Prefix to add to object keys in shared store. Path separator(if any) should
# always be a '/'. Prefix should never start with a separator but should always
# end with it.
# CLI flag: -compactor.shared-store.key-prefix
[shared_store_key_prefix: <string> | default = "index/"]
# Interval at which to re-run the compaction operation.
# CLI flag: -compactor.compaction-interval
[compaction_interval: <duration> | default = 10m]
Expand Down Expand Up @@ -2331,10 +2305,14 @@ The `compactor` block configures the compactor component, which compacts index s
# CLI flag: -compactor.retention-table-timeout
[retention_table_timeout: <duration> | default = 0s]
# Store used for managing delete requests. Defaults to -compactor.shared-store.
# Store used for managing delete requests.
# CLI flag: -compactor.delete-request-store
[delete_request_store: <string> | default = ""]
# Path prefix for storing delete requests.
# CLI flag: -compactor.delete-request-store.key-prefix
[delete_request_store_key_prefix: <string> | default = "index/"]
# The max number of delete requests to run per compaction cycle.
# CLI flag: -compactor.delete-batch-size
[delete_batch_size: <int> | default = 70]
Expand Down Expand Up @@ -3578,7 +3556,7 @@ ring:
# CLI flag: -common.storage.ring.instance-enable-ipv6
[instance_enable_ipv6: <boolean> | default = false]
[instance_interface_names: <list of strings>]
[instance_interface_names: <list of strings> | default = [<private network interfaces>]]
[instance_addr: <string> | default = ""]
Expand Down Expand Up @@ -4364,6 +4342,10 @@ The `period_config` block configures what index schemas should be used for from
# Configures how the index is updated and stored.
index:
# Path prefix for index tables. Prefix always needs to end with a path
# delimiter '/', except when the prefix is empty.
[path_prefix: <string> | default = "index/"]
# Table prefix for all period tables.
[prefix: <string> | default = ""]
Expand Down
11 changes: 0 additions & 11 deletions docs/sources/configure/examples/configuration-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ storage_config:
tsdb_shipper:
active_index_directory: /tmp/loki/index
cache_location: /tmp/loki/index_cache
shared_store: filesystem
filesystem:
directory: /tmp/loki/chunks

Expand Down Expand Up @@ -81,7 +80,6 @@ storage_config:
tsdb_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
Expand Down Expand Up @@ -138,10 +136,8 @@ storage_config:
tsdb_shipper:
active_index_directory: /loki/index
cache_location: /loki/index_cache
shared_store: gcs
gcs:
bucket_name: replace_by_your_bucked_name


```

Expand All @@ -167,7 +163,6 @@ storage_config:
tsdb_shipper:
active_index_directory: /loki/index
cache_location: /loki/index_cache
shared_store: bos
bos:
bucket_name: bucket_name_1
endpoint: bj.bcebos.com
Expand All @@ -186,7 +181,6 @@ storage_config:

compactor:
working_directory: /tmp/loki/compactor
shared_store: s3
compaction_interval: 5m

```
Expand Down Expand Up @@ -218,7 +212,6 @@ schema_config:
index:
period: 24h
prefix: index_


```

Expand All @@ -243,7 +236,6 @@ storage_config:
tsdb_shipper:
active_index_directory: /loki/index
cache_location: /loki/index_cache
shared_store: alibabacloud
alibabacloud:
bucket: <bucket>
endpoint: <endpoint>
Expand Down Expand Up @@ -314,7 +306,6 @@ storage_config:
tsdb_shipper:
active_index_directory: /loki/index
cache_location: /loki/index_cache
shared_store: cos
cos:
bucketnames: <bucket1, bucket2>
endpoint: <endpoint>
Expand Down Expand Up @@ -345,7 +336,6 @@ storage_config:
tsdb_shipper:
active_index_directory: /loki/index
cache_location: /loki/index_cache
shared_store: cos
cos:
bucketnames: <bucket1, bucket2>
endpoint: <endpoint>
Expand Down Expand Up @@ -383,7 +373,6 @@ storage_config:
tsdb_shipper:
active_index_directory: /loki/index
cache_location: /loki/index_cache
shared_store: cos
cos:
bucketnames: <bucket1, bucket2>
endpoint: <endpoint>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@ storage_config:
tsdb_shipper:
active_index_directory: /tmp/loki/index
cache_location: /tmp/loki/index_cache
shared_store: filesystem
filesystem:
directory: /tmp/loki/chunks
directory: /tmp/loki/chunks
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ storage_config:
tsdb_shipper:
active_index_directory: /loki/index
cache_location: /loki/index_cache
shared_store: cos
cos:
bucketnames: <bucket1, bucket2>
endpoint: <endpoint>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ storage_config:
tsdb_shipper:
active_index_directory: /loki/index
cache_location: /loki/index_cache
shared_store: cos
cos:
bucketnames: <bucket1, bucket2>
endpoint: <endpoint>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ storage_config:
tsdb_shipper:
active_index_directory: /loki/index
cache_location: /loki/index_cache
shared_store: cos
cos:
bucketnames: <bucket1, bucket2>
endpoint: <endpoint>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ storage_config:
tsdb_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
s3forcepathstyle: true
2 changes: 0 additions & 2 deletions docs/sources/configure/examples/yaml/4-GCS-Example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,5 @@ storage_config:
tsdb_shipper:
active_index_directory: /loki/index
cache_location: /loki/index_cache
shared_store: gcs
gcs:
bucket_name: replace_by_your_bucked_name

Loading

0 comments on commit 29ba897

Please sign in to comment.