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 firehose event via server after failing to log via client #28634

Merged
merged 1 commit into from May 20, 2019

Conversation

davidsbailey
Copy link
Member

@davidsbailey davidsbailey commented May 17, 2019

Background

Data loss issues seem to affect certain classrooms, and we suspect this may have to do with their network configurations. We try to log many firehose event types to help diagnose these issues, however some classrooms with data loss problems do not show any of these events in the logs. One complicating factor is that some classrooms might not allow log messages to the firehose servers, which hit amazon urls directly via ajax requests. To work around this, the idea is to detect failed log attempts from the client, and to ask our server (which must already be allowed on the classroom's network) to log to firehose for us.

Description

Whenever a firehose event is logged on the client, if the log attempt fails and no callback was specified, use our own callback to ask our servers to log a firehose event. the server request includes all the original details from the failed client request.

Sample output

sample server log event after failing to save channel for standalone project:

{
  "study": "firehose-error-unreachable",
  "event": "save-channel-error",
  "project_id": "350J0x1aMhcD4hYxewRuZA",
  "data_json": "{\"study\":\"project-data-integrity\",\"study_group\":\"v4\",\"event\":\"save-channel-error\",\"data_int\":1,\"project_id\":\"350J0x1aMhcD4hYxewRuZA\",\"data_string\":\"Error: status: error; error: \",\"data_json\":\"{\\\"errorCount\\\":1,\\\"errorText\\\":\\\"Error: status: error; error: \\\",\\\"isOwner\\\":true,\\\"currentUrl\\\":\\\"http://localhost-studio.code.org:3000/projects/applab/350J0x1aMhcD4hYxewRuZA/edit\\\",\\\"shareUrl\\\":\\\"http://localhost-studio.code.org:3000/projects/applab/350J0x1aMhcD4hYxewRuZA\\\",\\\"currentSourceVersionId\\\":\\\"YAiX5Ct5zjuKcF1iz5DY_yx.wLqQMB2c\\\"}\",\"created_at\":\"2019-05-17T23:14:22.635Z\",\"environment\":\"development\",\"uuid\":\"71f5c40a-87b1-4116-b365-b152c3a65423\",\"device\":\"{\\\"user_agent\\\":\\\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36\\\",\\\"window_width\\\":974,\\\"window_height\\\":776,\\\"hostname\\\":\\\"localhost-studio.code.org\\\",\\\"full_path\\\":\\\"http://localhost-studio.code.org:3000/projects/applab/350J0x1aMhcD4hYxewRuZA/edit\\\"}\",\"user_id\":1,\"script_id\":null,\"level_id\":null}",
  "data_string": "NetworkingError: Network Failure"
}

@davidsbailey davidsbailey requested a review from sureshc May 20, 2019 04:41
@davidsbailey davidsbailey merged commit 3e88a9e into staging May 20, 2019
@davidsbailey davidsbailey deleted the log-firehose-failure branch May 20, 2019 20:47
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

2 participants