Skip to content

Gate static telemetry bootstrap and remove invalid OpenTelemetry dependency#37

Merged
phuquoc81 merged 9 commits intoclaude/fix-action-run-issuesfrom
copilot/fix-issue
Mar 14, 2026
Merged

Gate static telemetry bootstrap and remove invalid OpenTelemetry dependency#37
phuquoc81 merged 9 commits intoclaude/fix-action-run-issuesfrom
copilot/fix-issue

Conversation

Copy link
Contributor

Copilot AI commented Mar 14, 2026

Static Fastcash launches were attempting to initialize browser telemetry in an environment that cannot resolve bare npm imports, producing runtime console errors. The telemetry dependency set also included an invalid package, causing npm install to fail.

  • Telemetry bootstrap

    • Make telemetry opt-in for static launches via ?telemetry=1 or localStorage.setItem("fastcash.telemetry", "enabled")
    • Stop loading telemetry by default on every page visit
    • Change failure logging to reflect actual initialization failures instead of implying intentional skips
  • Static-environment handling

    • Skip telemetry initialization when import-map support is not present
    • Skip exporter setup when fastcash.kubiksKey is not configured
    • Keep local console exporting limited to loopback hosts used for development
  • Dependency cleanup

    • Remove @opentelemetry/sdk-web from package.json since the package does not exist and breaks dependency installation
  • Resulting behavior

    • Default static app loads no longer emit telemetry module-resolution errors
    • Opted-in telemetry fails closed in unsupported static contexts instead of producing hard runtime noise
<script type="module">
  const telemetryEnabled =
    new URLSearchParams(window.location.search).get('telemetry') === '1' ||
    window.localStorage.getItem('fastcash.telemetry') === 'enabled';

  if (telemetryEnabled) {
    import('./otel-init.js').catch(err => console.warn('Telemetry initialization failed:', err));
  }
</script>
  • Screenshot
    • Fastcash UI

📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI and others added 5 commits March 12, 2026 00:28
Co-authored-by: phuquoc81 <51638662+phuquoc81@users.noreply.github.com>
Co-authored-by: phuquoc81 <51638662+phuquoc81@users.noreply.github.com>
Restore main workflow badge and repair the `main.yml` Actions workflow
Copilot AI and others added 2 commits March 14, 2026 21:59
Co-authored-by: phuquoc81 <51638662+phuquoc81@users.noreply.github.com>
Co-authored-by: phuquoc81 <51638662+phuquoc81@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with system performance Gate static telemetry bootstrap and remove invalid OpenTelemetry dependency Mar 14, 2026
Copilot AI requested a review from phuquoc81 March 14, 2026 22:04
@phuquoc81 phuquoc81 marked this pull request as ready for review March 14, 2026 23:36
Copilot AI review requested due to automatic review settings March 14, 2026 23:36
@phuquoc81 phuquoc81 changed the base branch from Main to claude/fix-action-run-issues March 14, 2026 23:36
@phuquoc81 phuquoc81 changed the base branch from claude/fix-action-run-issues to copilot/fix-coding-script March 14, 2026 23:37
@phuquoc81 phuquoc81 changed the base branch from copilot/fix-coding-script to claude/fix-action-run-issues March 14, 2026 23:37
Copy link

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.

Pull request overview

This PR makes browser telemetry safe for static Fastcash launches by gating OpenTelemetry initialization behind explicit opt-in and by removing an invalid dependency that could break installs.

Changes:

  • Make telemetry opt-in on static launches via ?telemetry=1 or localStorage.fastcash.telemetry=enabled.
  • Update otel-init.js to skip initialization when prerequisites aren’t met and to load OTel packages dynamically.
  • Remove the invalid @opentelemetry/sdk-web dependency and replace the corrupted workflow file with a real CI workflow.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
package.json Removes invalid OTel dependency; confirms ESM module setup.
otel-init.js Adds conditional telemetry bootstrap and dynamic imports.
index.html Gates telemetry loading behind opt-in flags.
README.md Adds GitHub Actions badge; minor formatting cleanup.
.github/workflows/main.yml Replaces invalid content with a Node-based validation workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@phuquoc81
Copy link
Owner

@copilot apply changes based on the comments in this thread

Co-authored-by: phuquoc81 <51638662+phuquoc81@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 14, 2026

@copilot apply changes based on the comments in this thread

Applied in 7cf2810. I updated the telemetry follow-up so import-map browser support is checked separately from import-map configuration, and the default enablement message now mentions the import-map requirement for static launches. Screenshot: https://github.com/user-attachments/assets/e7fb17e6-9374-46bf-bed3-fe85300b025a

Copilot AI requested a review from phuquoc81 March 14, 2026 23:48
@phuquoc81 phuquoc81 merged commit f978436 into claude/fix-action-run-issues Mar 14, 2026
1 check passed
Copy link

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.

Pull request overview

This PR makes static (no-bundler) Fastcash launches stop attempting to initialize OpenTelemetry by default, and fixes dependency installation by removing a non-existent OpenTelemetry package.

Changes:

  • Gate telemetry bootstrap behind an explicit opt-in (?telemetry=1 or localStorage flag) in index.html.
  • Make otel-init.js fail closed for unsupported static contexts (no import-map support / no configured import map / missing Kubiks key) and use dynamic imports.
  • Remove invalid @opentelemetry/sdk-web dependency from package.json.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
package.json Removes invalid OpenTelemetry dependency that breaks installs.
otel-init.js Adds static-environment guards + dynamic imports; requires Kubiks key before init.
index.html Makes telemetry opt-in and adjusts logging around initialization.
.github/workflows/main.yml Minor workflow cleanup/rename; keeps JS syntax validation + build step.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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