Skip to content

Commit 018c917

Browse files
authored
fix(playwright): ensure engine knows when tracing is enabled (#2533)
1 parent 6b6ff07 commit 018c917

File tree

2 files changed

+4
-3
lines changed
  • packages
    • artillery-engine-playwright
    • artillery-plugin-publish-metrics/lib/open-telemetry

2 files changed

+4
-3
lines changed

packages/artillery-engine-playwright/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ class PlaywrightEngine {
1111
this.launchOptions = this.config.launchOptions || {};
1212
this.contextOptions = this.config.contextOptions || {};
1313

14-
this.tracing = (script.config?.plugins?.['publish-metrics'] || []).some((config) => {
15-
return (config.type === 'open-telemetry') && config.traces})
14+
this.tracing = global.artillery.OTEL_TRACING_ENABLED || false;
1615

1716
this.defaultNavigationTimeout =
1817
(parseInt(this.config.defaultNavigationTimeout, 10) || 30) * 1000;

packages/artillery-plugin-publish-metrics/lib/open-telemetry/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ class OTelReporter {
6868
if (!this.metricsConfig && !this.tracesConfig) {
6969
return this;
7070
}
71-
71+
if (this.tracesConfig) {
72+
global.artillery.OTEL_TRACING_ENABLED = true;
73+
}
7274
// Warn if traces are configured in multiple reporters
7375
this.warnIfDuplicateTracesConfigured(this.translatedConfigsList);
7476

0 commit comments

Comments
 (0)