Skip to content

Commit 2b2b34f

Browse files
rochdevBridgeAR
authored andcommitted
refactor(plugins): rename Plugin.experimental to Plugin.optIn (#9802)
The `experimental` static flag never signaled experimental status - it only decides whether a plugin is enabled by default or requires an explicit opt-in (via DD_TRACE_<NAME>_ENABLED or tracer.use()). Rename it to `optIn` so the name matches its only behavior.
1 parent 0f21ee4 commit 2b2b34f

7 files changed

Lines changed: 12 additions & 12 deletions

File tree

packages/datadog-plugin-electron/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const ElectronNetPlugin = require('./net')
77

88
class ElectronPlugin extends CompositePlugin {
99
static id = 'electron'
10-
static experimental = DD_MAJOR >= 7
10+
static optIn = DD_MAJOR >= 7
1111
static get plugins () {
1212
return {
1313
net: ElectronNetPlugin,

packages/datadog-plugin-fs/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const TracingPlugin = require('../../dd-trace/src/plugins/tracing')
55
class FsPlugin extends TracingPlugin {
66
static id = 'fs'
77
static operation = 'operation'
8-
static experimental = true
8+
static optIn = true
99

1010
bindStart (ctx) {
1111
if (!this.activeSpan) return { noop: true }

packages/datadog-plugin-fs/test/index.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ describe('Plugin', () => {
2525
assert.strictEqual(plugins['node:fs'], FsPlugin)
2626
})
2727

28-
it('marks the fs plugin experimental so it stays disabled by default', () => {
29-
assert.strictEqual(FsPlugin.experimental, true)
28+
it('marks the fs plugin opt-in so it stays disabled by default', () => {
29+
assert.strictEqual(FsPlugin.optIn, true)
3030
})
3131
})
3232

packages/datadog-plugin-nats/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class NatsPlugin extends CompositePlugin {
88
static id = 'nats'
99
// Disabled by default — users must opt in via DD_TRACE_NATS_ENABLED=true
1010
// or `tracer.use('nats')`. Matches the feature parity dashboard policy.
11-
static experimental = true
11+
static optIn = true
1212
static get plugins () {
1313
return {
1414
producer: ProducerPlugin,

packages/dd-trace/src/config/major-overrides.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function applyMajorOverrides (supportedConfigurations, majorVersion) {
6161

6262
if (majorVersion >= 7) {
6363
// The Electron plugin moved to the Electron SDK and is opt-in (disabled by default) from v7 on,
64-
// while remaining enabled by default on earlier majors (see ElectronPlugin.experimental).
64+
// while remaining enabled by default on earlier majors (see ElectronPlugin.optIn).
6565
const electronEntry = supportedConfigurations.DD_TRACE_ELECTRON_ENABLED?.[0]
6666
if (electronEntry) electronEntry.default = 'false'
6767
}

packages/dd-trace/src/plugin_manager.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ function maybeEnable (Plugin) {
6161
function getEnabled (Plugin) {
6262
const envName = `DD_TRACE_${Plugin.id.toUpperCase()}_ENABLED`
6363
// skipDefault: only an explicitly configured value should drive enablement here. A registered
64-
// default of `false` (e.g. an experimental plugin like `nats`) must not be read as an explicit
64+
// default of `false` (e.g. an opt-in plugin like `nats`) must not be read as an explicit
6565
// "disabled via configuration option" — that path both logs a misleading line and nulls the
66-
// plugin class, bypassing the experimental opt-in handled by `loadPlugin`.
66+
// plugin class, bypassing the opt-in handled by `loadPlugin`.
6767
return getValueFromEnvSources(normalizePluginEnvName(envName), true)
6868
}
6969

@@ -102,7 +102,7 @@ module.exports = class PluginManager {
102102
}
103103
const pluginConfig = this._configsByName[name] || {
104104
enabled: this._tracerConfig.plugins !== false &&
105-
(!Plugin.experimental || isTrue(getEnabled(Plugin))),
105+
(!Plugin.optIn || isTrue(getEnabled(Plugin))),
106106
}
107107

108108
// extracts predetermined configuration from tracer and combines it with plugin-specific config

packages/dd-trace/test/plugin_manager.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ describe('Plugin Manager', () => {
6868
},
6969
seven: {},
7070
eight: class Eight extends FakePlugin {
71-
static experimental = true
71+
static optIn = true
7272
static id = 'eight'
7373
},
7474
graphql: class Graphql extends FakePlugin {
@@ -96,7 +96,7 @@ describe('Plugin Manager', () => {
9696

9797
// Mirrors getValueFromEnvSources: an explicit env value wins, otherwise the registered
9898
// default is returned unless the caller passes skipDefault. registeredDefaults lets a test
99-
// model a plugin whose default-enabled flag is `false` (e.g. an experimental plugin).
99+
// model a plugin whose default-enabled flag is `false` (e.g. an opt-in plugin).
100100
registeredDefaults = {}
101101
PluginManager = proxyquire.noPreserveCache()('../src/plugin_manager', {
102102
'./plugins': { ...plugins, '@noCallThru': true },
@@ -309,7 +309,7 @@ describe('Plugin Manager', () => {
309309
})
310310
})
311311

312-
describe('with an experimental plugin', () => {
312+
describe('with an opt-in plugin', () => {
313313
it('should disable the plugin by default', () => {
314314
pm.configure(makeTracerConfig())
315315
loadChannel.publish({ name: 'eight' })

0 commit comments

Comments
 (0)