src/platform/packages/shared/kbn-scout-synthtrace/README.md
Optional Playwright fixtures and helpers that depend on @kbn/synthtrace and @kbn/synthtrace-client.
@kbn/scout stays free of those dependencies so selective Scout runs and module graphs stay smaller.
Full wiring guide (platform, Oblt, global setup, typing): see Scout README — Optional: wiring Synthtrace.
@kbn/scout-oblt, @kbn/scout-search, and @kbn/scout-security do not depend on or re-export this package.
apmSynthtraceEsClient, infraSynthtraceEsClient, or logsSynthtraceEsClient.global.setup.ts callbacks that need those fixtures in scope.getSynthtraceClient (e.g. Discover-style trace ingestion in setup only).Add @kbn/scout-synthtrace to your module’s tsconfig.json kbn_references (and regenerate Moon if you use it).
| Export | Use |
|---|---|
synthtraceFixture | mergeTests(scoutTest, synthtraceFixture) (or with Oblt test / spaceTest). |
getSynthtraceClient | Imperative client creation in setup scripts; pass esClient, log, config, optional kbnUrl. |
globalSetupHookWithSynthtrace | Same worker stack as @kbn/scout globalSetupHook plus synthtrace (for parallel global setup). |
SynthtraceFixture | Type for ScoutWorkerFixtures & SynthtraceFixture when you .extend merged tests. |
Merge into UI test (platform):
import { mergeTests, test as scoutTest } from '@kbn/scout';
import { synthtraceFixture } from '@kbn/scout-synthtrace';
export const test = mergeTests(scoutTest, synthtraceFixture).extend(/* … */);
Global setup only:
import { globalSetupHookWithSynthtrace } from '@kbn/scout-synthtrace';
globalSetupHookWithSynthtrace('Setup', async ({ logsSynthtraceEsClient, log }) => {
await logsSynthtraceEsClient.clean();
});
Merge with an existing global hook (e.g. Oblt):
import { mergeTests, globalSetupHook as obltGlobalSetupHook } from '@kbn/scout-oblt';
import { synthtraceFixture } from '@kbn/scout-synthtrace';
const globalSetupHook = mergeTests(obltGlobalSetupHook, synthtraceFixture);
SynthtraceFixture describes the worker fixture keys (apmSynthtraceEsClient, etc.). Use it when typing helpers or extend<..., ScoutWorkerFixtures & SynthtraceFixture>.