playwright-opentelemetry 0.1.0 → 0.1.1
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/README.md
CHANGED
|
@@ -23,9 +23,9 @@ export default defineConfig({
|
|
|
23
23
|
[
|
|
24
24
|
"playwright-opentelemetry/reporter",
|
|
25
25
|
{
|
|
26
|
-
// Or OTEL_EXPORTER_OTLP_ENDPOINT
|
|
26
|
+
// Or use environment variable OTEL_EXPORTER_OTLP_ENDPOINT
|
|
27
27
|
otlpEndpoint: "https://api.eu1.honeycomb.io/v1/traces",
|
|
28
|
-
// Or OTEL_EXPORTER_OTLP_HEADERS
|
|
28
|
+
// Or use environment variable OTEL_EXPORTER_OTLP_HEADERS
|
|
29
29
|
otlpHeaders: {
|
|
30
30
|
"x-honeycomb-team": "xxxabc",
|
|
31
31
|
}
|
package/dist/fixture.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as generateSpanId, c as readNetworkSpanParent, d as writeNetworkSpanParent, o as getCurrentSpanId, s as getOrCreateTraceId, u as writeNetworkSpan } from "./trace-files-
|
|
1
|
+
import { a as generateSpanId, c as readNetworkSpanParent, d as writeNetworkSpanParent, o as getCurrentSpanId, s as getOrCreateTraceId, u as writeNetworkSpan } from "./trace-files-BnO7hKxI.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { test as test$1 } from "@playwright/test";
|
|
4
4
|
|
package/dist/reporter.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as generateSpanId, i as createNetworkDirs, l as writeCurrentSpanId, n as cleanupTestFiles, r as collectNetworkSpans, s as getOrCreateTraceId, t as
|
|
1
|
+
import { a as generateSpanId, i as createNetworkDirs, l as writeCurrentSpanId, n as cleanupTestFiles, r as collectNetworkSpans, s as getOrCreateTraceId, t as PW_OTEL_DIR } from "./trace-files-BnO7hKxI.mjs";
|
|
2
2
|
import { mkdirSync } from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
|
|
@@ -19,7 +19,7 @@ const ATTR_TEST_STEP_CATEGORY = "test.step.category";
|
|
|
19
19
|
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region package.json
|
|
22
|
-
var version = "0.1.
|
|
22
|
+
var version = "0.1.1";
|
|
23
23
|
|
|
24
24
|
//#endregion
|
|
25
25
|
//#region src/reporter/sender.ts
|
|
@@ -137,7 +137,7 @@ var PlaywrightOpentelemetryReporter = class {
|
|
|
137
137
|
for (const test of suite.allTests()) {
|
|
138
138
|
const project = test.parent.project();
|
|
139
139
|
if (project?.outputDir) {
|
|
140
|
-
mkdirSync(path.join(project.outputDir,
|
|
140
|
+
mkdirSync(path.join(project.outputDir, PW_OTEL_DIR), { recursive: true });
|
|
141
141
|
this.testOutputDirs.set(test.id, project.outputDir);
|
|
142
142
|
}
|
|
143
143
|
}
|
|
@@ -3,7 +3,7 @@ import path from "node:path";
|
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
|
|
5
5
|
//#region src/shared/trace-files.ts
|
|
6
|
-
const
|
|
6
|
+
const PW_OTEL_DIR = "playwright-opentelemetry";
|
|
7
7
|
function getOrCreateTraceId(outputDir, testId) {
|
|
8
8
|
const tracePath = getTracePath(outputDir, testId);
|
|
9
9
|
if (existsSync(tracePath)) return readFileSync(tracePath, "utf-8");
|
|
@@ -110,16 +110,16 @@ async function cleanupTestFiles(outputDir, testId) {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
function getTracePath(outputDir, testId) {
|
|
113
|
-
return path.join(outputDir,
|
|
113
|
+
return path.join(outputDir, PW_OTEL_DIR, `${sanitizeTestId(testId)}.trace`);
|
|
114
114
|
}
|
|
115
115
|
function getSpanPath(outputDir, testId) {
|
|
116
|
-
return path.join(outputDir,
|
|
116
|
+
return path.join(outputDir, PW_OTEL_DIR, `${sanitizeTestId(testId)}.span`);
|
|
117
117
|
}
|
|
118
118
|
function getNetworkParentDir(outputDir, testId) {
|
|
119
|
-
return path.join(outputDir,
|
|
119
|
+
return path.join(outputDir, PW_OTEL_DIR, `${sanitizeTestId(testId)}-network-parents`);
|
|
120
120
|
}
|
|
121
121
|
function getNetworkSpanDir(outputDir, testId) {
|
|
122
|
-
return path.join(outputDir,
|
|
122
|
+
return path.join(outputDir, PW_OTEL_DIR, `${sanitizeTestId(testId)}-network-spans`);
|
|
123
123
|
}
|
|
124
124
|
function getNetworkParentPath(outputDir, testId, traceHeader) {
|
|
125
125
|
return path.join(getNetworkParentDir(outputDir, testId), traceHeader);
|
|
@@ -148,4 +148,4 @@ function generateSpanId() {
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
//#endregion
|
|
151
|
-
export { generateSpanId as a, readNetworkSpanParent as c, writeNetworkSpanParent as d, createNetworkDirs as i, writeCurrentSpanId as l, cleanupTestFiles as n, getCurrentSpanId as o, collectNetworkSpans as r, getOrCreateTraceId as s,
|
|
151
|
+
export { generateSpanId as a, readNetworkSpanParent as c, writeNetworkSpanParent as d, createNetworkDirs as i, writeCurrentSpanId as l, cleanupTestFiles as n, getCurrentSpanId as o, collectNetworkSpans as r, getOrCreateTraceId as s, PW_OTEL_DIR as t, writeNetworkSpan as u };
|