From bf780b22a6c0944e96610c2fb06151fc7162a43e Mon Sep 17 00:00:00 2001 From: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com> Date: Wed, 4 Dec 2024 11:34:32 +0100 Subject: [PATCH 1/2] add docs on explicit timed API --- .../instrumentation/custom-instrumentation.mdx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/platforms/native/common/tracing/instrumentation/custom-instrumentation.mdx b/docs/platforms/native/common/tracing/instrumentation/custom-instrumentation.mdx index d20aa278a1dc3..d38c0e94ee40a 100644 --- a/docs/platforms/native/common/tracing/instrumentation/custom-instrumentation.mdx +++ b/docs/platforms/native/common/tracing/instrumentation/custom-instrumentation.mdx @@ -19,6 +19,21 @@ To capture transactions and spans customized to your organization's needs, you m +## Custom Timestamps +Sometimes systems don't provide a reliable system time. For these cases, the following explicitly timed functions can be used. +- `sentry_transaction_start_ts` +- `sentry_transaction_finish_ts` +- `sentry_transaction_start_child_ts` +- `sentry_transaction_start_child_ts_n` +- `sentry_span_start_child_ts` +- `sentry_span_start_child_ts_n` +- `sentry_span_finish_ts` + +They only differ from their non-timestamped counterparts by taking an additional timestamp parameter, which is the unix epoch offset in microseconds. + +When using these functions, you should ensure that the provided timestamps are consistent. It is recommended to use the normal interface with automatic timestamping, and to only use the explicitly timed interface when absolutely necessary. + + From 02649df161ae6ad4bcd54b7558c9169a3135a14d Mon Sep 17 00:00:00 2001 From: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:22:35 +0100 Subject: [PATCH 2/2] rephrasing --- .../common/tracing/instrumentation/custom-instrumentation.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/native/common/tracing/instrumentation/custom-instrumentation.mdx b/docs/platforms/native/common/tracing/instrumentation/custom-instrumentation.mdx index d38c0e94ee40a..15cfe5aa9f1df 100644 --- a/docs/platforms/native/common/tracing/instrumentation/custom-instrumentation.mdx +++ b/docs/platforms/native/common/tracing/instrumentation/custom-instrumentation.mdx @@ -20,7 +20,7 @@ To capture transactions and spans customized to your organization's needs, you m ## Custom Timestamps -Sometimes systems don't provide a reliable system time. For these cases, the following explicitly timed functions can be used. +Sometimes you want to measure timings in code that cannot call Native SDK functions directly (like GPU shaders). For these cases, the following explicitly timed functions can be used. - `sentry_transaction_start_ts` - `sentry_transaction_finish_ts` - `sentry_transaction_start_child_ts`