You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add Add-SentryEventProcessor cmdlet for custom event processors #124
There's no clean public API for registering an event processor. To do it today, a user has to write a PowerShell class deriving from an internal C# base type (SentryEventProcessor_) and then register this with options.AddEventProcessor from inside Start-Sentry.
In #27 Ivan proposed we add Add-SentryEventProcessor taking a scriptblock, wrapped internally by a C# class that implements ISentryEventProcessor directly. Could be used like so:
Add-SentryEventProcessor {
if ($_.Message-match'secret') { return$null }
$_.SetTag('host',$env:COMPUTERNAME)
$_
}
I bumped into it yesterday when trying to run the new sample I'd but together (same behaviour with the other existing sample) on my mac. I saw you'd already made a comment on it in #27 :
event processors - it's a pain to add to Windows Powershell due to the conflict with the Process keyword. Internally, we have a c# class that changes the call to DoProcess but modules don't really work well with exporting classes. Alternatively, we could have a Add-SentryEventProcessor which would take a scriptblock argument and we would wrap that in our internal EventProcessor implementation.
At least I think your comment relates to the same thing.
I had Claude put a PR together yesterday to address it, which I haven't had time to look through yet and check/understand. It looks like a fairly substantial PR though so will definitely sanity check with you if/when it looks like we might want to merge that. I'm far from a Powershell expert (I think I've generally resisted it and all it's weird syntax - but maybe it will win me over one day).
$PSVersionTable.PSVersion
Major Minor Patch PreReleaseLabel BuildLabel
----- ----- ----- --------------- ----------
7 6 0
@vaind if you've still only got PS 7.5 installed, that would explain why you're not seeing the same warnings I am (and why we're not seeing any issues on CI).
I've updated the title/description on this issue to dial it back to just what you had in your original TODO and we can deal with correctly matching more recent versions of PS to .NET in #125 - looks like there's already an automatically generated PR for this which needs a bit of TLC:
changed the title [-]ParserError noise from EventProcessor warnings[/-][+]Add Add-SentryEventProcessor cmdlet for custom event processors[/+]on May 25, 2026
Activity
linear-code commentedon May 22, 2026
POWERSH-12
[-]ParserError noise from module class-loading order[/-][+]ParserError noise from EventProcessor warnings[/+]vaind commentedon May 22, 2026
That's surprising - when did you encounter this? I've never seen this personally. Also not present in CI logs https://github.com/getsentry/sentry-powershell/actions/runs/23848934882/job/69523457650
jamescrosswell commentedon May 23, 2026
I bumped into it yesterday when trying to run the new sample I'd but together (same behaviour with the other existing sample) on my mac. I saw you'd already made a comment on it in #27 :
At least I think your comment relates to the same thing.
I had Claude put a PR together yesterday to address it, which I haven't had time to look through yet and check/understand. It looks like a fairly substantial PR though so will definitely sanity check with you if/when it looks like we might want to merge that. I'm far from a Powershell expert (I think I've generally resisted it and all it's weird syntax - but maybe it will win me over one day).
jamescrosswell commentedon May 25, 2026
Possibly Claude misdiagnosed this... it might be a side effect of this:
sentry-powershell/modules/Sentry/private/Get-SentryAssembliesDirectory.ps1
Lines 12 to 18 in 7818d05
On my machine I have:
@vaind if you've still only got PS 7.5 installed, that would explain why you're not seeing the same warnings I am (and why we're not seeing any issues on CI).
I've updated the title/description on this issue to dial it back to just what you had in your original TODO and we can deal with correctly matching more recent versions of PS to .NET in #125 - looks like there's already an automatically generated PR for this which needs a bit of TLC:
[-]ParserError noise from EventProcessor warnings[/-][+]Add Add-SentryEventProcessor cmdlet for custom event processors[/+]