Execute Analytic Service Generic - sonata-nfv/tng-analytics-engine GitHub Wiki

Scope: This functionality is used for realizing an analysis upon any monitored Prometheus metrics.

REST - API: http://profiler_server_IP_address/analytic_service

POST body parameters

{
        "periods": "JSONArray with start and end timestamps. The start and end datetime should be synchronized with Prometheus instance clock",
        "name": "String with the name of the analytic service",
        "process_friendly_name": "String with the name of the friendly name of the analytic process",
        "step": "The frequency of getting data from Prometheus. This is an optional field",
        "vendor": "Vendor name. supported names are 5gtango.vnv, 5gtango.sp, k8s, matilda",
	"metrics": "JSONArray. This is an optional field",
        "callback": "callback url for triggering by GET when the analytic service is completed. callback url should return a string with an id reference to the analytic service results object"
}

Some examples are:

chord diagram

See via a chord diagram how all metrics coming from an application graph are related between them:

{"periods":[{"start":"2019-06-13T07:15:00.000Z","end":"2019-06-13T07:27:00.000Z"}],
 "step":"3m",
 "name":"chord",
 "vendor":"matilda",
 "callback":"http://localhost:8082/analytic_service/124/status",
 "metrics": "netdata:jmSRafpAkY:Gi2E9NYbxy:X2eHHQdkBW_system_softirqs_softirqs_persec_average{chart='system.softirqs',dimension='BLOCK',family='softirqs',instance='[fca7:9e35:c403:630f:939a:ecb3:9cef:b487]:19999',job='netdata'}",..........,"netdata:jmSRafpAkY:Gi2E9NYbxy:X2eHHQdkBW_net_packets_packets_persec_average{chart='cgroup_x2ehhqdkbw.net_packets_eth0',dimension='multicast',family='net eth0',instance='[fca7:9e35:c403:630f:939a:ecb3:9cef:b487]:19999',job='netdata'}"]

A response example should be:

 [{
 	"result": "http://opencpu_server/ocpu/tmp/x0ee94c67bf3b17/files/correlation_matrix.csv",
 	"type": "csv"
 }, {
 	"result": "http://opencpu_server/ocpu/tmp/x0ee94c67bf3b17/files/correlation_matrix.json",
 	"type": "json"
 }, {
 	"result": "http://opencpu_server/ocpu/tmp/x0ee94c67bf3b17/files/correlation_page.html",
 	"type": "html"
 }, {
 	"result": "http://opencpu_server/ocpu/tmp/x0ee94c67bf3b17/files/metrics_appendix.csv",
 	"type": "csv"
 }]

see specific example call: ChordDiagramSampleCall.txt and html result file : indicative_results

Linear regression model and plot

See how all two metrics depend on each other based on their linear regression model:

{"periods":[{"start":"2019-06-13T07:15:00.000Z","end":"2019-06-13T07:27:00.000Z"}],
	"step":"3m",
        "name":"linear_regression",
        "vendor":"matilda",
        "callback":"http://localhost:8082/analytic_service/124/status",
	"metrics":["netdata:jmSRafpAkY:Gi2E9NYbxy:J9emWzWSbq_system_load_load_average{chart='system.load',dimension='load15',family='load',instance='[fc97:3759:ced:3b1a:209e:36d9:515a:22e2]:19999',job='netdata'}","netdata:jmSRafpAkY:Gi2E9NYbxy:J9emWzWSbq_apps_cpu_system_cpu_time___average{chart='apps.cpu_system',dimension='containers',family='cpu',instance='[fc97:3759:ced:3b1a:209e:36d9:515a:22e2]:19999',job='netdata'}"]
}

A response example should be:

[{
	"result": "http://opencpu_server/ocpu/tmp/x0774a0629508ec/files/finaldata.csv",
	"type": "csv"
}, {
	"result": "http://opencpu_server/ocpu/tmp/x0774a0629508ec/files/metricsCombination.html",
	"type": "html"
}]

see specific example call: linearRegressionSampleCall.txt and html result file : indicative_results