How to debug edge functions on Data Streaming
The debugging process in edge functions’ code on Data Streaming helps you identify if errors are still occurring or if the process was successful.
Before analyzing the process, you need to apply the debugging code. Find out more on Debugging edge functions.
Setting up Data Streaming to debug edge functions
After applying the debugging code for edge functions:
- Access RTM.
- On the upper-left corner, select Data Streaming on the OBSERVE section.
- Click Add Streaming.
- Choose a name for your data streaming.
- On the Data Source dropdown menu, select Edge Functions.
- On the Template dropdown menu, select Custom Template.
- On the Data Set code box, add the following variables:
{
"time": "$time",
"global_id": "$global_id",
"edge_function_id": "$edge_function_id",
"request_id": "$request_id",
"log_level": "$log_level",
"log_message": "$log_message"
}
- On Options, select between Filter Domains or All Domains. See more about each option on How to associate domains on Data Streaming.
- On the Destination section, select an Endpoint Type on the dropdown menu. See more about setting an endpoint.
- You’ll see different fields depending on the endpoint type you choose.
Finally, to finish your data streaming setup:
- Make sure the Active switch is turned on.
- Click the Save button.
Now, you’ll be able to analyze the behavior of the edge functions debugging process through the logs sent to your configured data streaming.
Variables definition
Variable | Definition |
---|---|
$time | Request date and time. Example: Oct. 31st, 2022 - 19:30:41 |
$global_id | Settings identifier. |
$edge_function_id | Edge Function identifier. |
$request_id | Unique request identifier. Example: 5f222ae5938482c32a822dbf15e19f0f |
$log_level | Level of the log generator: ERROR, WARN, INFO, DEBUG, or TRACE. |
$log_message | Editable message used in the log function. Available for users to identify and report a given behavior. |
Related documentation
Didn’t find what you were looking for? Open a support ticket.