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

Logging in Watchbot4 #205

Closed
wants to merge 29 commits into from
Closed

Logging in Watchbot4 #205

wants to merge 29 commits into from

Conversation

tapaswenipathak
Copy link
Contributor

@tapaswenipathak tapaswenipathak commented Jun 5, 2018

Closes #204.

cc @mapbox/platform-engine-room.

lib/logger.js Outdated
@@ -31,11 +31,11 @@ class Logger {
}

workerFailure(results) {
this.log(`[failure] ${JSON.stringify(results)}`);
this.log(`[worker] [failure] ${JSON.stringify(results)}`);

Choose a reason for hiding this comment

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

These logs are not coming from the internals of the worker, but are instead coming from the watchbot listen process. Should this be prefixed with [watchbot] instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see workerFailure is called from

this.logger.workerFailure(results);

do you also suggest changing the method names as watchbotFailure()?

Other than this I think it is necessary to prefix [worker] here

child.stdout.pipe(logger.stream());
child.stderr.pipe(logger.stream());

Copy link

@jakepruitt jakepruitt Jun 6, 2018

Choose a reason for hiding this comment

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

Right, it's necessary to prefix [worker] on those streamed logs since they are actually coming from the worker child process, while the message with the results JSON is coming from the code inside of watchbot. I think the function should still be called workerFailure, but since this log is taking place inside of the watchbot code and not inside of the code defined by the user in the subprocess, the log should be prefixed with [watchbot].

tapaswenipathak and others added 3 commits June 7, 2018 12:16
* Add alarms and alarm docs

* Add failedPlacementAlarmPeriods

* Add CloudWatch Alarms snapshots

* Update template jest snapshots

* Add CloudWatch Alarms snapshots

* Add failedworker and failedworkerplacement metric

* Typo r/LogGroup/Logs

* Change metric name

* Metric Filter of worker errors to "[failure]"

* Have current published version instead of undefined

* Jake's Review

* uh update-jest

* Update alarms.md
tapaswenipathak and others added 2 commits June 9, 2018 13:34
* Add alarms and alarm docs

* Add failedPlacementAlarmPeriods

* Add CloudWatch Alarms snapshots

* Update template jest snapshots

* Add CloudWatch Alarms snapshots

* Add failedworker and failedworkerplacement metric

* Typo r/LogGroup/Logs

* Change metric name

* Metric Filter of worker errors to "[failure]"

* Have current published version instead of undefined

* Jake's Review

* uh update-jest

* Update alarms.md
Jake Pruitt and others added 6 commits June 11, 2018 16:31
* Add travis user

* Ensure this fails

* Add validation for notificationEmail or notificationTopic
…queue threshold, info to doc (#211)

* Closes #208, #207, #206, #182, #149, #72, #15

(cherry picked from commit 8de328df79ccf52b8d612c625891555808c2fa0e)

* Add minSize as option

* update jest tests

* Change MinSize to 0

* update jest

* identation and minSize to 0

* Add deadletterThreshold info in Worker-retry-cycle
@tapaswenipathak tapaswenipathak changed the base branch from container-recycling to master June 18, 2018 04:35
@jakepruitt
Copy link

Seems like this PR needs to be rebased on master. @tapasweni-pathak let us know when you're ready for this to get a final review!

@tapaswenipathak
Copy link
Contributor Author

@jakepruitt The Travis is failing, can you run in your local and suggest what is missing in the tests? Plus I don't think I would be rebasing this one, I would just create a new one.

@jakepruitt
Copy link

Hmmm @tapasweni-pathak I was able to fix the test locally, but it looks like I can't replicate the ECONNRESET error that's showing up in travis 😕 . This may be a case of strange things happening due to the commit history of this branch - I'd start by resolving that and see if the problem persists.

@tapaswenipathak
Copy link
Contributor Author

@jakepruitt I added an empty commit for ECONNRESET error, I think usually this error goes away with an empty commit or with just a restart Travis build. Travis errors with Error: write EPIPE as child.stdout.write has writable:false, did the test pass locally with 285710d? I edited this in some commit the master has [worker] on line 154. child.stdin.write should be used to write to subprocess. I get better errors with it, #225.

@jakepruitt
Copy link

@tapasweni-pathak yeah, the EPIPE was passing for me locally. Could you set this up on a new branch/rebased branch and see if the error persists? I think we should address it in a fresh environment that we know is up to date with master, since it's tough to know the state of the files in this branch.

@tapaswenipathak
Copy link
Contributor Author

@jakepruitt yeah error persists, I already created a separate PR #225 before checking again if the tests worked locally for you. Tests didn't work locally or on Travis for me. child.stdout.write and child.stdout.stderr has writable property as false and think the error would appear. Could you suggest why Travis is failing with Error: write EPIPE on Travis #225?

@jakepruitt
Copy link

jakepruitt commented Jun 25, 2018

Could we close this PR to avoid confusion with #225?

@jakepruitt
Copy link

Closing in favor of #225

@jakepruitt jakepruitt closed this Jun 28, 2018
@YannickMeeus YannickMeeus deleted the logging branch March 23, 2023 13:21
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.

None yet

4 participants