Skip to content

Commit

Permalink
[8.x] [Logs] Deprecate HTTP APIs used in LogStream app (elastic#201974)…
Browse files Browse the repository at this point in the history
… (elastic#203748)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Logs] Deprecate HTTP APIs used in LogStream app
(elastic#201974)](elastic#201974)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Marco Antonio
Ghiani","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-11T10:41:28Z","message":"[Logs]
Deprecate HTTP APIs used in LogStream app (elastic#201974)\n\n## 📓
Summary\r\n\r\nCloses elastic#200968 \r\n\r\nThese changes deprecate internal
APIs used by the LogStream app, which\r\nis also deprecated.\r\n\r\nWith
v9, any internal API will become unreachable from external
origins.\r\nIn case we get an external request to these APIs (although
it should be\r\nless likely to happen), the deprecation will be surfaced
on the Upgrade\r\nAssistant UI as a warning.\r\n\r\n<img width=\"3005\"
alt=\"Screenshot 2024-11-27 at 13 16
39\"\r\nsrc=\"https://github.com/user-attachments/assets/c3864a5a-49c7-4cbd-8893-9041b5ee207e\">\r\n\r\n<img
width=\"3007\" alt=\"Screenshot 2024-11-27 at 13 16
25\"\r\nsrc=\"https://github.com/user-attachments/assets/f9fb254f-b795-4d01-8d92-463a0ca526a3\">\r\n\r\nCo-authored-by:
Marco Antonio Ghiani
<[email protected]>","sha":"a176c0fdd7815e5841ed78f5213f1296226b276e","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-logs"],"title":"[Logs]
Deprecate HTTP APIs used in LogStream
app","number":201974,"url":"https://github.com/elastic/kibana/pull/201974","mergeCommit":{"message":"[Logs]
Deprecate HTTP APIs used in LogStream app (elastic#201974)\n\n## 📓
Summary\r\n\r\nCloses elastic#200968 \r\n\r\nThese changes deprecate internal
APIs used by the LogStream app, which\r\nis also deprecated.\r\n\r\nWith
v9, any internal API will become unreachable from external
origins.\r\nIn case we get an external request to these APIs (although
it should be\r\nless likely to happen), the deprecation will be surfaced
on the Upgrade\r\nAssistant UI as a warning.\r\n\r\n<img width=\"3005\"
alt=\"Screenshot 2024-11-27 at 13 16
39\"\r\nsrc=\"https://github.com/user-attachments/assets/c3864a5a-49c7-4cbd-8893-9041b5ee207e\">\r\n\r\n<img
width=\"3007\" alt=\"Screenshot 2024-11-27 at 13 16
25\"\r\nsrc=\"https://github.com/user-attachments/assets/f9fb254f-b795-4d01-8d92-463a0ca526a3\">\r\n\r\nCo-authored-by:
Marco Antonio Ghiani
<[email protected]>","sha":"a176c0fdd7815e5841ed78f5213f1296226b276e"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201974","number":201974,"mergeCommit":{"message":"[Logs]
Deprecate HTTP APIs used in LogStream app (elastic#201974)\n\n## 📓
Summary\r\n\r\nCloses elastic#200968 \r\n\r\nThese changes deprecate internal
APIs used by the LogStream app, which\r\nis also deprecated.\r\n\r\nWith
v9, any internal API will become unreachable from external
origins.\r\nIn case we get an external request to these APIs (although
it should be\r\nless likely to happen), the deprecation will be surfaced
on the Upgrade\r\nAssistant UI as a warning.\r\n\r\n<img width=\"3005\"
alt=\"Screenshot 2024-11-27 at 13 16
39\"\r\nsrc=\"https://github.com/user-attachments/assets/c3864a5a-49c7-4cbd-8893-9041b5ee207e\">\r\n\r\n<img
width=\"3007\" alt=\"Screenshot 2024-11-27 at 13 16
25\"\r\nsrc=\"https://github.com/user-attachments/assets/f9fb254f-b795-4d01-8d92-463a0ca526a3\">\r\n\r\nCo-authored-by:
Marco Antonio Ghiani
<[email protected]>","sha":"a176c0fdd7815e5841ed78f5213f1296226b276e"}}]}]
BACKPORT-->

Co-authored-by: Marco Antonio Ghiani <[email protected]>
  • Loading branch information
kibanamachine and tonyghiani authored Dec 11, 2024
1 parent 390014a commit 6354217
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { fold } from 'fp-ts/lib/Either';
import { identity } from 'fp-ts/lib/function';
import { schema } from '@kbn/config-schema';

import { i18n } from '@kbn/i18n';
import { logEntriesV1 } from '../../../common/http_api';
import { throwErrors } from '../../../common/runtime_types';

Expand All @@ -33,6 +34,20 @@ export const initLogEntriesHighlightsRoute = ({ framework, logEntries }: LogsSha
{
version: '1',
validate: { request: { body: escapeHatch } },
options: {
deprecated: {
documentationUrl: '',
severity: 'warning',
message: i18n.translate(
'xpack.logsShared.deprecations.postLogEntriesHighlightsRoute.message',
{
defaultMessage:
'Given the deprecation of the LogStream feature, this API will not return reliable data in upcoming versions of Kibana.',
}
),
reason: { type: 'deprecate' },
},
},
},
async (requestContext, request, response) => {
const payload = pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { fold } from 'fp-ts/lib/Either';
import { identity } from 'fp-ts/lib/function';
import { schema } from '@kbn/config-schema';

import { i18n } from '@kbn/i18n';
import { logEntriesV1 } from '../../../common/http_api';
import { throwErrors } from '../../../common/runtime_types';

Expand All @@ -36,6 +37,20 @@ export const initLogEntriesSummaryRoute = ({
{
version: '1',
validate: { request: { body: escapeHatch } },
options: {
deprecated: {
documentationUrl: '',
severity: 'warning',
message: i18n.translate(
'xpack.logsShared.deprecations.postLogEntriesSummaryRoute.message',
{
defaultMessage:
'Given the deprecation of the LogStream feature, this API will not return reliable data in upcoming versions of Kibana.',
}
),
reason: { type: 'deprecate' },
},
},
},
async (requestContext, request, response) => {
const payload = pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { fold } from 'fp-ts/lib/Either';
import { identity } from 'fp-ts/lib/function';
import { schema } from '@kbn/config-schema';

import { i18n } from '@kbn/i18n';
import { logEntriesV1 } from '../../../common/http_api';
import { throwErrors } from '../../../common/runtime_types';

Expand All @@ -35,6 +36,20 @@ export const initLogEntriesSummaryHighlightsRoute = ({
{
version: '1',
validate: { request: { body: escapeHatch } },
options: {
deprecated: {
documentationUrl: '',
severity: 'warning',
message: i18n.translate(
'xpack.logsShared.deprecations.postLogEntriesSummaryHighlightsRoute.message',
{
defaultMessage:
'Given the deprecation of the LogStream feature, this API will not return reliable data in upcoming versions of Kibana.',
}
),
reason: { type: 'deprecate' },
},
},
},
async (requestContext, request, response) => {
const payload = pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* 2.0.
*/

import { i18n } from '@kbn/i18n';
import { logViewsV1 } from '../../../common/http_api';
import { LOG_VIEW_URL } from '../../../common/http_api/log_views';
import { createValidationFunction } from '../../../common/runtime_types';
Expand All @@ -30,6 +31,17 @@ export const initGetLogViewRoute = ({
params: createValidationFunction(logViewsV1.getLogViewRequestParamsRT),
},
},
options: {
deprecated: {
documentationUrl: '',
severity: 'warning',
message: i18n.translate('xpack.logsShared.deprecations.getLogViewRoute.message', {
defaultMessage:
'Given the deprecation of the LogStream feature, this API will not have any effect configuring upcoming versions of Kibana.',
}),
reason: { type: 'deprecate' },
},
},
},
async (_requestContext, request, response) => {
const { logViewId } = request.params;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* 2.0.
*/

import { i18n } from '@kbn/i18n';
import { logViewsV1 } from '../../../common/http_api';
import { LOG_VIEW_URL } from '../../../common/http_api/log_views';
import { createValidationFunction } from '../../../common/runtime_types';
Expand All @@ -26,6 +27,17 @@ export const initPutLogViewRoute = ({ framework, getStartServices }: LogsSharedB
body: createValidationFunction(logViewsV1.putLogViewRequestPayloadRT),
},
},
options: {
deprecated: {
documentationUrl: '',
severity: 'warning',
message: i18n.translate('xpack.logsShared.deprecations.putLogViewRoute.message', {
defaultMessage:
'Given the deprecation of the LogStream feature, this API will not have any effect configuring upcoming versions of Kibana.',
}),
reason: { type: 'deprecate' },
},
},
},
async (_requestContext, request, response) => {
const { logViewId } = request.params;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,20 @@ export class LogEntriesService {
setupDeps: LogEntriesServiceSetupDeps
) {
void core.getStartServices().then(([, startDeps, selfStartDeps]) => {
/**
* @deprecated
*
* Given the deprecation of the LogStream feature, this API will not return reliable data in upcoming versions of Kibana.
*/
setupDeps.data.search.registerSearchStrategy(
LOG_ENTRIES_SEARCH_STRATEGY,
logEntriesSearchStrategyProvider({ ...setupDeps, ...startDeps, ...selfStartDeps })
);
/**
* @deprecated
*
* Given the deprecation of the LogStream feature, this API will not return reliable data in upcoming versions of Kibana.
*/
setupDeps.data.search.registerSearchStrategy(
LOG_ENTRY_SEARCH_STRATEGY,
logEntrySearchStrategyProvider({ ...setupDeps, ...startDeps, ...selfStartDeps })
Expand Down

0 comments on commit 6354217

Please sign in to comment.