diff --git a/.github/workflows/typescript.yml b/.github/workflows/typescript.yml index ac17dc3a..c39e9a53 100644 --- a/.github/workflows/typescript.yml +++ b/.github/workflows/typescript.yml @@ -56,6 +56,10 @@ jobs: yarn install yarn test --coverage + cd ../grafana-http-table-plugin/ + yarn install + yarn test --coverage + - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 with: diff --git a/build/charts/theia/README.md b/build/charts/theia/README.md index 1553ad77..f75c226c 100644 --- a/build/charts/theia/README.md +++ b/build/charts/theia/README.md @@ -62,11 +62,11 @@ Kubernetes: `>= 1.16.0-0` | clickhouse.storage.persistentVolumeClaimSpec | object | `{}` | Specification for PersistentVolumeClaim. This is ignored if createPersistentVolume.type is non-empty. To use a custom PersistentVolume, please set storageClassName: "" volumeName: "". To dynamically provision a PersistentVolume, please set storageClassName: "". Memory storage is used if both createPersistentVolume.type and persistentVolumeClaimSpec are empty. | | clickhouse.storage.size | string | `"8Gi"` | ClickHouse storage size. Can be a plain integer or as a fixed-point number using one of these quantity suffixes: E, P, T, G, M, K. Or the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki. | | clickhouse.ttl | string | `"12 HOUR"` | Time to live for data in the ClickHouse. Can be a plain integer using one of these unit suffixes SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, YEAR. | -| grafana.dashboards | list | `["homepage.json","flow_records_dashboard.json","pod_to_pod_dashboard.json","pod_to_service_dashboard.json","pod_to_external_dashboard.json","node_to_node_dashboard.json","networkpolicy_dashboard.json","network_topology_dashboard.json"]` | The dashboards to be displayed in Grafana UI. The files must be put under provisioning/dashboards. | +| grafana.dashboards | list | `["homepage.json","flow_records_dashboard.json","pod_to_pod_dashboard.json","pod_to_service_dashboard.json","pod_to_external_dashboard.json","node_to_node_dashboard.json","networkpolicy_dashboard.json","network_topology_dashboard.json","application_layer_dashboard.json"]` | The dashboards to be displayed in Grafana UI. The files must be put under provisioning/dashboards. | | grafana.enable | bool | `true` | Determine whether to install Grafana. It is used as a data visualization and monitoring tool. | | grafana.homeDashboard | string | `"homepage.json"` | Default home dashboard. | | grafana.image | object | `{"pullPolicy":"IfNotPresent","repository":"projects.registry.vmware.com/antrea/theia-grafana","tag":"9.1.6"}` | Container image used by Grafana. | -| grafana.installPlugins | list | `["https://downloads.antrea.io/artifacts/grafana-custom-plugins/theia-grafana-sankey-plugin-1.0.3.zip;theia-grafana-sankey-plugin","https://downloads.antrea.io/artifacts/grafana-custom-plugins/theia-grafana-chord-plugin-1.0.2.zip;theia-grafana-chord-plugin","https://downloads.antrea.io/artifacts/grafana-custom-plugins/theia-grafana-dependency-plugin-1.0.2.zip;theia-grafana-dependency-plugin","grafana-clickhouse-datasource 2.2.0"]` | Grafana plugins to install. | +| grafana.installPlugins | list | `["https://downloads.antrea.io/artifacts/grafana-custom-plugins/theia-grafana-sankey-plugin-1.0.3.zip;theia-grafana-sankey-plugin","https://downloads.antrea.io/artifacts/grafana-custom-plugins/theia-grafana-chord-plugin-1.0.2.zip;theia-grafana-chord-plugin","https://github.com/Dhruv-J/grafana-dependency-plugin/archive/refs/tags/v1.zip;theia-grafana-dependency-plugin","https://github.com/Dhruv-J/grafana-http-table-plugin/archive/refs/tags/v2.zip;theia-grafana-http-table-plugin","grafana-clickhouse-datasource 2.2.0"]` | Grafana plugins to install. | | grafana.log | object | `{"daily_rotate":"true","level":"info","log_rotate":"true","max_days":"7","max_lines":"1000000","max_size_shift":"27","mode":"console file"}` | Grafana logging options. | | grafana.log.daily_rotate | string | `"true"` | Enable daily rotation of files, valid options are false or true. Default is true. Only applicable when “file” used in [log] mode. | | grafana.log.level | string | `"info"` | Logging level. Options are “debug”, “info”, “warn”, “error”, and “critical”. Default is info. | diff --git a/build/charts/theia/provisioning/dashboards/application_layer_dashboard.json b/build/charts/theia/provisioning/dashboards/application_layer_dashboard.json new file mode 100644 index 00000000..a6c5ede5 --- /dev/null +++ b/build/charts/theia/provisioning/dashboards/application_layer_dashboard.json @@ -0,0 +1,119 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 11, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "gridPos": { + "h": 14, + "w": 11, + "x": 0, + "y": 0 + }, + "id": 2, + "targets": [ + { + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "meta": { + "builderOptions": { + "fields": [], + "limit": 100, + "mode": "list" + } + }, + "queryType": "sql", + "rawSql": "SELECT CONCAT(sourcePodNamespace, '/', sourcePodName) as srcPod,\nCONCAT(destinationPodNamespace, '/', destinationPodName) as dstPod,\nsourceTransportPort as srcPort,\ndestinationTransportPort as dstPort,\ndestinationServicePort as dstSvcPort,\ndestinationServicePortName as dstSvc,\ndestinationIP as dstIP,\nSUM(octetDeltaCount) as bytes,\nSUM(reverseOctetDeltaCount) as revBytes,\negressNetworkPolicyName,\negressNetworkPolicyRuleAction,\ningressNetworkPolicyName,\ningressNetworkPolicyRuleAction\nfrom flows_policy_view\nWHERE sourcePodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\n AND destinationPodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\n AND l7ProtocolName!=''\n AND $__timeFilter(flowEndSeconds)\nGROUP BY srcPod, dstPod, srcPort, dstPort, dstSvcPort, dstSvc, dstIP, egressNetworkPolicyName, egressNetworkPolicyRuleAction, ingressNetworkPolicyName, ingressNetworkPolicyRuleAction\nHAVING bytes > 0\norder by bytes DESC\n", + "refId": "A" + } + ], + "title": "Cumulative Bytes of Flows with L7 NetworkPolicy Information", + "type": "theia-grafana-chord-plugin" + }, + { + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "gridPos": { + "h": 18, + "w": 24, + "x": 0, + "y": 14 + }, + "id": 4, + "options": { + "seriesCountSize": "sm", + "showSeriesCount": false, + "text": "Default value of text input option" + }, + "targets": [ + { + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "meta": { + "builderOptions": { + "fields": [], + "limit": 100, + "mode": "list" + } + }, + "queryType": "sql", + "rawSql": "SELECT sourceIP, sourceTransportPort, destinationIP, destinationTransportPort, httpVals\nFROM flows\nWHERE l7ProtocolName!=''\nORDER BY flowEndSeconds DESC", + "refId": "A" + } + ], + "title": "HTTP Values", + "type": "theia-grafana-http-table-plugin" + } + ], + "schemaVersion": 37, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "application_layer_dashboard", + "uid": "tCTkERMSk", + "version": 1, + "weekStart": "" +} diff --git a/build/charts/theia/provisioning/dashboards/homepage.json b/build/charts/theia/provisioning/dashboards/homepage.json index 2ac2285c..031b2e79 100644 --- a/build/charts/theia/provisioning/dashboards/homepage.json +++ b/build/charts/theia/provisioning/dashboards/homepage.json @@ -576,7 +576,7 @@ }, "id": 27, "options": { - "content": "The following seven dashboards are pre-built and are recommended for network flow\nvisualization.\n\nFlow Records Dashboard displays the flow records being captured in the selected\ntime range.\n\nPod-to-Pod Flows Dashboard shows cumulative bytes and throughput of Pod-to-Pod\ntraffic.\n\nPod-to-External Flows Dashboard shows cumulative bytes and throughput of\ntraffic from in-cluster to out-of-cluster. The destination of such a traffic flow\nis represented by the destination IP address.\n\nPod-to-Service Flows Dashboard shows cumulative bytes and throughput of\nPod-to-Service flows. The destination of such a traffic is represented by the\ndestination Service metadata.\n\nNode-to-Node Flows Dashboard visualizes the Node-to-Node traffic, including intra-Node\nand inter-Node flows.\n\nNetwork-Policy Flows Dashboard visualizes both the traffic with NetworkPolicies enforced,\nand unprotected traffic.\n\nNetwork Topology Dashboard visualizes both Pod-to-Pod and Pod-to-Service traffic via a graph.", + "content": "The following eight dashboards are pre-built and are recommended for network flow\nvisualization.\n\nFlow Records Dashboard displays the flow records being captured in the selected\ntime range.\n\nPod-to-Pod Flows Dashboard shows cumulative bytes and throughput of Pod-to-Pod\ntraffic.\n\nPod-to-External Flows Dashboard shows cumulative bytes and throughput of\ntraffic from in-cluster to out-of-cluster. The destination of such a traffic flow\nis represented by the destination IP address.\n\nPod-to-Service Flows Dashboard shows cumulative bytes and throughput of\nPod-to-Service flows. The destination of such a traffic is represented by the\ndestination Service metadata.\n\nNode-to-Node Flows Dashboard visualizes the Node-to-Node traffic, including intra-Node\nand inter-Node flows.\n\nNetwork-Policy Flows Dashboard visualizes both the traffic with NetworkPolicies enforced,\nand unprotected traffic.\n\nNetwork Topology Dashboard visualizes both Pod-to-Pod and Pod-to-Service traffic via a graph.\n\nApplication Visibility Dashboard shows cumulative bytes and throughput for L7 NetworkPolicies\nas well as corresponding HTTP data.", "mode": "markdown" }, "pluginVersion": "8.3.3", diff --git a/build/charts/theia/provisioning/dashboards/network_topology_dashboard.json b/build/charts/theia/provisioning/dashboards/network_topology_dashboard.json index 53867799..8cc0778b 100644 --- a/build/charts/theia/provisioning/dashboards/network_topology_dashboard.json +++ b/build/charts/theia/provisioning/dashboards/network_topology_dashboard.json @@ -21,8 +21,8 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 8, - "iteration": 1682533463233, + "id": 6, + "iteration": 1695808205600, "links": [], "liveNow": false, "panels": [ @@ -32,15 +32,56 @@ "uid": "PDEE91DDB90597936" }, "gridPos": { - "h": 35, - "w": 23, + "h": 22, + "w": 10, "x": 0, "y": 0 }, + "id": 4, + "options": { + "color": "yellow", + "groupByPodLabel": false, + "layerFour": true + }, + "targets": [ + { + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "meta": { + "builderOptions": { + "fields": [], + "limit": 100, + "mode": "list" + } + }, + "queryType": "sql", + "rawSql": "SELECT sourcePodName, sourcePodLabels, sourcePodNamespace, sourceNodeName, destinationPodName, destinationPodLabels, destinationNodeName, destinationServicePortName, octetDeltaCount FROM flows\nWHERE sourcePodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\nAND destinationPodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\nAND ( destinationPodName != '' OR sourcePodName != '' )\nAND octetDeltaCount != 0\nAND httpVals == ''\nAND $__timeFilter(flowEndSeconds)\nORDER BY flowEndSeconds DESC", + "refId": "A" + } + ], + "title": "Layer 4 Topology", + "type": "theia-grafana-dependency-plugin" + }, + { + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "description": "The different colors of the lines mean different codes, but are labelled by the content length of the flow.\nGreen: Success", + "gridPos": { + "h": 22, + "w": 10, + "x": 10, + "y": 0 + }, "id": 2, "options": { "color": "yellow", "groupByLabel": false, + "groupByPodLabel": false, + "layerFour": false, "seriesCountSize": "sm", "showSeriesCount": false, "text": "Default value of text input option" @@ -60,11 +101,11 @@ } }, "queryType": "sql", - "rawSql": "SELECT sourcePodName, sourcePodLabels, sourcePodNamespace, sourceNodeName, destinationPodName, destinationPodLabels, destinationNodeName, destinationServicePortName, octetDeltaCount FROM flows\nWHERE sourcePodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\nAND destinationPodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\nAND destinationPodName != ''\nAND sourcePodName != ''\nAND octetDeltaCount != 0\nAND $__timeFilter(flowEndSeconds)\nORDER BY flowEndSeconds DESC", + "rawSql": "SELECT sourcePodName, sourcePodLabels, sourcePodNamespace, sourceNodeName, sourceIP, sourceTransportPort, destinationPodName, destinationPodLabels, destinationNodeName, destinationServicePortName, destinationIP, destinationTransportPort, octetDeltaCount, httpVals FROM flows\nWHERE sourcePodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\nAND destinationPodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\nAND ( destinationPodName != '' OR sourcePodName != '' )\nAND octetDeltaCount != 0\nAND httpVals != ''\nAND $__timeFilter(flowEndSeconds)\nORDER BY flowEndSeconds DESC", "refId": "A" } ], - "title": "Network Topology", + "title": "Layer 7 Topology", "type": "theia-grafana-dependency-plugin" } ], @@ -102,6 +143,6 @@ "timezone": "", "title": "network_topology_dashboard", "uid": "yRVDEad4k", - "version": 2, + "version": 3, "weekStart": "" -} +} \ No newline at end of file diff --git a/build/charts/theia/provisioning/dashboards/networkpolicy_dashboard.json b/build/charts/theia/provisioning/dashboards/networkpolicy_dashboard.json index 7fa4a6c2..88d67c1e 100644 --- a/build/charts/theia/provisioning/dashboards/networkpolicy_dashboard.json +++ b/build/charts/theia/provisioning/dashboards/networkpolicy_dashboard.json @@ -54,7 +54,7 @@ } }, "queryType": "sql", - "rawSql": "SELECT CONCAT(sourcePodNamespace, '/', sourcePodName) as srcPod,\nCONCAT(destinationPodNamespace, '/', destinationPodName) as dstPod,\nsourceTransportPort as srcPort,\ndestinationTransportPort as dstPort,\ndestinationServicePort as dstSvcPort,\ndestinationServicePortName as dstSvc,\ndestinationIP as dstIP,\nSUM(octetDeltaCount) as bytes,\nSUM(reverseOctetDeltaCount) as revBytes,\negressNetworkPolicyName,\negressNetworkPolicyRuleAction,\ningressNetworkPolicyName,\ningressNetworkPolicyRuleAction\nfrom flows_policy_view\nWHERE sourcePodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\n AND destinationPodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\n AND $__timeFilter(flowEndSeconds)\nGROUP BY srcPod, dstPod, srcPort, dstPort, dstSvcPort, dstSvc, dstIP, egressNetworkPolicyName, egressNetworkPolicyRuleAction, ingressNetworkPolicyName, ingressNetworkPolicyRuleAction\nHAVING bytes > 0\norder by bytes DESC\n", + "rawSql": "SELECT CONCAT(sourcePodNamespace, '/', sourcePodName) as srcPod,\nCONCAT(destinationPodNamespace, '/', destinationPodName) as dstPod,\nsourceTransportPort as srcPort,\ndestinationTransportPort as dstPort,\ndestinationServicePort as dstSvcPort,\ndestinationServicePortName as dstSvc,\ndestinationIP as dstIP,\nSUM(octetDeltaCount) as bytes,\nSUM(reverseOctetDeltaCount) as revBytes,\negressNetworkPolicyName,\negressNetworkPolicyRuleAction,\ningressNetworkPolicyName,\ningressNetworkPolicyRuleAction\nfrom flows_policy_view\nWHERE sourcePodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\n AND destinationPodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\n AND l7ProtocolName==''\n AND $__timeFilter(flowEndSeconds)\nGROUP BY srcPod, dstPod, srcPort, dstPort, dstSvcPort, dstSvc, dstIP, egressNetworkPolicyName, egressNetworkPolicyRuleAction, ingressNetworkPolicyName, ingressNetworkPolicyRuleAction\nHAVING bytes > 0\norder by bytes DESC\n", "refId": "A" } ], diff --git a/build/charts/theia/provisioning/datasources/create_table.sh b/build/charts/theia/provisioning/datasources/create_table.sh old mode 100644 new mode 100755 index f8efb08f..b5486183 --- a/build/charts/theia/provisioning/datasources/create_table.sh +++ b/build/charts/theia/provisioning/datasources/create_table.sh @@ -80,6 +80,8 @@ clickhouse client -n -h 127.0.0.1 <<-EOSQL clusterUUID String, egressName String, egressIP String, + l7ProtocolName String, + httpVals String, trusted UInt8 DEFAULT 0 ) engine=ReplicatedMergeTree('/clickhouse/tables/{shard}/{database}/{table}', '{replica}') ORDER BY (timeInserted, flowEndSeconds); @@ -269,7 +271,9 @@ clickhouse client -n -h 127.0.0.1 <<-EOSQL reverseThroughputFromSourceNode UInt64, throughputFromDestinationNode UInt64, reverseThroughputFromDestinationNode UInt64, - clusterUUID String + clusterUUID String, + l7ProtocolName String, + httpVals String ) ENGINE = ReplicatedSummingMergeTree('/clickhouse/tables/{shard}/{database}/{table}', '{replica}') ORDER BY ( timeInserted, @@ -291,7 +295,9 @@ clickhouse client -n -h 127.0.0.1 <<-EOSQL destinationServicePort, destinationServicePortName, destinationIP, - clusterUUID); + clusterUUID, + l7ProtocolName, + httpVals); ALTER TABLE "policy_view_table_local" MODIFY TTL timeInserted + INTERVAL {{ .Values.clickhouse.ttl }}; ALTER TABLE "policy_view_table_local" MODIFY SETTING merge_with_ttl_timeout={{ $ttlTimeout }}; @@ -317,6 +323,8 @@ clickhouse client -n -h 127.0.0.1 <<-EOSQL destinationServicePort, destinationServicePortName, destinationIP, + l7ProtocolName, + httpVals, sum(octetDeltaCount) AS octetDeltaCount, sum(reverseOctetDeltaCount) AS reverseOctetDeltaCount, sum(throughput) AS throughput, @@ -347,6 +355,8 @@ clickhouse client -n -h 127.0.0.1 <<-EOSQL destinationServicePort, destinationServicePortName, destinationIP, + l7ProtocolName, + httpVals, clusterUUID; --Create a table to store the network policy recommendation results diff --git a/build/charts/theia/provisioning/datasources/migrators/000006_0-7-0.down.sql b/build/charts/theia/provisioning/datasources/migrators/000006_0-7-0.down.sql new file mode 100644 index 00000000..c2b9cb01 --- /dev/null +++ b/build/charts/theia/provisioning/datasources/migrators/000006_0-7-0.down.sql @@ -0,0 +1,13 @@ +--Alter table to drop new columns +ALTER TABLE flows + DROP COLUMN l7ProtocolName, + DROP COLUMN httpVals; +ALTER TABLE flows_local + DROP COLUMN l7ProtocolName, + DROP COLUMN httpVals; +ALTER TABLE flows_policy_view + DROP COLUMN l7ProtocolName String, + DROP COLUMN httpVals String; +ALTER TABLE flows_policy_view_local + DROP COLUMN l7ProtocolName String, + DROP COLUMN httpVals String; diff --git a/build/charts/theia/provisioning/datasources/migrators/000006_0-7-0.up.sql b/build/charts/theia/provisioning/datasources/migrators/000006_0-7-0.up.sql new file mode 100644 index 00000000..c37c2ab6 --- /dev/null +++ b/build/charts/theia/provisioning/datasources/migrators/000006_0-7-0.up.sql @@ -0,0 +1,13 @@ +--Alter table to add new columns +ALTER TABLE flows + ADD COLUMN l7ProtocolName String, + ADD COLUMN httpVals String; +ALTER TABLE flows_local + ADD COLUMN l7ProtocolName String, + ADD COLUMN httpVals String; +ALTER TABLE flows_policy_view + ADD COLUMN l7ProtocolName String, + ADD COLUMN httpVals String; +ALTER TABLE flows_policy_view_local + ADD COLUMN l7ProtocolName String, + ADD COLUMN httpVals String; diff --git a/build/charts/theia/values.yaml b/build/charts/theia/values.yaml index 72909da6..8646be82 100644 --- a/build/charts/theia/values.yaml +++ b/build/charts/theia/values.yaml @@ -240,7 +240,8 @@ grafana: installPlugins: - https://downloads.antrea.io/artifacts/grafana-custom-plugins/theia-grafana-sankey-plugin-1.0.3.zip;theia-grafana-sankey-plugin - https://downloads.antrea.io/artifacts/grafana-custom-plugins/theia-grafana-chord-plugin-1.0.2.zip;theia-grafana-chord-plugin - - https://downloads.antrea.io/artifacts/grafana-custom-plugins/theia-grafana-dependency-plugin-1.0.2.zip;theia-grafana-dependency-plugin + - https://github.com/Dhruv-J/grafana-dependency-plugin/archive/refs/tags/v1.zip;theia-grafana-dependency-plugin + - https://github.com/Dhruv-J/grafana-http-table-plugin/archive/refs/tags/v2.zip;theia-grafana-http-table-plugin - grafana-clickhouse-datasource 2.2.0 # -- The dashboards to be displayed in Grafana UI. The files must be put under # provisioning/dashboards. @@ -253,6 +254,7 @@ grafana: - node_to_node_dashboard.json - networkpolicy_dashboard.json - network_topology_dashboard.json + - application_layer_dashboard.json # -- Default home dashboard. homeDashboard: homepage.json storage: diff --git a/build/yamls/flow-visibility.yml b/build/yamls/flow-visibility.yml index da760340..f3af4a1a 100644 --- a/build/yamls/flow-visibility.yml +++ b/build/yamls/flow-visibility.yml @@ -757,6 +757,34 @@ data: ADD COLUMN aggType String, ADD COLUMN direction String, ADD COLUMN podName String; + 000006_0-7-0.down.sql: | + --Alter table to drop new columns + ALTER TABLE flows + DROP COLUMN l7ProtocolName, + DROP COLUMN httpVals; + ALTER TABLE flows_local + DROP COLUMN l7ProtocolName, + DROP COLUMN httpVals; + ALTER TABLE flows_policy_view + DROP COLUMN l7ProtocolName String, + DROP COLUMN httpVals String; + ALTER TABLE flows_policy_view_local + DROP COLUMN l7ProtocolName String, + DROP COLUMN httpVals String; + 000006_0-7-0.up.sql: | + --Alter table to add new columns + ALTER TABLE flows + ADD COLUMN l7ProtocolName String, + ADD COLUMN httpVals String; + ALTER TABLE flows_local + ADD COLUMN l7ProtocolName String, + ADD COLUMN httpVals String; + ALTER TABLE flows_policy_view + ADD COLUMN l7ProtocolName String, + ADD COLUMN httpVals String; + ALTER TABLE flows_policy_view_local + ADD COLUMN l7ProtocolName String, + ADD COLUMN httpVals String; create_table.sh: | #!/usr/bin/env bash @@ -831,6 +859,8 @@ data: clusterUUID String, egressName String, egressIP String, + l7ProtocolName String, + httpVals String, trusted UInt8 DEFAULT 0 ) engine=ReplicatedMergeTree('/clickhouse/tables/{shard}/{database}/{table}', '{replica}') ORDER BY (timeInserted, flowEndSeconds); @@ -1020,7 +1050,9 @@ data: reverseThroughputFromSourceNode UInt64, throughputFromDestinationNode UInt64, reverseThroughputFromDestinationNode UInt64, - clusterUUID String + clusterUUID String, + l7ProtocolName String, + httpVals String ) ENGINE = ReplicatedSummingMergeTree('/clickhouse/tables/{shard}/{database}/{table}', '{replica}') ORDER BY ( timeInserted, @@ -1042,7 +1074,9 @@ data: destinationServicePort, destinationServicePortName, destinationIP, - clusterUUID); + clusterUUID, + l7ProtocolName, + httpVals); ALTER TABLE "policy_view_table_local" MODIFY TTL timeInserted + INTERVAL 12 HOUR; ALTER TABLE "policy_view_table_local" MODIFY SETTING merge_with_ttl_timeout=14400; @@ -1068,6 +1102,8 @@ data: destinationServicePort, destinationServicePortName, destinationIP, + l7ProtocolName, + httpVals, sum(octetDeltaCount) AS octetDeltaCount, sum(reverseOctetDeltaCount) AS reverseOctetDeltaCount, sum(throughput) AS throughput, @@ -1098,6 +1134,8 @@ data: destinationServicePort, destinationServicePortName, destinationIP, + l7ProtocolName, + httpVals, clusterUUID; --Create a table to store the network policy recommendation results @@ -1186,6 +1224,126 @@ metadata: --- apiVersion: v1 data: + application_layer_dashboard.json: | + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 11, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "gridPos": { + "h": 14, + "w": 11, + "x": 0, + "y": 0 + }, + "id": 2, + "targets": [ + { + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "meta": { + "builderOptions": { + "fields": [], + "limit": 100, + "mode": "list" + } + }, + "queryType": "sql", + "rawSql": "SELECT CONCAT(sourcePodNamespace, '/', sourcePodName) as srcPod,\nCONCAT(destinationPodNamespace, '/', destinationPodName) as dstPod,\nsourceTransportPort as srcPort,\ndestinationTransportPort as dstPort,\ndestinationServicePort as dstSvcPort,\ndestinationServicePortName as dstSvc,\ndestinationIP as dstIP,\nSUM(octetDeltaCount) as bytes,\nSUM(reverseOctetDeltaCount) as revBytes,\negressNetworkPolicyName,\negressNetworkPolicyRuleAction,\ningressNetworkPolicyName,\ningressNetworkPolicyRuleAction\nfrom flows_policy_view\nWHERE sourcePodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\n AND destinationPodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\n AND l7ProtocolName!=''\n AND $__timeFilter(flowEndSeconds)\nGROUP BY srcPod, dstPod, srcPort, dstPort, dstSvcPort, dstSvc, dstIP, egressNetworkPolicyName, egressNetworkPolicyRuleAction, ingressNetworkPolicyName, ingressNetworkPolicyRuleAction\nHAVING bytes > 0\norder by bytes DESC\n", + "refId": "A" + } + ], + "title": "Cumulative Bytes of Flows with L7 NetworkPolicy Information", + "type": "theia-grafana-chord-plugin" + }, + { + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "gridPos": { + "h": 18, + "w": 24, + "x": 0, + "y": 14 + }, + "id": 4, + "options": { + "seriesCountSize": "sm", + "showSeriesCount": false, + "text": "Default value of text input option" + }, + "targets": [ + { + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "meta": { + "builderOptions": { + "fields": [], + "limit": 100, + "mode": "list" + } + }, + "queryType": "sql", + "rawSql": "SELECT sourceIP, sourceTransportPort, destinationIP, destinationTransportPort, httpVals\nFROM flows\nWHERE l7ProtocolName!=''\nORDER BY flowEndSeconds DESC", + "refId": "A" + } + ], + "title": "HTTP Values", + "type": "theia-grafana-http-table-plugin" + } + ], + "schemaVersion": 37, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "application_layer_dashboard", + "uid": "tCTkERMSk", + "version": 1, + "weekStart": "" + } flow_records_dashboard.json: |- { "annotations": { @@ -2770,7 +2928,7 @@ data: }, "id": 27, "options": { - "content": "The following seven dashboards are pre-built and are recommended for network flow\nvisualization.\n\nFlow Records Dashboard displays the flow records being captured in the selected\ntime range.\n\nPod-to-Pod Flows Dashboard shows cumulative bytes and throughput of Pod-to-Pod\ntraffic.\n\nPod-to-External Flows Dashboard shows cumulative bytes and throughput of\ntraffic from in-cluster to out-of-cluster. The destination of such a traffic flow\nis represented by the destination IP address.\n\nPod-to-Service Flows Dashboard shows cumulative bytes and throughput of\nPod-to-Service flows. The destination of such a traffic is represented by the\ndestination Service metadata.\n\nNode-to-Node Flows Dashboard visualizes the Node-to-Node traffic, including intra-Node\nand inter-Node flows.\n\nNetwork-Policy Flows Dashboard visualizes both the traffic with NetworkPolicies enforced,\nand unprotected traffic.\n\nNetwork Topology Dashboard visualizes both Pod-to-Pod and Pod-to-Service traffic via a graph.", + "content": "The following eight dashboards are pre-built and are recommended for network flow\nvisualization.\n\nFlow Records Dashboard displays the flow records being captured in the selected\ntime range.\n\nPod-to-Pod Flows Dashboard shows cumulative bytes and throughput of Pod-to-Pod\ntraffic.\n\nPod-to-External Flows Dashboard shows cumulative bytes and throughput of\ntraffic from in-cluster to out-of-cluster. The destination of such a traffic flow\nis represented by the destination IP address.\n\nPod-to-Service Flows Dashboard shows cumulative bytes and throughput of\nPod-to-Service flows. The destination of such a traffic is represented by the\ndestination Service metadata.\n\nNode-to-Node Flows Dashboard visualizes the Node-to-Node traffic, including intra-Node\nand inter-Node flows.\n\nNetwork-Policy Flows Dashboard visualizes both the traffic with NetworkPolicies enforced,\nand unprotected traffic.\n\nNetwork Topology Dashboard visualizes both Pod-to-Pod and Pod-to-Service traffic via a graph.\n\nApplication Visibility Dashboard shows cumulative bytes and throughput for L7 NetworkPolicies\nas well as corresponding HTTP data.", "mode": "markdown" }, "pluginVersion": "8.3.3", @@ -3508,7 +3666,7 @@ data: "version": 6, "weekStart": "" } - network_topology_dashboard.json: | + network_topology_dashboard.json: |- { "annotations": { "list": [ @@ -3532,8 +3690,8 @@ data: "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 8, - "iteration": 1682533463233, + "id": 6, + "iteration": 1695808205600, "links": [], "liveNow": false, "panels": [ @@ -3543,15 +3701,56 @@ data: "uid": "PDEE91DDB90597936" }, "gridPos": { - "h": 35, - "w": 23, + "h": 22, + "w": 10, "x": 0, "y": 0 }, + "id": 4, + "options": { + "color": "yellow", + "groupByPodLabel": false, + "layerFour": true + }, + "targets": [ + { + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "meta": { + "builderOptions": { + "fields": [], + "limit": 100, + "mode": "list" + } + }, + "queryType": "sql", + "rawSql": "SELECT sourcePodName, sourcePodLabels, sourcePodNamespace, sourceNodeName, destinationPodName, destinationPodLabels, destinationNodeName, destinationServicePortName, octetDeltaCount FROM flows\nWHERE sourcePodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\nAND destinationPodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\nAND ( destinationPodName != '' OR sourcePodName != '' )\nAND octetDeltaCount != 0\nAND httpVals == ''\nAND $__timeFilter(flowEndSeconds)\nORDER BY flowEndSeconds DESC", + "refId": "A" + } + ], + "title": "Layer 4 Topology", + "type": "theia-grafana-dependency-plugin" + }, + { + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "description": "The different colors of the lines mean different codes, but are labelled by the content length of the flow.\nGreen: Success", + "gridPos": { + "h": 22, + "w": 10, + "x": 10, + "y": 0 + }, "id": 2, "options": { "color": "yellow", "groupByLabel": false, + "groupByPodLabel": false, + "layerFour": false, "seriesCountSize": "sm", "showSeriesCount": false, "text": "Default value of text input option" @@ -3571,11 +3770,11 @@ data: } }, "queryType": "sql", - "rawSql": "SELECT sourcePodName, sourcePodLabels, sourcePodNamespace, sourceNodeName, destinationPodName, destinationPodLabels, destinationNodeName, destinationServicePortName, octetDeltaCount FROM flows\nWHERE sourcePodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\nAND destinationPodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\nAND destinationPodName != ''\nAND sourcePodName != ''\nAND octetDeltaCount != 0\nAND $__timeFilter(flowEndSeconds)\nORDER BY flowEndSeconds DESC", + "rawSql": "SELECT sourcePodName, sourcePodLabels, sourcePodNamespace, sourceNodeName, sourceIP, sourceTransportPort, destinationPodName, destinationPodLabels, destinationNodeName, destinationServicePortName, destinationIP, destinationTransportPort, octetDeltaCount, httpVals FROM flows\nWHERE sourcePodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\nAND destinationPodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\nAND ( destinationPodName != '' OR sourcePodName != '' )\nAND octetDeltaCount != 0\nAND httpVals != ''\nAND $__timeFilter(flowEndSeconds)\nORDER BY flowEndSeconds DESC", "refId": "A" } ], - "title": "Network Topology", + "title": "Layer 7 Topology", "type": "theia-grafana-dependency-plugin" } ], @@ -3613,7 +3812,7 @@ data: "timezone": "", "title": "network_topology_dashboard", "uid": "yRVDEad4k", - "version": 2, + "version": 3, "weekStart": "" } networkpolicy_dashboard.json: | @@ -3673,7 +3872,7 @@ data: } }, "queryType": "sql", - "rawSql": "SELECT CONCAT(sourcePodNamespace, '/', sourcePodName) as srcPod,\nCONCAT(destinationPodNamespace, '/', destinationPodName) as dstPod,\nsourceTransportPort as srcPort,\ndestinationTransportPort as dstPort,\ndestinationServicePort as dstSvcPort,\ndestinationServicePortName as dstSvc,\ndestinationIP as dstIP,\nSUM(octetDeltaCount) as bytes,\nSUM(reverseOctetDeltaCount) as revBytes,\negressNetworkPolicyName,\negressNetworkPolicyRuleAction,\ningressNetworkPolicyName,\ningressNetworkPolicyRuleAction\nfrom flows_policy_view\nWHERE sourcePodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\n AND destinationPodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\n AND $__timeFilter(flowEndSeconds)\nGROUP BY srcPod, dstPod, srcPort, dstPort, dstSvcPort, dstSvc, dstIP, egressNetworkPolicyName, egressNetworkPolicyRuleAction, ingressNetworkPolicyName, ingressNetworkPolicyRuleAction\nHAVING bytes > 0\norder by bytes DESC\n", + "rawSql": "SELECT CONCAT(sourcePodNamespace, '/', sourcePodName) as srcPod,\nCONCAT(destinationPodNamespace, '/', destinationPodName) as dstPod,\nsourceTransportPort as srcPort,\ndestinationTransportPort as dstPort,\ndestinationServicePort as dstSvcPort,\ndestinationServicePortName as dstSvc,\ndestinationIP as dstIP,\nSUM(octetDeltaCount) as bytes,\nSUM(reverseOctetDeltaCount) as revBytes,\negressNetworkPolicyName,\negressNetworkPolicyRuleAction,\ningressNetworkPolicyName,\ningressNetworkPolicyRuleAction\nfrom flows_policy_view\nWHERE sourcePodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\n AND destinationPodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator')\n AND l7ProtocolName==''\n AND $__timeFilter(flowEndSeconds)\nGROUP BY srcPod, dstPod, srcPort, dstPort, dstSvcPort, dstSvc, dstIP, egressNetworkPolicyName, egressNetworkPolicyRuleAction, ingressNetworkPolicyName, ingressNetworkPolicyRuleAction\nHAVING bytes > 0\norder by bytes DESC\n", "refId": "A" } ], @@ -6819,7 +7018,7 @@ spec: containers: - env: - name: GF_INSTALL_PLUGINS - value: https://downloads.antrea.io/artifacts/grafana-custom-plugins/theia-grafana-sankey-plugin-1.0.3.zip;theia-grafana-sankey-plugin,https://downloads.antrea.io/artifacts/grafana-custom-plugins/theia-grafana-chord-plugin-1.0.2.zip;theia-grafana-chord-plugin,https://downloads.antrea.io/artifacts/grafana-custom-plugins/theia-grafana-dependency-plugin-1.0.2.zip;theia-grafana-dependency-plugin,grafana-clickhouse-datasource + value: https://downloads.antrea.io/artifacts/grafana-custom-plugins/theia-grafana-sankey-plugin-1.0.3.zip;theia-grafana-sankey-plugin,https://downloads.antrea.io/artifacts/grafana-custom-plugins/theia-grafana-chord-plugin-1.0.2.zip;theia-grafana-chord-plugin,https://github.com/Dhruv-J/grafana-dependency-plugin/archive/refs/tags/v1.zip;theia-grafana-dependency-plugin,https://github.com/Dhruv-J/grafana-http-table-plugin/archive/refs/tags/v2.zip;theia-grafana-http-table-plugin,grafana-clickhouse-datasource 2.2.0 - name: CLICKHOUSE_USERNAME valueFrom: @@ -7329,6 +7528,10 @@ spec: path: migrators/000005_0-6-0.down.sql - key: 000005_0-6-0.up.sql path: migrators/000005_0-6-0.up.sql + - key: 000006_0-7-0.down.sql + path: migrators/000006_0-7-0.down.sql + - key: 000006_0-7-0.up.sql + path: migrators/000006_0-7-0.up.sql name: clickhouse-mounted-configmap name: clickhouse-configmap-volume - emptyDir: diff --git a/plugins/grafana-custom-plugins/grafana-dependency-plugin/yarn.lock b/plugins/grafana-custom-plugins/grafana-dependency-plugin/yarn.lock index 74727d6d..00efefca 100644 --- a/plugins/grafana-custom-plugins/grafana-dependency-plugin/yarn.lock +++ b/plugins/grafana-custom-plugins/grafana-dependency-plugin/yarn.lock @@ -51,10 +51,10 @@ json5 "^2.2.1" semver "^6.3.0" -"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.8.0": +"@babel/generator@^7.18.9", "@babel/generator@^7.20.2", "@babel/generator@^7.7.2": version "7.20.2" - resolved "https://registry.npmjs.org/@babel/core/-/core-7.20.2.tgz" - integrity sha512-w7DbG8DtMrJcFOi4VrLm+8QM4az8Mo+PuLBKLp2zrYRCow8W/f9xiXm5sN53C8HksCyDQwCKha9JiDoIyPjT2g== + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.20.2.tgz" + integrity sha512-SD75PMIK6i9H8G/tfGvB4KKl4Nw6Ssos9nGgYwxbgyTP0iX/Z55DveoH86rmUB/YHTQQ+ZC0F7xxaY8l2OF44Q== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.18.6" @@ -72,7 +72,7 @@ json5 "^2.2.1" semver "^6.3.0" -"@babel/generator@^7.18.9", "@babel/generator@^7.20.2", "@babel/generator@^7.7.2": +"@babel/generator@^7.18.9", "@babel/generator@^7.20.1", "@babel/generator@^7.20.2", "@babel/generator@^7.7.2": version "7.20.2" resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.20.2.tgz" integrity sha512-SD75PMIK6i9H8G/tfGvB4KKl4Nw6Ssos9nGgYwxbgyTP0iX/Z55DveoH86rmUB/YHTQQ+ZC0F7xxaY8l2OF44Q== @@ -210,10 +210,170 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.18.9", "@babel/helper-module-transforms@^7.19.6", "@babel/helper-module-transforms@^7.20.2": +"@babel/helper-optimise-call-expression@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" + integrity sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" + integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== + +"@babel/helper-remap-async-to-generator@^7.18.9", "@babel/helper-remap-async-to-generator@^7.22.5": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.20.tgz#7b68e1cb4fa964d2996fd063723fb48eca8498e0" + integrity sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-wrap-function" "^7.22.20" + +"@babel/helper-replace-supers@^7.22.5", "@babel/helper-replace-supers@^7.22.9": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.22.20.tgz#e37d367123ca98fe455a9887734ed2e16eb7a793" + integrity sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw== + dependencies: + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-member-expression-to-functions" "^7.22.15" + "@babel/helper-optimise-call-expression" "^7.22.5" + +"@babel/helper-simple-access@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de" + integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-skip-transparent-expression-wrappers@^7.20.0", "@babel/helper-skip-transparent-expression-wrappers@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz#007f15240b5751c537c40e77abb4e89eeaaa8847" + integrity sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-split-export-declaration@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" + integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-string-parser@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" + integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== + +"@babel/helper-validator-identifier@^7.22.19", "@babel/helper-validator-identifier@^7.22.20", "@babel/helper-validator-identifier@^7.22.5": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== + +"@babel/helper-validator-option@^7.18.6", "@babel/helper-validator-option@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz#694c30dfa1d09a6534cdfcafbe56789d36aba040" + integrity sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA== + +"@babel/helper-wrap-function@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.22.20.tgz#15352b0b9bfb10fc9c76f79f6342c00e3411a569" + integrity sha512-pms/UwkOpnQe/PDAEdV/d7dVCoBbB+R4FvYoHGZz+4VPcg7RtYy2KP7S2lbuWM6FCSgob5wshfGESbC/hzNXZw== + dependencies: + "@babel/helper-function-name" "^7.22.5" + "@babel/template" "^7.22.15" + "@babel/types" "^7.22.19" + +"@babel/helper-split-export-declaration@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" + integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-string-parser@^7.19.4": + version "7.19.4" + resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz" + integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== + +"@babel/helper-string-parser@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" + integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== + +"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": + version "7.19.1" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz" + integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== + +"@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== + +"@babel/helper-validator-option@^7.18.6": + version "7.18.6" + resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz" + integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== + +"@babel/helper-wrap-function@^7.18.9": + version "7.19.0" + resolved "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.19.0.tgz" + integrity sha512-txX8aN8CZyYGTwcLhlk87KRqncAzhh5TpQamZUa0/u3an36NtDpUP6bQgBCBcLeBs09R/OwQu3OjK0k/HwfNDg== + dependencies: + "@babel/template" "^7.22.15" + "@babel/traverse" "^7.22.15" + "@babel/types" "^7.22.15" + +"@babel/highlight@^7.22.13": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.20.tgz#4ca92b71d80554b01427815e06f2df965b9c1f54" + integrity sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg== + dependencies: + "@babel/helper-validator-identifier" "^7.22.20" + chalk "^2.4.2" + js-tokens "^4.0.0" + +"@babel/highlight@^7.22.13": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.20.tgz#4ca92b71d80554b01427815e06f2df965b9c1f54" + integrity sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg== + dependencies: + "@babel/helper-validator-identifier" "^7.22.20" + chalk "^2.4.2" + js-tokens "^4.0.0" + +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.18.9", "@babel/parser@^7.20.2": version "7.20.2" - resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.20.2.tgz" - integrity sha512-zvBKyJXRbmK07XhMuujYoJ48B5yvvmM6+wcpv6Ivj4Yg6qO7NOZOSnvZN9CRl1zz1Z4cKf8YejmCMh8clOoOeA== + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.20.2.tgz" + integrity sha512-afk318kh2uKbo7BEj2QtEi8HVCGrwHUffrYDy7dgVcSa2j9lY3LDjPzcyGdpX7xgm35aWqvciZJ4WKmdF/SxYg== + +"@babel/parser@^7.22.15", "@babel/parser@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.0.tgz#da950e622420bf96ca0d0f2909cdddac3acd8719" + integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw== + +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.15.tgz#02dc8a03f613ed5fdc29fb2f728397c78146c962" + integrity sha512-FB9iYlz7rURmRJyXRKEnalYPPdn87H5no108cyuQQyMwlpJ2SJtpIUBI27kdTin956pz+LPypkPVPUTlxOmrsg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.18.9": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.15.tgz#2aeb91d337d4e1a1e7ce85b76a37f5301781200f" + integrity sha512-Hyph9LseGvAeeXzikV88bczhsrLrIZqDPxO+sSmAunMPaGrBGhfMWzCPYTtiW9t+HzSE2wtV8e5cc5P6r1xMDQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/plugin-transform-optional-chaining" "^7.22.15" + +"@babel/plugin-proposal-async-generator-functions@^7.20.1": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz#bfb7276d2d573cb67ba379984a2334e262ba5326" + integrity sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA== dependencies: "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-module-imports" "^7.18.6" @@ -278,33 +438,16 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-split-export-declaration@^7.22.6": - version "7.22.6" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" - integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== - dependencies: - "@babel/types" "^7.22.5" - "@babel/helper-string-parser@^7.19.4": version "7.19.4" resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz" integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== -"@babel/helper-string-parser@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" - integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== - "@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": version "7.19.1" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz" integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== -"@babel/helper-validator-identifier@^7.22.20": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" - integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== - "@babel/helper-validator-option@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz" @@ -338,25 +481,11 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/highlight@^7.22.13": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.20.tgz#4ca92b71d80554b01427815e06f2df965b9c1f54" - integrity sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg== - dependencies: - "@babel/helper-validator-identifier" "^7.22.20" - chalk "^2.4.2" - js-tokens "^4.0.0" - -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.18.9", "@babel/parser@^7.20.2": +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.18.9", "@babel/parser@^7.20.1", "@babel/parser@^7.20.2": version "7.20.2" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.20.2.tgz" integrity sha512-afk318kh2uKbo7BEj2QtEi8HVCGrwHUffrYDy7dgVcSa2j9lY3LDjPzcyGdpX7xgm35aWqvciZJ4WKmdF/SxYg== -"@babel/parser@^7.22.15", "@babel/parser@^7.23.0": - version "7.23.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.0.tgz#da950e622420bf96ca0d0f2909cdddac3acd8719" - integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw== - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz" @@ -1086,13 +1215,6 @@ dependencies: regenerator-runtime "^0.13.11" -"@babel/runtime@^7.18.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.0.tgz#5b55c9d394e5fcf304909a8b00c07dc217b56673" - integrity sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw== - dependencies: - regenerator-runtime "^0.13.11" - "@babel/template@^7.18.10", "@babel/template@^7.18.6", "@babel/template@^7.3.3": version "7.18.10" resolved "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz" diff --git a/plugins/grafana-custom-plugins/grafana-http-table-plugin/.config/.eslintrc b/plugins/grafana-custom-plugins/grafana-http-table-plugin/.config/.eslintrc new file mode 100644 index 00000000..15ae260a --- /dev/null +++ b/plugins/grafana-custom-plugins/grafana-http-table-plugin/.config/.eslintrc @@ -0,0 +1,13 @@ +/* + * ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️ + * + * In order to extend the configuration follow the steps in + * https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/extend-configurations#extend-the-eslint-config + */ + { + "extends": ["@grafana/eslint-config"], + "root": true, + "rules": { + "react/prop-types": "off" + } +} diff --git a/plugins/grafana-custom-plugins/grafana-http-table-plugin/.config/.prettierrc.js b/plugins/grafana-custom-plugins/grafana-http-table-plugin/.config/.prettierrc.js new file mode 100644 index 00000000..4afe885a --- /dev/null +++ b/plugins/grafana-custom-plugins/grafana-http-table-plugin/.config/.prettierrc.js @@ -0,0 +1,16 @@ +/* + * ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️ + * + * In order to extend the configuration follow the steps in .config/README.md + */ + +module.exports = { + "endOfLine": "auto", + "printWidth": 120, + "trailingComma": "es5", + "semi": true, + "jsxSingleQuote": false, + "singleQuote": true, + "useTabs": false, + "tabWidth": 2 +}; diff --git a/plugins/grafana-custom-plugins/grafana-http-table-plugin/.config/Dockerfile b/plugins/grafana-custom-plugins/grafana-http-table-plugin/.config/Dockerfile new file mode 100644 index 00000000..40537a54 --- /dev/null +++ b/plugins/grafana-custom-plugins/grafana-http-table-plugin/.config/Dockerfile @@ -0,0 +1,16 @@ +ARG grafana_version=latest +ARG grafana_image=grafana-enterprise + +FROM grafana/${grafana_image}:${grafana_version} + +# Make it as simple as possible to access the grafana instance for development purposes +# Do NOT enable these settings in a public facing / production grafana instance +ENV GF_AUTH_ANONYMOUS_ORG_ROLE "Admin" +ENV GF_AUTH_ANONYMOUS_ENABLED "true" +ENV GF_AUTH_BASIC_ENABLED "false" +# Set development mode so plugins can be loaded without the need to sign +ENV GF_DEFAULT_APP_MODE "development" + +# Inject livereload script into grafana index.html +USER root +RUN sed -i 's/<\/body><\/html>/