diff --git a/lib/utils.js b/lib/utils.js index ff38627..bfa0319 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -40,7 +40,7 @@ function getResource() { LOG._info && LOG.info('Unable to require package.json to resolve app name and version due to error:', err) } - const name = PKG?.name || VCAP_APPLICATION?.name || 'CAP Application' + const name = VCAP_APPLICATION?.name || PKG?.name || 'CAP Application' const version = PKG?.version || VCAP_APPLICATION?.application_version || '1.0.0' const attributes = {} @@ -61,7 +61,7 @@ function getResource() { if (VCAP_APPLICATION) { attributes['sap.cf.source_id'] = VCAP_APPLICATION.application_id attributes['sap.cf.app_id'] = VCAP_APPLICATION.application_id - attributes['sap.cf.app_name'] = name + attributes['sap.cf.app_name'] = VCAP_APPLICATION.name attributes['sap.cf.space_id'] = VCAP_APPLICATION.space_id attributes['sap.cf.space_name'] = VCAP_APPLICATION.space_name attributes['sap.cf.org_id'] = VCAP_APPLICATION.organization_id