Skip to content

Conversation

@paula-stacho
Copy link
Collaborator

Description

Another small addition to DM telemetry - relationship_inference_phase_ms. The other two phases overlap.

@paula-stacho paula-stacho requested a review from a team as a code owner February 10, 2026 10:49
@paula-stacho paula-stacho added no release notes Fix or feature not for release notes no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) labels Feb 10, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new telemetry metric to Data Modeling analysis events to capture just the relationship inference phase duration.

Changes:

  • Extends Data Modeling telemetry event payloads with relationship_inference_phase_ms (optional).
  • Measures and propagates relationship inference phase duration from analyzeCollections() into tracked events for create/redo flows.
  • Updates inline event documentation to describe the new metric.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
packages/compass-telemetry/src/telemetry-events.ts Adds optional relationship_inference_phase_ms to multiple Data Modeling telemetry event payload types and documents the metric.
packages/compass-data-modeling/src/store/analysis-process.ts Tracks relationship inference duration inside analyzeCollections() and includes it in telemetry for diagram creation / re-analysis outcomes.

Comment on lines 296 to 310
@@ -305,6 +306,8 @@ export function startAnalysis(
options,
})
);
const { collections, relations } = result;
relationsInferencePhaseMs = result.relationsInferencePhaseMs;
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

relationship_inference_phase_ms will only be populated if analyzeCollections() resolves successfully. If the analysis fails/cancels during relationship inference (or earlier inside analyzeCollections()), relationsInferencePhaseMs remains undefined, even though the telemetry event types now allow reporting it for Failed/Cancelled events. If the intent is to capture inference duration for those outcomes too, consider capturing the inference timing in analyzeCollections() via a try/finally around the inference block and surfacing it on failure (e.g., attach to the thrown error, dispatch a dedicated action containing the duration, or move telemetry for failure/cancel to where the duration is known).

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I kinda agree with this. Do we really need relationsInferencePhaseMs in failed/cancelled events?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah right. yeah I'll remove it, I was following the analysis_time_ms and it didn't hit me. thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

actually.. it might be nice to have it (if available), I'll look into including the number in case of failures instead

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

for example if the user waited for 45 mins and then cancelled the DM creation - and the last 40 mins have been relationships.. that'd be good for us to know.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Kind of. After its available, we only await on getInitialLayout.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Feel free to merge as is

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated to ensure the failures also have the last phase time

@paula-stacho paula-stacho force-pushed the relationship_infer_time branch from 979cfe1 to 3853284 Compare February 11, 2026 14:27
@paula-stacho paula-stacho merged commit 10bc2ff into main Feb 12, 2026
80 of 81 checks passed
@paula-stacho paula-stacho deleted the relationship_infer_time branch February 12, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no release notes Fix or feature not for release notes no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants