Loading src/opticalattackmanager/utils/monitor.py +1 −1 Original line number Diff line number Diff line Loading @@ -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() Loading src/tests/scenario3/optical/dashboard.json +89 −0 Original line number Diff line number Diff line Loading @@ -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", Loading src/tests/scenario3/optical/ofc23/run_experiment_demo.py +2 −1 Original line number Diff line number Diff line Loading @@ -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 Loading src/tests/scenario3/optical/scaphandre.yaml 0 → 100644 +28 −0 Original line number Diff line number Diff line 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 Loading
src/opticalattackmanager/utils/monitor.py +1 −1 Original line number Diff line number Diff line Loading @@ -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() Loading
src/tests/scenario3/optical/dashboard.json +89 −0 Original line number Diff line number Diff line Loading @@ -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", Loading
src/tests/scenario3/optical/ofc23/run_experiment_demo.py +2 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
src/tests/scenario3/optical/scaphandre.yaml 0 → 100644 +28 −0 Original line number Diff line number Diff line 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