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

Add config endpoint #3228

Merged
merged 2 commits into from
Jan 26, 2021
Merged

Conversation

MichelHollands
Copy link
Contributor

@MichelHollands MichelHollands commented Jan 25, 2021

This PR adds a /config endpoint which works the same as in Cortex. See the documentation for an explanation of the mode parameter.

Here's an example running it against Loki running in a Docker container built by the Makefile:

cortex % curl "http://localhost:3100/config?mode=diff"
compactor:
  shared_store: filesystem
  working_directory: /loki/boltdb-shipper-compactor
ingester:
  chunk_idle_period: 1h0m0s
  chunk_retain_period: 30s
  chunk_target_size: 1048576
  lifecycler:
    address: 127.0.0.1
    final_sleep: 0s
    ring:
      kvstore:
        store: inmemory
      replication_factor: 1
  query_store_max_look_back_period: 1h21m0s
limits_config:
  reject_old_samples: true
  reject_old_samples_max_age: 168h0m0s
ruler:
  alertmanager_url: http://localhost:9093
  enable_api: true
  ring:
    kvstore:
      store: inmemory
  rule_path: /loki/rules-temp
  storage:
    local:
      directory: /loki/rules
    type: local
schema_config:
  configs:
  - chunks:
      period: 0s
      prefix: ""
      tags: {}
    from: "2020-10-24"
    index:
      period: 1d
      prefix: index_
      tags: {}
    object_store: filesystem
    row_shards: 16
    schema: v11
    store: boltdb-shipper
server:
  http_listen_port: 3100
storage_config:
  boltdb_shipper:
    active_index_directory: /loki/boltdb-shipper-active
    cache_location: /loki/boltdb-shipper-cache
    shared_store: filesystem
  filesystem:
    directory: /loki/chunks
cortex %

Checklist

  • Documentation added
  • Tests updated

Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
@codecov-io
Copy link

Codecov Report

Merging #3228 (929f909) into master (0208071) will increase coverage by 0.01%.
The diff coverage is 57.69%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3228      +/-   ##
==========================================
+ Coverage   63.20%   63.22%   +0.01%     
==========================================
  Files         197      198       +1     
  Lines       16685    16763      +78     
==========================================
+ Hits        10546    10598      +52     
- Misses       5184     5197      +13     
- Partials      955      968      +13     
Impacted Files Coverage Δ
pkg/loki/loki.go 0.00% <0.00%> (ø)
pkg/loki/config_handler.go 61.64% <61.64%> (ø)
pkg/querier/queryrange/limits.go 91.66% <0.00%> (-4.17%) ⬇️
pkg/logql/evaluator.go 89.87% <0.00%> (-0.36%) ⬇️
pkg/promtail/positions/positions.go 58.51% <0.00%> (+11.70%) ⬆️

Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

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

LGTM Nice one !

@cyriltovena cyriltovena merged commit 2afebbc into grafana:master Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants