Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(telemetry): Adding Scarf based telemetry to Superset #26011

Merged
merged 31 commits into from
Dec 14, 2023
Merged

Conversation

rusackas
Copy link
Member

@rusackas rusackas commented Nov 17, 2023

SUMMARY

This PR does a handful of things:

  • Adds the Scarf pixel to Superset (as approved by SIP) via a new TelemetryPixel component
  • Adds the ENABLE_TELEMETRY feature flag
  • Adds basic tests for the above
  • Bumps react types to support the no-referrer-when-downgrade
  • Bumps the npm version... not that I intended to, but it keeps coming along for the ride
  • Fixes the shim for frontend tests, which had a weird incompatibility with certain node 18.x versions, throwing a TypeError: Cannot redefine property: window error

TODO:

  • Get the pixel to load via Scarf gateway so that url params (version/sha/build) are reliably captured
  • Feature flag documentation
  • Turn off more Scarf stuff with this flag?

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

RTL tests for the new component with FF on and off should pass. Run it, and have any PMC member check the Scarf data for proper capture.

ADDITIONAL INFORMATION

  • Has associated issue: [SIP-107] Proposal for Telemetry Pixel in Apache Superset #25639
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d20f96f) 69.10% compared to head (f5fae76) 69.41%.
Report is 60 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #26011      +/-   ##
==========================================
+ Coverage   69.10%   69.41%   +0.31%     
==========================================
  Files        1940     1946       +6     
  Lines       75869    78721    +2852     
  Branches     8445     8935     +490     
==========================================
+ Hits        52427    54642    +2215     
- Misses      21267    21772     +505     
- Partials     2175     2307     +132     
Flag Coverage Δ
hive 53.71% <ø> (+0.03%) ⬆️
javascript 56.71% <100.00%> (+0.43%) ⬆️
mysql 78.51% <ø> (+0.35%) ⬆️
postgres 78.61% <ø> (+0.35%) ⬆️
presto 53.67% <ø> (+0.03%) ⬆️
python 83.17% <ø> (+0.22%) ⬆️
sqlite 77.13% <ø> (+0.22%) ⬆️
unit 55.69% <ø> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rusackas rusackas marked this pull request as ready for review November 28, 2023 21:07
@michael-s-molina
Copy link
Member

The John ❤️ JS commit cracked me up! 🤣

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM with a minor nit, looking forward to this 👍

superset-frontend/src/components/TelemetryPixel/index.tsx Outdated Show resolved Hide resolved
Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

LGTM

@rusackas rusackas merged commit 8437a23 into master Dec 14, 2023
56 checks passed
@rusackas rusackas deleted the scarf-pixel branch December 14, 2023 19:08
@michael-s-molina michael-s-molina added the v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch label Dec 14, 2023
Comment on lines +48 to +49
return process.env.SCARF_ANALYTICS === 'false' ||
process.env.SCARF_ANALYTICS === 'false' ? null : (
Copy link
Member

Choose a reason for hiding this comment

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

process.env.SCARF_ANALYTICS === 'false' ||
    process.env.SCARF_ANALYTICS === 'false'

Just noticed this is duplicated.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeesh... I thought I nabbed that. Will open a PR to clean up... Especially if this does not have the intended effect now. Surprised some linting rule doesn't spot this kind of thing.

@michael-s-molina michael-s-molina removed the v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch label Dec 14, 2023
sadpandajoe added a commit to preset-io/superset that referenced this pull request Dec 22, 2023
sadpandajoe added a commit to preset-io/superset that referenced this pull request Jan 3, 2024
sadpandajoe added a commit to preset-io/superset that referenced this pull request Jan 13, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.0.0 labels Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 4.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants