Skip to content

feat(logs): Add experimental user-callable logging methods #15442

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

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
bdcb9e1
initial work on .log
colin-sentry Feb 14, 2025
4281cbe
improve a bit
colin-sentry Feb 14, 2025
1869d6f
linting, etc
colin-sentry Feb 18, 2025
4b89486
fix: Rename ourlog -> log
AbhiPrasad Feb 20, 2025
2fe0e1b
ref: Namespace logging methods in experiment obj
AbhiPrasad Feb 20, 2025
21b16e8
ref: Improve log creation logic and update option name
AbhiPrasad Feb 20, 2025
9ac58b1
allow for multiple logs to be flushed in the same envelope
AbhiPrasad Feb 20, 2025
8fc4ae2
feat: Add release and environment to logs
AbhiPrasad Feb 20, 2025
f3adcde
ref: Change log buffer max length from 100 -> 25
AbhiPrasad Feb 20, 2025
bbc170d
feat: Send severityNumber
AbhiPrasad Feb 20, 2025
bab4c6e
ref: re-org functions and exports
AbhiPrasad Feb 20, 2025
f750d08
feat: Add log function
AbhiPrasad Feb 20, 2025
7218377
fix: use correct severity number for log
AbhiPrasad Feb 20, 2025
3e936c9
chore: Bump size-limit
AbhiPrasad Feb 24, 2025
b702cf0
chore: size limit entries that were missed
AbhiPrasad Feb 24, 2025
301a1ca
Update packages/core/src/log.ts
k-fish Mar 4, 2025
6f3560c
Use '.' for param so it renders more nicely in the log attribute tree…
k-fish Mar 4, 2025
6215ad9
json the parameters
colin-sentry Mar 4, 2025
9048164
align attributes with what was agreed
AbhiPrasad Mar 4, 2025
4e0d9bd
Merge branch 'develop' into colin/log-api
AbhiPrasad Mar 4, 2025
a8673b7
fix: Duplicate export identifier
AbhiPrasad Mar 4, 2025
e9fa3bc
ref: introduce format function and restructure exports
AbhiPrasad Mar 4, 2025
2c3db7d
Merge branch 'develop' into colin/log-api
AbhiPrasad Mar 5, 2025
3ffc54b
Merge branch 'develop' into colin/log-api
AbhiPrasad Mar 5, 2025
cdf8bc5
chore: bump size-limit
AbhiPrasad Mar 5, 2025
0e77407
fix: ParamaterizeString typing to allow more than string values
AbhiPrasad Mar 6, 2025
4d0678a
feat: Add parent_span_id to outgoing logs
AbhiPrasad Mar 6, 2025
7b83155
feat: Export logging methods for node/server-side SDKs
AbhiPrasad Mar 6, 2025
6994781
fix: Set parent_span_id properly
AbhiPrasad Mar 6, 2025
8602f81
fix: Remove unneeded import
AbhiPrasad Mar 6, 2025
7d22aa2
chore: bump size-limit
AbhiPrasad Mar 6, 2025
d7e3479
Merge branch 'develop' into colin/log-api
AbhiPrasad Mar 6, 2025
bbb1698
Merge branch 'develop' into colin/log-api
colin-sentry Mar 11, 2025
c4b6d2d
feat(buffer): Add beforeSendLogs for sampling decisions
colin-sentry Mar 13, 2025
1da9a7f
clean up
colin-sentry Mar 13, 2025
5b66ccf
remove old comment
colin-sentry Mar 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/core/src/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ export function sendLog(level: LogSeverityLevel, messageArr: TemplateStringsArra

const attributes = values.reduce<Record<string, unknown>>(
(acc, value, index) => {
acc[`param.${index}`] = value;
acc[`sentry.message.parameters.${index}`] = value;
return acc;
},
{
'sentry.template': messageArr.map((s, i) => s + (i < messageArr.length - 1 ? `$param.${i}` : '')).join(''),
'sentry.message.template': messageArr.map((s, i) => s + (i < messageArr.length - 1 ? `$param.${i}` : '')).join(''),
},
);

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-sdk/src/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ module.exports = {
// Make sure all expressions are used. Turned off in tests
// Must disable base rule to prevent false positives
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': ['error', { allowShortCircuit: true }],
'@typescript-eslint/no-unused-expressions': ['error', { allowShortCircuit: true, allowTaggedTemplates: true }],

// Make sure Promises are handled appropriately
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: false }],
Expand Down