Skip to content

Commit 7c3c2fb

Browse files
authored
chore(tracing): create new rpc call wrapper type with trace info (#443)
Supporting types for #5748, allowing us to pass trace context to Ocaml with each RPC call. - [x] I ran `make setup && make` to update the generated code after editing a `.atd` file - [x] I made sure we're still backward compatible with old versions of the CLI. For example, the Semgrep backend need to still be able to *consume* data generated by Semgrep 1.50.0. See https://atd.readthedocs.io/en/latest/atdgen-tutorial.html#smooth-protocol-upgrades Note that the types related to the semgrep-core JSON output or the semgrep-core RPC do not need to be backward compatible! - [x] Any accompanying changes in `semgrep-proprietary` are approved and ready to merge once this PR is merged
1 parent dd71db1 commit 7c3c2fb

9 files changed

Lines changed: 9478 additions & 9213 deletions

semgrep_output_v1.atd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3520,6 +3520,13 @@ type function_result = {
35203520
profiling_results: profiling_entry list;
35213521
}
35223522

3523+
(* Wraps a function_call with the caller's OpenTelemetry span ID for per-request tracing.
3524+
The trace ID is read from the environment (set by the Python process before starting OCaml). *)
3525+
type rpc_call = {
3526+
call: function_call;
3527+
?parent_span_id: string option;
3528+
}
3529+
35233530
(*****************************************************************************)
35243531
(* Misc *)
35253532
(*****************************************************************************)

semgrep_output_v1.jsonschema

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1.proto

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)