Skip to content

Commit f2c40ec

Browse files
committed
fix error
1 parent 49f1a07 commit f2c40ec

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

chronos_npm_package/controllers/mongo.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,6 @@ mongo.createGrafanaDashboards = async (config, parsedArray) => {
315315
console.log('In mongo.createGrafanaDashboards!!!')
316316
console.log('Calling utilities.getGrafanaDatasource()');
317317
const datasource = await utilities.getGrafanaDatasource(config.grafanaAPIKey);
318-
console.log('mongo.createGrafanaDashboards line 318:', datasource);
319318
//console.log('Calling utilities.promMetricsQuery()');
320319
//const parsedArray = await utilities.promMetricsQuery(config);
321320
//const datasource = await utilities.getGrafanaDatasource();

chronos_npm_package/controllers/utilities.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ const helpers = {
249249
parseProm: (config, data) => {
250250
const res = [];
251251
const time = Date.now();
252-
const category = config.mode === 'docker' ? `${config.containerName}`: 'Event';
252+
const category = config.mode === 'docker' ? `${config.containerName}` : 'Event';
253253

254254
/**
255255
* Opportunity for improvement: Prometheus may query metrics that have the same job + instance + metric
@@ -266,7 +266,7 @@ const helpers = {
266266
for (const info of data) {
267267
let wholeName;
268268
let name;
269-
if (config.mode === 'docker'){
269+
if (config.mode === 'docker') {
270270
if (!info.metric.name) continue;
271271
wholeName = info.metric['__name__'];
272272
name = wholeName.replace(/.*\/.*\//g, '');
@@ -303,7 +303,7 @@ const helpers = {
303303
return res;
304304
},
305305

306-
306+
307307

308308
createGrafanaDashboard: async (
309309
metric,
@@ -337,7 +337,6 @@ const helpers = {
337337

338338
// push panel into dashboard object with a line for each metric in promQLQueries object
339339
dashboard.dashboard.panels.push(createGrafanaPanelObject(metric, datasource, graphType));
340-
console.log('utilities.createGrafanaDashboard line 340:', dashboard.dashboard.panels);
341340
try {
342341
// POST request to Grafana Dashboard API to create a dashboard
343342
const dashboardResponse = await axios.post(
@@ -350,7 +349,6 @@ const helpers = {
350349
},
351350
}
352351
);
353-
console.log("utilities.createGrafanaDashboard line 353 dashboardResponse is: ", dashboardResponse)
354352

355353
// Descriptive error log for developers
356354
if (dashboardResponse.status >= 400) {
@@ -376,22 +374,21 @@ const helpers = {
376374
'Authorization': token
377375
},
378376
});
379-
console.log('utilities.getGrafanaDatasource line 379:', datasourceResponse);
377+
// console.log('utilities.getGrafanaDatasource line 379:', datasourceResponse);
380378
console.log("Successfully fetched datasource from Grafana API")
381379
// Create a datasource object to be used within panels.
382380
const datasource = {
383381
type: datasourceResponse.data[0].type,
384382
uid: datasourceResponse.data[0].uid,
385383
};
386-
console.log('datasource is', datasource)
384+
// console.log('datasource is', datasource)
387385

388386
return datasource;
389387
},
390388

391389
updateGrafanaDatasource: async (token) => {
392390
// Fetch datasource information from grafana API.
393391
// This datasource is PRECONFIGURED on launch using grafana config.
394-
console.log('In utilities.getGrafanaDatasource!!!');
395392
const datasourceResponse = await axios.get('http://localhost:32000/api/datasources', {
396393
headers: {
397394
'Content-Type': 'application/json',

examples/kubernetes/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ kubectl apply -f frontend.yml
9090
<p align="center">
9191
<img alt="dashboards created" src="../../assets/kubernetes-example2.png">
9292
</p>
93-
(The second image is inside k8s_node-backend_node-backend-d597768c-6zm5j_default_46da04f8-99c6-4522-9141-6c05f8d5141d_0 container, it may take a while to show up in Docker desktop based on the scraping interval)
9493

94+
The second image is inside **k8s_node-backend_node-backend-d597768c-6zm5j_default_46da04f8-99c6-4522-9141-6c05f8d5141d_0** container, it may take a while to show up in Docker desktop based on the scraping interval
9595

9696
Your microservice health metrics can now be viewed at the given `CHRONOS_URI` or, preferrably, in the Electron.js desktop application.
9797

examples/kubernetes/server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"start": "nodemon app.js"
77
},
88
"dependencies": {
9-
"@chronosmicro/tracker": "^12.0.1",
9+
"@chronosmicro/tracker": "file:./chronos_npm_package",
1010
"cors": "2.8.5",
1111
"dotenv": "^16.0.3",
1212
"express": "^4.18.2"

0 commit comments

Comments
 (0)