19 Mar 2024 07:39 AM - last edited on 29 Mar 2024 10:41 AM by Michal_Gebacki
It's quite common you don't provide your services 24x7, but you will run them also during non-business hours. Until business hours or business calendar features land into the Dynatrace product natively, it's possible to have a simple solution.
My approach below works for both Dynatrace Managed and SaaS.
For this feature, we will introduce a new metric - in this example slo.business_hours which will provide just static values:
Of course, in your environment you probably have different business hours for different services, thus you will likely need to have a dimension for it, such as level (24x7, 10x5, etc... ). See example below:
For example, values for a 12x7 service level will look like this - a value of 1 between 8:00 and 20:00 for each day and no value outside these times.
Then in the SLO definition, you will simply use metric expression and multiply your desired metric with the business hours metric with the desired dimension representing your business hours, for example - for SLO on key requests:
(
builtin:service.keyRequest.successes.server.rate:splitBy():auto
*
slo.business_hours:filter(and(or(eq(level,"8x5")))):splitBy():auto
):setUnit(Percent)
So in the example - during business hours, your original metric will be unaffected (multiplied by 1) and outside of business hours, you will have no value. In this example I've chosen a service level of 8x5, so the result will look like this - notice there are no values during the weekend of 16th and 17th March, and during Monday - Friday we have values only between 8:00 to 16:00 - representing 8x5.
You can use this approach also in Data Explorer, for Metric event definitions or elsewhere you can utilize metric expressions.
If anyone is interested in an configurable EF2 extension providing such metric, reach out to me in the comments.
08 Apr 2024 03:26 PM
Hi Julius,
(you have fans (-;)
I am very interested in your Extension, can you share?
KR Henk
10 Apr 2024 09:10 AM
Hi Julius,
I am very interested.🙂
18 Apr 2024 08:58 AM
Hi @jiri_stefanek ,
can you please reach out to me directly at julius.loman (at) alanata.sk ?
18 Apr 2024 09:13 AM
Hi Julius,
I just send you email.
25 Apr 2024 07:16 PM
Hi Julius,
I just sent you an email directly as well. Hope to hear from you soon. Thank you!
25 Apr 2024 07:38 PM
How did you create the custom metric that defines the different business hours for different services, thus you will likely need to have a dimension for it, such as level (24x7, 10x5, etc) in data explorer?
26 Apr 2024 08:08 AM
@hy exactly. I've just replied to your email.
07 May 2024 05:32 PM
Hi Julius, this is great! I would also be interested in your extension please 🙂
Thank you!