@@ -44,6 +44,7 @@ class Telemetry(metaclass=SingletonMetaClass):
44
44
with opt_in_out script.
45
45
:param disable_in_ci: Turn off telemetry for CI jobs.
46
46
"""
47
+
47
48
def __init__ (self , app_name : str = None , app_version : str = None , tid : str = None ,
48
49
backend : [str , None ] = 'ga' , enable_opt_in_dialog = True , disable_in_ci = False ):
49
50
# The case when instance is already configured
@@ -56,7 +57,7 @@ def __init__(self, app_name: str = None, app_version: str = None, tid: str = Non
56
57
self .init (app_name , app_version , tid , backend , enable_opt_in_dialog , disable_in_ci )
57
58
58
59
def init (self , app_name : str = None , app_version : str = None , tid : str = None ,
59
- backend : [str , None ] = 'ga' , enable_opt_in_dialog = True , disable_in_ci = False ):
60
+ backend : [str , None ] = 'ga' , enable_opt_in_dialog = True , disable_in_ci = False ):
60
61
opt_in_checker = OptInChecker ()
61
62
opt_in_check_result = opt_in_checker .check (enable_opt_in_dialog , disable_in_ci )
62
63
if enable_opt_in_dialog :
@@ -168,21 +169,24 @@ def force_shutdown(self, timeout: float = 1.0):
168
169
self .sender .force_shutdown (timeout )
169
170
170
171
def send_event (self , event_category : str , event_action : str , event_label : str , event_value : int = 1 ,
171
- force_send = False , ** kwargs ):
172
+ app_name = None , app_version = None , force_send = False , ** kwargs ):
172
173
"""
173
174
Send single event.
174
175
175
176
:param event_category: category of the event
176
177
:param event_action: action of the event
177
178
:param event_label: the label associated with the action
178
179
:param event_value: the integer value corresponding to this label
180
+ :param app_name: application name
181
+ :param app_version: application version
179
182
:param force_send: forces to send event ignoring the consent value
180
183
:param kwargs: additional parameters
181
184
:return: None
182
185
"""
183
186
if self .consent or force_send :
184
187
self .sender .send (self .backend , self .backend .build_event_message (event_category , event_action , event_label ,
185
- event_value , ** kwargs ))
188
+ event_value , app_name , app_version ,
189
+ ** kwargs ))
186
190
187
191
def start_session (self , category : str , ** kwargs ):
188
192
"""
0 commit comments