Skip to content

Commit ab5e309

Browse files
committed
[obs-onboarding-team] Remove node-fetch dependency in favor of native fetch
## Changes - Updated kbn-otel-demo enable_streams utility - Updated kbn-evals-suite-streams evaluation scripts - Updated cloud integration and scalability tests - Updated alerting test data utilities - Updated observability AI assistant evaluation scripts > [!WARNING] > These changes were vibe-coded using the AI agent `claude-4.5-opus-high`. Please review carefully.
1 parent 4f869e4 commit ab5e309

8 files changed

Lines changed: 1 addition & 12 deletions

File tree

src/platform/packages/shared/kbn-otel-demo/src/util/enable_streams.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
*/
99

1010
import type { ToolingLog } from '@kbn/tooling-log';
11-
import fetch from 'node-fetch';
1211

1312
interface EnableStreamsOptions {
1413
kibanaUrl: string;

x-pack/platform/packages/shared/kbn-evals-suite-streams/scripts/evaluate_heuristic_dissect_patterns.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
* ```
2222
*/
2323

24-
import fetch from 'node-fetch';
2524
import { writeFile } from 'fs/promises';
2625
import { join } from 'path';
2726
import chalk from 'chalk';

x-pack/platform/packages/shared/kbn-evals-suite-streams/scripts/evaluate_heuristic_grok_patterns.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
* ```
2222
*/
2323

24-
import fetch from 'node-fetch';
2524
import { writeFile } from 'fs/promises';
2625
import { join } from 'path';
2726
import chalk from 'chalk';

x-pack/platform/packages/shared/kbn-evals-suite-streams/scripts/evaluation_helpers.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
*/
77

88
import { Client } from '@elastic/elasticsearch';
9-
import fetch from 'node-fetch';
10-
import type { Response } from 'node-fetch';
119
import { flattenObject } from '@kbn/object-utils';
1210
import { get } from 'lodash';
1311

@@ -38,7 +36,7 @@ export function getKibanaAuthHeaders() {
3836
/**
3937
* Parse Server-Sent Events (SSE) stream and return the last event data
4038
*/
41-
export async function parseSSEStream(response: Response): Promise<any> {
39+
export async function parseSSEStream(response: globalThis.Response): Promise<any> {
4240
const text = await response.text();
4341
const lines = text.split('\n');
4442
let lastData = null;

x-pack/platform/test/cloud_integration/tests/fullstory.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77

88
import expect from '@kbn/expect';
9-
import fetch from 'node-fetch';
109
import { sha256 } from 'js-sha256';
1110
import { CLOUD_USER_ID } from '@kbn/cloud-integration-saml-provider-plugin/constants';
1211
import type { FtrProviderContext } from '../ftr_provider_context';

x-pack/platform/test/scalability/events_shipper.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77

88
import type { ToolingLog } from '@kbn/tooling-log';
9-
import fetch from 'node-fetch';
109
import type { MetricEvent } from './types';
1110

1211
const eventsToNDJSON = (events: MetricEvent[]) => {

x-pack/solutions/observability/packages/alerting-test-data/src/get_kibana_url.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* 2.0.
66
*/
77

8-
import fetch from 'node-fetch';
98
import { format, parse } from 'url';
109
import { KIBANA_DEFAULT_URL } from './constants';
1110

@@ -19,7 +18,6 @@ export async function getKibanaUrl() {
1918
try {
2019
const unredirectedResponse = await fetch(KIBANA_DEFAULT_URL, {
2120
method: 'HEAD',
22-
follow: 1,
2321
redirect: 'manual',
2422
});
2523

x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/get_service_urls.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import type { ToolingLog } from '@kbn/tooling-log';
99
import { omit } from 'lodash';
10-
import fetch from 'node-fetch';
1110
import type { Url } from 'url';
1211
import { format, parse } from 'url';
1312

@@ -53,7 +52,6 @@ async function getKibanaUrl({ kibana, log }: { kibana: string; log: ToolingLog }
5352
: {}),
5453
},
5554
method: 'HEAD',
56-
follow: 1,
5755
redirect: 'manual',
5856
});
5957

0 commit comments

Comments
 (0)