Skip to main content
Answer

LucidScale Formula for boot monitoring

  • February 21, 2024
  • 2 replies
  • 62 views

paul.moro.ext
Forum|alt.badge.img+1

Hello, 

I use lucidScale to monitor my AWS cloud. I have created a specific template for EC2 instances with different informations and i want to add a conditional formating to alert me when an instance is up since more than 1y.

I tried to use a condition with “LaunchTime“ but a i could only refer to a static date like “start with 2022..”. Could you give me if a formula to warn me if there s more than 365d uptime ?

 

thx 

 

Best answer by geoffmaddox

To implement this, you can use the DATEDIFF formula function (https://developer.lucid.co/formulas/#datediff) which allows you to determine the time between two dates. In this case, you would want to also use the NOW formula function (https://developer.lucid.co/formulas/#now) to get the current date. Note that this returns an integer, so it wouldn’t give you much granularity.

datediff("years", @"LaunchTime", now) >= 1

 

Another option would be to use the YEARSAGO formula function (https://developer.lucid.co/formulas/#yearsago), which returns a fraction of the number of years from the current date. This would let you differentiate between exactly 1 year ago, and more than 1 year ago.

yearsago(@"LaunchTime") > 1

Comments

geoffmaddox
Forum|alt.badge.img
  • Lucidite
  • Answer
  • February 22, 2024

To implement this, you can use the DATEDIFF formula function (https://developer.lucid.co/formulas/#datediff) which allows you to determine the time between two dates. In this case, you would want to also use the NOW formula function (https://developer.lucid.co/formulas/#now) to get the current date. Note that this returns an integer, so it wouldn’t give you much granularity.

datediff("years", @"LaunchTime", now) >= 1

 

Another option would be to use the YEARSAGO formula function (https://developer.lucid.co/formulas/#yearsago), which returns a fraction of the number of years from the current date. This would let you differentiate between exactly 1 year ago, and more than 1 year ago.

yearsago(@"LaunchTime") > 1


paul.moro.ext
Forum|alt.badge.img+1

thx it works exactly how i need !