-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Network Topology Dashboard Update #488
Conversation
f63798e
to
8fce175
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #488 +/- ##
==========================================
+ Coverage 70.51% 70.60% +0.09%
==========================================
Files 40 45 +5
Lines 5253 5511 +258
Branches 0 41 +41
==========================================
+ Hits 3704 3891 +187
- Misses 1372 1436 +64
- Partials 177 184 +7
*This pull request uses carry forward flags. Click here to find out more. |
For reviewers, a lot of files needed to be added as a result of the yarn tool being updated from toolkit to the Grafana command itself. This update comes with a lot more surrounding configuration, and is necessary for anyone wanting to build the plugin locally. The contents of the .config/ folder can be ignored, as they were automatically generated by the command |
Why do we have duplicated connections in layer 4/7 Topology? Or are they two different connections? |
They are two different connections
Yes, the goal of the layer 4 topology is to show destination Pod and Service, I'll update the legend to reflect that. |
Please correct me if I'm wrong. I remember last time we decided to use the chord diagrams to show the flows and use a table to display all the L7 fields. Did I miss anything? |
Not wrong at all, I'm splitting them up into two PRs, with the latter having the second dashboard with the chord diagram and httpvals table. Since httpvals contains nested JSON, some massaging to the data is required. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments:
- Do we need a .config folder? I don't see this folder under other plugins?
- Do you think we can add these changes to the e2e test or UT?
- Can you update network-flow-visibility.md to reflect these changes?
} | ||
}, | ||
"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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please correct me if I'm wrong.
I think we don't have case where destinationPodName == '' and sourcePodName == ''
.?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had it as a failsafe, but I'll remove that conditional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
"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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing description for other colors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove description, as the legend describes the colors anyways.
"weekStart": "" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing empty line at the end of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not fixed?
@@ -212,3 +212,9 @@ ALTER TABLE tadetector_local | |||
DROP COLUMN aggType, | |||
DROP COLUMN direction, | |||
DROP COLUMN podName; | |||
ALTER TABLE flows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these changes be in 000005_0-6-0.down.sql or in next version like 000006_0-7-0.down.sql?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these are changes part of Tushar's commit and PR, I just have them in this PR as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR has been updated, Please use the new fields and files
@@ -151,3 +151,9 @@ ALTER TABLE tadetector_local | |||
ADD COLUMN aggType String, | |||
ADD COLUMN direction String, | |||
ADD COLUMN podName String; | |||
ALTER TABLE flows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
build/charts/theia/values.yaml
Outdated
@@ -211,7 +211,7 @@ grafana: | |||
installPlugins: | |||
- https://downloads.antrea.io/artifacts/grafana-custom-plugins/theia-grafana-sankey-plugin-1.0.2.zip;theia-grafana-sankey-plugin | |||
- https://downloads.antrea.io/artifacts/grafana-custom-plugins/theia-grafana-chord-plugin-1.0.1.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/v0.zip;theia-grafana-dependency-plugin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
|
||
# Inject livereload script into grafana index.html | ||
USER root | ||
RUN sed -i 's/<\/body><\/html>/<script src=\"http:\/\/localhost:35729\/livereload.js\"><\/script><\/body><\/html>/g' /usr/share/grafana/public/views/index.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing empty line here.
@@ -0,0 +1,3 @@ | |||
{ | |||
"extends": "./.config/.eslintrc" | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing empty line not solved?
}; | ||
// Prettier configuration provided by Grafana scaffolding | ||
...require("./.config/.prettierrc.js") | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Yes, as I mentioned in my comment earlier, the .config folder is created as a result of upgrading the tool used to create, build, and sign plugins. The old tool will be deprecated soon, and there will be another PR that updates all the plugins to have such a configuration. Older plugins don't have this since they haven't been rebuilt or upgraded to have it, but it is a necessary folder for anyone wishing to build the plugin locally or make changes to its source code. The additional config file I added was weback.config.ts within the base grafana-dependency-plugin directory, which was provided by a Grafana dev.
The network topology dashboard already has a unit test, which I included when I originally made the dashboard. It simply checks the query to see if it returns expected values.
Yes, will do. |
build/yamls/flow-visibility.yml
Outdated
@@ -3571,11 +3626,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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not getting l7ProtocolName? how are we checking if the flow is L7 and which protocol is used in the flow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since only http protocols are being exported, right now I only check for httpVals existing. Once new protocols are added, their JSON will need to be parsed differently as well, so a patch PR can be made.
"singleQuote": true, | ||
"useTabs": false, | ||
"tabWidth": 2 | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolve all empty line issues
} else { | ||
graphLine = graphLine + destinationIP + ':' + destinationPort; | ||
} | ||
// graphLine = sourceIP + ':' + sourcePort + ' --' + frameHttpInfo.ContentLength + '--> ' + destinationIP + ':' + destinationPort + '\n'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this line?
build/yamls/flow-visibility.yml
Outdated
} | ||
}, | ||
"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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use l7ProtocolName to filter L4 flows
@@ -212,3 +212,9 @@ ALTER TABLE tadetector_local | |||
DROP COLUMN aggType, | |||
DROP COLUMN direction, | |||
DROP COLUMN podName; | |||
ALTER TABLE flows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR has been updated, Please use the new fields and files
@@ -80,6 +80,8 @@ clickhouse client -n -h 127.0.0.1 <<-EOSQL | |||
clusterUUID String, | |||
egressName String, | |||
egressIP String, | |||
isL7 Bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l7ProtocolName?
@@ -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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use l7ProtocolName
Refer to Adding L7 visibility fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll need to check httpVals regardless, since I need to parse its JSON in a specific manner, so I assumed it was redundant to check both. If needed, I can make a later patch that checks the protocolName and parses the JSON accordingly.
} | ||
}, | ||
"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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
2482c26
to
d4526d3
Compare
Will further update README and changelog to reflect latest changes. |
ci/kind/test-multi-cluster.sh
Outdated
@@ -33,7 +33,7 @@ function print_usage { | |||
|
|||
|
|||
TESTBED_CMD=$(dirname $0)"/kind-setup.sh" | |||
FLOW_VISIBILITY_CH_ONLY_CMD=$(dirname $0)"/../../hack/generate-manifest.sh --no-grafana --node-port --secure-connection" | |||
FLOW_VISIBILITY_CH_ONLY_CMD=$(dirname $0)"/../../hack/generate-manifest.sh --ch-only --node-port --secure-connection" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove changes not belong to this PR? Do rebase?
@@ -114,7 +143,8 @@ installed panels will appear. For more information, visit the docs on [Grafana p | |||
|
|||
Users can customize the panel by editing its options and choosing to group the | |||
diagram based on a chosen Pod label. It is also possible to change the color | |||
of the Pod squares in the diagram. | |||
of the Pod squares in the diagram. Additionally, users can switch betwen layer | |||
4 and layer 7 visualizations. | |||
|
|||
<img src="https://user-images.githubusercontent.com/10016630/233191376-7cf471b8-5e3e-473a-8696-da25ab981066.png" width="400" alt="Panel Option Editor View"> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to update the section 4 as you already migrate the dependency-plugin from grafana/toolkit to create-plugin?
.github/workflows/kind.yml
Outdated
@@ -217,6 +217,10 @@ jobs: | |||
docker tag antrea/theia-clickhouse-monitor:latest projects.registry.vmware.com/antrea/theia-clickhouse-monitor:latest | |||
docker load -i clickhouse-server.tar | |||
docker tag antrea/theia-clickhouse-server:latest projects.registry.vmware.com/antrea/theia-clickhouse-server:latest | |||
- name: Remove Theia images tar files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to update the typescript.yaml in workflow as well?
c910962
to
7a79147
Compare
Unit tests are proving to be challenging to setup with updated toolkit versions, will make patch PR for them separately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why we have these two empty files here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not solved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add more details into the PR descriptions? including the your changes from the following aspects and why we need those changes:
- data schema
- dependency plugin source code changes, with newly added diagramController
- dependency upgrade of dependency plugin, which introduces .config, jest folders, etc
- newly added UT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not solved?
} | ||
}, | ||
"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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I missed something, but why we enforce ( destinationPodName != '' OR sourcePodName != '' )
for layer 4 but accept ip+port for layer 7?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove them for both, that condition should be true by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty file?
@@ -0,0 +1,3 @@ | |||
{ | |||
"extends": "./.config/.eslintrc" | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing empty line not solved?
props.width = 600, | ||
props.height = 600; | ||
props.options = {}; | ||
let component = shallow(<DependencyPanel {...props} />); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yuntanghsu could you help take a look at this UT as you recently modified chord/sankey plugins UT and have some experience with how we should design react UTs? I feel like we can also reference to your latest change https://github.com/antrea-io/theia/blob/main/plugins/grafana-custom-plugins/grafana-chord-plugin/src/ChordPanel.test.tsx, but not very sure whether it's also applicable here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are doing a similar test, which verifies the input data reflected in the output component.
But I think we can also verify the context for [boxColor, layerLevelFour, themeColors]? And maybe we can add one more input for layerSeven as the format of GraphString of these two layer graphs are different?
|
||
renderCallback(svgCode: string, bindFunctions: any) { | ||
if (this && bindFunctions) { | ||
console.log('binding diagram functions'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug log can be removed?
let boxColor; | ||
let layerLevel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need an extra var layerLevel
? Can we just reuse options.layerFour
this boolean var?
return sourcePodName; | ||
} | ||
|
||
let groupByPodLabel = options.groupByPodLabel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question, can we reuse options.groupByPodLabel
without introducing new variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, i can change this one
function layerSevenGraph() { | ||
function getColorFromStatus(httpStatus: string) { | ||
// colors that correspond to each of the types of http response code; i.e. 4xx and 5xx codes return red to symbolize errors | ||
const colors = ['orange', 'green', 'blue', 'red', 'red']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest just use a map data structure or case switch statement for this function, rather than the status first char matching colors list index.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking of checking the first character because it would allow all response codes that are within the 100 possible codes range to be represented. Since all 4xx codes are error codes, and all 2xx are success codes, I just checked the first character. I can put the underlying logic into a case switch however, that would be cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking the first char is ok. But I think the list index thing is not a common practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose we can combine the first char matching with a case switch statement.
A general note: If the pull request isn't prepared for review yet, feel free to change its status to draft. If it is ready, I suggest consolidating certain intermediate and less relevant commits that might not provide meaningful information to reviewers. |
3df3912
to
72f071e
Compare
This PR updates the Network Topology dashboard to include visualizations for multiple networking layers. It also updates the legends of both graphs to improve readability. Signed-off-by: Dhruv-J <dhruvj@vmware.com>
72f071e
to
0b94865
Compare
Signed-off-by: Dhruv-J <dhruvj@vmware.com>
"weekStart": "" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not fixed?
}; | ||
// Prettier configuration provided by Grafana scaffolding | ||
...require("./.config/.prettierrc.js") | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
AND octetDeltaCount != 0 | ||
AND $__timeFilter(flowEndSeconds) | ||
WHERE sourcePodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator') | ||
AND destinationPodNamespace NOT IN ('kube-system', 'flow-visibility', 'flow-aggregator') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Kind cluster, there will be 1 more Namespace 'local-path-storage'. Do we want to exclude that as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, how can I test this change locally?
"start": "yarn watch" | ||
"build": "webpack -c ./webpack.config.ts --env production", | ||
"dev": "webpack -w -c ./webpack.config.ts --env development", | ||
"e2e": "yarn exec cypress install && yarn exec grafana-e2e run", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
props.width = 600, | ||
props.height = 600; | ||
props.options = {}; | ||
let component = shallow(<DependencyPanel {...props} />); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are doing a similar test, which verifies the input data reflected in the output component.
But I think we can also verify the context for [boxColor, layerLevelFour, themeColors]? And maybe we can add one more input for layerSeven as the format of GraphString of these two layer graphs are different?
renderedHtmlString.includes(expectedGraphString) | ||
).toEqual(true); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty line.
} | ||
} | ||
"extends": "./.config/tsconfig.json" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
}); | ||
}; | ||
|
||
export default config; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Those are used directly into the theme, and in order to test them, the mermaid components would directly need to be tested, which doesn't seem possible because the component gets split up upon rendering in the DOM, and cannot be checked for directly.
Yes, will do |
Signed-off-by: Dhruv-J <dhruvj@vmware.com>
Signed-off-by: Dhruv-J <dhruvj@vmware.com>
// colors that correspond to each of the types of http response code; i.e. 4xx and 5xx codes return red to symbolize errors | ||
const codeToColor = {1:'orange', 2:'green', 3:'blue', 4:'red', 5:'red'}; | ||
let statusType = +httpStatus.charAt(0); | ||
if (statusType < 1 || statusType > 5) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible for us to get statusType < 1 or > 5? Is there such a http status code? I see you added it for indicating errors, but I wonder whether it is possible to happen, if it does happen, would it be better to catch this error in Flow Exporter or Flow Aggregator? cc @tushartathgur
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it should, but we can double check with @tushartathgur.
ref={this.setDiagramRef} | ||
className={`diagram-seven`} | ||
></div> | ||
<div><p>In this graph, each flow between a source and destination is represented by an arrow labelled with the http content length of the data being sent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a legend/sentence to explain how the colors are mapped to http codes, e.g. 1xx(informational response), 2xx(success), etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I can add a sentence below at the end.
Signed-off-by: Dhruv-J <dhruvj@vmware.com>
Instructions for those wanting to deploy the solution for themselves:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Let's wait for all the required PRs getting merged first and give the final approval on this
This PR is stale because it has been open 90 days with no activity. Remove stale label or comment, or this will be closed in 90 days |
This PR updates the Network Topology dashboard to include visualizations for
multiple networking layers. Specifically, the following has been changed:
The source code of DependencyPanel has been modified to include the
DiagramController class, which acts as a rendering controller for the
mermaid diagram. This is needed after an update to the mermaid library,
which changes the functionality of the existing mermaidAPI render function.
The @grafana-toolkit tool will be deprecated soon, and will be replaced
by @grafana/create-plugin. With the replacement, the directory structure of
the plugin has been significantly changed, with a .config folder containing
the specific configuration files for the plugin's build and run, with general
configuration files in the base directory used to extend the default configs.
A unit test for the DependencyPanel has been added, and it generates a
simple graph and checks the DOM for the expected graph string being present.
Additionally, this PR builds upon #417, which adds additional fields for L7
visibility.