slogen supports native sumologic SLO creation from spec version v1 of OpenSLO.
Samples can be found in the samples/sumologic/v1 directory.
They can be tried out as below from the root of the repo.
go run main.go samples/sumologic/v1 --clean --onlyNative=true --sloFolder=slogen-v1 --sloMonitorFolder=slogen-v- the
namevalue specified inmetadata:namefield of the OpenSLO spec is used as the SLO name - Budgeting method
Occurrencesmaps toRequestbased SLO's whileTimeslicesmaps toWindowbased SLO's - use
sumologic-logsasmetricSource:typefor logs based Indicators, whilesumologic-metricsfor metrics based Indicators
For now slogen doesn't support inline alerting conditional in SLO config yaml. Alerting policies need to specified separately as showed in the samples and then can be referred by name the SLO config.
To specify the critical and warning threshold use the same condition name while changing the severity level as done in the samples.
Notification targets can be specified in the OpenSLO format while using the annotations field for specifying the extra parameters required. These targets can then be referred in the alert policy config to generate the monitors.
Examples below
apiVersion: openslo/v1
kind: AlertNotificationTarget
spec:
description: Notifies by a mail message to the on-call devops mailing group
target: email
metadata:
name: OnCallDevopsMailNotification
annotations:
recipients: "agaurav@sumologic.com"
subject: "Monitor Alert: {{TriggerType}} on {{Name}}"
message_body: "Triggered {{TriggerType}} Alert on {{Name}}: {{QueryURL}}"
time_zone: "PST"
run_for_triggers: "Critical,ResolvedCritical" apiVersion: openslo/v1
kind: AlertNotificationTarget
spec:
description: Notifies by a mail message to the on-call devops mailing group
target: connection
metadata:
name: OnCallDevopsSlackNotification
annotations:
connection_type : "Webhook"
connection_id: "0000000000000431"
run_for_triggers: "Critical,ResolvedCritical"The annotation field sumologic/slo-folder-id can be used to specify the id of the folder in which the SLO should be created.
Similarly, the annotation field sumologic/slo-monitor-folder-id can be used to specify the id of the folder in which the SLO monitor should be created.
e.g.
apiVersion: openslo/v1
kind: SLO
metadata:
name: drift_gen_Calendar
displayName: DriftGen SLO Calendar
annotations:
sumologic/signal-type: Latency
sumologic/tf-resource-name: slo-driftgen-latency-calendar
sumologic/slo-folder-id: 0000000000000ABC
sumologic/monitor-folder-id: 0000000000026ABC
spec:
description: test slo created from slogen
service: tsat
indicator:
metadata:
...
The annotation field sumologic/tf-resource-name can be used to pin the terraform resource name, thus allowing the SLO name to be changed without destroying the old SLO in sumo.
This is required as otherwise the terraform resource name is derived from SLO name and its service.