Insights Inference - KPI Job Configuration
Learn to Add/Edit Insights Inference - KPI on this page.
On this page:
Insights Inference - KPI Job JSON Structure
KPI Attribute | Description |
---|---|
kpiID | It is like a primary key of a Insights - Inference KPI. It should be unique, and have numerical value. It shall also be specified same when adding custom KPI message for UI. |
expectedTrend | It is expected trend of the Insights Inference - KPI. Eg. UPWARDS / DOWNWARDS |
name | It denotes the name of the Insights Inference - KPI. |
action | It is the Mathematical Function that is imposed on a Insights Inference - KPI. It shall also be specified same when adding custom KPI message for UI. Eg. AVERAGE / COUNT / MINMAX |
schedule | It is the job schedule of a Insights Inference - KPI. Eg. DAILY / WEEKLY / MONTHLY / YEARLY |
vector | It denotes the DevOps vector of a tool, which is specified in the Insights Inference - KPI. Eg. BUILD, CODEQUALITY, DEFECTS, DEPLOYMENT etc,. |
toolName | It is the name of the DevOps tool. Eg. JIRA, Jenkins, Sonar, Rundeck etc,. |
isGroupBy | It is used for Aggregation if more than one instance is specified. Its value is Boolean. Eg. true / false |
groupByFieldName | It is required when "isGroupBy" is set to true. It is used to specify the description for "groupByField", on which the Aggregation would be imposed. |
groupByField | It is required when "isGroupBy" is set to true. It is used for Aggregation if more than one instance is specified. It's generally the name of the field on which Aggregation will be imposed. |
averageField | It is required only when the KPI "action" is AVERAGE. Input the name of the field on which AVERAGE Mathematical Calculations must be imposed. |
startTimeField | It indicates the Start time property/field name of a DevOps tool. Its input is a String value. It is mandatory if your Insights Inference - KPI's "action" is "AVERAGE". |
endTimeField | It indicates the End time property/field name of a DevOps tool. Its input is a String value. It is mandatory if your Insights Inference - KPI's "action" is "AVERAGE". |
resultOutPutType | It indicates the result type of the Insights Inference - KPI. For instance, AVERAGE type KPI could have result as Average Time or Average of Numbers. Use time when the type of output is Time Duration, and number when the type of output is just a Normal Number. Eg. time / number |
isComparisionKpi | It is a Boolean value. It generally indicates whether or not the KPI result should have a comparison with previous KPI result. Eg. true / false |
esquery | It is an Elasticsearch query to fetch the data and collect the results. |
timeFormat | It is the standard time format of a region. Eg. YYYY-MM-DD HH:MM |
esresource | It is the node/index at which the tools data is present in Elasticsearch. Eg. neo4j-index-node/tool-data |
es-index-read-missing-as-empty | It is a Boolean value used to denote undefined nodes/indexes in Elasticsearch as empty. Eg. true / false |
nextRun | It is the next scheduled date on which Insights - KPI Job Execution will be executed. It is represented as Epoch Time in milliseconds. |
lastRunTime | It is the previous scheduled date on which Insights - KPI Job Execution was run. It is represented as Epoch Time in milliseconds. |
isActive | It denotes whether or not the Insights Inference - KPI is in use or not. It is generally used to Enable / Disable the KPI. It accepts a Boolean value. Eg. true / false |
Sample CURL command to create an Insights KPI
It is required to execute CURL command from a console such as Command Prompt/Git Bash.
The following is a sample CURL command to Add a KPI in Elasticsearch -
Please note below is just a sample and you will need to replace the field names like SPKduration, SPKvector, SPKtoolName etc with relevant field names from your Elasticsearch DB. Do not use below sample as is.
curl POST 'http://localhost:9200/spark-jobs-conf/configs/' -d '{
"kpiDefinition": {
"kpiID": "140",
"expectedTrend": "DOWNWARDS",
"name": "Average Duration of Successful Deployments",
"action": "AVERAGE",
"schedule": "DAILY",
"vector": "DEPLOYMENT",
"toolName": "RUNDECK",
"isGroupBy": false,
"groupByFieldName": "",
"groupByField": "",
"averageField": "SPKduration",
"startTimeField": "SPKstartTime",
"endTimeField": "SPKendTime",
"resultOutPutType": "time",
"isComparisionKpi": true,
"esquery": "{ \"query\": { \"bool\": { \"must\": [ { \"match\": { \"SPKvector\": \"DEPLOYMENT\" } }, { \"match\": { \"SPKtoolName\": \"RUNDECK\" } }, { \"match\": { \"SPKstatus\": \"Success\" } }, { \"bool\": { \"must\": [ { \"range\": { \"SPKstartTime\": { \"gte\": \"__dataFromTime__\", \"lte\": \"__dataToTime__\", \"format\": \"epoch_millis\" } } } ] } } ] } } }",
"timeFormat": "YYYY-MM-DD HH:MM",
"esresource": "neo4j-index-node/SPKDATA",
"es-index-read-missing-as-empty": true
},
"name": "Average Duration of Succesful Deployments",
"nextRun": "1511395260000",
"lastRunTime": 1511395260000,
"isActive": true
}'
"__dataFromTime__", and "__dataToTime__" will be calculated at run time by Insights Inference service based on the schedule of the Insights Inference - KPI Job.
To view/download sample of current/default supported KPI Jobs, click here.
Sample Insights Inference - KPI Job in Elasticsearch
©2021 Cognizant, all rights reserved. US Patent 10,410,152