notice
This is unreleased documentation for Rasa Documentation Main/Unreleased version.
For the latest released documentation, see the latest version (3.x).
rasa.telemetry
print_telemetry_reporting_info
Print telemetry information to std out.
is_telemetry_enabled
Check if telemetry is enabled either in configuration or environment.
Returns:
True
, if telemetry is enabled, False
otherwise.
initialize_telemetry
Read telemetry configuration from the user's Rasa config file in $HOME.
Creates a default configuration if no configuration exists.
Returns:
True
, if telemetry is enabled, False
otherwise.
ensure_telemetry_enabled
Function decorator for telemetry functions that ensures telemetry is enabled.
WARNING: does not work as a decorator for async generators.
Arguments:
f
- function to call if telemetry is enabled
Returns:
Return wrapped function
telemetry_write_key
Read the Segment write key from the segment key text file.
The segment key text file should by present only in wheel/sdist packaged versions of Rasa Open Source. This avoids running telemetry locally when developing on Rasa or when running CI builds.
In local development, this should always return None
to avoid logging telemetry.
Returns:
Segment write key, if the key file was present.
sentry_write_key
Read the sentry write key from the sentry key text file.
Returns:
Sentry write key, if the key file was present.
segment_request_header
Use a segment write key to create authentication headers for the segment API.
Arguments:
write_key
- Authentication key for segment.
Returns:
Authentication headers for segment.
segment_request_payload
Compose a valid payload for the segment API.
Arguments:
distinct_id
- Unique telemetry ID.event_name
- Name of the event.properties
- Values to report along the event.context
- Context information about the event.
Returns:
Valid segment payload.
in_continuous_integration
Returns True
if currently running inside a continuous integration context.
print_telemetry_event
Print a telemetry events payload to the commandline.
Arguments:
payload
- payload of the event
with_default_context_fields
Return a new context dictionary with default and provided field values merged.
The default fields contain only the OS information for now.
Arguments:
context
- Context information about the event.
Returns:
A new context.
get_telemetry_id
Return the unique telemetry identifier for this Rasa Open Source install.
The identifier can be any string, but it should be a UUID.
Returns:
The identifier, if it is configured correctly.
toggle_telemetry_reporting
Write to the configuration if telemetry tracking should be enabled or disabled.
Arguments:
is_enabled
-True
if the telemetry reporting should be enabled,False
otherwise.
filter_errors
Filter errors.
Arguments:
event
- event to be logged to sentryhint
- some hinting information sent alongside of the event
Returns:
the event without any sensitive / PII data or None
if the event constitutes
an ImportError
which should be discarded.
before_send
Strips the sensitive data and filters errors before sending to sentry.
Arguments:
event
- event to be logged to sentry_unused_hint
- some hinting information sent alongside of the event
Returns:
the event without any sensitive / PII data or None
if the event should
be discarded.
strip_sensitive_data_from_sentry_event
Remove any sensitive data from the event (e.g. path names).
Arguments:
event
- event to be logged to sentry_unused_hint
- some hinting information sent alongside of the event
Returns:
the event without any sensitive / PII data or None
if the event should
be discarded.
initialize_error_reporting
Sets up automated error reporting.
Exceptions are reported to sentry. We avoid sending any metadata (local
variables, paths, ...) to make sure we don't compromise any data. Only the
exception and its stacktrace is logged and only if the exception origins
from the rasa
package.
track_model_training
Track a model training started.
WARNING: since this is a generator, it can't use the ensure telemetry decorator. We need to manually add these checks here. This can be fixed as soon as we drop python 3.6 support.
Arguments:
training_data
- Training data used for the training.model_type
- Specifies the type of training, should be either "rasa", "core" or "nlu".is_finetuning
-True
if the model is trained by finetuning another model.
track_telemetry_disabled
Track when a user disables telemetry.
track_data_split
Track when a user splits data.
Arguments:
fraction
- How much data goes into train and how much goes into testdata_type
- Is this core, nlu or nlg data
track_validate_files
Track when a user validates data files.
Arguments:
validation_success
- Whether the validation was successful
track_data_convert
Track when a user converts data.
Arguments:
output_format
- Target format for the converterdata_type
- Is this core, nlu or nlg data
track_tracker_export
Track when a user exports trackers.
Arguments:
number_of_exported_events
- Number of events that got exportedtracker_store
- Store used to retrieve the events fromevent_broker
- Broker the events are getting published towards
track_interactive_learning_start
Track when a user starts an interactive learning session.
Arguments:
skip_visualization
- Is visualization skipped in this sessionsave_in_e2e
- Is e2e used in this session
track_server_start
Tracks when a user starts a rasa server.
Arguments:
input_channels
- Used input channelsendpoints
- Endpoint configuration for the servermodel_directory
- directory of the running modelnumber_of_workers
- number of used Sanic workersis_api_enabled
- whether the rasa API server is enabled
track_project_init
Track when a user creates a project using rasa init.
Arguments:
path
- Location of the project
track_shell_started
Track when a user starts a bot using rasa shell.
Arguments:
model_type
- Type of the model, core / nlu or rasa.
track_visualization
Track when a user runs the visualization.
track_core_model_test
Track when a user tests a core model.
Arguments:
num_story_steps
- Number of test stories used for the comparisone2e
- indicator if tests running in end to end modeagent
- Agent of the model getting tested
track_nlu_model_test
Track when a user tests an nlu model.
Arguments:
test_data
- Data used for testing
track_markers_extraction_initiated
Track when a user tries to extract success markers.
Arguments:
strategy
- The strategy the user is using for tracker selectiononly_extract
- Indicates if the user is only extracting markers or also producing statsseed
- Indicates if the user used a seed for this attemptcount
- (Optional) The number of trackers the user is trying to select.
track_markers_extracted
Track when markers have been extracted by a user.
Arguments:
trackers_count
- The actual number of trackers processed
track_markers_stats_computed
Track when stats over markers have been computed by a user.
Arguments:
trackers_count
- The actual number of trackers processed
track_markers_parsed_count
Track when markers have been successfully parsed from config.
Arguments:
marker_count
- The number of markers found in the configmax_depth
- The maximum depth of any marker in the configbranching_factor
- The maximum number of children of any marker in the config.