diff --git a/argus/client/session.py b/argus/client/session.py index 08714dbf..0f4fd731 100644 --- a/argus/client/session.py +++ b/argus/client/session.py @@ -27,6 +27,45 @@ def _resolve_use_tunnel(use_tunnel: bool | None) -> bool: return os.environ.get("ARGUS_USE_TUNNEL", "").strip().lower() in ("1", "true", "yes", "on") +# Upper bound on the build-id header value to keep the backend's per-build +# Prometheus label cardinality bounded even if a client sends junk. +_MAX_BUILD_ID_LEN = 256 + + +def _resolve_build_id() -> str | None: + """Resolve a human-identifiable build id for tunnel attribution. + + Order of preference: + + 1. ``ARGUS_BUILD_ID`` — explicit override, used verbatim. + 2. Jenkins ``JOB_NAME`` (full folder path) combined with ``BUILD_NUMBER`` + when available, formatted as ``job/path#42`` for easy identification. + + Returns ``None`` outside CI so the ``X-Argus-Build-Id`` header is simply + omitted. + """ + override = os.environ.get("ARGUS_BUILD_ID", "").strip() + if override: + return override[:_MAX_BUILD_ID_LEN] + + job_name = os.environ.get("JOB_NAME", "").strip() + if not job_name: + return None + build_number = os.environ.get("BUILD_NUMBER", "").strip() + build_id = f"{job_name}#{build_number}" if build_number else job_name + return build_id[:_MAX_BUILD_ID_LEN] + + +def _resolve_build_url() -> str | None: + """Jenkins ``BUILD_URL`` (or ``ARGUS_BUILD_URL`` override) for the run. + + Carried as ``X-Argus-Build-Url`` so the Grafana ``build_id`` series can link + straight back to the originating build. ``None`` when not running in CI. + """ + value = (os.environ.get("ARGUS_BUILD_URL") or os.environ.get("BUILD_URL") or "").strip() + return value[:_MAX_BUILD_ID_LEN * 2] if value else None + + def _resolve_monitor_interval() -> float: raw = os.environ.get("ARGUS_TUNNEL_MONITOR_INTERVAL") if raw is None: @@ -82,6 +121,8 @@ def __init__(self, auth_token: str, original_base_url: str, max_retries: int = 3 self._auth_token = auth_token self._original_base_url = original_base_url + self._build_id = _resolve_build_id() + self._build_url = _resolve_build_url() self._tunnel: SSHTunnel | None = None self._tunnel_config: TunnelConfig | None = None @@ -252,6 +293,10 @@ def _tunnel_headers(self) -> dict[str, str]: } if self._tunnel_config.key_id: headers["X-Forwarded-Key-ID"] = self._tunnel_config.key_id + if self._build_id: + headers["X-Argus-Build-Id"] = self._build_id + if self._build_url: + headers["X-Argus-Build-Url"] = self._build_url return headers def request(self, method: str, url: str, *args, **kwargs) -> requests.Response: diff --git a/argus/client/tests/test_tunnel.py b/argus/client/tests/test_tunnel.py index 47101e57..605cab3f 100644 --- a/argus/client/tests/test_tunnel.py +++ b/argus/client/tests/test_tunnel.py @@ -388,6 +388,67 @@ def test_tunneled_session_close_unregisters_atexit(): callback(ref) +def _prime_tunnel_state(session): + """Force a session into the 'tunnel active' state so _tunnel_headers() emits.""" + from types import SimpleNamespace + + session._tunnel_port = 12345 + session._tunnel_established_at = "2026-06-16T00:00:00+00:00" + session._tunnel_config = SimpleNamespace(proxy_host="proxy.example.com", key_id="key-uuid") + + +def test_tunnel_headers_explicit_build_id_used_verbatim(monkeypatch): + monkeypatch.setenv("ARGUS_BUILD_ID", "custom-id#7") + session = TunneledSession(auth_token="token", original_base_url="https://argus.scylladb.com") + try: + _prime_tunnel_state(session) + headers = session._tunnel_headers() + assert headers["X-Argus-Build-Id"] == "custom-id#7" + assert headers["X-SSH-Tunnel-Origin"] == "proxy.example.com" + finally: + session.close() + + +def test_tunnel_headers_compose_job_name_and_build_number(monkeypatch): + monkeypatch.delenv("ARGUS_BUILD_ID", raising=False) + monkeypatch.setenv("JOB_NAME", "scylla-master/longevity/longevity-100gb") + monkeypatch.setenv("BUILD_NUMBER", "42") + monkeypatch.setenv("BUILD_URL", "https://jenkins.scylladb.com/job/scylla-master/job/longevity/42/") + session = TunneledSession(auth_token="token", original_base_url="https://argus.scylladb.com") + try: + _prime_tunnel_state(session) + headers = session._tunnel_headers() + assert headers["X-Argus-Build-Id"] == "scylla-master/longevity/longevity-100gb#42" + assert headers["X-Argus-Build-Url"] == "https://jenkins.scylladb.com/job/scylla-master/job/longevity/42/" + finally: + session.close() + + +def test_tunnel_headers_build_id_job_name_without_build_number(monkeypatch): + monkeypatch.delenv("ARGUS_BUILD_ID", raising=False) + monkeypatch.delenv("BUILD_NUMBER", raising=False) + monkeypatch.setenv("JOB_NAME", "jenkins-job-name") + session = TunneledSession(auth_token="token", original_base_url="https://argus.scylladb.com") + try: + _prime_tunnel_state(session) + assert session._tunnel_headers()["X-Argus-Build-Id"] == "jenkins-job-name" + finally: + session.close() + + +def test_tunnel_headers_omit_build_id_and_url_when_unset(monkeypatch): + for var in ("ARGUS_BUILD_ID", "JOB_NAME", "BUILD_NUMBER", "ARGUS_BUILD_URL", "BUILD_URL"): + monkeypatch.delenv(var, raising=False) + session = TunneledSession(auth_token="token", original_base_url="https://argus.scylladb.com") + try: + _prime_tunnel_state(session) + headers = session._tunnel_headers() + assert "X-Argus-Build-Id" not in headers + assert "X-Argus-Build-Url" not in headers + finally: + session.close() + + def test_argus_client_works_as_context_manager(requests_mock, monkeypatch): requests_mock.get( "https://argus.scylladb.com/api/v1/client/testrun/test-type/test-id/get", diff --git a/argus_backend.py b/argus_backend.py index 44adb20c..b49bd4c5 100644 --- a/argus_backend.py +++ b/argus_backend.py @@ -79,6 +79,21 @@ def register_metrics(): }, ) ) + METRICS.register_default( + METRICS.counter( + "http_request_tunnel_build_total", + "Tunneled requests by Jenkins build/job id (X-Argus-Build-Id)", + labels={ + # One series per Jenkins build (job/path#42). Requests without the + # header (non-tunnel or pre-attribution clients) fall into the + # "unknown" bucket and are filtered out in dashboards. + "build_id": lambda: request.headers.get("X-Argus-Build-Id") or "unknown", + # 1:1 with build_id (no extra series) — carried so Grafana can + # link the build_id straight back to the Jenkins build. + "build_url": lambda: request.headers.get("X-Argus-Build-Url") or "", + }, + ) + ) def start_server(config=None) -> Flask: diff --git a/scripts/grafana/argus-overview.json b/scripts/grafana/argus-overview.json new file mode 100644 index 00000000..f3ba7d91 --- /dev/null +++ b/scripts/grafana/argus-overview.json @@ -0,0 +1,2468 @@ +{ + "__elements": {}, + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 3, + "panels": [], + "title": "Application Stats", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "decimals": 0, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + } + ] + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "HTTP 500" + }, + "properties": [ + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 50 + } + ] + } + } + ] + } + ] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 1 + }, + "id": 10, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "disableTextWrap": false, + "editorMode": "code", + "expr": "sum by(status) (increase(http_request_total[$__range]))", + "fullMetaSearch": false, + "includeNullMetadata": true, + "legendFormat": "HTTP {{status}}", + "range": true, + "refId": "A", + "useBackend": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + } + } + ], + "title": "HTTP Status", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "orange", + "value": 1000 + }, + { + "color": "red", + "value": 1500 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 12, + "y": 1 + }, + "id": 7, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "nginx_connections_active", + "fullMetaSearch": false, + "includeNullMetadata": true, + "legendFormat": "NGINX HTTP Requests", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "Active Connections", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 9, + "x": 15, + "y": 1 + }, + "id": 2, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "disableTextWrap": false, + "editorMode": "code", + "expr": "sum(increase(nginx_http_requests_total[$__range]))", + "fullMetaSearch": false, + "includeNullMetadata": true, + "legendFormat": "HTTP Requests", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "NGINX Requests", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 4 + }, + "id": 1, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "disableTextWrap": false, + "editorMode": "code", + "expr": "rate (http_request_total{method!=\"HEAD\"}[1m])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "legendFormat": "{{method}} {{status}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "HTTP Requests", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 30, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 4 + }, + "id": 9, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "disableTextWrap": false, + "editorMode": "builder", + "exemplar": true, + "expr": "rate(http_request_by_endpoint_total[$__rate_interval])", + "format": "time_series", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": false, + "interval": "", + "legendFormat": "{{endpoint}}", + "range": true, + "refId": "A", + "useBackend": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + } + } + ], + "title": "Endpoint Request Rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 125 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byValue", + "options": { + "op": "gte", + "reducer": "allIsZero", + "value": 0 + } + }, + "properties": [] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 12 + }, + "id": 11, + "options": { + "displayMode": "gradient", + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "maxVizHeight": 300, + "minVizHeight": 16, + "minVizWidth": 8, + "namePlacement": "left", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showUnfilled": false, + "sizing": "manual", + "valueMode": "text" + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "editorMode": "code", + "exemplar": false, + "expr": "sort_desc(http_request_by_endpoint_total - http_request_by_endpoint_total offset $__range) > 15", + "format": "time_series", + "instant": true, + "legendFormat": "{{method}} /{{endpoint}}", + "range": false, + "refId": "A", + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + } + } + ], + "title": "Endpoint Stats", + "type": "bargauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "semi-dark-blue", + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "hue", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 7, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": 0 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 12 + }, + "id": 12, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "editorMode": "code", + "expr": "histogram_quantile(0.99, sum by(le, endpoint) (rate(http_request_duration_seconds_bucket[$__range])))", + "legendFormat": "{{endpoint}}", + "range": true, + "refId": "A", + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + } + } + ], + "title": "Request P99", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 20 + }, + "id": 4, + "panels": [], + "title": "System Info", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "Per-interface network traffic (receive and transmit) in bits per second", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 40, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + } + ] + }, + "unit": "bps" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Tx.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 21 + }, + "id": 5, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "editorMode": "code", + "expr": "rate(node_network_receive_bytes_total[$__rate_interval])*8", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Rx {{device}}", + "range": true, + "refId": "A", + "step": 240, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + } + }, + { + "editorMode": "code", + "expr": "rate(node_network_transmit_bytes_total[$__rate_interval])*8", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Tx {{device}} ", + "range": true, + "refId": "B", + "step": 240, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + } + } + ], + "title": "Network Traffic Basic", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "CPU time spent busy vs idle, split by activity type", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 40, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "percent" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Busy Iowait" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#890F02", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Idle" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Busy System" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Busy User" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A437C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Busy Other" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 21 + }, + "id": 6, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true, + "width": 250 + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "editorMode": "code", + "exemplar": false, + "expr": "sum(irate(node_cpu_seconds_total{mode=\"system\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total) by (cpu)))", + "format": "time_series", + "hide": false, + "instant": false, + "intervalFactor": 1, + "legendFormat": "Busy System", + "range": true, + "refId": "A", + "step": 240, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + } + }, + { + "editorMode": "code", + "expr": "sum(irate(node_cpu_seconds_total{mode=\"user\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total) by (cpu)))", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Busy User", + "range": true, + "refId": "B", + "step": 240, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + } + }, + { + "editorMode": "code", + "expr": "sum(irate(node_cpu_seconds_total{mode=\"iowait\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total) by (cpu)))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Busy Iowait", + "range": true, + "refId": "C", + "step": 240, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + } + }, + { + "editorMode": "code", + "expr": "sum(irate(node_cpu_seconds_total{mode=~\".*irq\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total) by (cpu)))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Busy IRQs", + "range": true, + "refId": "D", + "step": 240, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + } + }, + { + "editorMode": "code", + "expr": "sum(irate(node_cpu_seconds_total{mode!='idle',mode!='user',mode!='system',mode!='iowait',mode!='irq',mode!='softirq'}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total) by (cpu)))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Busy Other", + "range": true, + "refId": "E", + "step": 240, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + } + }, + { + "editorMode": "code", + "expr": "sum(irate(node_cpu_seconds_total{mode=\"idle\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total) by (cpu)))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Idle", + "range": true, + "refId": "F", + "step": 240, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + } + } + ], + "title": "CPU Basic", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "Percentage of filesystem space used for each mounted device", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 40, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 29 + }, + "id": 8, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "editorMode": "code", + "expr": "((node_filesystem_size_bytes{device!~\"rootfs\"} - node_filesystem_avail_bytes{device!~\"rootfs\"}) / node_filesystem_size_bytes{device!~\"rootfs\"}) * 100", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{mountpoint}}", + "range": true, + "refId": "A", + "step": 240, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + } + } + ], + "title": "Disk Space Used Basic", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 37 + }, + "id": 100, + "panels": [], + "title": "SSH Tunneling", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 30, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 38 + }, + "id": 101, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(http_request_ssh_tunnel_total{ssh_tunnel=\"yes\"}[$__rate_interval]))", + "legendFormat": "via SSH tunnel", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(http_request_ssh_tunnel_total{ssh_tunnel=\"no\"}[$__rate_interval]))", + "legendFormat": "direct / cloudflare", + "range": true, + "refId": "B" + } + ], + "title": "Tunneled vs Direct Traffic (proof)", + "type": "timeseries", + "description": "Requests arriving with X-SSH-Tunnel-Origin (set by the client ONLY when traffic actually traverses the established SSH tunnel). Non-zero 'via SSH tunnel' is proof the tunnel is up and carrying traffic." + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "max": 100, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": 0 + }, + { + "color": "orange", + "value": 50 + }, + { + "color": "green", + "value": 90 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 12, + "y": 38 + }, + "id": 102, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "100 * sum(rate(http_request_ssh_tunnel_total{ssh_tunnel=\"yes\"}[$__rate_interval])) / clamp_min(sum(rate(http_request_ssh_tunnel_total[$__rate_interval])), 1)", + "legendFormat": "tunneled %", + "range": true, + "refId": "A" + } + ], + "title": "% Traffic via Tunnel", + "type": "gauge", + "description": "Share of backend requests that arrived through the SSH tunnel." + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 0.0001 + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 18, + "y": 38 + }, + "id": 103, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(http_request_ssh_tunnel_total{ssh_tunnel=\"yes\",tunnel_established=\"no\"}[$__rate_interval]))", + "legendFormat": "anomalous req/s", + "range": true, + "refId": "A" + } + ], + "title": "Header Anomalies (tunnel w/o established-at)", + "type": "stat", + "description": "Requests claiming tunnel origin but missing X-Tunnel-Established-At. Should be ~0; non-zero implies client/header inconsistency or spoofing." + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 46 + }, + "id": 104, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(http_request_by_endpoint_total{endpoint=~\".*get_authorized_keys\"}[$__rate_interval]))", + "legendFormat": "AuthorizedKeysCommand lookups", + "range": true, + "refId": "A" + } + ], + "title": "SSH Connection / Auth Attempts (proxy key lookups)", + "type": "timeseries", + "description": "Each new SSH connection to the proxy triggers one AuthorizedKeysCommand -> argus-cli -> GET /ssh/keys. This rate approximates SSH connection/auth-attempt rate on the proxy host." + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 46 + }, + "id": 105, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(http_request_by_endpoint_total{endpoint=~\".*register_tunnel\",method=\"POST\"}[$__rate_interval]))", + "legendFormat": "key registrations (POST /ssh/tunnel)", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(http_request_by_endpoint_total{endpoint=~\".*get_tunnel_connection\"}[$__rate_interval]))", + "legendFormat": "config fetches (GET /ssh/tunnel)", + "range": true, + "refId": "B" + } + ], + "title": "Tunnel Registrations & Config Fetches", + "type": "timeseries", + "description": "New client SSH key registrations and proxy-config fetches. Spikes indicate clients (re)establishing tunnels." + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 54 + }, + "id": 106, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "topk(10, sum by(endpoint) (rate(http_request_ssh_tunnel_total{ssh_tunnel=\"yes\"}[$__rate_interval])))", + "legendFormat": "{{endpoint}}", + "range": true, + "refId": "A" + } + ], + "title": "Tunneled Requests by Endpoint", + "type": "timeseries", + "description": "Top backend endpoints receiving traffic through the SSH tunnel." + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 54 + }, + "id": 107, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(http_request_by_user_agent_total{user_agent_category=\"argus-client-tunnel\"}[$__rate_interval]))", + "legendFormat": "argus-client-tunnel", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(http_request_by_user_agent_total{user_agent_category=\"argus-client\"}[$__rate_interval]))", + "legendFormat": "argus-client (direct)", + "range": true, + "refId": "B" + } + ], + "title": "Tunnel Client Requests by User-Agent", + "type": "timeseries", + "description": "Requests from the tunnel-aware client UA vs the plain client UA." + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "Tunneled requests attributed to the Jenkins build that originated them (X-Argus-Build-Id, formatted job/path#buildNumber). Click a series/point and choose 'Open Jenkins build' to jump to the run. The 'unknown' bucket (non-tunnel or pre-attribution clients) is excluded.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + } + ] + }, + "unit": "reqps", + "links": [ + { + "title": "Open Jenkins build", + "url": "${__field.labels.build_url}", + "targetBlank": true + } + ] + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 61 + }, + "id": 108, + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "topk(15, sum by(build_id, build_url) (rate(http_request_tunnel_build_total{build_id!=\"unknown\"}[$__rate_interval])))", + "legendFormat": "{{build_id}}", + "range": true, + "refId": "A" + } + ], + "title": "Tunneled Traffic by Build / Job", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 70 + }, + "id": 120, + "panels": [], + "title": "SSH Proxy Vitals", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + } + ] + }, + "unit": "bps" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/Tx.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 71 + }, + "id": 121, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "rate(node_network_receive_bytes_total{job=~\"$proxy_job\",device!~\"lo\"}[$__rate_interval])*8", + "legendFormat": "Rx {{device}}", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "rate(node_network_transmit_bytes_total{job=~\"$proxy_job\",device!~\"lo\"}[$__rate_interval])*8", + "legendFormat": "Tx {{device}}", + "range": true, + "refId": "B" + } + ], + "title": "Proxy Bandwidth (NIC)", + "type": "timeseries", + "description": "Per-interface bandwidth on the proxy host. REQUIRES node_exporter running on the proxy, scraped under job=$proxy_job." + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "max": 100, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "orange", + "value": 70 + }, + { + "color": "red", + "value": 90 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 12, + "y": 71 + }, + "id": 122, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "100 * (1 - avg(rate(node_cpu_seconds_total{job=~\"$proxy_job\",mode=\"idle\"}[$__rate_interval])))", + "legendFormat": "cpu busy %", + "range": true, + "refId": "A" + } + ], + "title": "Proxy CPU Busy", + "type": "gauge", + "description": "Proxy host CPU utilisation. Requires node_exporter on the proxy." + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "max": 100, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "orange", + "value": 70 + }, + { + "color": "red", + "value": 90 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 18, + "y": 71 + }, + "id": 123, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "100 * (1 - node_memory_MemAvailable_bytes{job=~\"$proxy_job\"} / node_memory_MemTotal_bytes{job=~\"$proxy_job\"})", + "legendFormat": "mem used %", + "range": true, + "refId": "A" + } + ], + "title": "Proxy Memory Used", + "type": "gauge", + "description": "Proxy host memory utilisation. Requires node_exporter on the proxy." + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 79 + }, + "id": 124, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "node_netstat_Tcp_CurrEstab{job=~\"$proxy_job\"}", + "legendFormat": "established TCP", + "range": true, + "refId": "A" + } + ], + "title": "Proxy Active TCP Connections", + "type": "timeseries", + "description": "Established TCP connections on the proxy (node_exporter netstat) \u2014 a rough proxy for concurrent active SSH tunnel sessions." + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 79 + }, + "id": 125, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "100 * (1 - node_filesystem_avail_bytes{job=~\"$proxy_job\",fstype!~\"tmpfs|overlay|squashfs\"} / node_filesystem_size_bytes{job=~\"$proxy_job\",fstype!~\"tmpfs|overlay|squashfs\"})", + "legendFormat": "{{mountpoint}}", + "range": true, + "refId": "A" + } + ], + "title": "Proxy Disk Space Used", + "type": "timeseries", + "description": "Filesystem usage on the proxy host. Requires node_exporter on the proxy." + } + ], + "preload": false, + "schemaVersion": 42, + "tags": [], + "templating": { + "list": [ + { + "current": {}, + "hide": 0, + "includeAll": false, + "label": "Data source", + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(node_uname_info, job)", + "includeAll": true, + "label": "Proxy node_exporter job", + "multi": true, + "name": "proxy_job", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(node_uname_info, job)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "Argus Overview", + "uid": "2c2fc83c-616f-4c69-999a-323a2aee9684", + "weekStart": "" +}