Existing script/method to reliably determine if instance is Production

paulmorris
Giga Sage

I'm looking for a way to determine if an instance is Production.

I noticed there is a system property, glide.installation.production

property.PNG

However, this is set to true on every instance!

On HI, the instance in question is listed correctly as being Non-Production.

hi.png

Is there a reliable, configuration agnostic way to tell from within the instance if it is Production or not?

2 ACCEPTED SOLUTIONS

GlideUtil.isProductionInstance()



However this is not available in Scoped Code.


View solution in original post

JeffPatt
Tera Expert

As Dominic and Daniel have mentioned, the accepted solution is not correct at all.

 

For my use case I ended up setting a new System Property to store the name of the Production instance and a function in an open-access global scope Script Includes that performs an equality check against instance_name.

It's not OOTB, but has advantages in that it doesn't modify existing properties, and works.

View solution in original post

9 REPLIES 9

... Which in turn means that Pauls issue is not fixed with the accepted solution.
(I can see this here as well on a dev instance).

JeffPatt
Tera Expert

As Dominic and Daniel have mentioned, the accepted solution is not correct at all.

 

For my use case I ended up setting a new System Property to store the name of the Production instance and a function in an open-access global scope Script Includes that performs an equality check against instance_name.

It's not OOTB, but has advantages in that it doesn't modify existing properties, and works.

This notification just came up.
Must have been a false positive. The method doesn't do what it says on the tin.

Luuk Vonk
Tera Guru

Please check the "sn_appclient.instance_type" system property for this information.

Just checked this, it's accurate now but has been incorrect for years (this is my dev instance).

JeffPatt_0-1729219170197.png