-
Notifications
You must be signed in to change notification settings - Fork 130
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
Create replibyte debug
command
#159
Comments
It makes total sense to me and will help troubleshoot issues and even build a reproducible environment. Do you think you can propose a PR for this? |
I'm happy to give it a go yes 👍 Oh also I forgot to mention this in the original issue, but see as the config file obviously contains sensitive data like database credentials, cloud account credentials
|
💯 , you can inspire yourself (or even re-use) this part from |
Hi @wtait1-ff , let me know if you need any help 👍🏽 |
Hi @evoxmusic, It seems that there has been no activity on this issue for a while, and I'm interested to work on it for my first contribution to the project. Is it possible? If so, can we agree with the information that the In my mind, to avoid a big PR, it would be better to split the issue in two more atomic issues :
In a very simple way, the replibyte debug
# Output
Replibyte $VERSION (running on $OS/$ARCH)
config :
# here the config file with all sensitive data redacted
$CONFIG I think we should at least display the 4 following informations to help reproduce a bug :
What do you think about it ? Thanks ! |
Hi @thomasgouveia , thank you for your help. I'm happy to speak with you to see how we can add this because it would be super helpful. I am working on adding some benchmarking to Replibyte to improve the overall performance, which could also be added to the debug part in some way. The |
Happy to help! For sure, it makes sense to do something that is relevant to help debugging issues or to provide context for an issue. Just to be sure we agree on what we want to achieve, at first, the idea was to provide a You said that it would be nice to have a kind of "profiling" file with a stack trace, I totally agree with you for that because it is clearly better to analysis the software behavior. I suppose that in your idea, you want to be able to trace what is done through the execution when executing any of the commands, for example a Do you agree with that? Do you have any idea for this profiling file? I will be pleased to give it a try! Another point, about the redact of the configuration. I saw that you use transformers in telemetry.rs to hide sensitive data that comes from the configuration file. I have another approach for that, using trait Redact {
fn redact(&self) -> Self;
} This trait will need to be implemented by each configuration related structs, so that way, each block can redact their sensitive data : impl Redact for Config {
fn redact(&self) -> Self {
// We create a mutable deep copy of the current element
// as we don't want to alter our base configuration
let mut copy = self.clone();
if copy.encryption_key.is_some() {
copy.encryption_key = Some(REDACTED.to_string());
}
if let Some(source) = copy.source {
copy.source = Some(source.redact())
}
if let Some(destination) = copy.destination {
copy.destination = Some(destination.redact())
}
copy.datastore = match copy.datastore {
DatastoreConfig::AWS(cfg) => DatastoreConfig::AWS(cfg.redact()),
DatastoreConfig::GCP(cfg) => DatastoreConfig::GCP(cfg.redact()),
// We don't need to redact this piece of configuration, it does not contain any sensitive information
DatastoreConfig::LocalDisk(cfg) => DatastoreConfig::LocalDisk(cfg)
};
copy
}
} At the end, we can simply call |
Proposal
It seems to be a common theme that when bug reports / help issues are filed, the author is asked for certain info like
replibyte
versionIt would be helpful for people both authoring + triaging issues if a user could run a command like
replibyte debug
that would collect all that useful info automatically. Then they would just need to copy that output and past it in the issue.Other thoughts
bug
-type issueThe text was updated successfully, but these errors were encountered: