Skip to content

Commit 30de585

Browse files
author
dashuser1
committed
Added custom column for legend display
1 parent 447a31e commit 30de585

4 files changed

Lines changed: 21 additions & 11 deletions

File tree

plugins/eginnovations/v1/data_streams.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{
1010
"map": {
1111
"unmonitored": [],
12-
"unknown": [],
12+
"unknown": ["unknown"],
1313
"error": ["critical"],
1414
"warning": ["major"],
1515
"success": ["minor"]
@@ -35,6 +35,7 @@
3535
{
3636
"name": "HistoricalData",
3737
"metadata": [
38+
{ "name": "legend", "displayName": "Legend", "shape": "string", "role": "label" },
3839
{
3940
"name": "date",
4041
"displayName": "Date",
@@ -88,7 +89,7 @@
8889
{
8990
"map": {
9091
"unmonitored": [],
91-
"unknown": [],
92+
"unknown": ["Unknown"],
9293
"error": ["Critical"],
9394
"warning": ["Major"],
9495
"success": ["Minor"]
@@ -174,10 +175,10 @@
174175
"state",
175176
{
176177
"map": {
177-
"unmonitored": ["Minor"],
178+
"unmonitored": [],
178179
"unknown": ["Unknown"],
179-
"error": ["Critical"],
180-
"warning": ["Major"],
180+
"error": ["Critical", "Major"],
181+
"warning": ["Minor"],
181182
"success": ["Normal"]
182183
}
183184
}
@@ -220,14 +221,15 @@
220221
"map": {
221222
"unmonitored": [],
222223
"unknown": ["Unknown"],
223-
"error": ["Critical"],
224-
"warning": ["Major"],
224+
"error": ["Critical", "Major"],
225+
"warning": ["Minor"],
225226
"success": ["Normal"]
226227
}
227228
}
228229
],
229230
"name": "priority"
230231
},
232+
{ "name": "legend", "displayName": "Legend", "shape": "string", "role": "label" },
231233
{
232234
"name": "priority",
233235
"displayName": "Priority",

plugins/eginnovations/v1/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "eGInnovations",
33
"displayName": "eG Enterprise",
4-
"version": "1.1.9",
4+
"version": "1.2.0",
55
"author": "eG Innovations Pvt Ltd",
66
"description": "Monitor key application metrics from your eG environment",
77
"category": "APM",

plugins/eginnovations/v1/readDataSource/getHistoricalData.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ export async function getHistoricalData(context) {
6767

6868
let data = await response.json();
6969

70-
return data.data;
70+
// return data.data;
71+
return data.data.map((component) => ({
72+
...component,
73+
legend: `${component.componentType} / ${component.componentName} / ${component.test}/ ${component.descriptor}/ ${component.measure}`
74+
}));
7175
} catch (error) {
7276
// Catch and log any errors
7377
context.log.error(`Error in getHistoricalData: ${error.message}`);

plugins/eginnovations/v1/readDataSource/getLiveMeasure.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export async function getLiveMeasure(context) {
1414

1515
if (context.dataSourceConfig.descriptor != 'All' && context.dataSourceConfig.descriptor != 'Not Applicable') {
1616
info = context.dataSourceConfig.descriptor;
17-
}else{
17+
} else {
1818
info = '';
1919
}
2020

@@ -59,7 +59,11 @@ export async function getLiveMeasure(context) {
5959

6060
let data = await response.json();
6161

62-
return data;
62+
// return data;
63+
return data.map((component) => ({
64+
...component,
65+
legend: `${component.componentType} / ${component.componentName} / ${component.test}/ ${component.descriptor}/ ${component.measure}`
66+
}));
6367
} catch (error) {
6468
// Catch and log any errors
6569
context.log.error(`Error in getLiveMeasure: ${error.message}`);

0 commit comments

Comments
 (0)