Skip to content

Commit

Permalink
Update docs and English grammar corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
Castro, Mario committed Aug 19, 2024
1 parent cf75012 commit 6d09f00
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/framework-core/src/sensor/health/health-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function rootHealthProviders(
)
}

export function childrenHealthProviders(
export function childHealthProviders(
healthIndicatorMetadata: HealthIndicatorMetadata,
healthProviders: Record<string, HealthIndicatorMetadata>
): Array<HealthIndicatorMetadata> {
Expand Down
12 changes: 6 additions & 6 deletions packages/framework-core/test/sensor/health/health-utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HealthIndicatorMetadata } from '@boostercloud/framework-types'
import 'mocha'
import {
childrenHealthProviders,
childHealthProviders,
isEnabled,
metadataFromId,
parentId,
Expand Down Expand Up @@ -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([])
})
})
18 changes: 13 additions & 5 deletions website/docs/10_going-deeper/health/sensor-health.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 6d09f00

Please sign in to comment.