-
Notifications
You must be signed in to change notification settings - Fork 668
DYN-9695: Add analytics support for external components #16597
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
Conversation
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.
Pull Request Overview
This PR adds two new analytics categories to track events for MCP (Model Context Protocol) Extension/Server operations and Dynamo Assistant operations. This enables better monitoring and analytics collection for these newer Dynamo features.
- Adds
MCPOperationscategory for MCP-related analytics events - Adds
AssistantOperationscategory for DynamoAssistant analytics events
benglin
left a comment
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.
Thanks for doing this, @kalunkuo! LGTM! 🚀
src/NodeServices/IAnalyticsClient.cs
Outdated
| /// <summary> | ||
| /// Events Category related to DynamoAssistant operations | ||
| /// </summary> | ||
| AssistantOperations |
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.
Hmm… having Dynamo services be aware of external components like MCP and Assistant does seem a bit unusual. But since Analytics.TrackEvent is strongly typed with the Categories enum, there’s not much we can do about it right now (unless we introduce something like IAnalyticsClient.TrackEvent(Actions action, string category, ...), since it ultimately gets converted to a string anyway).
Just some food for thought.
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.
That's a good idea!
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.
On second thought, @kalunkuo, I’m not sure if this was a finalized decision. Instead of doing this:
Analytics.TrackEvent(Actions.Run, Categories.MCPOperations, $"MCP.ToolCalled_{name}", success ? 1 : 0);
// Equivalent: TrackEvent("Run", "MCPOperations", "MCP.ToolCalled_createNodes", 1);
Would it make more sense to do this instead (by introducing Actions.CallTool, etc. and Categories.MCP)?
Analytics.TrackEvent(Actions.CallTool, Categories.MCP, name, 1); // New action 'CallTool'
Analytics.TrackEvent(Actions.Handle, Categories.MCP, method); // New action 'Handle'
Analytics.TrackEvent(Actions.Start, Categories.MCP, "ServerInitialized", port); // Existing action 'Start'
This might make data segmentation and grouping more intuitive -- we wouldn’t need to parse out createNodes from ToolCalled_createNodes in the analytics portal. Just curious what the team’s thoughts are; if a decision’s already been made, that’s totally fine by me 🙂
I would agree, and prefer this approach, also I see the last argument takes in an integer, we can use it to record how many nodes were created/deleted/connected, since these tools can process batch request. |
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.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9695
johnpierson
left a comment
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.
very awesome. thanks for the comments @benglin and @zeusongit. I think this implementation is clean. 👍
aparajit-pratap
left a comment
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.
@kalunkuo, I think that the DaaS team was also planning on adding analytics to their service. Did you check with @mjkkirschner for any of their requirements?
Let me confirm with him! |
Purpose
Add analytics support for external components like MCP and Dynamo Assistant operations
Declarations
Check these if you believe they are true
Release Notes
This PR introduces a new
TrackEventoverload that accepts a string-based category, enabling external components to log analytics events without relying on the predefined Categories enum.Reviewers
@DynamoDS/synapse
@DynamoDS/eidos
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of