Should DSNs be kept private?

I’m working on an open source project. Am I safe to keep my public DSN in the code, or should I keep it as a secret?

The DSN is not a secret, worst thing that can happen is that someone sends events to your account. In that case you can cycle the DSN to a new one or block a specific IP.