-
Notifications
You must be signed in to change notification settings - Fork 341
telemetry: add transmit:false flag for logs, reduce log cardinality #5871
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
base: master
Are you sure you want to change the base?
Changes from all commits
5d8c240
521044f
5dab7b7
4076850
b076813
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -27,7 +27,8 @@ | |||||
} | ||||||
|
||||||
function isValid (logEntry) { | ||||||
return logEntry?.level && logEntry.message | ||||||
console.log('isValid', logEntry) | ||||||
return logEntry?.level && logEntry.message && logEntry.transmit !== false | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe I'm reading the code wrong, but isn't
Suggested change
|
||||||
} | ||||||
|
||||||
const EOL = '\n' | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,12 @@ describe('telemetry log collector', () => { | |
).to.be.false | ||
}) | ||
|
||
it('should not store logs with transmit flag set to false', () => { | ||
expect(logCollector.add({ message: 'Error 1', level: 'ERROR' })).to.be.true | ||
expect(logCollector.add({ message: 'Error 2', level: 'ERROR', transmit: true })).to.be.true | ||
expect(logCollector.add({ message: 'Error 3', level: 'ERROR', transmit: false })).to.be.false | ||
Comment on lines
+52
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I'm correct about my question about |
||
}) | ||
|
||
it('should include original message and dd frames', () => { | ||
const ddFrame = `at T (${ddBasePath}path/to/dd/file.js:1:2)` | ||
const stack = new TypeError('Error 1') | ||
|
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.
Awesome thanks!