-
Notifications
You must be signed in to change notification settings - Fork 0
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: add logging on ChooChooTrain #288
Conversation
@IgnacioBecerra to make sure I understand, if 20 instrumented packages run during a scan, currently, these commands would run 20 times?
With this refactor, these commands would only run once? And the hypothesis is this change would speed things up? |
@mattrosno Yeah so currently every instance of the ChooChooTrain calls its own Since we need identifiers for our logs within the ChooChooTrain, we're gonna need to run those commands before calling I'm not totally sure if it'll be indeed possible to run it only once, but at least for the time being this slight refactor is mostly to avoid running those commands in two different functions each. The commands run very fast, so this isn't the bottleneck we think it might be, but it's always good to squeeze out any extra speed if possible, or at least to avoid repetitive code. |
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.
We need to remove new lines in the template literals so the new line characters and spaces (tabs characters?) aren't included in the logging.
@mattrosno I'm now using concatenation instead since we have an eslint rule that a single line can't be over 150 characters. I'll be working on getting the SonarCloud number up. |
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 just one small thing commented
Co-authored-by: Ariella Gilmore <ariellalgilmore@gmail.com>
* feat: add env and scanID to metrics * feat: add scanID to metric docs * fix: use scanId variable * fix: added scanID to gitinfo * fix: ensure empty string in case of undefined Co-authored-by: Matt Rosno <matt.rosno@gmail.com> --------- Co-authored-by: Matt Rosno <matt.rosno@gmail.com>
|
Closes #
This PR adds logs that are sent out to the collector regarding the duration of the whole ChooChooTrain process. To get the information needed to be more specific in these logs, I had to use the
getGitInfo()
function that was called within theibmTelemetry()
function, meaning it would be called twice per instrumented package. While this probably wouldn't add a lot of time overhead, this whole logging exercise is mainly being done to troubleshoot packages not reporting data, and since our current working theory is that the process is taking longer than it should, I wouldn't want to add anything that would make it take even longer.Thus, the part of the code gathering all this git information was refactored to only be ran once at the beginning of the whole ChooChooTrain. It was also properly hashed in order to be passed down to the
ibmTelemetry()
function, where all needed to be done is add it to theotelContext
.Changelog
New
Changed
Testing / reviewing
{{ Add descriptions, steps or a checklist for how reviewers can verify this PR works or not }}