Thanks for using Sentry - and for coming here for help.
I think what you’re experiencing here is a common issue among issue alerts. You’ve actually figured it out already:
Question, could it be related to the fact that the Alert condition is for Event and this is an Issue type?
The answer is yes. I think it may be a simpler mental model to think of these conditions as “OR” rather than “AND”.
So in the case of your last screenshot, without the “An issue is first seen” condition added, we’d expect you to get a notification for an issue if any event in that issue has environment=production. An issue could have 10 events, 5 of which have environment=production and environment=staging - and if an 11th came in, you’d get a notification under that rule.
However, in your second screenshot of the rules page, you have the condition “An issue is first seen” - and I would expect this to only notify you once. It seems like you’ve posted screenshots with 3 different states of rules and I’m not entirely sure on what alerts have notified you and when, so it’s hard to definitively draw any conclusions here. If you got an alert in this state, then I think that is something we’d need to investigate deeper.
And unfortunately, I believe you are correct that you cannot filter notifications by environment for “issues” (issue’s don’t have environment’s attached to them).
However, we are actually working on some new alerting features that will give you the power to do all of this and more. Stay tuned!
Please let me know if I’ve not cleared things up or if you have more questions. I’d be happy to continue helping to make sure you’re in a good spot