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

log payloads, and add grpc duration as an integer #1615

Merged
merged 2 commits into from
Oct 26, 2023
Merged

Conversation

vroldanbet
Copy link
Contributor

@vroldanbet vroldanbet commented Oct 26, 2023

in order to better troubleshoot certain situations, it would be useful to load request and response payloads.

Also in certain log aggregators it's not possible to convert duration fields that are represented as a string, and this is useful in order to filter requests by a specific duration threshold. This commit changes the duration function to log it as an integer

Adds options to control request and response payloads via CLI

@vroldanbet vroldanbet requested a review from a team October 26, 2023 11:58
@vroldanbet vroldanbet changed the title log payloads and duration as an integer log payloads, and add grpc duration as an integer Oct 26, 2023
@github-actions github-actions bot added the area/CLI Affects the command line label Oct 26, 2023
@github-actions github-actions bot added area/dependencies Affects dependencies area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) labels Oct 26, 2023
@vroldanbet vroldanbet changed the base branch from main to grpc-health-prove-grpc-cve October 26, 2023 12:08
Base automatically changed from grpc-health-prove-grpc-cve to main October 26, 2023 15:16
@github-actions github-actions bot removed the area/dependencies Affects dependencies label Oct 26, 2023
pkg/cmd/serve.go Outdated
@@ -47,6 +47,10 @@ func RegisterServeFlags(cmd *cobra.Command, config *server.Config) error {
config.DispatchClusterMetricsEnabled = true
config.DispatchClientMetricsEnabled = true

// Flags for logging
cmd.Flags().BoolVar(&config.EnableRequestLogs, "enable-request-logs", false, "logs API request payloads")
Copy link
Member

Choose a reason for hiding this comment

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

Flags need to be named with a prefix for the subsystem they control, so that they are grouped together.
We should prefix this with grpc or log; probably log.

Any existing flags that start with enable were mistakes and should probably have their flags hidden and new ones introduced.

Copy link
Member

Choose a reason for hiding this comment

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

grpc-request-logs-enabled grpc-repsonse-logs-enabled

in order to better troubleshoot certain situations,
it would be useful to load request and response payloads.

Also in certain log aggregators it's not possible to convert
duration fields that are represented as a string, and
this is useful in order to filter requests by a specific
duration threshold. This commit changes the duration function
to log it as an integer
@jzelinskie jzelinskie enabled auto-merge October 26, 2023 21:09
@jzelinskie jzelinskie added this pull request to the merge queue Oct 26, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 26, 2023
@jzelinskie jzelinskie added this pull request to the merge queue Oct 26, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 26, 2023
@vroldanbet vroldanbet added this pull request to the merge queue Oct 26, 2023
Merged via the queue into main with commit aec1c86 Oct 26, 2023
@vroldanbet vroldanbet deleted the tweak-logs branch October 26, 2023 22:21
@github-actions github-actions bot locked and limited conversation to collaborators Oct 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/CLI Affects the command line area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants