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