# US 11,907,212 B1 · Trace events in a database system

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,907,212 B1
- Document ID: US11907212B1
- Status: Granted
- Kind: B1
- Application number: 18/194,357
- Filed: 2023-03-31
- Granted: 2024-02-20
- Earliest claimed: 2022-11-15
- Assignees: Snowflake Inc.
- Applicants: Snowflake Inc.
- Inventors: Tyson J. Hamilton; Qinye Li; Steven Parkes; Xie Xu
- Web page: https://patentgrep.com/patent/US11907212B1

## CPC

- G06F 16/217: {Database tuning (G06F16/2282 takes precedence; database performance monitoring G06F11/3409)}
- G06F 16/2448: {for particular applications; for extensibility, e.g. user defined types}
- G06F 16/2365: {Ensuring data consistency and integrity}
- G06F 16/248: Presentation of query results
- G06F 9/54: Interprogram communication
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Provided herein are systems and methods for configuring trace events. A system includes at least one hardware processor coupled to a memory and configured to instantiate a user code runtime to execute user-defined function (UDF) code. The user code runtime is instantiated within a sandbox process of an execution node. An application programming interface (API) call is detected during execution of the UDF code. The API call includes one or more configurations of a trace event. Telemetry information is collected based on the one or more configurations. The telemetry information is associated with the trace event using a telemetry API. The telemetry API corresponds to the API call. The telemetry information is formatted using the telemetry API, to generate structured telemetry information. The at least one hardware processor causes ingestion of the structured telemetry information into an event table.

## Claims

### Claim 1

A system comprising:
at least one hardware processor; and
at least one memory storing instructions that cause the at least one hardware processor to perform operations comprising:
instantiating a user code runtime to execute user-defined function (UDF) code, the user code runtime instantiated within a sandbox process of an execution node;
detecting an application programming interface (API) call during execution of the UDF code, the API call including one or more configurations of a trace event, and the API call being pre-mapped to a telemetry API configured to collect telemetry information associated with the trace event;
collecting based on the one or more configurations, the telemetry information associated with the trace event using the telemetry API, the telemetry API configured in a processing stack with the UDF code;
formatting the telemetry information using the telemetry API, to generate structured telemetry information compatible with a pre-defined schema of an event table; and
causing ingestion of the structured telemetry information into the event table according to the pre-defined schema.

### Claim 2 (depends on 1)

The system of claim 1, the operations further comprising:
configuring the telemetry API using a plurality of OpenTelemetry APIs embedded within the UDF code.

### Claim 3 (depends on 1)

The system of claim 1, the operations further comprising:
configuring the processing stack within the sandbox process, the processing stack including the UDF code, the telemetry API, a telemetry software development kit (SDK), and an exporter manager.

### Claim 4 (depends on 3)

The system of claim 3, the operations further comprising:
emitting the structured telemetry information to the exporter manager within the sandbox process using the telemetry SDK of the processing stack.

### Claim 5 (depends on 4)

The system of claim 4, the operations further comprising:
configuring transmission of the structured telemetry information from the exporter manager to an execution node process of the execution node via a coprocessor transceiver of the sandbox process.

### Claim 6 (depends on 5)

The system of claim 5, wherein the operations for the transmission further comprise:
communicating the structured telemetry information to the execution node process via a remote procedure call.

### Claim 7 (depends on 1)

The system of claim 1, wherein the operations for the collecting of the telemetry information further comprise:
collecting trace event information associated with the trace event, the trace event information including execution statistics associated with execution of the UDF code by the user code runtime.

### Claim 8 (depends on 1)

The system of claim 1, the operations further comprising:
configuring the processing stack within an execution node process of the execution node, the processing stack including the telemetry API, a telemetry software development kit (SDK), and an exporter manager.

### Claim 9 (depends on 8)

The system of claim 8, the operations further comprising:
emitting the structured telemetry information to the exporter manager within the execution node process using the telemetry SDK of the processing stack.

### Claim 10 (depends on 9)

The system of claim 9, the operations further comprising:
configuring transmission of the structured telemetry information from the exporter manager to a telemetry pipeline of the execution node process; and
ingesting the structured telemetry information from the telemetry pipeline into the event table, the event table stored in a table stage associated with the execution node process.

### Claim 11

A method comprising:
instantiating, by at least one hardware processor, a user code runtime to execute user-defined function (UDF) code, the user code runtime instantiated within a sandbox process of an execution node;
detecting, by the at least one hardware processor, an application programming interface (API) call during execution of the UDF code, the API call including one or more configurations of a trace event, and the API call being pre-mapped to a telemetry API configured to collect telemetry information associated with the trace event;
collecting, by the at least one hardware processor, based on the one or more configurations, the telemetry information associated with the trace event using the telemetry API, the telemetry API configured in a processing stack with the UDF code;
formatting, by the at least one hardware processor, the telemetry information using the telemetry API, to generate structured telemetry information compatible with a pre-defined schema of an event table; and
causing, by the at least one hardware processor, ingestion of the structured telemetry information into the event table according to the pre-defined schema.

### Claim 12 (depends on 11)

The method of claim 11, further comprising:
configuring the telemetry API using a plurality of OpenTelemetry APIs embedded within the UDF code.

### Claim 13 (depends on 11)

The method of claim 11, further comprising:
configuring the processing stack within the sandbox process, the processing stack including the UDF code, the telemetry API, a telemetry software development kit (SDK), and an exporter manager.

### Claim 14 (depends on 13)

The method of claim 13, further comprising:
emitting the structured telemetry information to the exporter manager within the sandbox process using the telemetry SDK of the processing stack.

### Claim 15 (depends on 14)

The method of claim 14, further comprising:
configuring transmission of the structured telemetry information from the exporter manager to an execution node process of the execution node via a coprocessor transceiver of the sandbox process.

### Claim 16 (depends on 15)

The method of claim 15, wherein the transmission of the structured telemetry information further comprises:
communicating the structured telemetry information to the execution node process via a remote procedure call.

### Claim 17 (depends on 11)

The method of claim 11, wherein the collecting of the telemetry information further comprises:
collecting trace event information associated with the trace event, the trace event information including execution statistics associated with execution of the UDF code by the user code runtime.

### Claim 18 (depends on 11)

The method of claim 11, further comprising:
configuring the processing stack within an execution node process of the execution node, the processing stack including the telemetry API, a telemetry software development kit (SDK), and an exporter manager.

### Claim 19 (depends on 18)

The method of claim 18, further comprising:
emitting the structured telemetry information to the exporter manager within the execution node process using the telemetry SDK of the processing stack.

### Claim 20 (depends on 19)

The method of claim 19, further comprising:
configuring transmission of the structured telemetry information from the exporter manager to a telemetry pipeline of the execution node process; and
ingesting the structured telemetry information from the telemetry pipeline into the event table, the event table stored in a table stage associated with the execution node process.

### Claim 21

A computer-storage medium comprising instructions that, when executed by one or more processors of a machine, configure the machine to perform operations comprising:
instantiating a user code runtime to execute user-defined function (UDF) code, the user code runtime instantiated within a sandbox process of an execution node;
detecting an application programming interface (API) call during execution of the UDF code, the API call including one or more configurations of a trace event, and the API call being pre-mapped to a telemetry API configured to collect telemetry information associated with the trace event;
collecting based on the one or more configurations, the telemetry information associated with the trace event using the telemetry API, the telemetry API configured in a processing stack with the UDF code;
formatting the telemetry information using the telemetry API, to generate structured telemetry information compatible with a pre-defined schema of an event table; and
causing ingestion of the structured telemetry information into the event table according to the pre-defined schema.

### Claim 22 (depends on 21)

The computer-storage medium of claim 21, the operations further comprising:
configuring the telemetry API using a plurality of OpenTelemetry APIs embedded within the UDF code.

### Claim 23 (depends on 21)

The computer-storage medium of claim 21, the operations further comprising:
configuring the processing stack within the sandbox process, the processing stack including the UDF code, the telemetry API, a telemetry software development kit (SDK), and an exporter manager.

### Claim 24 (depends on 23)

The computer-storage medium of claim 23, the operations further comprising:
emitting the structured telemetry information to the exporter manager within the sandbox process using the telemetry SDK of the processing stack.

### Claim 25 (depends on 24)

The computer-storage medium of claim 24, the operations further comprising:
configuring transmission of the structured telemetry information from the exporter manager to an execution node process of the execution node via a coprocessor transceiver of the sandbox process.

### Claim 26 (depends on 25)

The computer-storage medium of claim 25, wherein the operations for the transmission further comprise:
communicating the structured telemetry information to the execution node process via a remote procedure call.

### Claim 27 (depends on 21)

The computer-storage medium of claim 21, wherein the operations for the collecting of the telemetry information further comprise:
collecting trace event information associated with the trace event, the trace event information including execution statistics associated with execution of the UDF code by the user code runtime.

### Claim 28 (depends on 21)

The computer-storage medium of claim 21, the operations further comprising:
configuring the processing stack within an execution node process of the execution node, the processing stack including the telemetry API, a telemetry software development kit (SDK), and an exporter manager.

### Claim 29 (depends on 28)

The computer-storage medium of claim 28, the operations further comprising:
emitting the structured telemetry information to the exporter manager within the execution node process using the telemetry SDK of the processing stack.

### Claim 30 (depends on 29)

The computer-storage medium of claim 29, the operations further comprising:
configuring transmission of the structured telemetry information from the exporter manager to a telemetry pipeline of the execution node process; and
ingesting the structured telemetry information from the telemetry pipeline into the event table, the event table stored in a table stage associated with the execution node process.
