Skip to content
Snippets Groups Projects
Commit d9ea0308 authored by Carlos Natalino Da Silva's avatar Carlos Natalino Da Silva
Browse files

Improvements to the dashboard.

parent 396f497e
No related branches found
No related tags found
2 merge requests!142Release TeraFlowSDN 2.1,!97Optical cybersecurity scenario
......@@ -60,7 +60,7 @@ async def detect_attack(
LOGGER.warning(
"Exception while processing service_id {}/{}".format(service_id, kpi_id)
)
LOGGER.exception(e)
# LOGGER.exception(e)
DROP_COUNTER.inc()
......
......@@ -1364,6 +1364,95 @@
"panels": [],
"title": "General status",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 45
},
"id": 33,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "right"
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "sum(scaph_process_power_consumption_microwatts{namespace=\"tfs\", cmdline=~\".+opticalattackdetector.+\"})/1000000",
"legendFormat": "Detector",
"range": true,
"refId": "A"
}
],
"title": "Energy consumption",
"type": "timeseries"
}
],
"refresh": "5s",
......
......@@ -32,7 +32,8 @@ v1 = client.CoreV1Api()
caching_pod = None
pods = v1.list_namespaced_pod(namespace=namespace)
for pod in pods.items:
if "caching" in pod.metadata.labels["app"]:
print(pod.metadata)
if "app" in pod.metadata.labels and "caching" in pod.metadata.labels["app"]:
caching_pod = pod
LOGGER = None
......
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
namespace: monitoring # namespace where prometheus is running
name: tfs-scaph-metric
labels:
app.kubernetes.io/name: scaphandre
#release: prometheus
#release: prom # name of the release
# ( VERY IMPORTANT: You need to know the correct release name by viewing
# the servicemonitor of Prometheus itself: Without the correct name,
# Prometheus cannot identify the metrics of the Flask app as the target.)
spec:
selector:
matchLabels:
# Target app service
#namespace: tfs
app.kubernetes.io/name: scaphandre
#release: prometheus # same as above
endpoints:
- port: metrics # named port in target app
scheme: http
path: /metrics # path to scrape
interval: 5s # scrape interval
namespaceSelector:
any: false
matchNames:
- tfs # namespace where the app is running
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment