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

Add Snowplow tracking for behavior flags #10721

Merged
merged 8 commits into from
Sep 18, 2024
Merged

Conversation

mikealfare
Copy link
Contributor

@mikealfare mikealfare commented Sep 16, 2024

resolves #10552

Problem

We need to track deprecated states of behavior flags in Snowplow so that we get telemetry for both Cloud and Core users.

Solution

Handle the event that is already firing for logging with a callback that tracks the event in Snowplow.

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.
  • This PR includes type annotations for new and modified functions.

@cla-bot cla-bot bot added the cla:yes label Sep 16, 2024
@mikealfare mikealfare changed the title Add Behavior flags snowplow Add Snowplow tracking for behavior flags Sep 16, 2024
@mikealfare mikealfare self-assigned this Sep 16, 2024
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.96%. Comparing base (ab500a9) to head (1e20bd8).
Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10721      +/-   ##
==========================================
+ Coverage   88.90%   88.96%   +0.05%     
==========================================
  Files         180      181       +1     
  Lines       22785    22968     +183     
==========================================
+ Hits        20257    20433     +176     
- Misses       2528     2535       +7     
Flag Coverage Δ
integration 86.14% <80.00%> (+<0.01%) ⬆️
unit 62.40% <100.00%> (+0.03%) ⬆️

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

Components Coverage Δ
Unit Tests 62.40% <100.00%> (+0.03%) ⬆️
Integration Tests 86.14% <80.00%> (+<0.01%) ⬆️

@mikealfare mikealfare marked this pull request as ready for review September 16, 2024 23:17
@mikealfare mikealfare requested a review from a team as a code owner September 16, 2024 23:17
@mikealfare
Copy link
Contributor Author

@cla-bot check

Copy link

cla-bot bot commented Sep 16, 2024

The cla-bot has been summoned, and re-checked this pull request!

@@ -68,6 +70,7 @@ def setup_event_logger(flags, callbacks: List[Callable[[EventMsg], None]] = [])
make_log_dir_if_missing(flags.LOG_PATH)
event_manager = get_event_manager()
event_manager.callbacks = callbacks.copy()
add_callback_to_manager(track_behavior_deprecation_warn)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we want snowplow tracking for behavior flags regardless of the log setting. It should only be turned off when the user turns off tracking. However, this is handled outside of the event manager. The downside is that tests need to be updated for this, though it appears to only be one test.

@mikealfare
Copy link
Contributor Author

I think these tests are failing due to updates in dbt-common on which this is dependent. I'll rerun the tests once that PR is merged; it's currently queued.

@mikealfare mikealfare merged commit d182d06 into main Sep 18, 2024
62 checks passed
@mikealfare mikealfare deleted the behavior-flags-snowplow branch September 18, 2024 19:09
peterallenwebb pushed a commit that referenced this pull request Sep 20, 2024
* add behavior deprecation snowplow callback
* update tests for new callback
* update test input with the new required field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Behavior Flags] Track behavior flags in Snowplow
2 participants