@@ -8,49 +8,46 @@ export type TelemetryBoolSet = "true" | "false";
8
8
/**
9
9
* Base interface for all events
10
10
*/
11
- export interface Event {
11
+ export type TelemetryEvent < T > = {
12
12
timestamp : string ;
13
13
source : "mdbmcp" ;
14
- properties : Record < string , unknown > ;
15
- }
16
-
17
- export interface BaseEvent extends Event {
18
- properties : CommonProperties & {
14
+ properties : T & {
19
15
component : string ;
20
16
duration_ms : number ;
21
17
result : TelemetryResult ;
22
18
category : string ;
23
- } & Event [ "properties" ] ;
24
- }
19
+ } ;
20
+ } ;
21
+
22
+ export type BaseEvent = TelemetryEvent < unknown > ;
25
23
26
24
/**
27
25
* Interface for tool events
28
26
*/
29
- export interface ToolEvent extends BaseEvent {
30
- properties : {
31
- command : string ;
32
- error_code ?: string ;
33
- error_type ?: string ;
34
- project_id ?: string ;
35
- org_id ?: string ;
36
- cluster_name ?: string ;
37
- is_atlas ?: boolean ;
38
- } & BaseEvent [ "properties" ] ;
39
- }
27
+ export type ToolEventProperties = {
28
+ command : string ;
29
+ error_code ?: string ;
30
+ error_type ?: string ;
31
+ project_id ?: string ;
32
+ org_id ?: string ;
33
+ cluster_name ?: string ;
34
+ is_atlas ?: boolean ;
35
+ } ;
40
36
37
+ export type ToolEvent = TelemetryEvent < ToolEventProperties > ;
41
38
/**
42
39
* Interface for server events
43
40
*/
44
- export interface ServerEvent extends BaseEvent {
45
- properties : {
46
- command : ServerCommand ;
47
- reason ?: string ;
48
- startup_time_ms ?: number ;
49
- runtime_duration_ms ?: number ;
50
- read_only_mode ?: boolean ;
51
- disabled_tools ?: string [ ] ;
52
- } & BaseEvent [ "properties" ] ;
53
- }
41
+ export type ServerEventProperties = {
42
+ command : ServerCommand ;
43
+ reason ?: string ;
44
+ startup_time_ms ?: number ;
45
+ runtime_duration_ms ?: number ;
46
+ read_only_mode ?: boolean ;
47
+ disabled_tools ?: string [ ] ;
48
+ } ;
49
+
50
+ export type ServerEvent = TelemetryEvent < ServerEventProperties > ;
54
51
55
52
/**
56
53
* Interface for static properties, they can be fetched once and reused.
@@ -69,6 +66,7 @@ export type CommonStaticProperties = {
69
66
* Common properties for all events that might change.
70
67
*/
71
68
export type CommonProperties = {
69
+ device_id ?: string ;
72
70
mcp_client_version ?: string ;
73
71
mcp_client_name ?: string ;
74
72
config_atlas_auth ?: TelemetryBoolSet ;
0 commit comments