Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
jennypavlova committed Oct 8, 2024
1 parent d5d9eb0 commit 832abf1
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/kbn-apm-synthtrace/src/cli/scenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface EsClients {
infraEsClient: InfraSynthtraceEsClient;
assetsEsClient: AssetsSynthtraceEsClient;
syntheticsEsClient: SyntheticsSynthtraceEsClient;
otelSynthtraceEsClient: OtelSynthtraceEsClient;
otelEsClient: OtelSynthtraceEsClient;
}

type Generate<TFields> = (options: {
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-apm-synthtrace/src/cli/utils/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export async function bootstrap(runOptions: RunOptions) {
infraEsClient,
assetsEsClient,
syntheticsEsClient,
otelEsClient,
version,
kibanaUrl,
esUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,15 @@ export async function startLiveDataUpload({
}) {
const file = runOptions.file;

const { logger, apmEsClient, logsEsClient, infraEsClient, assetsEsClient, syntheticsEsClient } =
await bootstrap(runOptions);
const {
logger,
apmEsClient,
logsEsClient,
infraEsClient,
assetsEsClient,
syntheticsEsClient,
otelEsClient,
} = await bootstrap(runOptions);

const scenario = await getScenario({ file, logger });
const { generate } = await scenario({ ...runOptions, logger });
Expand Down Expand Up @@ -65,7 +72,14 @@ export async function startLiveDataUpload({

const generatorsAndClients = generate({
range: timerange(bucketFrom.getTime(), bucketTo.getTime()),
clients: { logsEsClient, apmEsClient, infraEsClient, assetsEsClient, syntheticsEsClient },
clients: {
logsEsClient,
apmEsClient,
infraEsClient,
assetsEsClient,
syntheticsEsClient,
otelEsClient,
},
});

const generatorsAndClientsArray = castArray(generatorsAndClients);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async function start() {
logger,
});

const otelSynthtraceEsClient = getOtelSynthtraceEsClient({
const otelEsClient = getOtelSynthtraceEsClient({
concurrency: runOptions.concurrency,
target: esUrl,
logger,
Expand All @@ -87,7 +87,7 @@ async function start() {
infraEsClient,
assetsEsClient,
syntheticsEsClient,
otelSynthtraceEsClient,
otelEsClient,
});
}

Expand All @@ -102,7 +102,7 @@ async function start() {
infraEsClient,
assetsEsClient,
syntheticsEsClient,
otelSynthtraceEsClient,
otelEsClient,
},
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { withClient } from '../lib/utils/with_client';

const scenario: Scenario<OtelDocument> = async (runOptions) => {
return {
generate: ({ range, clients: { otelSynthtraceEsClient } }) => {
generate: ({ range, clients: { otelEsClient } }) => {
const { numOtelTraces = 5 } = runOptions.scenarioOpts || {};
const { logger } = runOptions;
const traceId = generateShortId();
Expand All @@ -37,7 +37,7 @@ const scenario: Scenario<OtelDocument> = async (runOptions) => {

return [
withClient(
otelSynthtraceEsClient,
otelEsClient,
logger.perf('generating_otel_otelTrace', () => otelWithMetricsAndErrors)
),
];
Expand Down

0 comments on commit 832abf1

Please sign in to comment.