feat(winston): Add customLevelMap for winston transport#18922
feat(winston): Add customLevelMap for winston transport#18922
Conversation
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|
s1gr1d
left a comment
There was a problem hiding this comment.
Looks good, but I am wondering if we can auto-detect those levels so users don't have to manually add them 🤔
| attributes[SPLAT_SYMBOL] = undefined; | ||
|
|
||
| const logSeverityLevel = WINSTON_LEVEL_TO_LOG_SEVERITY_LEVEL_MAP[levelFromSymbol as string] ?? 'info'; | ||
| const customLevel = sentryWinstonOptions?.customLevelMap?.[levelFromSymbol as string]; |
There was a problem hiding this comment.
m: would it make sense to warn the user in case he provides a sentry level that does not exist?
There was a problem hiding this comment.
That could actually make sense
There was a problem hiding this comment.
@nicohrubec I added a debug warning now. This is however only then when levels are overwritten. In all other cases they will default to info already
That shouldn't be a problem. The main problem is what it should get mapped to. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
2f4c56e to
c2dece0
Compare
closes #18868
closes JS-1498
ATM it is not possible to map custom levels to OpenTelemetry levels. The option
customLevelMaphas been added to make this possible. Which means that custom levels would have never been send to Sentry, as they were not mapped correctly.Now when there are custom levels it can be used like this:
Merge checklist