Skip to content

Harden static telemetry bootstrap and remove committed Kubiks key - #35

Merged
phuquoc81 merged 4 commits into
codex/fix-issue-in-fastcash-actionsfrom
copilot/fix-issues-copilot-agent
Mar 14, 2026
Merged

Harden static telemetry bootstrap and remove committed Kubiks key#35
phuquoc81 merged 4 commits into
codex/fix-issue-in-fastcash-actionsfrom
copilot/fix-issues-copilot-agent

Conversation

Copilot AI commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

The Copilot-added telemetry integration introduced static-site regressions and committed a Kubiks credential into the repo. This change narrows telemetry startup to explicit opt-in and moves credential injection to runtime-only configuration.

  • Telemetry bootstrap

    • Gate otel-init.js behind explicit opt-in in index.html
    • Default app load no longer pulls telemetry code for normal static launches
    • Telemetry now starts only when both enablement and a runtime key are present
  • Credential handling

    • Remove the committed Kubiks key from browser code
    • Replace browser-side process.env usage with runtime lookup from:
      • ?kubiksKey=...
      • localStorage['fastcash.telemetry.kubiksKey']
  • Initialization behavior

    • Keep otel-init.js safe for direct import in the browser
    • Skip exporter registration cleanly when no runtime key is configured
    • Limit console span exporter usage to local debugging conditions
  • Documentation

    • Update TELEMETRY_SETUP.md to describe the static-app flow accurately
    • Document the required opt-in flag and runtime key pairing
    • Remove guidance that implied committed or build-time browser secrets
<script type="module">
  const params = new URLSearchParams(window.location.search);
  const telemetryEnabled =
    params.get('telemetry') === '1' ||
    window.localStorage.getItem('fastcash.telemetry') === 'enabled';

  if (telemetryEnabled) {
    import('./otel-init.js').catch(err =>
      console.error('Failed to initialize OpenTelemetry:', err)
    );
  }
</script>
  • UI
    • No functional UI redesign; app behavior remains unchanged for default users while telemetry becomes an explicit runtime opt-in

Fastcash UI verification


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 3 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>
Co-authored-by: phuquoc81 <51638662+phuquoc81@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues from Copilot agent using GPT 5.4 Harden static telemetry bootstrap and remove committed Kubiks key Mar 14, 2026
Copilot AI requested a review from phuquoc81 March 14, 2026 22:02
@phuquoc81
phuquoc81 marked this pull request as ready for review March 14, 2026 23:59
Copilot AI review requested due to automatic review settings March 14, 2026 23:59
@phuquoc81
phuquoc81 changed the base branch from Main to codex/fix-issue-in-fastcash-actions March 14, 2026 23:59
@phuquoc81
phuquoc81 merged commit 63e6b59 into codex/fix-issue-in-fastcash-actions Mar 14, 2026
4 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

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 hardens the static-site OpenTelemetry bootstrap by making telemetry explicitly opt-in at runtime and removing the previously committed Kubiks credential from browser code.

Changes:

  • Gate otel-init.js loading behind an explicit telemetry enablement flag in index.html.
  • Move Kubiks key lookup to runtime-only configuration via query param and/or localStorage, and skip exporter registration when missing.
  • Update TELEMETRY_SETUP.md to describe the new opt-in + runtime-key flow and remove build-time secret guidance.

Reviewed changes

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

File Description
otel-init.js Reads Kubiks key at runtime, avoids committed secrets, and conditionally registers exporters/provider.
index.html Dynamically imports telemetry init only when telemetry is explicitly enabled.
TELEMETRY_SETUP.md Updates setup documentation for the opt-in runtime configuration model.

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

Comment thread index.html
Comment thread otel-init.js
Comment thread TELEMETRY_SETUP.md
Comment thread TELEMETRY_SETUP.md
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