Skip to content

feat: consume uip telemetry package#432

Closed
Sandeepan-Ghosh-0312 wants to merge 2 commits into
mainfrom
feat/consumeUipTelemetryPackaeg
Closed

feat: consume uip telemetry package#432
Sandeepan-Ghosh-0312 wants to merge 2 commits into
mainfrom
feat/consumeUipTelemetryPackaeg

Conversation

@Sandeepan-Ghosh-0312

Copy link
Copy Markdown
Contributor

No description provided.

@Sandeepan-Ghosh-0312 Sandeepan-Ghosh-0312 requested a review from a team May 12, 2026 21:38
@Sandeepan-Ghosh-0312 Sandeepan-Ghosh-0312 marked this pull request as draft May 12, 2026 21:42
* Coded Action Apps telemetry constants

*
* `SDK_VERSION` is patched by the CAA publish workflow before build. Other

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The comment says "patched by the CAA publish workflow before build" but there is no CAA publish workflow — .github/workflows/ contains only one publish.yml and it exclusively patches src/core/telemetry/client.ts and src/core/telemetry/constants.ts. Neither $CODED_ACTION_APP_SDK_VERSION here nor $CONNECTION_STRING in packages/coded-action-apps/src/telemetry/client.ts are ever substituted, so CAA telemetry will silently never initialize in production (the isValidConnectionString guard returns false for any string starting with $). You need to either add the substitution sed steps to publish.yml, or create a separate CAA publish workflow that patches these two placeholders before the build.

});
this.service = new TelemetryService(
provider,
new BrowserContextStorage<TelemetryContext>()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

BrowserContextStorage is a browser-specific API. The core SDK is also consumed by Node.js backends (secret-based auth mode in src/core/index.ts). If BrowserContextStorage depends on browser globals (localStorage, sessionStorage, window, etc.), telemetry initialization will throw and be silently swallowed by the surrounding try/catch, leaving this.service unset and all @track calls as no-ops in server environments. Verify BrowserContextStorage is safe in Node.js 20+, or use a context-agnostic storage class when running outside a browser.

Comment thread src/core/telemetry/constants.ts
export const SDK_VERSION = "$SDK_VERSION";
export const CLOUD_ROLE_NAME = 'uipath-ts-sdk';
export const SDK_SERVICE_NAME = 'UiPath.TypeScript.Sdk';
export const SDK_LOGGER_NAME = 'uipath-ts-sdk-telemetry';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SDK_LOGGER_NAME is no longer used anywhere in the new client.ts (the TelemetryService from @uipath/telemetry manages its logger internally). It is still re-exported via src/core/telemetry/index.ts's export * from './constants', making it part of the public API. If it was only ever used internally by the old OpenTelemetry logger provider, remove it. If kept for backwards compatibility, add a /** @deprecated */ tag so it appears that way in the generated docs.

Comment thread src/core/telemetry/app-insights-provider.ts
Comment thread src/core/telemetry/app-insights-provider.ts
Comment thread packages/coded-action-apps/src/telemetry/constants.ts
@claude

claude Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Review findings

7 issues found across the new telemetry implementation.

New findings this run

  1. CAA publish workflow missingpackages/coded-action-apps/src/telemetry/constants.ts:5
    The $CODED_ACTION_APP_SDK_VERSION and $CONNECTION_STRING placeholders in the CAA package are never substituted by any workflow. CAA telemetry will silently never initialize in production.

  2. BrowserContextStorage in server-side SDKsrc/core/telemetry/client.ts:66
    The core SDK is also used in Node.js backends. If BrowserContextStorage requires browser globals, telemetry initialization will fail (silently, inside the try/catch) in all server-side consumers.

  3. Misleading comment in constants.tssrc/core/telemetry/constants.ts:4-9
    The JSDoc claims the connection string is injected into @uipath/telemetry — it is actually defined and patched in client.ts directly.

  4. SDK_LOGGER_NAME unused (core)src/core/telemetry/constants.ts:17
    No longer used internally but still publicly exported via index.ts. Remove or mark @deprecated.

  5. trackException uses EventData envelopesrc/core/telemetry/app-insights-provider.ts:53
    Exceptions are sent as custom events, not as App Insights ExceptionData. They won't appear in the Exceptions blade. Same issue in the CAA copy.

  6. Duplicate ApplicationInsightsTelemetryProvidersrc/core/telemetry/app-insights-provider.ts:40
    ~135-line class duplicated identically in both packages. Risks silent drift.

  7. SDK_LOGGER_NAME unused (CAA)packages/coded-action-apps/src/telemetry/constants.ts:13
    Exported but never imported by any file in the CAA telemetry module.

@claude

claude Bot commented May 17, 2026

Copy link
Copy Markdown
Contributor

Review update

No new findings this run. Reopened 3 previously-resolved threads whose requested fixes were not applied:

  1. CAA publish workflow missing placeholder substitutions (packages/coded-action-apps/src/telemetry/constants.ts:5) — publish.yml was updated to patch src/core/telemetry/client.ts instead of constants.ts, but still adds no sed steps for the CAA package. $CODED_ACTION_APP_SDK_VERSION in packages/coded-action-apps/src/telemetry/constants.ts and $CONNECTION_STRING in packages/coded-action-apps/src/telemetry/client.ts remain unpatched — CAA telemetry will silently skip initialization in production.

  2. BrowserContextStorage in Node.js-capable core SDK (src/core/telemetry/client.ts:66) — still imported and used at line 66 of the new client.ts. If BrowserContextStorage depends on browser globals, all server-side SDK consumers will silently lose telemetry (the try/catch around initialize swallows the error).

  3. SDK_LOGGER_NAME exported but unused from core constants (src/core/telemetry/constants.ts:17) — still present in the new file; the new client.ts no longer imports it. Still re-exported publicly via index.ts. Remove or mark /** @deprecated */.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
53.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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.

1 participant