-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Replace tracking events: project_id
, adapter_info
#7231
Merged
iknox-fa
merged 5 commits into
main
from
iknox/CT-1368-1368-GH-6097-6098-replace-tracking-events
Mar 29, 2023
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Fixes | ||
body: Recreates missing tracking events | ||
time: 2023-03-27T19:38:50.657292-05:00 | ||
custom: | ||
Author: iknox-fa | ||
Issue: 6097 6098 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,20 +30,22 @@ | |
|
||
COLLECTOR_URL = "fishtownanalytics.sinter-collect.com" | ||
COLLECTOR_PROTOCOL = "https" | ||
DBT_INVOCATION_ENV = "DBT_INVOCATION_ENV" | ||
|
||
INVOCATION_SPEC = "iglu:com.dbt/invocation/jsonschema/1-0-2" | ||
PLATFORM_SPEC = "iglu:com.dbt/platform/jsonschema/1-0-0" | ||
RUN_MODEL_SPEC = "iglu:com.dbt/run_model/jsonschema/1-0-2" | ||
INVOCATION_ENV_SPEC = "iglu:com.dbt/invocation_env/jsonschema/1-0-0" | ||
PACKAGE_INSTALL_SPEC = "iglu:com.dbt/package_install/jsonschema/1-0-0" | ||
RPC_REQUEST_SPEC = "iglu:com.dbt/rpc_request/jsonschema/1-0-1" | ||
ADAPTER_INFO_SPEC = "iglu:com.dbt/adapter_info/jsonschema/1-0-0" | ||
DEPRECATION_WARN_SPEC = "iglu:com.dbt/deprecation_warn/jsonschema/1-0-0" | ||
LOAD_ALL_TIMING_SPEC = "iglu:com.dbt/load_all_timing/jsonschema/1-0-3" | ||
RESOURCE_COUNTS = "iglu:com.dbt/resource_counts/jsonschema/1-0-0" | ||
EXPERIMENTAL_PARSER = "iglu:com.dbt/experimental_parser/jsonschema/1-0-0" | ||
INVOCATION_ENV_SPEC = "iglu:com.dbt/invocation_env/jsonschema/1-0-0" | ||
INVOCATION_SPEC = "iglu:com.dbt/invocation/jsonschema/1-0-2" | ||
LOAD_ALL_TIMING_SPEC = "iglu:com.dbt/load_all_timing/jsonschema/1-0-3" | ||
PACKAGE_INSTALL_SPEC = "iglu:com.dbt/package_install/jsonschema/1-0-0" | ||
Comment on lines
+38
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. alphabetical order, nice 👍 |
||
PARTIAL_PARSER = "iglu:com.dbt/partial_parser/jsonschema/1-0-1" | ||
PLATFORM_SPEC = "iglu:com.dbt/platform/jsonschema/1-0-0" | ||
PROJECT_ID_SPEC = "iglu:com.dbt/project_id/jsonschema/1-0-0" | ||
RESOURCE_COUNTS = "iglu:com.dbt/resource_counts/jsonschema/1-0-0" | ||
RPC_REQUEST_SPEC = "iglu:com.dbt/rpc_request/jsonschema/1-0-1" | ||
RUNNABLE_TIMING = "iglu:com.dbt/runnable/jsonschema/1-0-0" | ||
DBT_INVOCATION_ENV = "DBT_INVOCATION_ENV" | ||
RUN_MODEL_SPEC = "iglu:com.dbt/run_model/jsonschema/1-0-2" | ||
|
||
|
||
class TimeoutEmitter(Emitter): | ||
|
@@ -210,6 +212,32 @@ def track(user, *args, **kwargs): | |
fire_event(SendEventFailure()) | ||
|
||
|
||
def track_project_id(options): | ||
assert active_user is not None, "Cannot track project_id when active user is None" | ||
context = [SelfDescribingJson(PROJECT_ID_SPEC, options)] | ||
|
||
track( | ||
active_user, | ||
category="dbt", | ||
action="project_id", | ||
label=get_invocation_id(), | ||
context=context, | ||
) | ||
|
||
|
||
def track_adapter_info(options): | ||
assert active_user is not None, "Cannot track adapter_info when active user is None" | ||
context = [SelfDescribingJson(ADAPTER_INFO_SPEC, options)] | ||
|
||
track( | ||
active_user, | ||
category="dbt", | ||
action="adapter_info", | ||
label=get_invocation_id(), | ||
context=context, | ||
) | ||
|
||
|
||
def track_invocation_start(invocation_context): | ||
data = {"progress": "start", "result_type": None, "result": None} | ||
data.update(invocation_context) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The events outlined here exist to support "very very old versions of dbt-core, which expected to look directly at the HEAD branch of this github repo to find validation schemas". | ||
|
||
Eventually these should go away (see https:/dbt-labs/dbt-core/issues/7228) | ||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you haven't already, I think we'll need to add these two new validation schemas to https:/dbt-labs/iglu.sinter-collect.com
Doc: https://www.notion.so/dbtlabs/Add-new-metrics-to-tracking-in-dbt-3484cc31b8f449dfa2e960d2bbb15afe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeppers.
https:/dbt-labs/iglu.sinter-collect.com/pull/67 although there seems to be an issue with circle CI we'll need to fix if we want to enforce the checks there.