Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(Mobile): Fixes tracing options casing, updates options #10305

Merged
merged 8 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions docs/platforms/android/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ Controls how many seconds to wait before shutting down. Sentry SDKs send events

<ConfigKey name="enable-tracing">

A boolean value, if true, transactions and trace data will be generated and captured. This will set the `traces-sample-rate` to the recommended default of 1.0 if `traces-sample-rate` is not defined. Note that `traces-sample-rate` and `traces-sampler` take precedence over this option.
kahest marked this conversation as resolved.
Show resolved Hide resolved
A boolean value, if true, transactions and trace data will be generated and captured. This will set the <PlatformIdentifier name="traces-sample-rate" /> to the recommended default of 1.0 if <PlatformIdentifier name="traces-sample-rate" /> is not defined. Note that <PlatformIdentifier name="traces-sample-rate" /> and <PlatformIdentifier name="traces-sampler" /> take precedence over this option.

</ConfigKey>

Expand All @@ -284,12 +284,6 @@ A function responsible for determining the percentage chance a given transaction

</ConfigKey>

<ConfigKey name="tracing-origins">

An optional property that configures which downstream services receive the `sentry-trace` header attached to HTTP requests. It contains a list of URLs or regex against which URLs are matched. If not set, the `sentry-trace` header is attached to every request executed from an instrumented client.

</ConfigKey>

<ConfigKey name="trace-propagation-targets">

An optional property that controls which downstream services receive tracing data, in the form of a `sentry-trace` and a `baggage` header attached to any outgoing HTTP requests.
Expand All @@ -310,12 +304,6 @@ Set this boolean to `false` to disable tracing for `OPTIONS` requests. This opti

## Profiling Options

<ConfigKey name="enable-tracing">

A boolean value, if true, transactions and trace data will be generated and captured. This will set the `traces-sample-rate` to the recommended default of 1.0 if `traces-sample-rate` is not defined. Note that `traces-sample-rate` and `traces-sampler` take precedence over this option.

</ConfigKey>

<ConfigKey name="profiles-sample-rate">

A number between 0 and 1, controlling the percentage chance a given profile will be sent to Sentry. (0 represents 0% while 1 represents 100%.) Applies only to sampled transactions created in the app. Either this or <PlatformIdentifier name="profiles-sampler" /> must be defined to enable profiling.
Expand All @@ -330,6 +318,6 @@ A function responsible for determining the percentage chance a given profile wil

<ConfigKey name="enable-app-start-profiling">

A boolean value, if true, the startup process, including ContentProviders, Application and first Activity creation, will be profiled. Note that `profiles-sample-rate` or `profiles-sampler` must be defined.
A boolean value, if true, the startup process, including ContentProviders, Application and first Activity creation, will be profiled. Note that <PlatformIdentifier name="profiles-sample-rate" /> or <PlatformIdentifier name="profiles-sampler" /> must be defined.
kahest marked this conversation as resolved.
Show resolved Hide resolved

</ConfigKey>
4 changes: 2 additions & 2 deletions docs/platforms/apple/common/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ SentrySDK.start { options in
[SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
options.dsn = @"___PUBLIC_DSN___";
options.initialScope = ^(SentryScope *scope) {
scope setTagValue:@"my value" forKey:@"my-tag"];
[scope setTagValue:@"my value" forKey:@"my-tag"];
kahest marked this conversation as resolved.
Show resolved Hide resolved
return scope;
};
}];
Expand Down Expand Up @@ -245,7 +245,7 @@ The callback typically gets a second argument (called a "hint") which contains t

<ConfigKey name="enable-tracing">

A boolean value, if true, transactions and trace data will be generated and captured. This will set the `traces-sample-rate` to the recommended default of 1.0 if `traces-sample-rate` is not defined. Note that `traces-sample-rate` and `traces-sampler` take precedence over this option.
A boolean value, if true, transactions and trace data will be generated and captured. This will set the <PlatformIdentifier name="traces-sample-rate" /> to the recommended default of 1.0 if <PlatformIdentifier name="traces-sample-rate" /> is not defined. Note that <PlatformIdentifier name="traces-sample-rate" /> and <PlatformIdentifier name="traces-sampler" /> take precedence over this option.
kahest marked this conversation as resolved.
Show resolved Hide resolved

</ConfigKey>

Expand Down
32 changes: 32 additions & 0 deletions docs/platforms/dart/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,35 @@ Transports are used to send events to Sentry. Transports can be customized to so
Switches out the transport used to send events. How this works depends on the SDK. It can, for instance, be used to capture events for unit-testing or to send it through some more complex setup that requires proxy authentication.

</ConfigKey>

## Tracing Options

<ConfigKey name="enable-tracing">

A boolean value, if true, transactions and trace data will be generated and captured. This will set the <PlatformIdentifier name="traces-sample-rate" /> to the recommended default of 1.0 if <PlatformIdentifier name="traces-sample-rate" /> is not defined. Note that <PlatformIdentifier name="traces-sample-rate" /> and <PlatformIdentifier name="traces-sampler" /> take precedence over this option.
kahest marked this conversation as resolved.
Show resolved Hide resolved

</ConfigKey>

<ConfigKey name="traces-sample-rate">

A number between 0 and 1, controlling the percentage chance a given transaction will be sent to Sentry. (0 represents 0% while 1 represents 100%.) Applies equally to all transactions created in the app. Either this or <PlatformIdentifier name="traces-sampler" /> must be defined to enable tracing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Either this or must be defined to enable tracing."

Doesn't it default to 1 if these aren't defined?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only if enableTracing is set to true - then tracesSampleRate will be set to the recommended value of 1.0.

I know the wording for enableTracing that we copy-pasted and now have on all SDK docs is a bit confusing:

A boolean value, if true, transactions and trace data will be generated and captured. This will set the traces-sample-rate to the recommended default of 1.0 if traces-sample-rate is not defined

The default value is 0.0. The recommended value if you enable tracing is 1.0. We should probably re-word to something like

A boolean value that determines whether tracing is enabled and trace data will be generated and captured. This will set the traces-sample-rate to the recommended value of 1.0 if traces-sample-rate is not defined

OTOH there is an ongoing DACI to decide if we remove enableTracing altogether


</ConfigKey>

<ConfigKey name="traces-sampler">

A function responsible for determining the percentage chance a given transaction will be sent to Sentry. It will automatically be passed information about the transaction and the context in which it's being created, and must return a number between `0` (0% chance of being sent) and `1` (100% chance of being sent). Can also be used for filtering transactions, by returning 0 for those that are unwanted. Either this or <PlatformIdentifier name="traces-sample-rate" /> must be defined to enable tracing.

</ConfigKey>

<ConfigKey name="trace-propagation-targets">

An optional property that controls which downstream services receive tracing data, in the form of a `sentry-trace` and a `baggage` header attached to any outgoing HTTP requests.

The option may contain a list of strings or regex against which the URLs of outgoing requests are matched.
If one of the entries in the list matches the URL of an outgoing request, trace data will be attached to that request.
String entries do not have to be full matches, meaning the URL of a request is matched when it _contains_ a string provided through the option.

If <PlatformIdentifier name="trace-propagation-targets" /> is not provided, trace data is attached to every outgoing request from the instrumented client.

</ConfigKey>
32 changes: 32 additions & 0 deletions docs/platforms/flutter/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,38 @@ Switches out the transport used to send events. How this works depends on the SD

</ConfigKey>

## Tracing Options

<ConfigKey name="enable-tracing">

A boolean value, if true, transactions and trace data will be generated and captured. This will set the <PlatformIdentifier name="traces-sample-rate" /> to the recommended default of 1.0 if <PlatformIdentifier name="traces-sample-rate" /> is not defined. Note that <PlatformIdentifier name="traces-sample-rate" /> and <PlatformIdentifier name="traces-sampler" /> take precedence over this option.

</ConfigKey>

<ConfigKey name="traces-sample-rate">

A number between 0 and 1, controlling the percentage chance a given transaction will be sent to Sentry. (0 represents 0% while 1 represents 100%.) Applies equally to all transactions created in the app. Either this or <PlatformIdentifier name="traces-sampler" /> must be defined to enable tracing.

</ConfigKey>

<ConfigKey name="traces-sampler">

A function responsible for determining the percentage chance a given transaction will be sent to Sentry. It will automatically be passed information about the transaction and the context in which it's being created, and must return a number between `0` (0% chance of being sent) and `1` (100% chance of being sent). Can also be used for filtering transactions, by returning 0 for those that are unwanted. Either this or <PlatformIdentifier name="traces-sample-rate" /> must be defined to enable tracing.

</ConfigKey>

<ConfigKey name="trace-propagation-targets">

An optional property that controls which downstream services receive tracing data, in the form of a `sentry-trace` and a `baggage` header attached to any outgoing HTTP requests.

The option may contain a list of strings or regex against which the URLs of outgoing requests are matched.
If one of the entries in the list matches the URL of an outgoing request, trace data will be attached to that request.
String entries do not have to be full matches, meaning the URL of a request is matched when it _contains_ a string provided through the option.

If <PlatformIdentifier name="trace-propagation-targets" /> is not provided, trace data is attached to every outgoing request from the instrumented client.

</ConfigKey>

## Experimental Features

<ConfigKey name="experimental">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ Controls how many seconds to wait before shutting down. Sentry SDKs send events

<ConfigKey name="enable-tracing">

A boolean value, if true, transactions and trace data will be generated and captured. This will set the `traces-sample-rate` to the recommended default of 1.0 if `traces-sample-rate` is not defined. Note that `traces-sample-rate` and `traces-sampler` take precedence over this option.
A boolean value, if true, transactions and trace data will be generated and captured. This will set the <PlatformIdentifier name="traces-sample-rate" /> to the recommended default of 1.0 if <PlatformIdentifier name="traces-sample-rate" /> is not defined. Note that <PlatformIdentifier name="traces-sample-rate" /> and <PlatformIdentifier name="traces-sampler" /> take precedence over this option.

</ConfigKey>

Expand All @@ -245,12 +245,6 @@ A function responsible for determining the percentage chance a given transaction

</ConfigKey>

<ConfigKey name="tracing-origins">

An optional property that configures which downstream services receive the `sentry-trace` header attached to HTTP requests. It contains a list of URLs or regex against which URLs are matched. If not set, the `sentry-trace` header is attached to every request executed from an instrumented client.

</ConfigKey>

<ConfigKey name="trace-propagation-targets">

An optional property that controls which downstream services receive tracing data, in the form of a `sentry-trace` and a `baggage` header attached to any outgoing HTTP requests.
Expand Down
14 changes: 13 additions & 1 deletion docs/platforms/react-native/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ Controls how many seconds to wait before shutting down. Sentry SDKs send events

<ConfigKey name="enable-tracing">

A boolean value, if true, transactions and trace data will be generated and captured. This will set the `traces-sample-rate` to the recommended default of 1.0 if `traces-sample-rate` is not defined. Note that `traces-sample-rate` and `traces-sampler` take precedence over this option.
A boolean value, if true, transactions and trace data will be generated and captured. This will set the <PlatformIdentifier name="traces-sample-rate" /> to the recommended default of 1.0 if <PlatformIdentifier name="traces-sample-rate" /> is not defined. Note that <PlatformIdentifier name="traces-sample-rate" /> and <PlatformIdentifier name="traces-sampler" /> take precedence over this option.

</ConfigKey>

Expand All @@ -259,6 +259,18 @@ A function responsible for determining the percentage chance a given transaction

</ConfigKey>

<ConfigKey name="trace-propagation-targets">

An optional property that controls which downstream services receive tracing data, in the form of a `sentry-trace` and a `baggage` header attached to any outgoing HTTP requests.

The option may contain a list of strings or regex against which the URLs of outgoing requests are matched.
If one of the entries in the list matches the URL of an outgoing request, trace data will be attached to that request.
String entries do not have to be full matches, meaning the URL of a request is matched when it _contains_ a string provided through the option.

If <PlatformIdentifier name="trace-propagation-targets" /> is not provided, trace data is attached to every outgoing request from the instrumented client.
kahest marked this conversation as resolved.
Show resolved Hide resolved

</ConfigKey>

## Experimental Features

<ConfigKey name="experimental">
Expand Down
Loading