sentry-docs icon indicating copy to clipboard operation
sentry-docs copied to clipboard

Custom instrumentation example doesn't compile

Open parsley72 opened this issue 3 years ago • 3 comments

Core or SDK?

Platform/SDK

Which part? Which one?

native

Description

Code in https://docs.sentry.io/platforms/native/performance/instrumentation/custom-instrumentation/ doesn't work - sentry_transaction_start takes two parameters. Also sentry_transaction_context_new has a trailing comma that won't compile, I assume this is a mistake.

Suggested Solution

Fix example to explain where the second parameter of sentry_transaction_start comes from.

parsley72 avatar Sep 27 '22 03:09 parsley72

I found some example code with: sentry_transaction_t* tx = sentry_transaction_start(tx_ctx, sentry_value_new_null());

parsley72 avatar Sep 27 '22 19:09 parsley72

Routing to @getsentry/owners-native for triage. ⏲️

getsentry-release avatar Oct 05 '22 14:10 getsentry-release

Quoting from the documentation of sentry_transaction_start:

 The second parameter is a custom Sampling Context to be used with a Traces
 Sampler to make a more informed sampling decision. The SDK does not currently
 support a custom Traces Sampler and this parameter is ignored for the time
 being but needs to be provided.

So passing in sentry_value_new_null here is definitely sensible. Thanks for reporting this, I'll update the documentation.

loewenheim avatar Oct 05 '22 15:10 loewenheim