Removing an old environment and it's issues

Hello,

I’m currently transitioning from using statically defined environments to dynamically created ones for my developers.

Before the switch, I had those environments defined in Sentry:

  • environment1
  • environment2
  • environment3

And all looked nice and clean. Afterwards, my list doesn’t look so neat - we’re creating & tearing down multiple environments per day and after a week or so the environment list is full of rubbish.

I’d like to remove old environments, but don’t see a straightforward way to do so. Removing all Issues on a given environment sounded like the way to go, but after doing so the environment still remains on the list.

I don’t see it mentioned anywhere in the documentation or the API docs, am I missing something?

Currently the only way I see to handle this is to disable Sentry on those environments altogether, but developers really like your product so I’d like to avoid that :wink:

3 Likes

I have this issue as well. There is a hide environment feature but I’d still prefer to permanently get rid of spam environments.

There’s also the issue that if you hide an empty environment, it’ll not be unhidden if it gets events at a later time, right?

I “solved” the problem for myself (doesn’t work for your situation) by deleting and re-creating the affected projects.

so I clicked on all the hide in the project page by opening the console and using:

setInterval( () => { $('button:contains("Hide")')[0].click() }, 1500)

and then unhiding the environments I need.

Ok but how to remove the Environment actually?

I don’t think Sentry allows you to remove Environments (only hide them).

Here’s a faster one :

document.querySelectorAll('button[aria-label="Hide"]').forEach(el => el.click());

++