-
Notifications
You must be signed in to change notification settings - Fork 820
Only output config parameters that differ from the defaults for /config
endpoint
#3645
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
Only output config parameters that differ from the defaults for /config
endpoint
#3645
Conversation
This is the example output for using auth_enabled: false
blocks_storage:
backend: filesystem
bucket_store:
sync_dir: /tmp/cortex/tsdb-sync
filesystem:
dir: ./data/tsdb
tsdb:
dir: /tmp/cortex/tsdb
compactor:
data_dir: /tmp/cortex/compactor
sharding_ring:
kvstore:
store: inmemory
distributor:
shard_by_all_labels: true
frontend_worker:
match_max_concurrent: true
ingester:
lifecycler:
address: 127.0.0.1
final_sleep: 0s
min_ready_duration: 0s
num_tokens: 512
ring:
kvstore:
store: inmemory
replication_factor: 1
ingester_client:
grpc_client_config:
grpc_compression: gzip
max_send_msg_size: 104857600
ruler:
enable_api: true
storage:
local:
directory: /tmp/cortex/rules
type: local
server:
grpc_server_max_concurrent_streams: 1000
grpc_server_max_recv_msg_size: 104857600
grpc_server_max_send_msg_size: 104857600
http_listen_port: 9009
storage:
engine: blocks |
@simonswine I see a value in this change, but what do you think about enabling this logic via a query string parameter passed to the |
9e55df7
to
55662d5
Compare
55662d5
to
24cef90
Compare
/config
endpoint/config
endpoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you! This is very useful!
This adds a `mode` query parameter for the config endpoint: - `/config?mode=diff`: Shows the YAML configuration with all values that differ from the defaults. - `/config?mode=defaults`: Shows the YAML configuration with all the default values. Signed-off-by: Christian Simon <simon@swine.de>
24cef90
to
cf080b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love it, well done! 👏
defaultFS := flag.NewFlagSet("", flag.PanicOnError) | ||
defaultConfig.RegisterFlags(defaultFS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[non blocking, just FYI] You can achieve the same with flagext.DefaultValues()
.
What this PR does:
This changes the behaviour of the config endpoint to only show the config values that have really changed towards the default config.
I personally get lost quite often in the very verbose output of the user's configuration that includes the defaults. This tries to solve that by only show values that differ from the defaults.
Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]