updated convert.py

master
SLW\ARNAUA 2023-03-06 12:10:10 +01:00
parent b4214de6cd
commit 245a296ec4
16 changed files with 756 additions and 46 deletions

View File

@ -23,27 +23,9 @@ FOLDERS = {"My Journey":"DE-3",
"China Services":"EC-DE"}
# methods
def homogenize_metrics(metricList):
for metric in metricList:
if len(metricList) < 4:
metricList.append('')
return metricList
def homogenize_services(serviceList):
for service in serviceList:
if len(serviceList) < 2:
serviceList.append('')
return serviceList
def homogenize_keyRequests(keyRequestLists):
for keyRequestList in keyRequestLists:
if len(keyRequestLists) < 2:
keyRequestLists.append('')
return keyRequestLists
def template_logic(metricList):
for template,metricTemplate in TEMPLATE_FILES.items():
if all([item in metricTemplate for item in metricList]):
def template_logic(metric):
for template,metricElement in TEMPLATE_FILES.items():
if all([item in metricElement for item in metric]):
# if set(metricList) == set(metricTemplate):
return template
print("Problem occured while matching metric: Exiting program...")
@ -62,9 +44,9 @@ def main(configFile):
slo_definition_tresholds_failure = None
environments = {}
template = None
metricList = []
serviceList = []
keyRequestList = []
metric = None
services = None
keyRequests = None
try:
# read yaml file
@ -100,35 +82,28 @@ def main(configFile):
lstrip_blocks=True)
# generate terraform file
for i,(environment,ev) in enumerate(environments.items()):
for environment,ev in environments.items():
folder_path = os.path.join(cwd,OUTPUT_FOLDER_BASENAME,environment.replace('-','_'),"slo")
if not os.path.exists(folder_path):
os.makedirs(folder_path)
template = template_logic(nested_lookup('metric',ev))
metricList = homogenize_metrics(nested_lookup('metric',ev))
metric = nested_lookup('metric',ev)
for service in ev[i]["filter"]:
serviceList.append(nested_lookup('service',service))
keyRequestList.append(nested_lookup('keyRequests',service))
i = 0
for service in ev[0]["filter"]:
services = nested_lookup('service',service)
keyRequests = nested_lookup('keyRequests',service)
with open(os.path.join(folder_path,module_name+".tf"),"w+") as file:
jinja_template = jinja_environment.get_template(template)
file.write(jinja_template.render(module=module_name,
slo_name=slo_name,
metric=metricList[0],
metricA=metricList[0],metricB=metricList[1],metricC=metricList[2],metricD=metricList[3],
description=description,
services='~",\n\t\t\t\t~"'.join(serviceList[0]),
servicesA='~",\n\t\t\t\t~"'.join(serviceList[0]),servicesB='~",\n\t\t\t\t~"'.join(serviceList[1]),
keyRequests='~",\n\t\t\t\t~"'.join(itertools.chain.from_iterable(keyRequestList[0])),
keyRequestsA='~",\n\t\t\t\t~"'.join(itertools.chain.from_iterable(keyRequestList[0])),
keyRequestsB='~",\n\t\t\t\t~"'.join(itertools.chain.from_iterable(keyRequestList[1])),
target=slo_definition_tresholds_failure,
warning=slo_definition_tresholds_warning))
with open(os.path.join(folder_path,module_name+".tf"),"w+") as file:
jinja_template = jinja_environment.get_template(template_logic(metric))
file.write(jinja_template.render(module=module_name,
slo_name=slo_name,
metric=metric,
description=description,
services='~",\n\t\t\t\t~"'.join(services),
keyRequests='~",\n\t\t\t\t~"'.join(itertools.chain.from_iterable(keyRequests)),
target=slo_definition_tresholds_failure,
warning=slo_definition_tresholds_warning))
if __name__ == "__main__":
# pre-initialization get current working directory

View File

@ -0,0 +1,49 @@
module TP_Mobile_Login {
source = "../../_dynatrace-base-modules/dynatrace-service-level-objective"
name = "TP_Mobile_Login"
description = "2.0 SLO Mobile"
# entity selector object
filter = ""
# metric expression of the calculation as done in data explorer ui
metric_expression = <<EOT
(100)*((['builtin:service.keyRequest.errors.server.successCount']:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"btc-cn-connected-oauth-service - PROD~"
)
),entityName.in(
~"POST /api/v2/cop/login/pwd~",
~"POST /api/v2/cop/login/sms~",
~"POST /api/v2/cop/sso~",
~"GET /api/v1/cop/logout~"
)"))))):splitBy())
/
(builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"btc-cn-connected-oauth-service - PROD~"
)
),entityName.in(
~"POST /api/v2/cop/login/pwd~",
~"POST /api/v2/cop/login/sms~",
~"POST /api/v2/cop/sso~",
~"GET /api/v1/cop/logout~"
)"))))):splitBy()))
EOT
# if not set (removed) it's defaulted to "-1d"
timeframe = "-1d"
# currently the only possible value
evaluation = "AGGREGATE"
# target and warning percentage of the SLO as double
target = 98 # if not set(removed) it's defaulted to 98
warning = 99 # if not set(removed) it's defaulted to 99
}

View File

@ -0,0 +1,51 @@
module TP_Mobile_Mapping {
source = "../../_dynatrace-base-modules/dynatrace-service-level-objective"
name = "TP_Mobile_Mapping"
description = "2.0 SLO Mobile"
# entity selector object
filter = ""
# metric expression of the calculation as done in data explorer ui
metric_expression = <<EOT
(100)*((['builtin:service.keyRequest.errors.server.successCount']:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"vehicle-mapping-composite-service - PROD~"
)
),entityName.in(
~"POST /api/v2/vehicles/<VIN>/primary~",
~"POST /api/v2/vehicles/<VIN>/primary/map~",
~"POST /api/v1/vehicles/<VIN>/validate-security-code~",
~"POST /api/v1/vehicles/<VIN>/resend-security-code~",
~"DELETE /api/v1/vehicles/<VIN>~"
)"))))):splitBy())
/
(builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"vehicle-mapping-composite-service - PROD~"
)
),entityName.in(
~"POST /api/v2/vehicles/<VIN>/primary~",
~"POST /api/v2/vehicles/<VIN>/primary/map~",
~"POST /api/v1/vehicles/<VIN>/validate-security-code~",
~"POST /api/v1/vehicles/<VIN>/resend-security-code~",
~"DELETE /api/v1/vehicles/<VIN>~"
)"))))):splitBy()))
EOT
# if not set (removed) it's defaulted to "-1d"
timeframe = "-1d"
# currently the only possible value
evaluation = "AGGREGATE"
# target and warning percentage of the SLO as double
target = 98 # if not set(removed) it's defaulted to 98
warning = 99 # if not set(removed) it's defaulted to 99
}

View File

@ -0,0 +1,57 @@
module TP_Mobile_Remote360 {
source = "../../_dynatrace-base-modules/dynatrace-service-level-objective"
name = "TP_Mobile_Remote360"
description = "2.0 SLO Mobile"
# entity selector object
filter = ""
# metric expression of the calculation as done in data explorer ui
metric_expression = <<EOT
(100)*((['builtin:service.keyRequest.errors.server.successCount']:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"remote-360-composite-service - PROD~"
)
),entityName.in(
~"GET /api/v1/events/[UUID]~",
~"POST /api/v1/events/[UUID]/cancel~",
~"POST /api/v1/event/execute~",
~"GET /api/v1/download/[UUID]/<fileName>~",
~"POST /api/v1/download/[UUID]/<fileName>/confirm~",
~"GET /api/v1/vehicle/<VIN>/egomodelurl~",
~"GET /api/v1/vehicle/<VIN>/key~",
~"GET /api/v1/recordings/vehicle/<VIN>~"
)"))))):splitBy())
/
(builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"remote-360-composite-service - PROD~"
)
),entityName.in(
~"GET /api/v1/events/[UUID]~",
~"POST /api/v1/events/[UUID]/cancel~",
~"POST /api/v1/event/execute~",
~"GET /api/v1/download/[UUID]/<fileName>~",
~"POST /api/v1/download/[UUID]/<fileName>/confirm~",
~"GET /api/v1/vehicle/<VIN>/egomodelurl~",
~"GET /api/v1/vehicle/<VIN>/key~",
~"GET /api/v1/recordings/vehicle/<VIN>~"
)"))))):splitBy()))
EOT
# if not set (removed) it's defaulted to "-1d"
timeframe = "-1d"
# currently the only possible value
evaluation = "AGGREGATE"
# target and warning percentage of the SLO as double
target = 98 # if not set(removed) it's defaulted to 98
warning = 99 # if not set(removed) it's defaulted to 99
}

View File

@ -0,0 +1,45 @@
module TP_Mobile_Send2VehicleMGU {
source = "../../_dynatrace-base-modules/dynatrace-service-level-objective"
name = "TP_Mobile_Send2VehicleMGU"
description = "2.0 SLO Mobile"
# entity selector object
filter = ""
# metric expression of the calculation as done in data explorer ui
metric_expression = <<EOT
(100)*((['builtin:service.keyRequest.errors.server.successCount']:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"TripService - PROD~"
)
),entityName.in(
~"/v3/motorist/[UUID]/trips~",
~"/v2/motorist/[UUID]/trips~"
)"))))):splitBy())
/
(builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"TripService - PROD~"
)
),entityName.in(
~"/v3/motorist/[UUID]/trips~",
~"/v2/motorist/[UUID]/trips~"
)"))))):splitBy()))
EOT
# if not set (removed) it's defaulted to "-1d"
timeframe = "-1d"
# currently the only possible value
evaluation = "AGGREGATE"
# target and warning percentage of the SLO as double
target = 98 # if not set(removed) it's defaulted to 98
warning = 99 # if not set(removed) it's defaulted to 99
}

View File

@ -0,0 +1,43 @@
module TP_Mobile_VehicleList {
source = "../../_dynatrace-base-modules/dynatrace-service-level-objective"
name = "TP_Mobile_VehicleList"
description = "2.0 SLO Mobile"
# entity selector object
filter = ""
# metric expression of the calculation as done in data explorer ui
metric_expression = <<EOT
(100)*((['builtin:service.keyRequest.errors.server.successCount']:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"btc-vehicle-composite-service - PROD~"
)
),entityName.in(
~"GET /api/v1/vehicles~"
)"))))):splitBy())
/
(builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"btc-vehicle-composite-service - PROD~"
)
),entityName.in(
~"GET /api/v1/vehicles~"
)"))))):splitBy()))
EOT
# if not set (removed) it's defaulted to "-1d"
timeframe = "-1d"
# currently the only possible value
evaluation = "AGGREGATE"
# target and warning percentage of the SLO as double
target = 98 # if not set(removed) it's defaulted to 98
warning = 99 # if not set(removed) it's defaulted to 99
}

View File

@ -0,0 +1,49 @@
module TP_Mobile_Login {
source = "../../_dynatrace-base-modules/dynatrace-service-level-objective"
name = "TP_Mobile_Login"
description = "2.0 SLO Mobile"
# entity selector object
filter = ""
# metric expression of the calculation as done in data explorer ui
metric_expression = <<EOT
(100)*((['builtin:service.keyRequest.errors.server.successCount']:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"btc-cn-connected-oauth-service - PROD~"
)
),entityName.in(
~"POST /api/v2/cop/login/pwd~",
~"POST /api/v2/cop/login/sms~",
~"POST /api/v2/cop/sso~",
~"GET /api/v1/cop/logout~"
)"))))):splitBy())
/
(builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"btc-cn-connected-oauth-service - PROD~"
)
),entityName.in(
~"POST /api/v2/cop/login/pwd~",
~"POST /api/v2/cop/login/sms~",
~"POST /api/v2/cop/sso~",
~"GET /api/v1/cop/logout~"
)"))))):splitBy()))
EOT
# if not set (removed) it's defaulted to "-1d"
timeframe = "-1d"
# currently the only possible value
evaluation = "AGGREGATE"
# target and warning percentage of the SLO as double
target = 98 # if not set(removed) it's defaulted to 98
warning = 99 # if not set(removed) it's defaulted to 99
}

View File

@ -0,0 +1,51 @@
module TP_Mobile_Mapping {
source = "../../_dynatrace-base-modules/dynatrace-service-level-objective"
name = "TP_Mobile_Mapping"
description = "2.0 SLO Mobile"
# entity selector object
filter = ""
# metric expression of the calculation as done in data explorer ui
metric_expression = <<EOT
(100)*((['builtin:service.keyRequest.errors.server.successCount']:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"vehicle-mapping-composite-service - PROD~"
)
),entityName.in(
~"POST /api/v2/vehicles/<VIN>/primary~",
~"POST /api/v2/vehicles/<VIN>/primary/map~",
~"POST /api/v1/vehicles/<VIN>/validate-security-code~",
~"POST /api/v1/vehicles/<VIN>/resend-security-code~",
~"DELETE /api/v1/vehicles/<VIN>~"
)"))))):splitBy())
/
(builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"vehicle-mapping-composite-service - PROD~"
)
),entityName.in(
~"POST /api/v2/vehicles/<VIN>/primary~",
~"POST /api/v2/vehicles/<VIN>/primary/map~",
~"POST /api/v1/vehicles/<VIN>/validate-security-code~",
~"POST /api/v1/vehicles/<VIN>/resend-security-code~",
~"DELETE /api/v1/vehicles/<VIN>~"
)"))))):splitBy()))
EOT
# if not set (removed) it's defaulted to "-1d"
timeframe = "-1d"
# currently the only possible value
evaluation = "AGGREGATE"
# target and warning percentage of the SLO as double
target = 98 # if not set(removed) it's defaulted to 98
warning = 99 # if not set(removed) it's defaulted to 99
}

View File

@ -0,0 +1,57 @@
module TP_Mobile_Remote360 {
source = "../../_dynatrace-base-modules/dynatrace-service-level-objective"
name = "TP_Mobile_Remote360"
description = "2.0 SLO Mobile"
# entity selector object
filter = ""
# metric expression of the calculation as done in data explorer ui
metric_expression = <<EOT
(100)*((['builtin:service.keyRequest.errors.server.successCount']:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"remote-360-composite-service - PROD~"
)
),entityName.in(
~"GET /api/v1/events/[UUID]~",
~"POST /api/v1/events/[UUID]/cancel~",
~"POST /api/v1/event/execute~",
~"GET /api/v1/download/[UUID]/<fileName>~",
~"POST /api/v1/download/[UUID]/<fileName>/confirm~",
~"GET /api/v1/vehicle/<VIN>/egomodelurl~",
~"GET /api/v1/vehicle/<VIN>/key~",
~"GET /api/v1/recordings/vehicle/<VIN>~"
)"))))):splitBy())
/
(builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"remote-360-composite-service - PROD~"
)
),entityName.in(
~"GET /api/v1/events/[UUID]~",
~"POST /api/v1/events/[UUID]/cancel~",
~"POST /api/v1/event/execute~",
~"GET /api/v1/download/[UUID]/<fileName>~",
~"POST /api/v1/download/[UUID]/<fileName>/confirm~",
~"GET /api/v1/vehicle/<VIN>/egomodelurl~",
~"GET /api/v1/vehicle/<VIN>/key~",
~"GET /api/v1/recordings/vehicle/<VIN>~"
)"))))):splitBy()))
EOT
# if not set (removed) it's defaulted to "-1d"
timeframe = "-1d"
# currently the only possible value
evaluation = "AGGREGATE"
# target and warning percentage of the SLO as double
target = 98 # if not set(removed) it's defaulted to 98
warning = 99 # if not set(removed) it's defaulted to 99
}

View File

@ -0,0 +1,45 @@
module TP_Mobile_Send2VehicleMGU {
source = "../../_dynatrace-base-modules/dynatrace-service-level-objective"
name = "TP_Mobile_Send2VehicleMGU"
description = "2.0 SLO Mobile"
# entity selector object
filter = ""
# metric expression of the calculation as done in data explorer ui
metric_expression = <<EOT
(100)*((['builtin:service.keyRequest.errors.server.successCount']:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"TripService - PROD~"
)
),entityName.in(
~"/v3/motorist/[UUID]/trips~",
~"/v2/motorist/[UUID]/trips~"
)"))))):splitBy())
/
(builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"TripService - PROD~"
)
),entityName.in(
~"/v3/motorist/[UUID]/trips~",
~"/v2/motorist/[UUID]/trips~"
)"))))):splitBy()))
EOT
# if not set (removed) it's defaulted to "-1d"
timeframe = "-1d"
# currently the only possible value
evaluation = "AGGREGATE"
# target and warning percentage of the SLO as double
target = 98 # if not set(removed) it's defaulted to 98
warning = 99 # if not set(removed) it's defaulted to 99
}

View File

@ -0,0 +1,43 @@
module TP_Mobile_VehicleList {
source = "../../_dynatrace-base-modules/dynatrace-service-level-objective"
name = "TP_Mobile_VehicleList"
description = "2.0 SLO Mobile"
# entity selector object
filter = ""
# metric expression of the calculation as done in data explorer ui
metric_expression = <<EOT
(100)*((['builtin:service.keyRequest.errors.server.successCount']:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"btc-vehicle-composite-service - PROD~"
)
),entityName.in(
~"GET /api/v1/vehicles~"
)"))))):splitBy())
/
(builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"btc-vehicle-composite-service - PROD~"
)
),entityName.in(
~"GET /api/v1/vehicles~"
)"))))):splitBy()))
EOT
# if not set (removed) it's defaulted to "-1d"
timeframe = "-1d"
# currently the only possible value
evaluation = "AGGREGATE"
# target and warning percentage of the SLO as double
target = 98 # if not set(removed) it's defaulted to 98
warning = 99 # if not set(removed) it's defaulted to 99
}

View File

@ -0,0 +1,49 @@
module TP_Mobile_Login {
source = "../../_dynatrace-base-modules/dynatrace-service-level-objective"
name = "TP_Mobile_Login"
description = "2.0 SLO Mobile"
# entity selector object
filter = ""
# metric expression of the calculation as done in data explorer ui
metric_expression = <<EOT
(100)*((['builtin:service.keyRequest.errors.server.successCount']:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"btc-cn-connected-oauth-service - PROD~"
)
),entityName.in(
~"POST /api/v2/cop/login/pwd~",
~"POST /api/v2/cop/login/sms~",
~"POST /api/v2/cop/sso~",
~"GET /api/v1/cop/logout~"
)"))))):splitBy())
/
(builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"btc-cn-connected-oauth-service - PROD~"
)
),entityName.in(
~"POST /api/v2/cop/login/pwd~",
~"POST /api/v2/cop/login/sms~",
~"POST /api/v2/cop/sso~",
~"GET /api/v1/cop/logout~"
)"))))):splitBy()))
EOT
# if not set (removed) it's defaulted to "-1d"
timeframe = "-1d"
# currently the only possible value
evaluation = "AGGREGATE"
# target and warning percentage of the SLO as double
target = 98 # if not set(removed) it's defaulted to 98
warning = 99 # if not set(removed) it's defaulted to 99
}

View File

@ -0,0 +1,51 @@
module TP_Mobile_Mapping {
source = "../../_dynatrace-base-modules/dynatrace-service-level-objective"
name = "TP_Mobile_Mapping"
description = "2.0 SLO Mobile"
# entity selector object
filter = ""
# metric expression of the calculation as done in data explorer ui
metric_expression = <<EOT
(100)*((['builtin:service.keyRequest.errors.server.successCount']:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"vehicle-mapping-composite-service - PROD~"
)
),entityName.in(
~"POST /api/v2/vehicles/<VIN>/primary~",
~"POST /api/v2/vehicles/<VIN>/primary/map~",
~"POST /api/v1/vehicles/<VIN>/validate-security-code~",
~"POST /api/v1/vehicles/<VIN>/resend-security-code~",
~"DELETE /api/v1/vehicles/<VIN>~"
)"))))):splitBy())
/
(builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"vehicle-mapping-composite-service - PROD~"
)
),entityName.in(
~"POST /api/v2/vehicles/<VIN>/primary~",
~"POST /api/v2/vehicles/<VIN>/primary/map~",
~"POST /api/v1/vehicles/<VIN>/validate-security-code~",
~"POST /api/v1/vehicles/<VIN>/resend-security-code~",
~"DELETE /api/v1/vehicles/<VIN>~"
)"))))):splitBy()))
EOT
# if not set (removed) it's defaulted to "-1d"
timeframe = "-1d"
# currently the only possible value
evaluation = "AGGREGATE"
# target and warning percentage of the SLO as double
target = 98 # if not set(removed) it's defaulted to 98
warning = 99 # if not set(removed) it's defaulted to 99
}

View File

@ -0,0 +1,57 @@
module TP_Mobile_Remote360 {
source = "../../_dynatrace-base-modules/dynatrace-service-level-objective"
name = "TP_Mobile_Remote360"
description = "2.0 SLO Mobile"
# entity selector object
filter = ""
# metric expression of the calculation as done in data explorer ui
metric_expression = <<EOT
(100)*((['builtin:service.keyRequest.errors.server.successCount']:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"remote-360-composite-service - PROD~"
)
),entityName.in(
~"GET /api/v1/events/[UUID]~",
~"POST /api/v1/events/[UUID]/cancel~",
~"POST /api/v1/event/execute~",
~"GET /api/v1/download/[UUID]/<fileName>~",
~"POST /api/v1/download/[UUID]/<fileName>/confirm~",
~"GET /api/v1/vehicle/<VIN>/egomodelurl~",
~"GET /api/v1/vehicle/<VIN>/key~",
~"GET /api/v1/recordings/vehicle/<VIN>~"
)"))))):splitBy())
/
(builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"remote-360-composite-service - PROD~"
)
),entityName.in(
~"GET /api/v1/events/[UUID]~",
~"POST /api/v1/events/[UUID]/cancel~",
~"POST /api/v1/event/execute~",
~"GET /api/v1/download/[UUID]/<fileName>~",
~"POST /api/v1/download/[UUID]/<fileName>/confirm~",
~"GET /api/v1/vehicle/<VIN>/egomodelurl~",
~"GET /api/v1/vehicle/<VIN>/key~",
~"GET /api/v1/recordings/vehicle/<VIN>~"
)"))))):splitBy()))
EOT
# if not set (removed) it's defaulted to "-1d"
timeframe = "-1d"
# currently the only possible value
evaluation = "AGGREGATE"
# target and warning percentage of the SLO as double
target = 98 # if not set(removed) it's defaulted to 98
warning = 99 # if not set(removed) it's defaulted to 99
}

View File

@ -0,0 +1,45 @@
module TP_Mobile_Send2VehicleMGU {
source = "../../_dynatrace-base-modules/dynatrace-service-level-objective"
name = "TP_Mobile_Send2VehicleMGU"
description = "2.0 SLO Mobile"
# entity selector object
filter = ""
# metric expression of the calculation as done in data explorer ui
metric_expression = <<EOT
(100)*((['builtin:service.keyRequest.errors.server.successCount']:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"TripService - PROD~"
)
),entityName.in(
~"/v3/motorist/[UUID]/trips~",
~"/v2/motorist/[UUID]/trips~"
)"))))):splitBy())
/
(builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"TripService - PROD~"
)
),entityName.in(
~"/v3/motorist/[UUID]/trips~",
~"/v2/motorist/[UUID]/trips~"
)"))))):splitBy()))
EOT
# if not set (removed) it's defaulted to "-1d"
timeframe = "-1d"
# currently the only possible value
evaluation = "AGGREGATE"
# target and warning percentage of the SLO as double
target = 98 # if not set(removed) it's defaulted to 98
warning = 99 # if not set(removed) it's defaulted to 99
}

View File

@ -0,0 +1,43 @@
module TP_Mobile_VehicleList {
source = "../../_dynatrace-base-modules/dynatrace-service-level-objective"
name = "TP_Mobile_VehicleList"
description = "2.0 SLO Mobile"
# entity selector object
filter = ""
# metric expression of the calculation as done in data explorer ui
metric_expression = <<EOT
(100)*((['builtin:service.keyRequest.errors.server.successCount']:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"btc-vehicle-composite-service - PROD~"
)
),entityName.in(
~"GET /api/v1/vehicles~"
)"))))):splitBy())
/
(builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method),
fromRelationship.isServiceMethodOfService(
type(~"SERVICE~"),entityName.in(
~"btc-vehicle-composite-service - PROD~"
)
),entityName.in(
~"GET /api/v1/vehicles~"
)"))))):splitBy()))
EOT
# if not set (removed) it's defaulted to "-1d"
timeframe = "-1d"
# currently the only possible value
evaluation = "AGGREGATE"
# target and warning percentage of the SLO as double
target = 98 # if not set(removed) it's defaulted to 98
warning = 99 # if not set(removed) it's defaulted to 99
}