-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Status UI] Use the new output format of API GET /api/status
#107937
Conversation
Pinging @elastic/kibana-core (Team:Core) |
@elasticmachine run elasticsearch-ci/docs |
src/core/types/status.ts
Outdated
core: Record<string, ServerStatus>; | ||
plugins: Record<string, ServerStatus>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This StatusResponse
type isn't currently being shared across server and public, though we may not really be able to share it properly until we've removed the legacy type.
core/public is using this type, while core/server is using this unexported type:
interface StatusHttpBody { |
If it's not possible to align these two to use the same type, can we leave a TODO to do this as part of #94419 or in code?
serverState: formatStatus(response.status.overall).state, | ||
statuses: [ | ||
...Object.entries(response.status.core).map(([serviceName, status]) => | ||
formatStatus(`core:${serviceName}@${response.version.number}`, status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we should remove the version number from the core services as well. I think it's confusing and unnecessary.
@@ -7,8 +7,9 @@ | |||
*/ | |||
|
|||
import { i18n } from '@kbn/i18n'; | |||
import { deepFreeze } from '@kbn/std'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, if this is increasing the core bundle size, it's likely not worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meant to approve, no reason to block this merge.
6c0cc4d
to
3bf1714
Compare
- Use common types on the server and public - Remove `deepFreeze` - Remove version from core services
3bf1714
to
245943c
Compare
build_number: number; | ||
build_snapshot: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The moment we linked the types, this screamed as wrong 👌
* We need this type to convert the object `ServiceStatusLevel` to a union of the possible strings. | ||
* This is because of the "stringification" that occurs when serving HTTP requests. | ||
*/ | ||
export type ServiceStatusLevel = ReturnType<ServiceStatusLevelFromServer['toString']>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the biggest change when linking both types: the HTTP response calls the method toString()
. So the types are not exactly the same.
💚 Build SucceededMetrics [docs]Page load bundle
History
To update your PR or re-run it, just comment with: |
💔 Backport failed
To backport manually run: |
7.x backport PR: #108227 |
…) (#108227) # Conflicts: # packages/kbn-optimizer/limits.yml
Summary
Resolves #77624
This PR uses the request
GET /api/status?v8format=true
to prepare the Status page for the breaking changes in the output of such API coming up for 8.0.0.No major UI changes are made. The only visible one is that the version detailed as
plugin:[email protected]
is removed from each plugin name in the list.I removed it because, IMO, it doesn't add any value, and it wouldn't be accurate for 3rd-party plugins, since we are using Kibana's global version. The current logic has the same issue because
GET /api/status
injects the version from Kibana as well.Checklist
Delete any items that are not applicable to this PR.
For maintainers