diff --git a/.changes/unreleased/Features-20240923-155335.yaml b/.changes/unreleased/Features-20240923-155335.yaml new file mode 100644 index 00000000000..dc885a2c3b2 --- /dev/null +++ b/.changes/unreleased/Features-20240923-155335.yaml @@ -0,0 +1,6 @@ +kind: Features +body: Track incremental_strategy as part of model_run tracking event +time: 2024-09-23T15:53:35.898928+01:00 +custom: + Author: michelleark + Issue: "10761" diff --git a/core/dbt/task/run.py b/core/dbt/task/run.py index e6e380b4063..d3389749ab5 100644 --- a/core/dbt/task/run.py +++ b/core/dbt/task/run.py @@ -116,10 +116,12 @@ def track_model_run(index, num_nodes, run_model_result): access = node.access.value if node.access is not None else None contract_enforced = node.contract.enforced versioned = True if node.version else False + incremental_strategy = node.config.incremental_strategy else: access = None contract_enforced = False versioned = False + incremental_strategy = None tracking.track_model_run( { "invocation_id": invocation_id, @@ -130,6 +132,7 @@ def track_model_run(index, num_nodes, run_model_result): "run_skipped": run_model_result.status == NodeStatus.Skipped, "run_error": run_model_result.status == NodeStatus.Error, "model_materialization": node.get_materialization(), + "model_incremental_strategy": incremental_strategy, "model_id": utils.get_hash(node), "hashed_contents": utils.get_hashed_contents(node), "timing": [t.to_dict(omit_none=True) for t in run_model_result.timing], diff --git a/core/dbt/tracking.py b/core/dbt/tracking.py index 7d648d86e03..e34b80bf6cd 100644 --- a/core/dbt/tracking.py +++ b/core/dbt/tracking.py @@ -50,7 +50,7 @@ RESOURCE_COUNTS = "iglu:com.dbt/resource_counts/jsonschema/1-0-1" RPC_REQUEST_SPEC = "iglu:com.dbt/rpc_request/jsonschema/1-0-1" RUNNABLE_TIMING = "iglu:com.dbt/runnable/jsonschema/1-0-0" -RUN_MODEL_SPEC = "iglu:com.dbt/run_model/jsonschema/1-0-3" +RUN_MODEL_SPEC = "iglu:com.dbt/run_model/jsonschema/1-0-4" PLUGIN_GET_NODES = "iglu:com.dbt/plugin_get_nodes/jsonschema/1-0-0" SNOWPLOW_TRACKER_VERSION = Version(snowplow_version)