From 96f232a75f1b56a1ef830357a700bd32eb0c0cc3 Mon Sep 17 00:00:00 2001 From: MallanagoudaB Date: Mon, 10 Nov 2025 12:01:29 +0530 Subject: [PATCH 1/2] getting-version-from-package-file --- health-check/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/health-check/index.js b/health-check/index.js index 91fc9ca..8a9d4b5 100644 --- a/health-check/index.js +++ b/health-check/index.js @@ -16,7 +16,7 @@ const httpService = require('./services/httpService') * @param {string} [currentServiceName=''] - Optional. Name of the current service to avoid self-check. * @returns {Promise} - A formatted response with health check results. */ -async function healthCheckHandler(config, basicCheck = false, currentServiceName = '') { +async function healthCheckHandler(config, basicCheck = false, currentServiceName = '', serviceVersion) { validateHealthConfig(config) const checks = [] @@ -35,7 +35,7 @@ async function healthCheckHandler(config, basicCheck = false, currentServiceName if (config?.checks?.kafka?.enabled) { try { const kafka = require('./services/kafka') - const healthy = await kafka.check(config.checks.kafka.url, config.checks.kafka.topic) + const healthy = await kafka.check(config.checks.kafka.url, config.checks.kafka.topic,config.checks.kafka.groupId) checks.push(serviceResult('Kafka', healthy)) } catch (err) { checks.push(serviceResult('Kafka', false)) @@ -102,7 +102,7 @@ async function healthCheckHandler(config, basicCheck = false, currentServiceName checks, } - return formatResponse(result) + return formatResponse(result,serviceVersion) } /** @@ -193,10 +193,10 @@ function validateHealthConfig(config) { * @param {Object} result - The object containing service name, version, healthy status, and checks. * @returns {Object} - The formatted response object. */ -function formatResponse(result) { +function formatResponse(result,serviceVersion) { return { id: 'service.health.api', - ver: '1.0', + version: serviceVersion, ts: new Date(), params: { resmsgid: uuidv1(), From d032e9e89377a729e6d00122ffc217bc3b958f55 Mon Sep 17 00:00:00 2001 From: MallanagoudaB Date: Mon, 10 Nov 2025 12:02:31 +0530 Subject: [PATCH 2/2] getting-version-from-package-file --- health-check/index.js | 2 +- health-check/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/health-check/index.js b/health-check/index.js index 8a9d4b5..f444efd 100644 --- a/health-check/index.js +++ b/health-check/index.js @@ -35,7 +35,7 @@ async function healthCheckHandler(config, basicCheck = false, currentServiceName if (config?.checks?.kafka?.enabled) { try { const kafka = require('./services/kafka') - const healthy = await kafka.check(config.checks.kafka.url, config.checks.kafka.topic,config.checks.kafka.groupId) + const healthy = await kafka.check(config.checks.kafka.url, config.checks.kafka.topic) checks.push(serviceResult('Kafka', healthy)) } catch (err) { checks.push(serviceResult('Kafka', false)) diff --git a/health-check/package.json b/health-check/package.json index 338b5e0..7283954 100644 --- a/health-check/package.json +++ b/health-check/package.json @@ -1,6 +1,6 @@ { "name": "elevate-services-health-check", - "version": "0.0.7", + "version": "0.0.8", "description": "Package that can be used for service health check", "main": "index.js", "scripts": {