console
console copied to clipboard
SST Console issues subscription pattern doesn't match errors
We're using Powertools Logger and after some digging realised that the pattern provided by SST Console ?"Invoke Error" ?"Error: Runtime exited" ?"Task timed out after" ?" ERROR " ?"[ERROR]" does not match any part of the errors in the logs.
We will now be interception and formatting each log before passing on to the console, to adhere to this pattern. However, I might suggest a change to the subscription pattern that we be allowed to add custom filtering to the pattern in the sst.config.ts file.
https://github.com/sst/console/blob/5997616e354d0f8757613e5959a03e5ee6b8ec83/packages/core/src/issue/index.ts#L346-L358
filterPattern: [
`?"Invoke Error"`,
// OOM and other runtime error
`?"Error: Runtime exited"`,
// Timeout
`?"Task timed out after"`,
// NodeJS Uncaught and console.error
`?"\tERROR\t"`,
`?"[ERROR]"`,
// ...(fn.enrichment.runtime?.startsWith("nodejs")
// ? [`?"\tERROR\t"`]
// : []),
sstConfig.console?.customerFilterPattern ?? ""
].join(" "),