Skip to content

Commit

Permalink
fix(playwright): ensure engine knows when tracing is enabled (#2533)
Browse files Browse the repository at this point in the history
  • Loading branch information
InesNi authored Mar 4, 2024
1 parent 6b6ff07 commit 018c917
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions packages/artillery-engine-playwright/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ class PlaywrightEngine {
this.launchOptions = this.config.launchOptions || {};
this.contextOptions = this.config.contextOptions || {};

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

this.defaultNavigationTimeout =
(parseInt(this.config.defaultNavigationTimeout, 10) || 30) * 1000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ class OTelReporter {
if (!this.metricsConfig && !this.tracesConfig) {
return this;
}

if (this.tracesConfig) {
global.artillery.OTEL_TRACING_ENABLED = true;
}
// Warn if traces are configured in multiple reporters
this.warnIfDuplicateTracesConfigured(this.translatedConfigsList);

Expand Down

0 comments on commit 018c917

Please sign in to comment.