"description":"URLs to monitor for availability and certificate lifetime",
"type":"array",
"items":{
"type":"string"
}
},
"partitions":{
"description":"SlapOS partitions to monitor",
"type":"array",
"items":{
"type":"object",
"properties":{
"name":{
"type":"string",
"description":"Friendly name of the partition",
"examples":[
"mariadb",
"zope-activity"
]
},
"reference":{
"type":"string",
"description":"Reference of the partition",
"examples":[
"slappart1",
"slappart2"
]
},
"type":{
"type":"string",
"description":"Type of the partition. Known types have extra metrics and logs collected",
"enum":[
"erp5/mariadb",
"erp5/balancer",
"erp5/zope-activity",
"erp5/zope-front",
"erp5/zeo",
"mariadb",
"default"
]
},
"file-path":{
"type":"string",
"description":"Glob for the files to watch. This mostly makes sense for `default` type"
},
"static-tags":{
"type":"object",
"description":"Static tags for this partition",
"examples":[
{
"region":"eu",
"data-center":"abc123"
}
]
}
},
"anyOf":[
{
"properties":{
"type":{
"const":"default"
}
},
"required":[
"name",
"file-path"
]
},
{
"properties":{
"type":{
"not":{
"const":"default"
}
}
},
"required":[
"name",
"reference"
]
}
],
"examples":[
{
"name":"zope-backoffice",
"type":"erp5/zope-front",
"reference":"slappart1",
"static-tags":{
"instance":"instance-name"
}
},
{
"name":"mariadb",
"type":"erp5/mariadb",
"reference":"slappart2"
},
{
"name":"syslog",
"type":"default",
"file-path":"/var/log/syslog"
}
]
}
}
}
}
},
"promtail-extra-scrape-config":{
"description":"Raw promtail config (experimental parameter, see https://github.com/grafana/loki/blob/v0.3.0/docs/promtail.md#scrape-configs for detail)",
# normalize slapos process names, remove hash from wrappers and -on-watch suffix
processors["regex"].append({
"namepass": ["slapos-processes"],
"order": 1,
"tags": [{
"key": "name",
"pattern": "^(.*)-.{32}",
# XXX we concatenate strings so that we don't have to escape them for buildout
"replacement": "$" + "{1}",
}]})
processors["regex"].append({
"namepass": ["slapos-processes"],
"order": 2,
"tags": [{
"key": "name",
"pattern": "^(.*)-on-watch$",
"replacement": "$" + "{1}",
}]})
processors["enum"].append({
"namepass": [ "slapos-processes"],
"mapping": [{
# "tag": "group", # TODO: rename this in input plugin (in the golang code)
"tag": "slappart",
"dest": "partition",
"value_mappings": partition_mapping,
}]})
# TODOs:
# - [ ] slapos input
# - [x] friendly name of slappart
# - [x] strip hashes from -on-watch
# - [x] activity metrics
# - [ ] alert dashboard
# - [ ] inclu "jerome-dev" partout ???
# - [ ] apdex
# - [ ] check why no history list length in mysql metrics
options["extra-config"] = toml.dumps({
"inputs": inputs,
"processors": processors})
# import pdb; pdb.set_trace()
# apdex
# SELECT sum("success") / sum("all") FROM
# (SELECT count("duration") AS "all" FROM "jerome-dev-balancer" WHERE $timeFilter GROUP BY time($__interval) fill(null)),
# (SELECT count("duration") AS "success" FROM "jerome-dev-balancer" WHERE ("resp_code" = '200' ) AND $timeFilter GROUP BY time($__interval) fill(null))
#SELECT sum("success") + sum("all") FROM
# (SELECT count("duration") AS "all" FROM "jerome-dev-balancer" WHERE $timeFilter GROUP BY time($__interval) fill(0)),
# (SELECT count("duration") AS "success" FROM "jerome-dev-balancer" WHERE ("resp_code" = '200' ) AND $timeFilter GROUP BY time($__interval) fill(0))