{
    "annotations": {
        "list": [
            {
                "builtIn": 1,
                "datasource": {
                    "type": "grafana",
                    "uid": "-- Grafana --"
                },
                "enable": true,
                "hide": true,
                "iconColor": "rgba(0, 211, 255, 1)",
                "name": "Annotations & Alerts",
                "type": "dashboard"
            }
        ]
    },
    "title": "F5 TMM New Dashboard",
    "editable": true,
    "refresh": "10s",
    "timezone": "browser",
    "tags": [
        "f5",
        "tmm",
        "traffic-management"
    ],
    "time": {
        "from": "now-1h",
        "to": "now"
    },
    "panels": [
        {
            "datasource": "${ds}",
            "fieldConfig": {
                "defaults": {
                    "unit": "percent",
                    "min": 0,
                    "max": 100
                }
            },
            "gridPos": {
                "h": 8,
                "w": 12,
                "x": 0,
                "y": 0
            },
            "id": 1,
            "targets": [
                {
                    "expr": "f5_tmm_cpu_utilization_1sec_per_10_2{instance=~\"$instance\"} / 10",
                    "legendFormat": "1sec CPU %",
                    "refId": "A"
                },
                {
                    "expr": "f5_tmm_cpu_utilization_15secs_per_10_2{instance=~\"$instance\"} / 10",
                    "legendFormat": "15sec CPU %",
                    "refId": "B"
                },
                {
                    "expr": "f5_tmm_cpu_utilization_1min_per_10_2{instance=~\"$instance\"} / 10",
                    "legendFormat": "1min CPU %",
                    "refId": "C"
                },
                {
                    "expr": "f5_tmm_cpu_utilization_5mins_per_10_2{instance=~\"$instance\"} / 10",
                    "legendFormat": "5min CPU %",
                    "refId": "D"
                }
            ],
            "title": "TMM CPU Utilization by Instance",
            "type": "timeseries"
        },
        {
            "datasource": "${ds}",
            "fieldConfig": {
                "defaults": {
                    "unit": "bytes",
                    "min": 0
                }
            },
            "gridPos": {
                "h": 8,
                "w": 12,
                "x": 12,
                "y": 0
            },
            "id": 2,
            "targets": [
                {
                    "expr": "f5_tmm_memory_usage_bytes{instance=~\"$instance\"}",
                    "legendFormat": "Memory Usage",
                    "refId": "A"
                },
                {
                    "expr": "f5_tmm_memory_limit_bytes{instance=~\"$instance\"}",
                    "legendFormat": "Memory Limit",
                    "refId": "B"
                },
                {
                    "expr": "f5_tmm_memory_usage_bytes{instance=~\"$instance\"} / f5_tmm_memory_limit_bytes{instance=~\"$instance\"} * 100",
                    "legendFormat": "Memory Usage %",
                    "refId": "C"
                }
            ],
            "title": "TMM Memory Utilization by Instance",
            "type": "timeseries"
        },
        {
            "datasource": "${ds}",
            "fieldConfig": {
                "defaults": {
                    "unit": "short",
                    "min": 0
                }
            },
            "gridPos": {
                "h": 8,
                "w": 12,
                "x": 0,
                "y": 8
            },
            "id": 3,
            "targets": [
                {
                    "expr": "f5_tmm_clientside_connections_current{instance=~\"$instance\"}",
                    "legendFormat": "Client Connections",
                    "refId": "A"
                },
                {
                    "expr": "f5_tmm_serverside_connections_current{instance=~\"$instance\"}",
                    "legendFormat": "Server Connections",
                    "refId": "B"
                },
                {
                    "expr": "f5_tmm_clientside_connections_max_total{instance=~\"$instance\"}",
                    "legendFormat": "Client Max",
                    "refId": "C"
                },
                {
                    "expr": "f5_tmm_serverside_connections_max_total{instance=~\"$instance\"}",
                    "legendFormat": "Server Max",
                    "refId": "D"
                }
            ],
            "title": "TMM Connection Statistics by Instance",
            "type": "timeseries"
        },
        {
            "datasource": "${ds}",
            "fieldConfig": {
                "defaults": {
                    "unit": "Bps",
                    "min": 0
                }
            },
            "gridPos": {
                "h": 8,
                "w": 12,
                "x": 12,
                "y": 8
            },
            "id": 4,
            "targets": [
                {
                    "expr": "rate(f5_tmm_clientside_received_bytes_total{instance=~\"$instance\"}[5m])",
                    "legendFormat": "Client RX",
                    "refId": "A"
                },
                {
                    "expr": "rate(f5_tmm_clientside_transmitted_bytes_total{instance=~\"$instance\"}[5m])",
                    "legendFormat": "Client TX",
                    "refId": "B"
                },
                {
                    "expr": "rate(f5_tmm_serverside_received_bytes_total{instance=~\"$instance\"}[5m])",
                    "legendFormat": "Server RX",
                    "refId": "C"
                },
                {
                    "expr": "rate(f5_tmm_serverside_transmitted_bytes_total{instance=~\"$instance\"}[5m])",
                    "legendFormat": "Server TX",
                    "refId": "D"
                }
            ],
            "title": "TMM Traffic Throughput by Instance",
            "type": "timeseries"
        },
        {
            "datasource": "${ds}",
            "fieldConfig": {
                "defaults": {
                    "unit": "pps",
                    "min": 0
                }
            },
            "gridPos": {
                "h": 8,
                "w": 24,
                "x": 0,
                "y": 16
            },
            "id": 5,
            "targets": [
                {
                    "expr": "rate(f5_tmm_dropped_total{instance=~\"$instance\"}[5m])",
                    "legendFormat": "Dropped Packets/sec",
                    "refId": "A"
                }
            ],
            "title": "TMM Dropped Packets by Instance",
            "type": "timeseries"
        }
    ],
    "templating": {
        "list": [
            {
                "name": "ds",
                "label": "Data source",
                "type": "datasource",
                "query": "prometheus",
                "refresh": 1
            },
            {
                "name": "instance",
                "type": "query",
                "current": {
                    "text": "All",
                    "value": "$__all"
                },
                "datasource": "$ds",
                "multi": true,
                "includeAll": true,
                "allValue": ".*",
                "query": "label_values(up{job=\"bnk-otel\"}, instance)",
                "refresh": 1
            }
        ]
    }
}