Skip to content

Commit 36a2538

Browse files
authored
chore(perfmon): Update instructions on writing performance docs (#4641)
1 parent 5aed681 commit 36a2538

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

src/docs/contributing/approach/sdk-docs/write-performance.mdx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,42 @@ This file is `index.mdx`. It explains how to install or set up (if appropriate)
3131

3232
To develop content for this file:
3333

34-
1. Determine if the SDK needs an installation step or a property set to enable tracing. If so, add the SDK to `Supported` list in the `<PlatformSection>`, then add a code sample to `performance/enable-tracing/`. If not, add the SDK to `notSupported` list, which will prevent the **Enable Tracing** heading from displaying for this SDK.
34+
1. If the SDK is still a work-in-progress and is exposed as an experimental or an early access feature, add the platform to the `<PlatformSection>` wrapping the appropriate alert located at the beginning of the content for the page.
3535

36-
2. Add a code sample to `/src/includes/performance/configure-sample-rate/` that covers how to set sample rates.
36+
1. If the SDK is expected to be used in a high-throughput environment, add the platform to the following `<PlatformSection>` which advises testing before deploying to production.
3737

38-
3. Determine if you want to have users verify using our custom instrumentation. If so, add the SDK to `Supported` list in the `<PlatformSection>`. If not, add the SDK to `notSupported` list, which will prevent the `<PlatformLink>` to the Custom Instrumentation page from displaying for this SDK.
38+
1. If automatic instrumentation is still in preview/beta for the SDK, add your platform to the next `<PlatformSection>` that wraps around text that discusses this.
3939

40-
4. Determine if the paragraph regarding pageload and navigation applies to the SDK. If so, add the SDK to `Supported` list in the `<PlatformSection>`. If not, add the SDK to `notSupported` list, which will prevent the content from displaying for this SDK.
40+
1. If automatic instrumentation is supported, add your platform to the `<PlatformSection>` immediately following **Verify** which advises users to either use auto or custom (or manual) instrumentation to verify the feature. Either omit the platform from the `supported` list or add the platform to the `notSupported` list if auto instrumentation is not available.
4141

42-
5. Determine the level of instrumentation support for verification and add as appropriate to the `Supported` list in the `<PlatformSection>`.
42+
1. Add a code sample to `/src/includes/performance/configure-sample-rate/` that covers how to set sample rates. Make sure to update `/platforms/common/configuration/sampling.mdx` and **Tracing Options** in `/platforms/common/configuration/options.mdx`.
43+
44+
1. Do one of the following based on whether automatic instrumentation is available for the SDK or not:
45+
a. If automatic instrumentation is supported, add your platform to the `<PlatformSection>` immediately following **Verify** which advises users to either use auto or custom (a.k.a. manual) instrumentation to verify the feature. Either omit the platform from `supported` or the platform to `notSupported`.
46+
47+
b. If automatic instrumentation is not supported, add your platform to the second `<PlatformSection>` after **Verify** which advises users to test out tracing using custom (manual) instrumentation. Omit the platform from the `supported` list or add it to the `notSupported` list if automatic instrumentation is available.
48+
49+
1. Determine if the paragraph regarding pageload and navigation applies to the SDK. If so, add the SDK to the `Supported` list in the `<PlatformSection>`. If not, either omit the platform from the `supported` list or add the platform to the `notSupported` list, which will prevent the content from displaying for this SDK.
4350

4451
### Custom Instrumentation
4552

4653
We expect this content to apply to all SDKS.
4754

4855
This file is `performance/instrumentation/custom-instrumentation.mdx`. It explains how to manually instrument transactions.
4956

57+
If custom instrumentation for the SDK is exposed as an experimental or an early access feature, add the platform to the `<PlatformSection>` wrapping the appropriate alert located at the beginning of the content for the page.
58+
5059
To develop content for this file, add code samples to these directories:
5160

5261
- `/src/includes/enable-manual-instrumentation/`
5362
- `/src/includes/performance/add-spans-example/`
5463
- `/src/includes/performance/retrieve-transaction/`
5564

56-
Then determine whether to provide a code sample illustrating how to connect errors and spans. If so, add the SDK to `Supported` list in the `<PlatformSection>`, then add a code sample `/src/includes/performance/connect-errors-spans/`.
65+
If any of the above files are not applicable to your platform, find the `<PlatformSection>` wrapping the `<PlatformContent>` pointing to the unsupported file, and add your platform to its `notSupported` list. If such a `<PlatformSection>` doesn't already exist, create one and add your platform to its `notSupported` list.
66+
67+
Then, determine whether to provide a code sample illustrating how to connect errors and spans. If so, add the SDK to the `Supported` list in the appropriate `<PlatformSection>`, then add a code sample `/src/includes/performance/connect-errors-spans/`.
68+
69+
If the platform supports distributed tracing using custom instrumentation, add the SDK to the appropriate `<PlatformSection>` and create an appropriate file at `src/includes/performance/distributed-tracing`.
5770

5871
### Automatic Instrumentation
5972

src/platforms/common/performance/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Performance monitoring is still an experimental, work-in-progress feature, and i
4343

4444
</Note>
4545

46-
</PlatformSection >
46+
</PlatformSection>
4747

4848
<Note>
4949

@@ -77,7 +77,7 @@ Automatic instrumentation for monitoring the performance of your application is
7777

7878
## Configure the Sample Rate
7979

80-
Once you configure the <PlatformLink to="/configuration/sampling/">sample rate</PlatformLink>, tracing will be enabled in your app. Set the sample rate for your transactions by either:
80+
Sampling for transactions must also be configured before tracing is be enabled in your app. Set the sample rate for your transactions by either:
8181

8282
1. Setting a uniform sample rate for all transactions using the <PlatformIdentifier name="traces-sample-rate" /> option in your SDK config to a number between `0` and `1`. (For example, to send 20% of transactions, set <PlatformIdentifier name="traces-sample-rate" /> to `0.2`.)
8383
2. Controlling the sample rate based on the transaction itself and the context in which it's captured, by providing a function to the <PlatformIdentifier name="traces-sampler" /> config option.

src/platforms/common/performance/instrumentation/custom-instrumentation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Performance monitoring is still an experimental, work-in-progress feature, and i
4444

4545
</Note>
4646

47-
</PlatformSection >
47+
</PlatformSection>
4848

4949
To instrument certain regions of your code, you can create transactions to capture them.
5050

0 commit comments

Comments
 (0)