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

Change query log config format from JSON to TABLE #257

Merged
merged 11 commits into from
Oct 24, 2024

Conversation

bhupendray-yb
Copy link
Contributor

@bhupendray-yb bhupendray-yb commented Oct 21, 2024

Summary

  • Change DB query log config format from JSON to TABLE.
  • Show Integration Name instead of Integration ID in output.
  • Fixed unit tests
  • Added a new test for update log config subcommand flow, when changing the integration name/id for an existing log export config.
  • Added support for json/pretty output format.

Old Output:

State      Integration ID                         Log Config
ENABLING   9e740000-331b-4dec-89b0-4e59b81e9019   {"debug_print_plan":false,"log_connections":false,"log_disconnections":false,"log_duration":false,"log_error_verbosity":"DEFAULT","log_line_prefix":"\%m :\%r :\%u @ \%d :\[\%p\] :","log_min_duration_statement":-1,"log_min_error_statement":"ERROR","log_statement":"NONE"}

New Output:

# in table format
State     Integration Name
ACTIVE    bhupendray-db-logging

Log Config Key               Log Config Value
debug-print-plan             false
log-min-duration-statement   42
log-connections              false
log-disconnections           false
log-duration                 true
log-error-verbosity          DEFAULT
log-statement                ALL
log-min-error-statement      ERROR
log-line-prefix              %m :%r :%u @ %d %a :[%p] :

# In JSON format
$ make build && ./ybm cluster db-query-logging describe --cluster-name bhupendray-cluster -ojson
{"info":{"cluster_id":"8f0adf54-cc93-4298-b942-36bb669c3fe7","id":"f7933fd1-5e3c-4c92-a4a2-73853737d3dd","metadata":{"created_on":"2024-10-07T10:28:55.148Z","updated_on":"2024-10-22T11:16:49.373Z"},"state":"ACTIVE"},"spec":{"export_config":{"debug_print_plan":false,"log_connections":false,"log_disconnections":false,"log_duration":false,"log_error_verbosity":"DEFAULT","log_line_prefix":"%m :%r :%u @ %d :[%p] :","log_min_duration_statement":-1,"log_min_error_statement":"ERROR","log_statement":"NONE"},"exporter_id":"7eb1b884-600e-4a91-a92c-9ee79b754e11"}}

Base automatically changed from feat/db_query_log_exporter to main October 22, 2024 08:40
Copy link
Collaborator

@posriniv posriniv left a comment

Choose a reason for hiding this comment

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

Looks okay to me. Let's wait for a feature related review from @Siddarth-Baldwa and @bansal01yash too.

Copy link
Contributor

@Siddarth-Baldwa Siddarth-Baldwa left a comment

Choose a reason for hiding this comment

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

Minor nit. Rest lgtm

cmd/cluster/log-exporter/query_log_exporter.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@posriniv posriniv left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@bhupendray-yb bhupendray-yb merged commit 2e83931 into main Oct 24, 2024
2 checks passed
@bhupendray-yb bhupendray-yb deleted the feat/log-config-tbl-format branch October 24, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants