Add debugging-metadata and tracing directly to OCaml traits-module#121
Draft
ELLIOTTCABLE wants to merge 7 commits intoygrek:masterfrom
Draft
Add debugging-metadata and tracing directly to OCaml traits-module#121ELLIOTTCABLE wants to merge 7 commits intoygrek:masterfrom
ELLIOTTCABLE wants to merge 7 commits intoygrek:masterfrom
Conversation
This reverts commit 5efe95f.
* upstream/master: opam: update prepare release 20231201 Revert "gen_caml: some hygiene" gen: ensure no trailing whitespace collect params of subqueries gen_caml: some hygiene build: do not let dune mess up warnings sql: + some string functions sql: parse generated columns
ygrek
requested changes
Feb 1, 2024
|
|
||
| let select db sql set_params callback = | ||
| with_stmt db sql @@ fun stmt -> | ||
| let select ?operation ?tables ~span_name db sql set_params callback = |
Owner
There was a problem hiding this comment.
lets put all meta information into one record { tables; span_name; operation }
| "db.system", Some system; | ||
| "db.statement", Some sql; | ||
| "db.operation", operation; | ||
| "db.table", Option.map List.hd tables; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements an alternative to #117, making tracing-information non-optional (and thus requiring no build-system changes), instead requiring traits-implementations to be updated to accept the new tracing-information.
This is a breaking change for custom traits-implementations.
The built-in traits implementation use ocaml-trace, if present in the installed world (
opam install trace), to generate tracing-spans for each SQL statement.All of the additions are noops at runtime if the user does not have
ocaml-traceinstalled, and doesn't use a custom traits implementation.The diff in the generated output is as following: