Configure centralized event sharing for an app¶
This topic describes how providers can configure a Snowflake Native App to share log messages and trace events from different regions with a central location.
About centralized event sharing¶
The Snowflake Native App Framework supports centralized event sharing, which allows an app to share telemetry messages from different regions to a central location. These telemetry messages can include log messages, trace events, and other data. This feature is useful for monitoring and troubleshooting applications that are deployed across multiple regions. Without centralized event sharing, providers would need to manually route the events from each region to a central location using a custom solution.
Note
When using centralized event sharing, you must ensure that your app is compliant with all relevant regulations and standards, such as GDPR, HIPAA, and PCI DSS.
Overview: Implement centralized event sharing¶
Create an event routing table for the organization.
Activate the event routing table for the organization.
After the application starts to produce events, query the event routing table to retrieve the telemetry data.
Routing rules¶
When you create an event routing table, you define rules that control which account the telemetry events are routed to. These rules contain the following information:
The region or regions from which the events are routed.
The account to which the events are routed.
Typically, each table uses routing rules to route telemetry data to one or more accounts where the telemetry data will be analyzed.
You can define rules that are applied to specific regions, and a default rule that is applied to regions without specific rules. For example, you can define a rule to route events from all European regions to a specific account, and a default rule to route events from all other regions to a different account.
Create an event routing table¶
When you create an event routing table, you define rules that control to which account the events are routed. You use the CREATE EVENT ROUTING TABLE command to create an event routing table.
The following command creates an event routing table:
Where:
rule_nameThe name of the rule. The rule name must be named “default” if ALL is used for the REGIONS.
REGION_GROUPOptional. Specifies the group of regions that the rule applies to. The only supported value is
PUBLIC.REGIONSThe list of regions that the rule applies to. You can specify individual regions or use
ALLto specify all regions. Rules with specific regions take precedence over rules forALL. You can’t useALLand specific regions in the same rule. For a list of available regions, see the Snowflake Region ID column in the Region IDs table here: Region IDs.DESTINATION_ACCOUNTThe account to which the events are routed. You specify the routing account in the format
org.account_name, oraccount_namefor accounts in the current account’s organization.
Each organization can have only one event routing table activated for it. Each event routing table can have a maximum of 200 rules.
Update rules for an event routing table¶
To update the rules for an event routing table with a new set of rules, use the ALTER EVENT ROUTING TABLE command.
The following command updates the rules for an event routing table:
The preceding command replaces the existing rules with the new set of rules. The FORCE keyword is optional. If the event routing table is currently activated for an organization, and you do not use the FORCE option, the command fails.
Activate or deactivate an event routing table for an organization¶
To activate an existing event routing table for the organization, use the ALTER ORGANIZATION SET EVENT ROUTING TABLE command. The following command activates the event routing table for the organization:
When you activate an event routing table for the organization, the events are routed
to the accounts specified in the DESTINATION_ACCOUNT parameter of the table’s rules.
The following command deactivates the event routing table for the organization:
Drop an event routing table¶
To drop an event routing table, use the DROP EVENT ROUTING TABLE command. The following command drops the event routing table:
If the event routing table is currently activated for an organization, the command fails with an error.
Show available event routing tables¶
To show the available event routing tables, providers can use the SHOW EVENT ROUTING TABLES command.
The following command shows the available event routing tables:
Show rules in an event routing table¶
To show the rules in an event routing table, providers can use the SHOW RULES IN EVENT ROUTING TABLE command.
The following command shows the rules in an event routing table:
Show the active event routing table for an organization¶
To show the active event routing table for an organization, use the SHOW EVENT ROUTING TABLE ON ORGANIZATION command, as shown in the following example:
If there is no event routing table activated for the organization, the command returns no rows.
Required privileges¶
This section describes the privileges required to modify centralized event sharing settings or retrieve events from the central location.
Privileges required to modify centralized event routing¶
To configure centralized event routing at the organization level, you must have the following privileges:
Accounts using org accounts must have the
ORGADMINrole.
Privileges for viewing event routing configuration¶
To view the event routing configuration for an account, your account must have one of the following roles or privileges:
ORGADMINrole.CREATE ORGANIZATION LISTINGprivilege.CREATE DATA EXCHANGE LISTINGprivilege.
Compatibility with existing event sharing¶
Centralized event sharing supports compatibility with your existing event sharing configuration. With this feature, you can continue to use your existing event routing configuration while migrating to the new centralized event sharing feature. You can also continue to use event sharing for regions that are not supported by centralized event sharing, such as sovereign or government regions.
Events are routed using the existing event sharing configuration if either of the following conditions are met:
There is no event routing table assigned to the organization.
The event routing table has no default rule and no rule for the current region.
For information about the existing event sharing feature, see About event sharing.
Troubleshooting¶
To troubleshoot issues with centralized event sharing, use the following commands to view the event routing configuration for an account:
If you need to troubleshoot issues with legacy event routing configuration, use the following command:
Cross-region data transfer cost¶
Routing telemetry from one region to a destination account in a different region incurs cross-region data transfer (egress) charges. Providers are responsible for these costs. For background on how data transfer is billed, see Understanding data transfer cost.
To monitor cross-region egress associated with centralized event sharing, query the
DATA_TRANSFER_HISTORY view in the ACCOUNT_USAGE schema in the destination event account.
This view reports the number of bytes transferred along with the source cloud and region,
target cloud and region, and the transfer type.
To view the egress cost in currency rather than bytes, query the
USAGE_IN_CURRENCY_DAILY view in the ORGANIZATION_USAGE schema:
For more information about exploring data transfer cost, see Exploring data transfer cost.
Limitations¶
The following limitations apply to centralized event sharing:
- Special regions
Special regions such as FedRAMP regions and sovereign regions such as AWS China regions are not supported.
- Private Links
Sharing events over Private Links is not supported.