Skip to content

Commit

Permalink
Expose overall status to plugins (elastic#75503)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
joshdover and elasticmachine committed Aug 24, 2020
1 parent c1fa192 commit ba1ba0c
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ export interface StatusServiceSetup
| Property | Type | Description |
| --- | --- | --- |
| [core$](./kibana-plugin-core-server.statusservicesetup.core_.md) | <code>Observable&lt;CoreStatus&gt;</code> | Current status for all Core services. |
| [overall$](./kibana-plugin-core-server.statusservicesetup.overall_.md) | <code>Observable&lt;ServiceStatus&gt;</code> | Overall system status for all of Kibana. |

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [StatusServiceSetup](./kibana-plugin-core-server.statusservicesetup.md) &gt; [overall$](./kibana-plugin-core-server.statusservicesetup.overall_.md)

## StatusServiceSetup.overall$ property

Overall system status for all of Kibana.

<b>Signature:</b>

```typescript
overall$: Observable<ServiceStatus>;
```

## Remarks

The level of the overall status will reflect the most severe status of any core service or plugin.

Exposed only for reporting purposes to outside systems and should not be used by plugins. Instead, plugins should only depend on the statuses of [Core](./kibana-plugin-core-server.statusservicesetup.core_.md) or their dependencies.

1 change: 1 addition & 0 deletions src/core/server/legacy/legacy_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ export class LegacyService implements CoreService {
},
status: {
core$: setupDeps.core.status.core$,
overall$: setupDeps.core.status.overall$,
},
uiSettings: {
register: setupDeps.core.uiSettings.register,
Expand Down
1 change: 1 addition & 0 deletions src/core/server/plugins/plugin_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export function createPluginSetupContext<TPlugin, TPluginDependencies>(
},
status: {
core$: deps.status.core$,
overall$: deps.status.overall$,
},
uiSettings: {
register: deps.uiSettings.register,
Expand Down
1 change: 1 addition & 0 deletions src/core/server/server.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2802,6 +2802,7 @@ export type StartServicesAccessor<TPluginsStart extends object = object, TStart
// @public
export interface StatusServiceSetup {
core$: Observable<CoreStatus>;
overall$: Observable<ServiceStatus>;
}

// @public
Expand Down
1 change: 1 addition & 0 deletions src/core/server/status/status_service.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const availableCoreStatus: CoreStatus = {
const createSetupContractMock = () => {
const setupContract: jest.Mocked<StatusServiceSetup> = {
core$: new BehaviorSubject(availableCoreStatus),
overall$: new BehaviorSubject(available),
};

return setupContract;
Expand Down
15 changes: 11 additions & 4 deletions src/core/server/status/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,20 @@ export interface StatusServiceSetup {
* Current status for all Core services.
*/
core$: Observable<CoreStatus>;
}

/** @internal */
export interface InternalStatusServiceSetup extends StatusServiceSetup {
/**
* Overall system status used for HTTP API
* Overall system status for all of Kibana.
*
* @remarks
* The level of the overall status will reflect the most severe status of any core service or plugin.
*
* Exposed only for reporting purposes to outside systems and should not be used by plugins. Instead, plugins should
* only depend on the statuses of {@link StatusServiceSetup.core$ | Core} or their dependencies.
*/
overall$: Observable<ServiceStatus>;
}

/** @internal */
export interface InternalStatusServiceSetup extends StatusServiceSetup {
isStatusPageAnonymous: () => boolean;
}

0 comments on commit ba1ba0c

Please sign in to comment.