Skip to content

feat: core telemetry functionality #87

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

Merged
merged 52 commits into from
Apr 23, 2025
Merged

feat: core telemetry functionality #87

merged 52 commits into from
Apr 23, 2025

Conversation

blva
Copy link
Collaborator

@blva blva commented Apr 17, 2025

  • adds telemetry framework
  • adds auth and unauth telemetry emission
  • adds caching if events can't be published
  • adds support to disable telemetry

next:

  • add more events
  • add unit tests
  • check if we can add int tests

@blva blva changed the title Telemetry draft: telemetry Apr 17, 2025
@blva
Copy link
Collaborator Author

blva commented Apr 22, 2025

note: this is a draft, will do some cleanup and change tests, looking for feedback on the code architecture

@coveralls
Copy link
Collaborator

coveralls commented Apr 22, 2025

Pull Request Test Coverage Report for Build 14622981460

Details

  • 53 of 92 (57.61%) changed or added relevant lines in 8 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-3.2%) to 75.182%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/telemetry/eventCache.ts 8 13 61.54%
src/common/atlas/apiClient.ts 3 15 20.0%
src/telemetry/telemetry.ts 16 38 42.11%
Totals Coverage Status
Change from base Build 14619684116: -3.2%
Covered Lines: 624
Relevant Lines: 775

💛 - Coveralls

Copy link
Collaborator

@gagik gagik left a comment

Choose a reason for hiding this comment

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

Great start 🚀

src/config.ts Outdated
Comment on lines 48 to 49
version: SERVER_VERSION,
mcpServerName: SERVER_NAME,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd move this to MACHINE_METADATA and maybe get rid of individual global constants

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We use it in the client though, so wanted to keep it here where is common

Copy link
Collaborator

Choose a reason for hiding this comment

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

it's a bit confusing for me as it is inside a configuration, which to me means it is configurable

@blva blva requested a review from gagik April 23, 2025 14:56
*/
export interface ToolEvent extends BaseEvent {
properties: {
command: string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

right now we use this as the toolname, we also have resources, I think this should contain "tool" | "resource" | "prompt" and another one maybe called tool_name

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, we should have a category property where we can set "tool" but the idea is to keep command for all based on the tracking plan

Copy link
Collaborator

Choose a reason for hiding this comment

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

But how can you tell which is which?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

category: "tool"
command: "connect" | "list-projects" ...

Copy link
Collaborator

@gagik gagik left a comment

Choose a reason for hiding this comment

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

Awesome work 🚀 one last note about Telemetry being initialized in every tool that may be worth addressing

@blva blva requested a review from fmenezes April 23, 2025 16:47
@blva blva merged commit 4702e00 into main Apr 23, 2025
6 checks passed
@blva blva deleted the telemetry branch April 23, 2025 17:23
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.

4 participants