Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose overall status to plugins #75503

Merged
merged 3 commits into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -2785,6 +2785,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;
}