Determine information about event sharing in the consumer account¶
This topic describes how a provider can set up an app to determine if a consumer has enabled event sharing in their account.
Verify event definitions by using system functions¶
To determine if event sharing is enabled in a consumer account, providers can call the following system functions within the setup script:
SYSTEM$IS_APPLICATION_AUTHORIZED_FOR_TELEMETRY_EVENT_SHARING()
Returns TRUE if the AUTHORIZE_TELEMETRY_EVENT_SHARING property is set, which indicates that event sharing is allowed in the consumer account. Otherwise, this system function returns FALSE.
SYSTEM$IS_APPLICATION_ALL_MANDATORY_TELEMETRY_EVENT_DEFINITIONS_ENABLED()
Returns TRUE if all required event definitions have been enabled in the consumer account. Otherwise, this system function returns FALSE.
The following example shows a stored procedure that performs a calculation only if both IS_APPLICATION_AUTHORIZED_FOR_TELEMETRY_EVENT_SHARING and IS_APPLICATION_ALL_MANDATORY_TELEMETRY_EVENT_DEFINITIONS_ENABLED are set to TRUE.
Verify event definitions by using the Permissions SDK¶
The Python Permission SDK provides the following functions to determine if even sharing is enabled in a consumer account:
is_application_authorized_for_telemetry_event_sharing()Returns
trueif the AUTHORIZE_TELEMETRY_EVENT_SHARING property istrue. Returnsfalse, otherwise.See is_application_authorized_for_telemetry_event_sharing() for more information.
is_application_all_mandatory_telemetry_event_definitions_enabled()Returns
trueif all mandatory event definitions have been enabled in the consumer account.See is_application_all_mandatory _telemetry_event_definitions_enabled() for more information.
The following example shows how to use the is_application_authorized_for_telemetry_event_sharing()
and is_application_all_mandatory_telemetry_event_definitions_enabled() functions of the
Python Permission SDK to verify that event sharing is enabled in the consumer account and that mandatory
events have been enabled.