From 3c8ed17b23f847ccf33eacc4af93485e07ab0a1b Mon Sep 17 00:00:00 2001 From: Nikolay Stanchev <ns17@it-innovation.soton.ac.uk> Date: Fri, 9 Aug 2019 14:38:40 +0100 Subject: [PATCH] Extends CLMC dev guide with an example on how to request graph-based monitoring on the sandpit --- docs/clmc-development-guide.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/clmc-development-guide.md b/docs/clmc-development-guide.md index 785abe8..b2e2199 100644 --- a/docs/clmc-development-guide.md +++ b/docs/clmc-development-guide.md @@ -447,11 +447,41 @@ Since the Neo4j browser uses an adhoc port number (7687) we need a second tunnel Then by opening the URL above, the Neo4j browser will ask about credentials: Host: localhost (the port forwarding will forward port 7687 on localhost to port 7687 on the CLMC) + Username: neo4j + Password: admin Then we can execute Cypher queries against the Neo4j graph, the most useful one: ` MATCH (n) return n;` which will render the full graph. + +After the network topology graph is built, a media service provider can request graph-based monitoring. An example of how to request this, assuming that the SFC **sandpit-experiment** has been deployed (TOSCA files and LXD image included in sandpit repository in folder itinnov): + +JSON configuration: + +```json +{ + "query_period": 30, + "results_measurement_name": "graph_measurements", + "service_function_chain": "sandpit-experiment", + "service_function_chain_instance": "sandpit-experiment_1", + "service_functions": { + "sandstorage": { + "response_time_field": "(max(processing_time) - min(processing_time)) / ((max(request_count) -min(request_count))*1000)", + "request_size_field": "(max(bytes_received) - min(bytes_received)) / (max(request_count) - min(request_count))", + "response_size_field": "(max(bytes_sent) - min(bytes_sent)) / (max(request_count) - min(request_count))", + "measurement_name": "tomcat_connector" + } + } +} +``` + +Then, in chronograf we can view measurement called **graph_measurements** which will be populated from the CLMC graph monitoring pipeline. + +curl POST request: + +`curl -X POST http://localhost:9000/clmc/clmc-service/graph/monitor -d '{"query_period": 30, "results_measurement_name": "graph_measurements", "service_function_chain": "sandpit-experiment", "service_function_chain_instance": "sandpit-experiment_1", "service_functions": {"sandstorage": {"response_time_field": "(max(processing_time) - min(processing_time)) / ((max(request_count) -min(request_count))*1000)", "request_size_field": "(max(bytes_received) - min(bytes_received)) / (max(request_count) - min(request_count))", "response_size_field": "(max(bytes_sent) - min(bytes_sent)) / (max(request_count) - min(request_count))", "measurement_name": "tomcat_connector"}}}'` + #### Implementation details of the Alerts API The Alerts API is implemented on top of the Kapacitor HTTP API and includes the following main parts: -- GitLab