From 22b87a982afc3cdf2cd1e37fe0a76d5fb5d09b69 Mon Sep 17 00:00:00 2001 From: Blake Date: Tue, 17 Nov 2026 08:24:57 -0500 Subject: [PATCH 1/2] feat(node-server): observe offline provider SDK diagnostics --- packages/node-server/README.md | 22 ++ packages/node-server/rules-based.d.ts | 50 ++++ packages/node-server/src/core-provider.ts | 45 +++- packages/node-server/src/rules-based.ts | 1 + .../test/core-provider-diagnostics.spec.ts | 242 ++++++++++++++++++ 5 files changed, 350 insertions(+), 10 deletions(-) create mode 100644 packages/node-server/test/core-provider-diagnostics.spec.ts diff --git a/packages/node-server/README.md b/packages/node-server/README.md index 587fc8e8..c7656e3c 100644 --- a/packages/node-server/README.md +++ b/packages/node-server/README.md @@ -309,6 +309,28 @@ the delivery mechanism so an initialization result already in progress can be re After `onClose()`, the provider reports no further diagnostics, even if it is initialized again. +### Offline core provider + +`DatadogCoreProvider` accepts the same `onDiagnostic` callback and emits the same `SDKDiagnostic` observations. +Timing starts inside its constructor and includes snapshot validation and provider setup. A valid snapshot records +`configuration_received`; completed setup reports `ready`. Failed construction reports `INIT_FAILED` and throws the +original constructor error. Fetching or parsing completed before construction is outside these timings. + +Observations are delivered synchronously during construction. Start diagnostic delivery before constructing the +provider so the first observation can be buffered. Callback promises are not awaited, and callback errors do not +affect construction. The provider has no `initialize()` method and remains ready on synchronous OpenFeature +registration. It starts no fetch, poll, or uploader. Without `onDiagnostic`, measurement is disabled. + +Caller-owned refresh uses the same `reportConfigurationFetchStart()` and `reportConfigurationFetchResult(success)` +methods as `DatadogNodeServerProvider`. Report one start per sequential refresh attempt, including its retries, and +report the final fetch result. Do not report cancellation as failure. Report fetch success separately from applying +the configuration: invalid replacements and evaluation errors are not fetch failures. A failed refresh leaves the +active snapshot available. The shared outage suppression and cooldown rules above apply. + +Successful replacements do not emit another initialization observation. `onClose()` stops diagnostics permanently; +await it before closing diagnostic delivery. Synchronous construction has already succeeded or failed, so closing +the core provider does not create an incomplete initialization observation. + ## End-user license agreement https://www.datadoghq.com/legal/eula diff --git a/packages/node-server/rules-based.d.ts b/packages/node-server/rules-based.d.ts index 347c3cd4..8505b01b 100644 --- a/packages/node-server/rules-based.d.ts +++ b/packages/node-server/rules-based.d.ts @@ -1556,6 +1556,48 @@ export declare enum ExperimentationOptOutMode { Disabled = "disabled", Immediate = "immediate" } +type Milestone = { + elapsed_ms: number; +}; +type Initialization = { + started_at_ms: number; + duration_ms: number; + milestones: { + configuration_received?: Milestone; + provider_ready?: Milestone; + }; +}; +/** A provider observation. The integration adds SDK and service identity and handles delivery. */ +export type SDKDiagnostic = { + timestamp: number; +} & ({ + event_type: "sdk_initialization"; + initialization: Initialization & { + outcome: "ready"; + final: true; + milestones: { + configuration_received: Milestone; + provider_ready: Milestone; + }; + }; +} | { + event_type: "sdk_initialization"; + error_code: "INIT_FAILED"; + initialization: Initialization & { + outcome: "failed"; + final: true; + }; +} | { + event_type: "sdk_initialization"; + initialization: Initialization & { + outcome: "incomplete"; + final: false; + reason: "provider_closed"; + }; +} | { + event_type: "provider_error"; + error_code: "CONFIG_FETCH_FAILED"; +}); type PreparedDependencyExposure = { details: Omit, "value"> & { value?: FlagValue; @@ -1585,6 +1627,8 @@ interface ExposureSink { publish(event: ExposureEvent): void; } export interface DatadogCoreProviderOptions { + /** Receives diagnostic observations during construction without awaiting delivery. Omit to disable measurement. */ + onDiagnostic?: (diagnostic: SDKDiagnostic) => void | Promise; /** Experiment exclusion policy. Defaults to Disabled. */ experimentationOptOutMode?: ExperimentationOptOutMode; /** Caller-owned cache; generation changes reset it, but onClose() does not. Installs no hook or uploader. @internal */ @@ -1602,6 +1646,7 @@ export declare class DatadogCoreProvider implements Provider { readonly runsOn: "server"; readonly hooks: Hook[]; readonly events: ProviderEventEmitter; + private readonly diagnostics?; private configuration; private readonly experimentationOptOutMode; private readonly exposureCache; @@ -1612,6 +1657,11 @@ export declare class DatadogCoreProvider implements Provider { getConfiguration(): FlagsConfiguration$1; /** Validate and copy before replacement. Invalid input throws TypeError and leaves the active snapshot unchanged. */ setConfiguration(configuration: FlagsConfiguration$1): void; + /** Called by the integration once before a sequential configuration poll, including its retries. */ + reportConfigurationFetchStart(): void; + /** Called after the poll succeeds or exhausts retries; cancellations are not fetch failures. */ + reportConfigurationFetchResult(success: boolean): void; + /** Stops diagnostics permanently and clears the provider-owned exposure cache. Await before closing delivery. */ onClose(): Promise; resolveBooleanEvaluation(flagKey: string, defaultValue: boolean, context: EvaluationContext, logger: Logger): Promise>; resolveStringEvaluation(flagKey: string, defaultValue: string, context: EvaluationContext, logger: Logger): Promise>; diff --git a/packages/node-server/src/core-provider.ts b/packages/node-server/src/core-provider.ts index a461aa85..af523e6c 100644 --- a/packages/node-server/src/core-provider.ts +++ b/packages/node-server/src/core-provider.ts @@ -24,6 +24,7 @@ import type { import { evaluateWithTrace } from './configuration/evaluation' import { type ExperimentationOptOutMode, resolveExperimentationOptOutMode } from './experimentation-opt-out' import { NodeProviderEventEmitter } from './provider-event-emitter' +import { type SDKDiagnostic, SDKDiagnostics } from './sdk-diagnostics' import { DependencyTelemetrySidecar, type DependencyTelemetrySidecarApi, @@ -33,6 +34,8 @@ import { } from './tracking' export interface DatadogCoreProviderOptions { + /** Receives diagnostic observations during construction without awaiting delivery. Omit to disable measurement. */ + onDiagnostic?: (diagnostic: SDKDiagnostic) => void | Promise /** Experiment exclusion policy. Defaults to Disabled. */ experimentationOptOutMode?: ExperimentationOptOutMode /** Caller-owned cache; generation changes reset it, but onClose() does not. Installs no hook or uploader. @internal */ @@ -49,6 +52,7 @@ export class DatadogCoreProvider implements Provider { readonly runsOn = 'server' as const readonly hooks: Hook[] = [] readonly events: ProviderEventEmitter = new NodeProviderEventEmitter() + private readonly diagnostics?: SDKDiagnostics private configuration: FlagsConfiguration private readonly experimentationOptOutMode: ExperimentationOptOutMode private readonly exposureCache: AssignmentCache | undefined @@ -57,16 +61,25 @@ export class DatadogCoreProvider implements Provider { // No initialize(): a valid configuration is required before OpenFeature registration. constructor(configuration: FlagsConfiguration, options: DatadogCoreProviderOptions = {}) { - this.experimentationOptOutMode = resolveExperimentationOptOutMode(options.experimentationOptOutMode) - this.configuration = snapshotConfiguration(configuration) - this.dependencyTelemetrySidecar = options.dependencyTelemetrySidecar ?? new DependencyTelemetrySidecar(false) - this.exposureCache = options.exposureCache - this.ownsExposureCache = options.exposureCache === undefined && options.exposureChannel !== undefined - if (options.exposureChannel) { - this.exposureCache ??= new LRUInMemoryAssignmentCache(50_000) - this.hooks.push( - new ExposureLoggingHook(this.exposureCache, options.exposureChannel, this.dependencyTelemetrySidecar) - ) + this.diagnostics = options.onDiagnostic ? new SDKDiagnostics(options.onDiagnostic) : undefined + this.diagnostics?.start(false) + try { + this.experimentationOptOutMode = resolveExperimentationOptOutMode(options.experimentationOptOutMode) + this.configuration = snapshotConfiguration(configuration) + this.diagnostics?.configurationReceived() + this.dependencyTelemetrySidecar = options.dependencyTelemetrySidecar ?? new DependencyTelemetrySidecar(false) + this.exposureCache = options.exposureCache + this.ownsExposureCache = options.exposureCache === undefined && options.exposureChannel !== undefined + if (options.exposureChannel) { + this.exposureCache ??= new LRUInMemoryAssignmentCache(50_000) + this.hooks.push( + new ExposureLoggingHook(this.exposureCache, options.exposureChannel, this.dependencyTelemetrySidecar) + ) + } + this.diagnostics?.finish('ready') + } catch (error) { + this.diagnostics?.finish('failed') + throw error } } @@ -86,7 +99,19 @@ export class DatadogCoreProvider implements Provider { this.events.emit('PROVIDER_CONFIGURATION_CHANGED' as ServerProviderEvents.ConfigurationChanged) } + /** Called by the integration once before a sequential configuration poll, including its retries. */ + reportConfigurationFetchStart(): void { + this.diagnostics?.fetchStarted() + } + + /** Called after the poll succeeds or exhausts retries; cancellations are not fetch failures. */ + reportConfigurationFetchResult(success: boolean): void { + this.diagnostics?.fetchResult(success) + } + + /** Stops diagnostics permanently and clears the provider-owned exposure cache. Await before closing delivery. */ async onClose(): Promise { + this.diagnostics?.close() if (this.ownsExposureCache) await this.exposureCache?.clear() } diff --git a/packages/node-server/src/rules-based.ts b/packages/node-server/src/rules-based.ts index 3552c2d7..adfb0ade 100644 --- a/packages/node-server/src/rules-based.ts +++ b/packages/node-server/src/rules-based.ts @@ -17,3 +17,4 @@ export { type PrecomputeConfigurationOptions, precomputeConfiguration } from './ export { DatadogCoreProvider, type DatadogCoreProviderOptions } from './core-provider' export { ExperimentationOptOutMode } from './experimentation-opt-out' export { createExposureTracking } from './exposure-tracking' +export type { SDKDiagnostic } from './sdk-diagnostics' diff --git a/packages/node-server/test/core-provider-diagnostics.spec.ts b/packages/node-server/test/core-provider-diagnostics.spec.ts new file mode 100644 index 00000000..c175f1c7 --- /dev/null +++ b/packages/node-server/test/core-provider-diagnostics.spec.ts @@ -0,0 +1,242 @@ +import { performance } from 'node:perf_hooks' +import type { FlagsConfiguration } from '@datadog/flagging-core' +import { OpenFeature, ServerProviderStatus } from '@openfeature/server-sdk' +import precomputedWire from '../../browser/test/data/precomputed-v1-wire.json' +import rulesWire from '../../browser/test/data/rules-v1-wire.json' +import { diagnosticRecords } from '../../browser/test/openfeature/diagnostic-contract' +import type { DatadogNodeServerProviderOptions } from '../src/provider' +import { + configurationFromString, + DatadogCoreProvider, + type DatadogCoreProviderOptions, + type SDKDiagnostic, +} from '../src/rules-based' + +jest.mock('node:perf_hooks', () => ({ performance: { now: jest.fn() } })) + +const NOW = Date.UTC(2026, 10, 17) +const domain = 'core-provider-diagnostics' +const context = { targetingKey: 'subject', country: 'US' } + +describe('core provider SDK diagnostics', () => { + let provider: DatadogCoreProvider | undefined + let observations: SDKDiagnostic[] + let monotonic: number + + beforeEach(() => { + jest.useFakeTimers({ now: NOW }) + monotonic = 0 + jest + .mocked(performance.now) + .mockReset() + .mockImplementation(() => monotonic) + observations = [] + }) + + afterEach(async () => { + await provider?.onClose() + await OpenFeature.clearProviders() + provider = undefined + for (const observation of observations) { + diagnosticRecords( + JSON.stringify({ + type: 'sdk_diagnostic', + schema_version: 1, + payload: { + ...observation, + sdk_name: 'dd-trace-js', + sdk_version: '1.0.0', + service_id: 'offline-service', + environment: 'test', + }, + }) + ) + } + jest.restoreAllMocks() + jest.useRealTimers() + }) + + function configuration(): FlagsConfiguration { + return configurationFromString(JSON.stringify(rulesWire)) + } + + function create(options: DatadogCoreProviderOptions = {}, input = configuration()) { + provider = new DatadogCoreProvider(input, { + onDiagnostic: (observation) => { + observations.push(observation) + }, + ...options, + }) + return provider + } + + function failFetch() { + provider!.reportConfigurationFetchStart() + provider!.reportConfigurationFetchResult(false) + } + + async function advance(ms: number) { + monotonic += ms + await jest.advanceTimersByTimeAsync(ms) + } + + it.each(['rules', 'precomputed'] as const)( + 'reports %s construction synchronously without fetching or hooks', + (format) => { + const fetch = jest.spyOn(globalThis, 'fetch').mockRejectedValue(new Error('no network')) + const input = configurationFromString(JSON.stringify(format === 'rules' ? rulesWire : precomputedWire)) + jest.mocked(performance.now).mockReturnValueOnce(5).mockReturnValueOnce(10).mockReturnValueOnce(20) + create({}, input) + expect(observations).toEqual([ + { + timestamp: NOW, + event_type: 'sdk_initialization', + initialization: { + started_at_ms: NOW, + duration_ms: 15, + outcome: 'ready', + final: true, + milestones: { configuration_received: { elapsed_ms: 5 }, provider_ready: { elapsed_ms: 15 } }, + }, + }, + ]) + expect('initialize' in provider!).toBe(false) + expect(provider!.hooks).toEqual([]) + expect(fetch).not.toHaveBeenCalled() + } + ) + + it('keeps OpenFeature immediately ready for the first invocation', async () => { + const instance = create() + OpenFeature.setProvider(domain, instance) + const client = OpenFeature.getClient(domain) + expect(client.providerStatus).toBe(ServerProviderStatus.READY) + expect(observations).toHaveLength(1) + await expect(client.getBooleanDetails('test-flag', false, context)).resolves.toMatchObject({ + value: true, + variant: 'on', + }) + expect(observations).toHaveLength(1) + }) + + it('reports invalid construction once and preserves the constructor error', () => { + const onDiagnostic: DatadogNodeServerProviderOptions['onDiagnostic'] = (observation) => { + observations.push(observation) + } + expect(() => new DatadogCoreProvider({}, { onDiagnostic })).toThrow( + new TypeError('DatadogCoreProvider requires a valid rules-based or precomputed configuration') + ) + expect(observations).toEqual([ + { + timestamp: NOW, + event_type: 'sdk_initialization', + error_code: 'INIT_FAILED', + initialization: { started_at_ms: NOW, duration_ms: 0, outcome: 'failed', final: true, milestones: {} }, + }, + ]) + }) + + it('does no measurement without a callback, including refresh reporting and evaluation', async () => { + const instance = create({ onDiagnostic: undefined }) + instance.reportConfigurationFetchStart() + instance.reportConfigurationFetchResult(false) + OpenFeature.setProvider(domain, instance) + await OpenFeature.getClient(domain).getBooleanValue('test-flag', false, context) + await instance.onClose() + expect(performance.now).not.toHaveBeenCalled() + expect(observations).toEqual([]) + }) + + it('reports a sustained refresh outage after cooldown and retains working configuration', async () => { + const instance = create() + failFetch() + await advance(10_000) + instance.reportConfigurationFetchResult(true) + await advance(10_000) + failFetch() + await advance(39_999) + failFetch() + expect(observations).toHaveLength(2) + await advance(1) + failFetch() + await advance(60_000) + failFetch() + expect(observations.map((observation) => observation.event_type)).toEqual([ + 'sdk_initialization', + 'provider_error', + 'provider_error', + ]) + OpenFeature.setProvider(domain, instance) + await expect(OpenFeature.getClient(domain).getBooleanValue('test-flag', false, context)).resolves.toBe(true) + instance.reportConfigurationFetchResult(true) + failFetch() + expect(observations).toHaveLength(4) + }) + + it('ignores a cancelled refresh when the caller does not report failure', () => { + const instance = create() + instance.reportConfigurationFetchStart() + instance.reportConfigurationFetchStart() + instance.reportConfigurationFetchResult(true) + expect(observations).toHaveLength(1) + failFetch() + expect(observations[1]).toMatchObject({ event_type: 'provider_error', error_code: 'CONFIG_FETCH_FAILED' }) + }) + + it('does not report configuration replacement or evaluation errors as fetch failures', async () => { + const instance = create() + instance.setConfiguration(configuration()) + expect(() => instance.setConfiguration({})).toThrow(TypeError) + OpenFeature.setProvider(domain, instance) + await expect(OpenFeature.getClient(domain).getBooleanDetails('missing', false, context)).resolves.toMatchObject({ + errorCode: 'FLAG_NOT_FOUND', + }) + expect(observations).toHaveLength(1) + }) + + it.each(['synchronous', 'asynchronous'] as const)( + 'contains %s callback errors and preserves invalid-input errors', + async (kind) => { + const onDiagnostic = jest.fn( + kind === 'synchronous' + ? () => { + throw new Error('delivery failed') + } + : async () => { + throw new Error('delivery failed') + } + ) + create({ onDiagnostic }) + expect(failFetch).not.toThrow() + await expect(provider!.onClose()).resolves.toBeUndefined() + expect(() => new DatadogCoreProvider({}, { onDiagnostic })).toThrow(TypeError) + await advance(0) + expect(onDiagnostic).toHaveBeenCalledTimes(3) + } + ) + + it('does not await delivery during construction or close', async () => { + let finishDelivery!: () => void + const delivery = new Promise((resolve) => { + finishDelivery = resolve + }) + const onDiagnostic = jest.fn(() => delivery) + try { + create({ onDiagnostic }) + expect(onDiagnostic).toHaveBeenCalledTimes(1) + await expect(provider!.onClose()).resolves.toBeUndefined() + } finally { + finishDelivery() + } + }) + + it('stops diagnostics permanently after close without adding an incomplete event', async () => { + const instance = create() + await instance.onClose() + await instance.onClose() + failFetch() + instance.reportConfigurationFetchResult(true) + instance.setConfiguration(configuration()) + expect(observations).toHaveLength(1) + }) +}) From 79e7b7c146122acccc8a240f2e4f3e5ec34ff17a Mon Sep 17 00:00:00 2001 From: Blake Date: Tue, 17 Nov 2026 08:25:12 -0500 Subject: [PATCH 2/2] test(node-server): verify packed core diagnostic compatibility --- test-app-node/configuration.test.mjs | 47 ++++++++++++++++++++++++++++ test-app-node/typecheck.mts | 15 +++++++++ test-app-node/typecheck.ts | 20 ++++++++++++ 3 files changed, 82 insertions(+) diff --git a/test-app-node/configuration.test.mjs b/test-app-node/configuration.test.mjs index 27c1af5f..fb28ec1c 100644 --- a/test-app-node/configuration.test.mjs +++ b/test-app-node/configuration.test.mjs @@ -120,6 +120,53 @@ test('packed core provider evaluates and replaces local rules without OpenFeatur await provider.onClose() }) +for (const [mode, CoreProvider] of [ + ['import', DatadogCoreProvider], + ['require', cjs.DatadogCoreProvider], +]) { + test(`${mode}: packed core provider uses the existing diagnostic callback and refresh interface`, async () => { + const observations = [] + const onDiagnostic = (observation) => { + observations.push(observation) + } + const configuration = configurationFromRulesBinary(new Uint8Array()) + const provider = new CoreProvider(configuration, { onDiagnostic }) + assert.equal('initialize' in provider, false) + assert.equal(observations.length, 1) + assert.equal(observations[0].event_type, 'sdk_initialization') + assert.equal(observations[0].initialization.outcome, 'ready') + assert.ok(observations[0].initialization.milestones.configuration_received) + assert.ok(observations[0].initialization.milestones.provider_ready) + if (OpenFeature) { + OpenFeature.setProvider(`diagnostics-${mode}`, provider) + const client = OpenFeature.getClient(`diagnostics-${mode}`) + assert.equal(client.providerStatus, 'READY') + const details = await client.getBooleanDetails('missing', false, {}) + assert.equal(details.errorCode, 'FLAG_NOT_FOUND') + } + provider.reportConfigurationFetchStart() + provider.reportConfigurationFetchResult(false) + provider.reportConfigurationFetchStart() + provider.reportConfigurationFetchResult(false) + assert.deepEqual(observations.slice(1), [ + { + timestamp: observations[1].timestamp, + event_type: 'provider_error', + error_code: 'CONFIG_FETCH_FAILED', + }, + ]) + await provider.onClose() + provider.reportConfigurationFetchResult(true) + provider.reportConfigurationFetchStart() + provider.reportConfigurationFetchResult(false) + assert.equal(observations.length, 2) + assert.throws(() => new CoreProvider({}, { onDiagnostic }), TypeError) + assert.equal(observations[2].error_code, 'INIT_FAILED') + assert.equal(observations[2].initialization.outcome, 'failed') + if (OpenFeature) await OpenFeature.clearProviders() + }) +} + for (const [format, registration] of [ ['rules', 'implicit'], ['precomputed', 'implicit'], diff --git a/test-app-node/typecheck.mts b/test-app-node/typecheck.mts index 0f076971..05e11103 100644 --- a/test-app-node/typecheck.mts +++ b/test-app-node/typecheck.mts @@ -4,6 +4,7 @@ import { DependencyTelemetrySidecar, fetchPrecomputedConfiguration, type PrecomputedConfigurationFetchOptions, + type SDKDiagnostic as RootSDKDiagnostic, configurationToString as serializePrecomputed, } from '@datadog/openfeature-node-server' import { @@ -15,6 +16,7 @@ import { fetchRulesConfiguration, precomputeConfiguration, type RulesConfigurationFetchOptions, + type SDKDiagnostic, } from '@datadog/openfeature-node-server/rules-based' export async function loadConfiguration(options: RulesConfigurationFetchOptions): Promise { @@ -61,3 +63,16 @@ import { fetchRulesConfiguration as rootFetch } from '@datadog/openfeature-node- void root.createExposureTracking void [DatadogNodeServerProvider, rootFetch] + +export function loadDiagnosticProvider( + configuration: ConstructorParameters[0], + onDiagnostic: (observation: RootSDKDiagnostic) => void | Promise +) { + const callback: (observation: SDKDiagnostic) => void | Promise = onDiagnostic + const provider = new DatadogCoreProvider(configuration, { onDiagnostic: callback }) + const reporter: Pick = + provider + reporter.reportConfigurationFetchStart() + reporter.reportConfigurationFetchResult(true) + return provider +} diff --git a/test-app-node/typecheck.ts b/test-app-node/typecheck.ts index bd283e08..2e2ef4f4 100644 --- a/test-app-node/typecheck.ts +++ b/test-app-node/typecheck.ts @@ -26,6 +26,7 @@ import { fetchPrecomputedConfiguration, type PrecomputedConfigurationFetchOptions, type FlagSelection as RootFlagSelection, + type SDKDiagnostic as RootSDKDiagnostic, type UniversalFlagConfigurationV1, } from '@datadog/openfeature-node-server' import { @@ -36,6 +37,7 @@ import { configurationFromString, configurationToString, DatadogCoreProvider, + type DatadogCoreProviderOptions, type FlagSelection, type FlagsConfiguration, fetchRulesConfiguration, @@ -43,6 +45,7 @@ import { type PrecomputeEvaluationError, precomputeConfiguration, type RulesConfigurationFetchOptions, + type SDKDiagnostic, } from '@datadog/openfeature-node-server/rules-based' // --- Test 1: DatadogNodeServerProvider can be instantiated with correct options --- @@ -204,3 +207,20 @@ void fetchPrecomputedConfiguration({ ...precomputedFetchOptions, experimentation void fetchPrecomputedConfiguration({ ...precomputedFetchOptions, flagSelection: { tags: [42] } }) // @ts-expect-error: Selection diagnostics require an error method. void fetchPrecomputedConfiguration({ ...precomputedFetchOptions, logger: {} }) + +// The tracer can use the same callback and refresh notifications with either provider. +const onDiagnostic = async (observation: SDKDiagnostic): Promise => { + const rootObservation: RootSDKDiagnostic = observation + void rootObservation +} +const coreDiagnosticOptions: DatadogCoreProviderOptions = { onDiagnostic } +const nodeDiagnosticOptions: DatadogNodeServerProviderOptions = { exposureChannel, onDiagnostic } +const diagnosticProvider = new DatadogCoreProvider(decoded, coreDiagnosticOptions) +const refreshReporter: Pick< + DatadogNodeServerProvider, + 'reportConfigurationFetchStart' | 'reportConfigurationFetchResult' +> = diagnosticProvider +refreshReporter.reportConfigurationFetchStart() +refreshReporter.reportConfigurationFetchResult(false) +const diagnosticsClosed: Promise = diagnosticProvider.onClose() +void [nodeDiagnosticOptions, diagnosticsClosed]