Skip to content

Conversation

@kalunkuo
Copy link
Contributor

@kalunkuo kalunkuo commented Oct 15, 2025

Purpose

Add analytics support for external components like MCP and Dynamo Assistant operations

  • Added new method in IAnalyticsClient, Analytics, and DynamoAnalyticsClient.
  • Supports optional description and metric value.
  • Maintains compatibility with existing analytics tracking behavior.

Declarations

Check these if you believe they are true

Release Notes

This PR introduces a new TrackEvent overload 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

@kalunkuo kalunkuo requested review from a team and Copilot October 15, 2025 03:14
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

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 MCPOperations category for MCP-related analytics events
  • Adds AssistantOperations category for DynamoAssistant analytics events

Copy link
Contributor

@benglin benglin left a 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! 🚀

/// <summary>
/// Events Category related to DynamoAssistant operations
/// </summary>
AssistantOperations
Copy link
Contributor

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.

Copy link
Contributor Author

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!

Copy link
Contributor

@benglin benglin left a 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 🙂

@zeusongit
Copy link
Contributor

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.
Tool Failure should have a separate log.

@kalunkuo kalunkuo changed the title Add MCPOperations and AssistantOperations to analytics categories DYN-9695: Add MCPOperations and AssistantOperations to analytics categories Oct 15, 2025
Copy link

@github-actions github-actions bot left a 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

Copy link
Member

@johnpierson johnpierson left a 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. 👍

@kalunkuo kalunkuo changed the title DYN-9695: Add MCPOperations and AssistantOperations to analytics categories DYN-9695: Update analytics for external components Oct 16, 2025
@kalunkuo kalunkuo changed the title DYN-9695: Update analytics for external components DYN-9695: Add analytics support for external components Oct 16, 2025
@kalunkuo kalunkuo merged commit e9ada9b into DynamoDS:master Oct 16, 2025
33 checks passed
Copy link
Contributor

@aparajit-pratap aparajit-pratap left a 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?

@kalunkuo
Copy link
Contributor Author

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants