playwright-opentelemetry 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fixture.cjs +1 -1
- package/dist/fixture.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{reporter-CWAovnMj.mjs → reporter-Owv9goRm.mjs} +34 -46
- package/dist/{reporter-DMlPQnrW.cjs → reporter-Z2WIipcT.cjs} +34 -46
- package/dist/reporter.cjs +1 -1
- package/dist/reporter.mjs +1 -1
- package/dist/{screenshots-zip-B07U2DaB.cjs → screenshots-zip-B6_DJ3oU.cjs} +1 -1
- package/dist/{screenshots-zip-DXk2R8_S.mjs → screenshots-zip-Cp3l4YRU.mjs} +1 -1
- package/package.json +1 -1
package/dist/fixture.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_screenshots_zip = require("./screenshots-zip-
|
|
2
|
+
const require_screenshots_zip = require("./screenshots-zip-B6_DJ3oU.cjs");
|
|
3
3
|
let node_fs_promises = require("node:fs/promises");
|
|
4
4
|
node_fs_promises = require_screenshots_zip.__toESM(node_fs_promises, 1);
|
|
5
5
|
let node_path = require("node:path");
|
package/dist/fixture.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as supportsScreencastScreenshots, d as flushFixtureSpans, f as registerExpectedTrace, h as filterRetainedDestinations, m as shouldRetainPlaywrightTrace, o as resolvePlaywrightOpentelemetryConfig, p as couldRetainPlaywrightTrace, r as createScreenshotsZip, s as BROWSER_SERVICE_NAME, t as SCREENSHOTS_ATTACHMENT_NAME, u as createTestTraceContext, y as generateSpanId } from "./screenshots-zip-
|
|
1
|
+
import { a as supportsScreencastScreenshots, d as flushFixtureSpans, f as registerExpectedTrace, h as filterRetainedDestinations, m as shouldRetainPlaywrightTrace, o as resolvePlaywrightOpentelemetryConfig, p as couldRetainPlaywrightTrace, r as createScreenshotsZip, s as BROWSER_SERVICE_NAME, t as SCREENSHOTS_ATTACHMENT_NAME, u as createTestTraceContext, y as generateSpanId } from "./screenshots-zip-Cp3l4YRU.mjs";
|
|
2
2
|
import fs from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { test as test$1 } from "@playwright/test";
|
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as withPlaywrightTraceApiHeaders, _ as PLAYWRIGHT_TRACE_API_SOURCE_REPORTER, a as supportsScreencastScreenshots, b as generateTraceId, c as FIXTURE_SPANS_ATTACHMENT_NAME, g as PLAYWRIGHT_TRACE_API_SOURCE_HEADER, h as filterRetainedDestinations, i as readScreenshotsZip, l as TRACE_CONTEXT_ATTACHMENT_NAME, m as shouldRetainPlaywrightTrace, n as addScreenshotsToZip, o as resolvePlaywrightOpentelemetryConfig, r as createScreenshotsZip, v as buildOtlpRequest, x as sendSpans, y as generateSpanId } from "./screenshots-zip-
|
|
1
|
+
import { S as withPlaywrightTraceApiHeaders, _ as PLAYWRIGHT_TRACE_API_SOURCE_REPORTER, a as supportsScreencastScreenshots, b as generateTraceId, c as FIXTURE_SPANS_ATTACHMENT_NAME, g as PLAYWRIGHT_TRACE_API_SOURCE_HEADER, h as filterRetainedDestinations, i as readScreenshotsZip, l as TRACE_CONTEXT_ATTACHMENT_NAME, m as shouldRetainPlaywrightTrace, n as addScreenshotsToZip, o as resolvePlaywrightOpentelemetryConfig, r as createScreenshotsZip, v as buildOtlpRequest, x as sendSpans, y as generateSpanId } from "./screenshots-zip-Cp3l4YRU.mjs";
|
|
2
2
|
import fs from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { BlobReader, BlobWriter, TextWriter, ZipReader, ZipWriter } from "@zip.js/zip.js";
|
|
@@ -229,10 +229,8 @@ var PlaywrightOpentelemetryReporter = class {
|
|
|
229
229
|
attributes[ATTR_CODE_FILE_PATH] = this.rootDir ? path.relative(this.rootDir, file) : file;
|
|
230
230
|
attributes[ATTR_CODE_LINE_NUMBER] = line;
|
|
231
231
|
}
|
|
232
|
-
const
|
|
233
|
-
const
|
|
234
|
-
if (result.steps && result.steps.length > 0) for (const step of result.steps) this.processTestStep(test, step, testSpanId, traceId, [], processedSteps, skippedStepIds);
|
|
235
|
-
const stepSpans = Array.from(processedSteps.values());
|
|
232
|
+
const stepSpans = [];
|
|
233
|
+
for (const step of result.steps ?? []) this.processTestStep(step, testSpanId, traceId, [], stepSpans);
|
|
236
234
|
let minStartTime = result.startTime;
|
|
237
235
|
let maxEndTime = new Date(result.startTime.getTime() + result.duration);
|
|
238
236
|
for (const stepSpan of stepSpans) {
|
|
@@ -272,16 +270,11 @@ var PlaywrightOpentelemetryReporter = class {
|
|
|
272
270
|
}
|
|
273
271
|
}
|
|
274
272
|
async onEnd(_result) {
|
|
275
|
-
for (const artifact of this.pendingTraceArtifacts) {
|
|
276
|
-
const prepared = await artifact.prepared;
|
|
277
|
-
if ("error" in prepared) throw prepared.error;
|
|
278
|
-
if (prepared.traceZipBlob) await writeTraceZip(artifact.outputDir, artifact.test, prepared.traceZipBlob);
|
|
279
|
-
}
|
|
280
273
|
const destinations = /* @__PURE__ */ new Map();
|
|
281
274
|
for (const batch of this.spanBatches) {
|
|
282
275
|
for (const destination of batch.config.otlpDestinations) {
|
|
283
276
|
if (!destination.url) continue;
|
|
284
|
-
addDestinationSpans(destinations, batch.spans, {
|
|
277
|
+
addDestinationSpans(destinations, batch.spans, "otlp", {
|
|
285
278
|
tracesEndpoint: destination.url,
|
|
286
279
|
headers: destination.headers,
|
|
287
280
|
playwrightVersion: this.playwrightVersion || "unknown",
|
|
@@ -290,7 +283,7 @@ var PlaywrightOpentelemetryReporter = class {
|
|
|
290
283
|
}
|
|
291
284
|
for (const destination of batch.config.playwrightTraceApiDestinations) {
|
|
292
285
|
if (!destination.url) continue;
|
|
293
|
-
addDestinationSpans(destinations, batch.spans, {
|
|
286
|
+
addDestinationSpans(destinations, batch.spans, "trace-api", {
|
|
294
287
|
tracesEndpoint: `${destination.url}/v1/traces`,
|
|
295
288
|
headers: withPlaywrightTraceApiHeaders(destination.headers),
|
|
296
289
|
playwrightVersion: this.playwrightVersion || "unknown",
|
|
@@ -298,7 +291,25 @@ var PlaywrightOpentelemetryReporter = class {
|
|
|
298
291
|
});
|
|
299
292
|
}
|
|
300
293
|
}
|
|
301
|
-
|
|
294
|
+
const sendFailures = (await Promise.all([...destinations.values()].map(async (destination) => {
|
|
295
|
+
try {
|
|
296
|
+
await sendSpans(destination.spans, destination.options);
|
|
297
|
+
return [];
|
|
298
|
+
} catch (error) {
|
|
299
|
+
return [{
|
|
300
|
+
destination,
|
|
301
|
+
error
|
|
302
|
+
}];
|
|
303
|
+
}
|
|
304
|
+
}))).flat();
|
|
305
|
+
for (const failure of sendFailures) console.warn(`Failed to send spans to ${failure.destination.options.tracesEndpoint}: ${errorMessage(failure.error)}`);
|
|
306
|
+
for (const artifact of this.pendingTraceArtifacts) {
|
|
307
|
+
const prepared = await artifact.prepared;
|
|
308
|
+
if ("error" in prepared) throw prepared.error;
|
|
309
|
+
if (prepared.traceZipBlob) await writeTraceZip(artifact.outputDir, artifact.test, prepared.traceZipBlob);
|
|
310
|
+
}
|
|
311
|
+
const traceApiFailure = sendFailures.find((failure) => failure.destination.kind === "trace-api");
|
|
312
|
+
if (traceApiFailure) throw traceApiFailure.error;
|
|
302
313
|
}
|
|
303
314
|
async prepareTraceArtifact(options) {
|
|
304
315
|
const screenshots = await readTestScreenshots(options);
|
|
@@ -318,36 +329,17 @@ var PlaywrightOpentelemetryReporter = class {
|
|
|
318
329
|
const [traceZipBlob] = await Promise.all([traceZipBlobPromise, ...uploadPromises]);
|
|
319
330
|
return { traceZipBlob };
|
|
320
331
|
}
|
|
321
|
-
processTestStep(
|
|
332
|
+
processTestStep(step, parentSpanId, traceId, parentTitlePath, stepSpans, inheritedPhase) {
|
|
322
333
|
let phase = inheritedPhase;
|
|
323
334
|
if (step.category === "hook") {
|
|
324
335
|
if (step.title === "Before Hooks") phase = "before";
|
|
325
336
|
if (step.title === "After Hooks" || step.title === "Worker Cleanup") phase = "after";
|
|
326
337
|
}
|
|
327
|
-
const stepId = getStepId(test, step);
|
|
328
338
|
if (isInternalFixtureStep(step) || isInternalApiRequestStep(step)) {
|
|
329
|
-
|
|
330
|
-
processedSteps.delete(stepId);
|
|
331
|
-
if (step.steps && step.steps.length > 0) for (const childStep of step.steps) this.processTestStep(test, childStep, parentSpanId, traceId, parentTitlePath, processedSteps, skippedStepIds, phase);
|
|
332
|
-
return;
|
|
333
|
-
}
|
|
334
|
-
if (skippedStepIds.has(stepId)) {
|
|
335
|
-
if (step.steps && step.steps.length > 0) for (const childStep of step.steps) this.processTestStep(test, childStep, parentSpanId, traceId, parentTitlePath, processedSteps, skippedStepIds, phase);
|
|
339
|
+
for (const childStep of step.steps ?? []) this.processTestStep(childStep, parentSpanId, traceId, parentTitlePath, stepSpans, phase);
|
|
336
340
|
return;
|
|
337
341
|
}
|
|
338
342
|
const currentTitlePath = [...parentTitlePath, step.title];
|
|
339
|
-
const existingSpan = processedSteps.get(stepId);
|
|
340
|
-
if (existingSpan) {
|
|
341
|
-
if (step.error) existingSpan.status = errorStatus(step.error.message);
|
|
342
|
-
if (step.location && !existingSpan.attributes["code.file.path"]) {
|
|
343
|
-
const { file, line } = step.location;
|
|
344
|
-
const relativePath = this.rootDir ? path.relative(this.rootDir, file) : file;
|
|
345
|
-
existingSpan.attributes[ATTR_CODE_FILE_PATH] = relativePath;
|
|
346
|
-
existingSpan.attributes[ATTR_CODE_LINE_NUMBER] = line;
|
|
347
|
-
}
|
|
348
|
-
if (step.steps && step.steps.length > 0) for (const childStep of step.steps) this.processTestStep(test, childStep, existingSpan.spanId, traceId, currentTitlePath, processedSteps, skippedStepIds, phase);
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
343
|
const attributes = {};
|
|
352
344
|
attributes[ATTR_TEST_STEP_NAME] = currentTitlePath.join(" > ");
|
|
353
345
|
attributes[ATTR_TEST_STEP_TITLE] = step.title;
|
|
@@ -373,8 +365,8 @@ var PlaywrightOpentelemetryReporter = class {
|
|
|
373
365
|
attributes
|
|
374
366
|
};
|
|
375
367
|
if (step.error) stepSpan.status = errorStatus(step.error.message);
|
|
376
|
-
|
|
377
|
-
|
|
368
|
+
stepSpans.push(stepSpan);
|
|
369
|
+
for (const childStep of step.steps ?? []) this.processTestStep(childStep, stepSpan.spanId, traceId, currentTitlePath, stepSpans, phase);
|
|
378
370
|
}
|
|
379
371
|
onStdOut(chunk, _test, _result) {
|
|
380
372
|
if (this.debug) console.log(chunk.toString().slice(0, -1));
|
|
@@ -435,7 +427,11 @@ function getTestOutputDir(test) {
|
|
|
435
427
|
if (!outputDir) throw new Error(`No outputDir found for test "${test.id}"`);
|
|
436
428
|
return outputDir;
|
|
437
429
|
}
|
|
438
|
-
function
|
|
430
|
+
function errorMessage(error) {
|
|
431
|
+
if (error instanceof Error) return error.message;
|
|
432
|
+
return String(error);
|
|
433
|
+
}
|
|
434
|
+
function addDestinationSpans(destinations, spans, kind, options) {
|
|
439
435
|
const key = JSON.stringify(options);
|
|
440
436
|
const destination = destinations.get(key);
|
|
441
437
|
if (destination) {
|
|
@@ -443,6 +439,7 @@ function addDestinationSpans(destinations, spans, options) {
|
|
|
443
439
|
return;
|
|
444
440
|
}
|
|
445
441
|
destinations.set(key, {
|
|
442
|
+
kind,
|
|
446
443
|
spans: [...spans],
|
|
447
444
|
options
|
|
448
445
|
});
|
|
@@ -581,14 +578,5 @@ function isRecord(value) {
|
|
|
581
578
|
function isTraceContextAttachment(value) {
|
|
582
579
|
return typeof value === "object" && value !== null && "traceId" in value && "rootSpanId" in value && typeof value.traceId === "string" && typeof value.rootSpanId === "string";
|
|
583
580
|
}
|
|
584
|
-
function getStepId(test, step) {
|
|
585
|
-
const startTimeMs = step.startTime.getTime();
|
|
586
|
-
return [
|
|
587
|
-
test.id,
|
|
588
|
-
step.category,
|
|
589
|
-
startTimeMs,
|
|
590
|
-
...step.titlePath()
|
|
591
|
-
].join(" > ");
|
|
592
|
-
}
|
|
593
581
|
//#endregion
|
|
594
582
|
export { PlaywrightOpentelemetryReporter as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_screenshots_zip = require("./screenshots-zip-
|
|
1
|
+
const require_screenshots_zip = require("./screenshots-zip-B6_DJ3oU.cjs");
|
|
2
2
|
let node_fs_promises = require("node:fs/promises");
|
|
3
3
|
node_fs_promises = require_screenshots_zip.__toESM(node_fs_promises, 1);
|
|
4
4
|
let node_path = require("node:path");
|
|
@@ -231,10 +231,8 @@ var PlaywrightOpentelemetryReporter = class {
|
|
|
231
231
|
attributes[ATTR_CODE_FILE_PATH] = this.rootDir ? node_path.default.relative(this.rootDir, file) : file;
|
|
232
232
|
attributes[ATTR_CODE_LINE_NUMBER] = line;
|
|
233
233
|
}
|
|
234
|
-
const
|
|
235
|
-
const
|
|
236
|
-
if (result.steps && result.steps.length > 0) for (const step of result.steps) this.processTestStep(test, step, testSpanId, traceId, [], processedSteps, skippedStepIds);
|
|
237
|
-
const stepSpans = Array.from(processedSteps.values());
|
|
234
|
+
const stepSpans = [];
|
|
235
|
+
for (const step of result.steps ?? []) this.processTestStep(step, testSpanId, traceId, [], stepSpans);
|
|
238
236
|
let minStartTime = result.startTime;
|
|
239
237
|
let maxEndTime = new Date(result.startTime.getTime() + result.duration);
|
|
240
238
|
for (const stepSpan of stepSpans) {
|
|
@@ -274,16 +272,11 @@ var PlaywrightOpentelemetryReporter = class {
|
|
|
274
272
|
}
|
|
275
273
|
}
|
|
276
274
|
async onEnd(_result) {
|
|
277
|
-
for (const artifact of this.pendingTraceArtifacts) {
|
|
278
|
-
const prepared = await artifact.prepared;
|
|
279
|
-
if ("error" in prepared) throw prepared.error;
|
|
280
|
-
if (prepared.traceZipBlob) await writeTraceZip(artifact.outputDir, artifact.test, prepared.traceZipBlob);
|
|
281
|
-
}
|
|
282
275
|
const destinations = /* @__PURE__ */ new Map();
|
|
283
276
|
for (const batch of this.spanBatches) {
|
|
284
277
|
for (const destination of batch.config.otlpDestinations) {
|
|
285
278
|
if (!destination.url) continue;
|
|
286
|
-
addDestinationSpans(destinations, batch.spans, {
|
|
279
|
+
addDestinationSpans(destinations, batch.spans, "otlp", {
|
|
287
280
|
tracesEndpoint: destination.url,
|
|
288
281
|
headers: destination.headers,
|
|
289
282
|
playwrightVersion: this.playwrightVersion || "unknown",
|
|
@@ -292,7 +285,7 @@ var PlaywrightOpentelemetryReporter = class {
|
|
|
292
285
|
}
|
|
293
286
|
for (const destination of batch.config.playwrightTraceApiDestinations) {
|
|
294
287
|
if (!destination.url) continue;
|
|
295
|
-
addDestinationSpans(destinations, batch.spans, {
|
|
288
|
+
addDestinationSpans(destinations, batch.spans, "trace-api", {
|
|
296
289
|
tracesEndpoint: `${destination.url}/v1/traces`,
|
|
297
290
|
headers: require_screenshots_zip.withPlaywrightTraceApiHeaders(destination.headers),
|
|
298
291
|
playwrightVersion: this.playwrightVersion || "unknown",
|
|
@@ -300,7 +293,25 @@ var PlaywrightOpentelemetryReporter = class {
|
|
|
300
293
|
});
|
|
301
294
|
}
|
|
302
295
|
}
|
|
303
|
-
|
|
296
|
+
const sendFailures = (await Promise.all([...destinations.values()].map(async (destination) => {
|
|
297
|
+
try {
|
|
298
|
+
await require_screenshots_zip.sendSpans(destination.spans, destination.options);
|
|
299
|
+
return [];
|
|
300
|
+
} catch (error) {
|
|
301
|
+
return [{
|
|
302
|
+
destination,
|
|
303
|
+
error
|
|
304
|
+
}];
|
|
305
|
+
}
|
|
306
|
+
}))).flat();
|
|
307
|
+
for (const failure of sendFailures) console.warn(`Failed to send spans to ${failure.destination.options.tracesEndpoint}: ${errorMessage(failure.error)}`);
|
|
308
|
+
for (const artifact of this.pendingTraceArtifacts) {
|
|
309
|
+
const prepared = await artifact.prepared;
|
|
310
|
+
if ("error" in prepared) throw prepared.error;
|
|
311
|
+
if (prepared.traceZipBlob) await writeTraceZip(artifact.outputDir, artifact.test, prepared.traceZipBlob);
|
|
312
|
+
}
|
|
313
|
+
const traceApiFailure = sendFailures.find((failure) => failure.destination.kind === "trace-api");
|
|
314
|
+
if (traceApiFailure) throw traceApiFailure.error;
|
|
304
315
|
}
|
|
305
316
|
async prepareTraceArtifact(options) {
|
|
306
317
|
const screenshots = await readTestScreenshots(options);
|
|
@@ -320,36 +331,17 @@ var PlaywrightOpentelemetryReporter = class {
|
|
|
320
331
|
const [traceZipBlob] = await Promise.all([traceZipBlobPromise, ...uploadPromises]);
|
|
321
332
|
return { traceZipBlob };
|
|
322
333
|
}
|
|
323
|
-
processTestStep(
|
|
334
|
+
processTestStep(step, parentSpanId, traceId, parentTitlePath, stepSpans, inheritedPhase) {
|
|
324
335
|
let phase = inheritedPhase;
|
|
325
336
|
if (step.category === "hook") {
|
|
326
337
|
if (step.title === "Before Hooks") phase = "before";
|
|
327
338
|
if (step.title === "After Hooks" || step.title === "Worker Cleanup") phase = "after";
|
|
328
339
|
}
|
|
329
|
-
const stepId = getStepId(test, step);
|
|
330
340
|
if (isInternalFixtureStep(step) || isInternalApiRequestStep(step)) {
|
|
331
|
-
|
|
332
|
-
processedSteps.delete(stepId);
|
|
333
|
-
if (step.steps && step.steps.length > 0) for (const childStep of step.steps) this.processTestStep(test, childStep, parentSpanId, traceId, parentTitlePath, processedSteps, skippedStepIds, phase);
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
if (skippedStepIds.has(stepId)) {
|
|
337
|
-
if (step.steps && step.steps.length > 0) for (const childStep of step.steps) this.processTestStep(test, childStep, parentSpanId, traceId, parentTitlePath, processedSteps, skippedStepIds, phase);
|
|
341
|
+
for (const childStep of step.steps ?? []) this.processTestStep(childStep, parentSpanId, traceId, parentTitlePath, stepSpans, phase);
|
|
338
342
|
return;
|
|
339
343
|
}
|
|
340
344
|
const currentTitlePath = [...parentTitlePath, step.title];
|
|
341
|
-
const existingSpan = processedSteps.get(stepId);
|
|
342
|
-
if (existingSpan) {
|
|
343
|
-
if (step.error) existingSpan.status = errorStatus(step.error.message);
|
|
344
|
-
if (step.location && !existingSpan.attributes["code.file.path"]) {
|
|
345
|
-
const { file, line } = step.location;
|
|
346
|
-
const relativePath = this.rootDir ? node_path.default.relative(this.rootDir, file) : file;
|
|
347
|
-
existingSpan.attributes[ATTR_CODE_FILE_PATH] = relativePath;
|
|
348
|
-
existingSpan.attributes[ATTR_CODE_LINE_NUMBER] = line;
|
|
349
|
-
}
|
|
350
|
-
if (step.steps && step.steps.length > 0) for (const childStep of step.steps) this.processTestStep(test, childStep, existingSpan.spanId, traceId, currentTitlePath, processedSteps, skippedStepIds, phase);
|
|
351
|
-
return;
|
|
352
|
-
}
|
|
353
345
|
const attributes = {};
|
|
354
346
|
attributes[ATTR_TEST_STEP_NAME] = currentTitlePath.join(" > ");
|
|
355
347
|
attributes[ATTR_TEST_STEP_TITLE] = step.title;
|
|
@@ -375,8 +367,8 @@ var PlaywrightOpentelemetryReporter = class {
|
|
|
375
367
|
attributes
|
|
376
368
|
};
|
|
377
369
|
if (step.error) stepSpan.status = errorStatus(step.error.message);
|
|
378
|
-
|
|
379
|
-
|
|
370
|
+
stepSpans.push(stepSpan);
|
|
371
|
+
for (const childStep of step.steps ?? []) this.processTestStep(childStep, stepSpan.spanId, traceId, currentTitlePath, stepSpans, phase);
|
|
380
372
|
}
|
|
381
373
|
onStdOut(chunk, _test, _result) {
|
|
382
374
|
if (this.debug) console.log(chunk.toString().slice(0, -1));
|
|
@@ -437,7 +429,11 @@ function getTestOutputDir(test) {
|
|
|
437
429
|
if (!outputDir) throw new Error(`No outputDir found for test "${test.id}"`);
|
|
438
430
|
return outputDir;
|
|
439
431
|
}
|
|
440
|
-
function
|
|
432
|
+
function errorMessage(error) {
|
|
433
|
+
if (error instanceof Error) return error.message;
|
|
434
|
+
return String(error);
|
|
435
|
+
}
|
|
436
|
+
function addDestinationSpans(destinations, spans, kind, options) {
|
|
441
437
|
const key = JSON.stringify(options);
|
|
442
438
|
const destination = destinations.get(key);
|
|
443
439
|
if (destination) {
|
|
@@ -445,6 +441,7 @@ function addDestinationSpans(destinations, spans, options) {
|
|
|
445
441
|
return;
|
|
446
442
|
}
|
|
447
443
|
destinations.set(key, {
|
|
444
|
+
kind,
|
|
448
445
|
spans: [...spans],
|
|
449
446
|
options
|
|
450
447
|
});
|
|
@@ -583,15 +580,6 @@ function isRecord(value) {
|
|
|
583
580
|
function isTraceContextAttachment(value) {
|
|
584
581
|
return typeof value === "object" && value !== null && "traceId" in value && "rootSpanId" in value && typeof value.traceId === "string" && typeof value.rootSpanId === "string";
|
|
585
582
|
}
|
|
586
|
-
function getStepId(test, step) {
|
|
587
|
-
const startTimeMs = step.startTime.getTime();
|
|
588
|
-
return [
|
|
589
|
-
test.id,
|
|
590
|
-
step.category,
|
|
591
|
-
startTimeMs,
|
|
592
|
-
...step.titlePath()
|
|
593
|
-
].join(" > ");
|
|
594
|
-
}
|
|
595
583
|
//#endregion
|
|
596
584
|
Object.defineProperty(exports, "PlaywrightOpentelemetryReporter", {
|
|
597
585
|
enumerable: true,
|
package/dist/reporter.cjs
CHANGED
package/dist/reporter.mjs
CHANGED
|
@@ -22,7 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
//#endregion
|
|
23
23
|
let _zip_js_zip_js = require("@zip.js/zip.js");
|
|
24
24
|
//#region package.json
|
|
25
|
-
var version = "0.
|
|
25
|
+
var version = "0.16.0";
|
|
26
26
|
const PLAYWRIGHT_TRACE_API_SOURCE_HEADER = "x-playwright-otel-source";
|
|
27
27
|
const PLAYWRIGHT_TRACE_API_SOURCE_REPORTER = "reporter";
|
|
28
28
|
function withPlaywrightTraceApiHeaders(headers) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlobReader, BlobWriter, TextWriter, ZipReader, ZipWriter } from "@zip.js/zip.js";
|
|
2
2
|
//#region package.json
|
|
3
|
-
var version = "0.
|
|
3
|
+
var version = "0.16.0";
|
|
4
4
|
const PLAYWRIGHT_TRACE_API_SOURCE_HEADER = "x-playwright-otel-source";
|
|
5
5
|
const PLAYWRIGHT_TRACE_API_SOURCE_REPORTER = "reporter";
|
|
6
6
|
function withPlaywrightTraceApiHeaders(headers) {
|