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

feat: Added extra fields for sentry #1203

Merged
merged 11 commits into from
Dec 18, 2023

Conversation

PranshuSrivastava
Copy link
Member

Related Issue

Currently there were very few fields being sent to sentry which was making it hard to debug

Describe the changes you've made

Add 4 new fields to all the events being sent by sentry using the zap logger

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>
Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>
Copy link

sweep-ai bot commented Dec 14, 2023

Apply Sweep Rules to your PR?

  • Apply: All new business logic should have corresponding unit tests.
  • Apply: Refactor large functions to be more modular.
  • Apply: Add docstrings to all functions and file headers.

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>
Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>
Copy link
Member

@charankamarapu charankamarapu left a comment

Choose a reason for hiding this comment

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

Please remove the keploy test folder and address the comments

cmd/root.go Outdated
@@ -124,8 +127,35 @@ func modifyToSentryLogger(log *zap.Logger, client *sentry.Client) *zap.Logger {
}

log = zapsentry.AttachCoreToLogger(core, log)

return log.With(zapsentry.NewScope())
kernelVersion := "Not linux"
Copy link
Member

Choose a reason for hiding this comment

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

What is the significance of this value..?

Copy link
Member Author

Choose a reason for hiding this comment

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

reverted

@keploy keploy deleted a comment from charankamarapu Dec 15, 2023
@keploy keploy deleted a comment from charankamarapu Dec 15, 2023
@keploy keploy deleted a comment from charankamarapu Dec 15, 2023
PranshuSrivastava and others added 5 commits December 15, 2023 12:59
Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>
Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>
Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>
Copy link
Member

@charankamarapu charankamarapu left a comment

Choose a reason for hiding this comment

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

Please resolve the comments and change the alias in read me and inform the respective people regarding change in alias.

cmd/record.go Outdated
} else {
fmt.Println("Example usage:\n", cmd.Example)
}
fmt.Println("Error: missing required -c flag or appCmd in config file")
Copy link
Member

Choose a reason for hiding this comment

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

Please correct the indentation.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

cmd/record.go Outdated
@@ -227,6 +233,9 @@ func (r *Record) GetCmd() *cobra.Command {

recordCmd.Flags().String("config-path", ".", "Path to the local directory where keploy configuration file is stored")

recordCmd.Flags().Bool("enableTele", true, "Switch for telemetry")
_ = recordCmd.Flags().MarkHidden("enableTele")
Copy link
Member

Choose a reason for hiding this comment

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

I think this assignment is optional. Please remove assignment if it is optional.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

cmd/root.go Outdated
}
}
sentry.ConfigureScope(func(scope *sentry.Scope) {
scope.SetTag("Keploy Version", utils.KeployVersion)
Copy link
Member

Choose a reason for hiding this comment

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

correct indentation.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>
Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>
Copy link
Member

@charankamarapu charankamarapu left a comment

Choose a reason for hiding this comment

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

Ship it!

@gouravkrosx gouravkrosx merged commit 1dccf36 into keploy:main Dec 18, 2023
10 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants