playwright-opentelemetry 0.11.0 → 0.11.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.
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  }) : target, mod));
22
22
  //#endregion
23
23
  //#region package.json
24
- var version = "0.11.0";
24
+ var version = "0.11.1";
25
25
  /** Generate a random 32-character hex trace ID. */
26
26
  function generateTraceId() {
27
27
  return Array.from({ length: 32 }, () => Math.floor(Math.random() * 16).toString(16)).join("");
@@ -259,18 +259,20 @@ function resolveDestinationKind(options) {
259
259
  const envEndpoint = process.env[options.envEndpointName];
260
260
  const envHeaders = process.env[options.envHeadersName];
261
261
  if (envHeaders && !envEndpoint) throw new Error(`${options.envHeadersName} is set but ${options.envEndpointName} is not set.`);
262
- if (envEndpoint) return [{
262
+ let primaryDestination;
263
+ if (envEndpoint) primaryDestination = {
263
264
  url: envEndpoint,
264
265
  headers: parseOtlpHeaders(envHeaders)
265
- }];
266
- if (options.singular) return [{
266
+ };
267
+ else if (options.singular) primaryDestination = {
267
268
  url: options.singular.url,
268
269
  headers: { ...options.singular.headers }
269
- }];
270
- return (options.plural ?? []).map((destination) => ({
270
+ };
271
+ const additionalDestinations = (options.plural ?? []).map((destination) => ({
271
272
  url: destination.url,
272
273
  headers: { ...destination.headers }
273
274
  }));
275
+ return primaryDestination ? [primaryDestination, ...additionalDestinations] : additionalDestinations;
274
276
  }
275
277
  function resolveLegacyDestinationConfig(destination, headers) {
276
278
  return typeof destination === "string" ? {
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.11.0";
2
+ var version = "0.11.1";
3
3
  /** Generate a random 32-character hex trace ID. */
4
4
  function generateTraceId() {
5
5
  return Array.from({ length: 32 }, () => Math.floor(Math.random() * 16).toString(16)).join("");
@@ -237,18 +237,20 @@ function resolveDestinationKind(options) {
237
237
  const envEndpoint = process.env[options.envEndpointName];
238
238
  const envHeaders = process.env[options.envHeadersName];
239
239
  if (envHeaders && !envEndpoint) throw new Error(`${options.envHeadersName} is set but ${options.envEndpointName} is not set.`);
240
- if (envEndpoint) return [{
240
+ let primaryDestination;
241
+ if (envEndpoint) primaryDestination = {
241
242
  url: envEndpoint,
242
243
  headers: parseOtlpHeaders(envHeaders)
243
- }];
244
- if (options.singular) return [{
244
+ };
245
+ else if (options.singular) primaryDestination = {
245
246
  url: options.singular.url,
246
247
  headers: { ...options.singular.headers }
247
- }];
248
- return (options.plural ?? []).map((destination) => ({
248
+ };
249
+ const additionalDestinations = (options.plural ?? []).map((destination) => ({
249
250
  url: destination.url,
250
251
  headers: { ...destination.headers }
251
252
  }));
253
+ return primaryDestination ? [primaryDestination, ...additionalDestinations] : additionalDestinations;
252
254
  }
253
255
  function resolveLegacyDestinationConfig(destination, headers) {
254
256
  return typeof destination === "string" ? {
package/dist/fixture.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_config = require("./config-Csi-apHL.cjs");
2
+ const require_config = require("./config-Dlhv7Jh9.cjs");
3
3
  let node_path = require("node:path");
4
4
  node_path = require_config.__toESM(node_path, 1);
5
5
  let _playwright_test = require("@playwright/test");
package/dist/fixture.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as createTestTraceContext, l as generateSpanId, n as BROWSER_SERVICE_NAME, o as flushFixtureSpans, t as resolvePlaywrightOpentelemetryConfig } from "./config-B0-IOZF-.mjs";
1
+ import { a as createTestTraceContext, l as generateSpanId, n as BROWSER_SERVICE_NAME, o as flushFixtureSpans, t as resolvePlaywrightOpentelemetryConfig } from "./config-vP1SpMPF.mjs";
2
2
  import path from "node:path";
3
3
  import { test as test$1 } from "@playwright/test";
4
4
  export * from "@playwright/test";
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region src/index.ts
2
- var src_default = require("./reporter-DszuIYsI.cjs").PlaywrightOpentelemetryReporter;
2
+ var src_default = require("./reporter-SVZk1e4Y.cjs").PlaywrightOpentelemetryReporter;
3
3
  //#endregion
4
4
  module.exports = src_default;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PlaywrightOpentelemetryReporter } from "./reporter-BGMoVKC7.mjs";
1
+ import { t as PlaywrightOpentelemetryReporter } from "./reporter-CeXM-i19.mjs";
2
2
  //#region src/index.ts
3
3
  var src_default = PlaywrightOpentelemetryReporter;
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { c as buildOtlpRequest, d as sendSpans, i as TRACE_CONTEXT_ATTACHMENT_NAME, l as generateSpanId, r as FIXTURE_SPANS_ATTACHMENT_NAME, s as shouldRetainPlaywrightTrace, t as resolvePlaywrightOpentelemetryConfig, u as generateTraceId } from "./config-B0-IOZF-.mjs";
1
+ import { c as buildOtlpRequest, d as sendSpans, i as TRACE_CONTEXT_ATTACHMENT_NAME, l as generateSpanId, r as FIXTURE_SPANS_ATTACHMENT_NAME, s as shouldRetainPlaywrightTrace, t as resolvePlaywrightOpentelemetryConfig, u as generateTraceId } from "./config-vP1SpMPF.mjs";
2
2
  import path from "node:path";
3
3
  import fs from "node:fs/promises";
4
4
  import { BlobReader, BlobWriter, TextWriter, ZipReader, ZipWriter } from "@zip.js/zip.js";
@@ -1,4 +1,4 @@
1
- const require_config = require("./config-Csi-apHL.cjs");
1
+ const require_config = require("./config-Dlhv7Jh9.cjs");
2
2
  let node_path = require("node:path");
3
3
  node_path = require_config.__toESM(node_path, 1);
4
4
  let node_fs_promises = require("node:fs/promises");
package/dist/reporter.cjs CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region src/reporter/index.ts
2
- var reporter_default = require("./reporter-DszuIYsI.cjs").PlaywrightOpentelemetryReporter;
2
+ var reporter_default = require("./reporter-SVZk1e4Y.cjs").PlaywrightOpentelemetryReporter;
3
3
  //#endregion
4
4
  module.exports = reporter_default;
package/dist/reporter.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PlaywrightOpentelemetryReporter } from "./reporter-BGMoVKC7.mjs";
1
+ import { t as PlaywrightOpentelemetryReporter } from "./reporter-CeXM-i19.mjs";
2
2
  //#region src/reporter/index.ts
3
3
  var reporter_default = PlaywrightOpentelemetryReporter;
4
4
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playwright-opentelemetry",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "A reporter for Playwright that can export traces and spans in opentelemetry format.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",