Skip to content

[OTel-SDK] Merge Core and Common shared packages into otel-core-js#2691

Merged
MSNev merged 6 commits intootel-sdkfrom
MSNev/OTelPkgMerge
Jan 26, 2026
Merged

[OTel-SDK] Merge Core and Common shared packages into otel-core-js#2691
MSNev merged 6 commits intootel-sdkfrom
MSNev/OTelPkgMerge

Conversation

@MSNev
Copy link
Collaborator

@MSNev MSNev commented Jan 23, 2026

  • Also extracts core Noop operations to a new otel-noop-js package

@MSNev MSNev requested a review from a team as a code owner January 23, 2026 22:00
import { cfgDfMerge } from "../Config/ConfigDefaultHelpers";
import { createDynamicConfig, onConfigChange } from "../Config/DynamicConfig";
import { DiagnosticLogger, _InternalLogMessage, _throwInternal, _warnToConsole } from "../Diagnostics/DiagnosticLogger";
import { cfgDfMerge } from "../config/ConfigDefaultHelpers";

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import cfgDfMerge.

Copilot Autofix

AI 12 days ago

In general, to fix an unused import issue, either remove the import or start using the imported symbol in active code. To avoid changing functionality, we prefer removal only when the symbol is not referenced anywhere in live code.

Here, cfgDfMerge is only used in a commented-out configuration (defaultStatsCfg). Since commented code has no effect, the safest and cleanest fix is to remove the cfgDfMerge import from AppInsightsCore.ts. No other code in the shown snippet depends on it, and no additional methods, imports, or definitions are needed.

Concretely, in shared/otel-core/src/core/AppInsightsCore.ts, delete the import line:

import { cfgDfMerge } from "../config/ConfigDefaultHelpers";

Leave the commented-out defaultStatsCfg block unchanged, as it will simply refer to a symbol that is not currently in scope but also not executed.

Suggested changeset 1
shared/otel-core/src/core/AppInsightsCore.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/shared/otel-core/src/core/AppInsightsCore.ts b/shared/otel-core/src/core/AppInsightsCore.ts
--- a/shared/otel-core/src/core/AppInsightsCore.ts
+++ b/shared/otel-core/src/core/AppInsightsCore.ts
@@ -8,7 +8,6 @@
     isFunction, isNullOrUndefined, isPlainObject, isPromiseLike, objDeepFreeze, objDefine, objForEachKey, objFreeze, objHasOwn,
     scheduleTimeout, throwError
 } from "@nevware21/ts-utils";
-import { cfgDfMerge } from "../config/ConfigDefaultHelpers";
 import { createDynamicConfig, onConfigChange } from "../config/DynamicConfig";
 import { ChannelControllerPriority } from "../constants/Constants";
 import {
EOF
@@ -8,7 +8,6 @@
isFunction, isNullOrUndefined, isPlainObject, isPromiseLike, objDeepFreeze, objDefine, objForEachKey, objFreeze, objHasOwn,
scheduleTimeout, throwError
} from "@nevware21/ts-utils";
import { cfgDfMerge } from "../config/ConfigDefaultHelpers";
import { createDynamicConfig, onConfigChange } from "../config/DynamicConfig";
import { ChannelControllerPriority } from "../constants/Constants";
import {
Copilot is powered by AI and may make mistakes. Always verify output.
const hasProcessors = registeredLogRecordProcessors.length > 0;

if (!hasProcessors) {
// This was previously creating a noop processor, but to reduce bundle size we are no longer doing that automatically.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only functional change in this PR.

const hasProcessors = registeredLogRecordProcessors.length > 0;
const activeProcessor = hasProcessors
? createMultiLogRecordProcessor(registeredLogRecordProcessors, forceFlushTimeoutMillis)
: createNoopLogRecordProcessor();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the functionality that was removed

  • No longer uses createNoopLogRecordProcessor as this is not in this package and the underlying createMultiLogRecordProcessor already "supported" passing in an empty array.

Copy link
Member

@rads-1996 rads-1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Fix: Issue for dts-gen because of renaming entrypoint to index.ts
@MSNev MSNev force-pushed the MSNev/OTelPkgMerge branch from cb1e1eb to 1f2969b Compare January 23, 2026 23:45
@MSNev MSNev requested a review from rads-1996 January 23, 2026 23:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@MSNev MSNev merged commit 206279b into otel-sdk Jan 26, 2026
9 checks passed
@MSNev MSNev deleted the MSNev/OTelPkgMerge branch January 26, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants