Skip to content

[core.http] Support Warning headers for deprecated http routes #105692

@lukeelmers

Description

@lukeelmers

Currently there isn't a great way for clients to understand that an http route has been deprecated:

  • In most cases we aren't logging warnings on the server when a deprecated route has been hit
  • For documented REST APIs, our only option is to use the docs to indicate that the route has been deprecated

Elasticsearch solves this problem with a Warning header that includes a 299 miscellaneous warn code and follows the RFC7234 spec for warning headers.

Example:

Warning: 299 Elasticsearch-8.0.0-###"Your license will expire in [N] days. Contact your administrator or update your license for continued use of features"

It would be useful if Kibana's http routes could be registered with some text that gets interpolated into a warning header, or perhaps a simple isDeprecated flag that would automatically produce a warning header. While deprecations is the obvious use case that comes to mind, there may be others as well.

As for the structure, I'd propose that we match the header structure to the same spec that Elasticsearch is using.

(cc @kobelb)

Metadata

Metadata

Assignees

Labels

Team:CorePlatform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//enhancementNew value added to drive a business result

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions