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

metrics: skip empty lines in process cloudflare #3765

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Jun 18, 2024

@trivikr trivikr force-pushed the skip-processing-empty-lines branch from a98a888 to c02c46c Compare June 18, 2024 23:25
@trivikr
Copy link
Member Author

trivikr commented Jun 18, 2024

cc @targos

@targos
Copy link
Member

targos commented Jun 19, 2024

Is it normal to have empty lines?

@trivikr
Copy link
Member Author

trivikr commented Jun 19, 2024

Is it normal to have empty lines?

I don't know. I noticed while processing an example file, and verified the error is not logged after adding the length check to skip processing. #3697 (comment)

Once merged and deployed, hopefully most or all of JSON.parse errors go away, making debugging easier.

@trivikr trivikr changed the title ansible: skip processing empty lines metrics: skip empty lines in process cloudflare Jun 20, 2024
Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

@trivikr
Copy link
Member Author

trivikr commented Jun 25, 2024

This PR is good to merge, and gcloud run deploy is successful

#3767 (comment)

@targos targos merged commit c5c15aa into nodejs:main Jun 25, 2024
1 check passed
@trivikr trivikr deleted the skip-processing-empty-lines branch June 25, 2024 15:53
@trivikr
Copy link
Member Author

trivikr commented Jun 25, 2024

Deployed, and verified that errors are no longer logged.

Before

EVENT TYPE:  OBJECT_FINALIZE
Node version is: v20.14.0
BUCKET cloudflare-logs-nodejs
FILENAME 20240625/20240625T193221Z_20240625T193327Z_121d0e03.log.gz
PROCESSEDFILENAME 20240625/20240625T193221Z_20240625T193327Z
INSIDE CREATE PIPELINE
String length:  23750258
Array Length:  48452
SyntaxError: Unexpected end of JSON input     at JSON.parse (<anonymous>)     at /usr/src/app/process-cloudflare.js:164:34     at callback (/usr/src/app/node_modules/@google-cloud/storage/build/src/file.js:1624:17)     at /usr/src/app/node_modules/@google-cloud/storage/build/src/file.js:1640:87     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Upload complete
rss 358.32 MB
heapTotal 57.23 MB
heapUsed 44.96 MB
external 26.86 MB
arrayBuffers 23.75 MB

After

EVENT TYPE:  OBJECT_FINALIZE
Node version is: v20.15.0
BUCKET cloudflare-logs-nodejs
FILENAME 20240625/20240625T193633Z_20240625T193744Z_8987830a.log.gz
PROCESSEDFILENAME 20240625/20240625T193633Z_20240625T193744Z
INSIDE CREATE PIPELINE
String length:  9327443
Array Length:  18849
Upload complete
rss 157.49 MB
heapTotal 31.18 MB
heapUsed 25.12 MB
external 12.45 MB
arrayBuffers 9.35 MB

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

3 participants