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 adapter telemetry to snowplow event. #10859

Merged
merged 13 commits into from
Oct 28, 2024
Merged

Conversation

VersusFacit
Copy link
Contributor

Resolves dbt-labs/dbt-adapters#301

Solution

We propose exposing a method on the base adapter that will use existing snowplow infrastructure for tracking user statistics for any adapter.

We designed the json schema and event data to make it easy for us to add additional per-adapter information as use-cases emerge.

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.

@VersusFacit VersusFacit self-assigned this Oct 16, 2024
@VersusFacit VersusFacit requested a review from a team as a code owner October 16, 2024 10:24
@cla-bot cla-bot bot added the cla:yes label Oct 16, 2024
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

1 similar comment
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@VersusFacit VersusFacit added the Skip Changelog Skips GHA to check for changelog file label Oct 16, 2024
Copy link

codecov bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.46%. Comparing base (3d96b4e) to head (03dfd41).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10859      +/-   ##
==========================================
- Coverage   89.15%   86.46%   -2.70%     
==========================================
  Files         183      183              
  Lines       23443    23469      +26     
==========================================
- Hits        20901    20292     -609     
- Misses       2542     3177     +635     
Flag Coverage Δ
integration 86.46% <100.00%> (+0.02%) ⬆️
unit ?

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

Components Coverage Δ
Unit Tests 86.46% <100.00%> (-2.70%) ⬇️
Integration Tests 86.46% <100.00%> (+0.02%) ⬆️

core/dbt/task/run.py Outdated Show resolved Hide resolved
core/dbt/task/run.py Outdated Show resolved Hide resolved
@@ -133,6 +139,7 @@ def track_model_run(index, num_nodes, run_model_result):
"contract_enforced": contract_enforced,
"access": access,
"versioned": versioned,
"adapter_info": asdict(adapter_info),
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 considered that this should be something JSON safe, which a Python dict is 🫡

core/dbt/task/run.py Outdated Show resolved Hide resolved
core/dbt/tracking.py Outdated Show resolved Hide resolved
@VersusFacit VersusFacit merged commit 4d4b05e into main Oct 28, 2024
59 of 60 checks passed
@VersusFacit VersusFacit deleted the ADAP-301/add-adapter-telemetry branch October 28, 2024 21:21
QMalcolm added a commit that referenced this pull request Oct 30, 2024
In #10859 we started using the
`get_adapter_run_info` method provided by `dbt-adapters`. However that
function is only available in dbt-adapters >= 1.8.0. Thus 1.8.0 is our
new minimum for dbt-adapters.
QMalcolm added a commit that referenced this pull request Oct 30, 2024
* Bump minimum dbt-adpaters to 1.8.0

In #10859 we started using the
`get_adapter_run_info` method provided by `dbt-adapters`. However that
function is only available in dbt-adapters >= 1.8.0. Thus 1.8.0 is our
new minimum for dbt-adapters.

* Add changie doc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes Skip Changelog Skips GHA to check for changelog file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Adapters Model Configuration Snowplow Tracking
4 participants