diff --git a/packages/framework-core/src/sensor/health/booster-health-service.ts b/packages/framework-core/src/sensor/health/booster-health-service.ts index ad2e383a6..5bd68ac63 100644 --- a/packages/framework-core/src/sensor/health/booster-health-service.ts +++ b/packages/framework-core/src/sensor/health/booster-health-service.ts @@ -7,7 +7,7 @@ import { HealthIndicatorsResult, UserEnvelope, } from '@boostercloud/framework-types' -import { childrenHealthProviders, isEnabled, metadataFromId, rootHealthProviders } from './health-utils' +import { childHealthProviders, isEnabled, metadataFromId, rootHealthProviders } from './health-utils' import { createInstance } from '@boostercloud/framework-common-helpers' import { defaultBoosterHealthIndicators } from './health-indicators' import { BoosterTokenVerifier } from '../../booster-token-verifier' @@ -51,14 +51,14 @@ export class BoosterHealthService { if (!indicatorResult) { continue } - const childrens = childrenHealthProviders(current, healthProviders) + const children = childHealthProviders(current, healthProviders) const newResult: HealthIndicatorsResult = { ...indicatorResult, name: current.healthIndicatorConfiguration.name, id: current.healthIndicatorConfiguration.id, } - if (childrens && childrens?.length > 0) { - newResult.components = await this.boosterHealthProviderResolver(childrens, healthProviders) + if (children && children?.length > 0) { + newResult.components = await this.boosterHealthProviderResolver(children, healthProviders) } result.push(newResult) } diff --git a/packages/framework-core/src/sensor/health/health-utils.ts b/packages/framework-core/src/sensor/health/health-utils.ts index 40d74542e..a5373b566 100644 --- a/packages/framework-core/src/sensor/health/health-utils.ts +++ b/packages/framework-core/src/sensor/health/health-utils.ts @@ -27,7 +27,7 @@ export function rootHealthProviders( ) } -export function childrenHealthProviders( +export function childHealthProviders( healthIndicatorMetadata: HealthIndicatorMetadata, healthProviders: Record ): Array { diff --git a/packages/framework-core/test/sensor/health/health-utils.test.ts b/packages/framework-core/test/sensor/health/health-utils.test.ts index ec5bec1ab..360537f0f 100644 --- a/packages/framework-core/test/sensor/health/health-utils.test.ts +++ b/packages/framework-core/test/sensor/health/health-utils.test.ts @@ -1,7 +1,7 @@ import { HealthIndicatorMetadata } from '@boostercloud/framework-types' import 'mocha' import { - childrenHealthProviders, + childHealthProviders, isEnabled, metadataFromId, parentId, @@ -165,13 +165,13 @@ describe('Health utils', () => { }) it('childrenHealthProviders', () => { - expect(childrenHealthProviders(root, healthProviders)).to.be.deep.equal([rootChildren1, rootChildren2]) - expect(childrenHealthProviders(rootChildren1, healthProviders)).to.be.deep.equal([ + expect(childHealthProviders(root, healthProviders)).to.be.deep.equal([rootChildren1, rootChildren2]) + expect(childHealthProviders(rootChildren1, healthProviders)).to.be.deep.equal([ rootChildren1Children1, rootChildren1Children2, ]) - expect(childrenHealthProviders(rootChildren1Children1, healthProviders)).to.be.deep.equal([]) - expect(childrenHealthProviders(rootChildren1Children2, healthProviders)).to.be.deep.equal([]) - expect(childrenHealthProviders(rootChildren2, healthProviders)).to.be.deep.equal([]) + expect(childHealthProviders(rootChildren1Children1, healthProviders)).to.be.deep.equal([]) + expect(childHealthProviders(rootChildren1Children2, healthProviders)).to.be.deep.equal([]) + expect(childHealthProviders(rootChildren2, healthProviders)).to.be.deep.equal([]) }) }) diff --git a/website/docs/10_going-deeper/health/sensor-health.md b/website/docs/10_going-deeper/health/sensor-health.md index bdf4eb8af..3a769a538 100644 --- a/website/docs/10_going-deeper/health/sensor-health.md +++ b/website/docs/10_going-deeper/health/sensor-health.md @@ -87,10 +87,11 @@ Booster provides the following endpoints to retrieve the enabled components: * https://your-application-url/sensor/health/booster/database/events: Events status * https://your-application-url/sensor/health/booster/database/readmodels: ReadModels status * https://your-application-url/sensor/health/booster/function: Functions status +* https://your-application-url/sensor/health/rockets: Rockets status * https://your-application-url/sensor/health/your-component-id: User defined status * https://your-application-url/sensor/health/your-component-id/your-component-child-id: User child component status -Depending on the `showChildren` configuration, children components will be included or not. +Depending on the `showChildren` configuration, child components will be included or not. ### Health Status Response @@ -100,7 +101,7 @@ Each component response will contain the following information: * name: component description * id: string. unique component identifier. You can request a component status using the id in the url * details: optional object. If `details` is true, specific details about this component. -* components: optional object. If `showChildren` is true, children components health status. +* components: optional object. If `showChildren` is true, child components health status. Example: @@ -150,6 +151,7 @@ Use the `id` field to get specific component health information. Booster provide * booster/database * booster/database/events * booster/database/readmodels +* rockets You can provide new components: ```typescript @@ -189,8 +191,8 @@ Health components are fully configurable, allowing you to display the informatio Configuration options: * enabled: If false, this indicator and the components of this indicator will be skipped * details: If false, the indicator will not include the details -* showChildren: If false, this indicator will not include children components in the tree. - * Children components will be shown through children urls +* showChildren: If false, this indicator will not include child components in the tree. + * Child components will be shown through child urls * authorize: Authorize configuration. [See security documentation](https://docs.boosterframework.com/security/security) #### Booster components default configuration @@ -316,12 +318,18 @@ export class ApplicationHealthIndicator { > **Note**: details will be included only if `details` is enabled +#### rockets + +* status: UP if and only if all rockets are UP, PARTIALLY_UP if not all rockets are UP + +> **Note**: sensors for rockets is only available for the Azure provider ### Health status Available status are * UP: The component or subsystem is working as expected +* PARTIALLY_UP: The component is partially working or has reduced functionality * DOWN: The component is not working * OUT_OF_SERVICE: The component is out of service temporarily * UNKNOWN: The component state is unknown @@ -370,7 +378,7 @@ If the request url is https://your-application-url/sensor/health/database, the c [Empty] ``` -And the children components will be disabled too using direct url https://your-application-url/sensor/health/database/events +And the child components will be disabled too using direct url https://your-application-url/sensor/health/database/events ```text [Empty]