Skip to content

Commit

Permalink
feat: Drop unnecessary default info level for Alert
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Jan 22, 2025
1 parent 0fc63b7 commit 6cab7b7
Show file tree
Hide file tree
Showing 199 changed files with 270 additions and 275 deletions.
2 changes: 1 addition & 1 deletion app/platform-redirect/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default async function Page(props: {

return (
<DocPage frontMatter={frontMatter}>
<Alert level="info">{platformInfo}</Alert>
<Alert>{platformInfo}</Alert>

<ul>
{platformList.map(p => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ In this case, the matching will happen from **top to bottom** and the following
1. Rule `1` is matched against the event payload, since it is of type `transaction`. The `samplingValue` is a `factor`, thus the accumulated factors will now be `2.0 * 1.0`, where `1.0` is the identity for the multiplication.
2. Because rule `1` was a factor rule, the matching continues and rule `2` will be matched against the DSC, since it is of type `trace`. The `samplingValue` is a `sampleRate`, thus the matching will stop and the sample rate will be computed as `2.0 * 0.5 = 1.0`, where `2.0` is the factor accumulated from the previous rule and `0.5` is the sample rate of the current rule.

<Alert title="✨ Note" level="info">
<Alert title="✨ Note">

It is important to note that a `sampleRate` rule must match in order for a sampling decision to be made; in case this condition is not met, the event will be kept. In practice, each project will have a uniform trace rule which will always match and contain the base sample rate of the organization.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sidebar_order: 2

Dynamic Sampling allows Sentry to automatically adjust the amount of data retained based on how valuable the data is to the user. This is technically achieved by applying a **sample rate** to every event, which is determined by a **set of rules** that are evaluated for each event.

<Alert title="✨ Note" level="info">
<Alert title="✨ Note">

A sample rate is a number in the interval `[0.0, 1.0]` that will determine the likelihood of a transaction to be retained. For example, a sample rate of `0.5` means that the transaction will be retained on average 50% of the time.

Expand All @@ -21,15 +21,15 @@ There are two available modes to govern the target sample rates for Dynamic Samp
- **Automatic Mode** dynamically manages the target sample rate for each project based on the target sample rate for the organization, prioritizing lower volume projects to increase visibility. Automatic Mode is active if the organization option `sentry:sampling_mode` is set to `organization`. The target sample rate for the organization is stored in the **organization** option `sentry:target_sample_rate`, and project target sample rates are calculated based on the organization target sample rate.
- **Manual Mode** allows the user to set static target sample rates on a per-project basis that serve as the baseline sample rate before applying the dynamic biases outlined below. Target sample rates are not adjusted by the system. Manual Mode is active if the organization option `sentry:sampling_mode` is set to `project`. The target sample rates for projects are stored in the **project** option `sentry:target_sample_rate`.

All functionality defaults to Automatic Mode if the option `sentry:sampling_mode` is not set, and all target sample rates default to 1 if the option `sentry:target_sample_rate` is not set.
All functionality defaults to Automatic Mode if the option `sentry:sampling_mode` is not set, and all target sample rates default to 1 if the option `sentry:target_sample_rate` is not set.

When the user switches between modes, target sample rates are transferred unless changed explicitly. For example, if the user switches from Automatic Mode to Manual Mode, the sample rates calculated during Automatic Mode are persisted in the project option `sentry:target_sample_rate`. Conversely, if the user switches from Manual Mode to Automatic Mode, the project target sample rates are recalculated based on the overall organization target sample rate.

The [sample rates are periodically recalibrated](https://github.com/getsentry/sentry/blob/9b98be6b97323a78809a829e06dcbef26a16365c/src/sentry/dynamic_sampling/rules/biases/recalibration_bias.py#L11-L44) to ensure that the overall target sample rate is met. This recalibration is done on a project level or organization level, depending on the dynamic sampling mode. Within the target sample rate, Dynamic Sampling **biases towards more meaningful data**. This is achieved by constantly updating and communicating special rules to Relay, via a project configuration, which then applies targeted sampling to every event.
The [sample rates are periodically recalibrated](https://github.com/getsentry/sentry/blob/9b98be6b97323a78809a829e06dcbef26a16365c/src/sentry/dynamic_sampling/rules/biases/recalibration_bias.py#L11-L44) to ensure that the overall target sample rate is met. This recalibration is done on a project level or organization level, depending on the dynamic sampling mode. Within the target sample rate, Dynamic Sampling **biases towards more meaningful data**. This is achieved by constantly updating and communicating special rules to Relay, via a project configuration, which then applies targeted sampling to every event.

![Concept of Fidelity](./images/fidelityAndPriorities.png)

<Alert title="✨ Note" level="info">
<Alert title="✨ Note">
For orgs under AM2, Dynamic sampling uses a [sliding window function](https://github.com/getsentry/sentry/blob/cc8cc38c8a108719d068e5622b24a8d0c744e84c/src/sentry/dynamic_sampling/tasks/sliding_window_org.py#L37-L61) over the incoming volume to calculate the target sample rate.
</Alert>

Expand All @@ -39,7 +39,7 @@ It is important to note that fidelity only determines an **approximate target sa

Instead, the Sentry backend **computes a set of rules** whose goal is to cooperatively achieve the target sample rate. Determining when and how to set these rules is part of the Dynamic Sampling infrastructure.

<Alert title="✨ Note" level="info">
<Alert title="✨ Note">

The effectively applied sample rate, in the end, depends on how much data matches each of the bias overrides.

Expand All @@ -59,7 +59,7 @@ To achieve trace sampling, SDKs pass all fields that can be sampled by [Dynamic

![Trace Sampling](./images/traceSampling.png)

<Alert title="✨ Note" level="info">
<Alert title="✨ Note">

In order to achieve full trace sampling, the random number generator used by Relay is seeded with the trace ID inside of the DSC sent by the SDK. This ensures that traces with the same trace ID will always yield the same sampling decision.

Expand Down Expand Up @@ -115,7 +115,7 @@ The list of development environments is available [here](https://github.com/gets
For prioritizing dev environments, we use a sample rate of `1.0` (100%), which results in all traces being sampled.

### Prioritize Low Volume Projects
<Alert title="✨ Note" level="info">
<Alert title="✨ Note">
This bias is only active in Automatic Mode (and not in Manual Mode). It applies to any incoming trace and is defined on a per-project basis.
</Alert>

Expand All @@ -126,13 +126,13 @@ The algorithm used in this bias computes a new sample rate with the goal of prio
### Prioritize Low Volume Transactions
This bias is used to prioritize low-volume transactions that can be drowned out by high-volume transactions. The goal is to rebalance sample rates of the individual transactions so that low-volume transactions are more likely to have representative samples. The bias is of type trace, which means that the transaction considered for rebalancing will be the root transaction of the trace.

Prioritization of low volume transactions works slightly differently depending on the dynamic sampling mode:
- In **Automatic Mode** (`sentry:sampling_mode` == `organization`), the output of the [boost_low_volume_projects](https://github.com/getsentry/sentry/blob/dee539472e999bf590cfc4e99b9b12981963defb/src/sentry/dynamic_sampling/tasks/boost_low_volume_transactions.py#L183) task is used as the base sample rate for the balancing algorithm.
Prioritization of low volume transactions works slightly differently depending on the dynamic sampling mode:
- In **Automatic Mode** (`sentry:sampling_mode` == `organization`), the output of the [boost_low_volume_projects](https://github.com/getsentry/sentry/blob/dee539472e999bf590cfc4e99b9b12981963defb/src/sentry/dynamic_sampling/tasks/boost_low_volume_transactions.py#L183) task is used as the base sample rate for the balancing algorithm.
- In **Manual Mode** (`sentry:sampling_mode` == `project`), the project target sample rate is used as the base sample rate for the balancing algorithm.

In order to rebalance transactions, the system retrieves the counts of the transactions for each project and calculates a new sample rate for each transaction.
In order to rebalance transactions, the system retrieves the counts of the transactions for each project and calculates a new sample rate for each transaction.

<Alert title="✨ Note" level="info">
<Alert title="✨ Note">

The algorithms for boosting low volume events are run periodically (with cron jobs) with a sliding window to account for changes in the incoming volume.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_order: 1
![Sequencing](./images/sequencing.png)


<Alert title="💡 Note" level="info">
<Alert title="💡 Note">

Dynamic Sampling currently operates on either spans or transactions to measure data throughput. This is controlled by the feature flag `organizations:dynamic-sampling-spans` and usually set to what the organization's subscription is metered by. In development, this currently defaults to transactions.
The logic between the two data categories is identical, so most of this documentation is kept at a generic level and important differences are pointed out explicitly.
Expand All @@ -27,7 +27,7 @@ When events arrive, in a simplified model, they go through the following steps:
4. **Dynamic Sampling**: based on an internal set of rules, Relay determines a sample rate for every incoming event. A random number generator finally decides whether a payload should be kept or dropped.
5. **Rate limiting**: events that are sampled by Dynamic Sampling will be stored and indexed. To protect the infrastructure, internal rate limits apply at this point. Under normal operation, this **rate limit is never reached** since dynamic sampling already reduces the volume of events stored.

<Alert title="💡 Example" level="info">
<Alert title="💡 Example">

A client is sending 1000 events per second to Sentry:
1. 100 events per second are from old browsers and get dropped through an inbound data filter.
Expand All @@ -44,7 +44,7 @@ The ingestion pipeline has two kinds of rate limits that behave differently com
1. **High-level request limits on load balancers**: these limits do not differentiate which data is sent by clients and drop requests as soon as the throughput from clients reaches the limit.
2. **Specific limits per data category in Relay**: these limits apply once requests have been parsed and have gone through basic handling (see [Sequencing](#sequencing) above).

<Alert title="✨️ Note" level="info">
<Alert title="✨️ Note">

There is a dedicated rate limit for stored events after inbound filters and dynamic sampling. However, it does not affect total events since the fidelity decreases with higher total event volumes and this rate limit is not expected to trigger since Dynamic Sampling already reduces the stored event throughput.

Expand All @@ -56,7 +56,7 @@ Dynamic sampling ensures complete traces by retaining all events associated with

Despite dynamic sampling providing trace completeness, events or other items (errors, replays, ...) may still be missing from a trace when rate limiting drops one or more of them. Rate limiting drops items without regard for the trace, making each decision independently and potentially resulting in broken traces.

<Alert title="💡 Example" level="info">
<Alert title="💡 Example">

For example, if there is a trace from `Project A` to `Project B` and `Project B` is subject to rate limiting or quota enforcement, events of `Project B` from the trace initiated by `Project A` are lost.

Expand Down Expand Up @@ -84,7 +84,7 @@ Each of these metrics can be filtered and grouped by a number of predefined tags

For more granular queries, **stored events are needed**. _The purpose of dynamic sampling here is to ensure that there are always sufficient representative sample events._

<Alert title="💡 Example" level="info">
<Alert title="💡 Example">

If Sentry applies a 1% dynamic sample rate, you can still receive accurate events per minute (SPM or TPM, depending on event type) and web vital quantiles through total event data backed by metrics. There is also a listing of each of these numbers by the transaction.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Prior to our multi-region offering, all API traffic from customers would be sent
- DSN host
- A static list of URL names (region pin list)

<Alert level="info">
<Alert>
💡 Requests going to sentry.io do not meet data residency requirements. Customers will need to use region domains in order to not have requests go to the US.
</Alert>

Expand Down
2 changes: 1 addition & 1 deletion develop-docs/application-architecture/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ In order to offer customers data residency we needed to co-locate the bulk of an

These constraints led our design to having multiple 'silo modes'.

<Alert level="info">
<Alert>
☝ The term ‘silo’ was chosen as other applicable terms (region, zone, partition, cluster) are all taken.
</Alert>

Expand Down
4 changes: 2 additions & 2 deletions develop-docs/backend/api/design.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Here are some additional examples:
- 👍 `/projects/\{organization_slug}/\{project_slug}/issues/`
- 👎 `/projects/`

<Alert title="Note" level="info">
<Alert title="Note">

Hierarchy here does not necessarily mean that one collection belongs to a parent collection. For example:
- `projects/\{project_identifier}/teams/` refers to the **teams** that have been added to specific project
Expand Down Expand Up @@ -82,7 +82,7 @@ Here are some notes that can help you decide between similar methods. We use *Ge
## Response Object
Each response object returned from an API should be a serialized version of the Django model associated with the resource. You can see all the existing serializers [here](https://github.com/getsentry/sentry/tree/master/src/sentry/api/serializers/models).

<Alert title="Note" level="info">
<Alert title="Note">

Some models might have different serializers based on use case. For example, `Project` can be serialized into `DetailedProjectSerializer` or `ProjectSerializer`. Decide which one to use based on your use case and API scope but **DO NOT RETURN CUSTOM OBJECTS** like \{`slug: project_slug, platform: project_platform`}. We want the API responses to be uniform and useable in multiple automations without adding extra complication to the external developers' code.

Expand Down
2 changes: 1 addition & 1 deletion develop-docs/backend/api/public.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ build. With that being said, there are 3 exceptions where we don't publish APIs:
that you think it should be published let [owners-api](https://github.com/orgs/getsentry/teams/owners-api)
know and we can help with that.

<Alert title="Note" level="info">
<Alert title="Note">

Always keep in mind that your APIs may still be used even if they're `private`. All the APIs
in the Sentry repo are accessible due to our open-source nature.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ features.add(
feature.<feature_scope>:<feature_name>
```

<Alert level="info">
<Alert>
The feature config should not be merged until the registration commit in step 1 has been fully deployed to all target environments. This is because Options Automator will fail to push options to any environments missing the option registration.
If this happens, make sure to rerun the options deployment once all environments have been updated to ensure your feature is active.
</Alert>
Expand Down
6 changes: 3 additions & 3 deletions develop-docs/backend/application-domains/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Follow these rules when adding new options:

The value of an option can be any pickleable value.

<Alert level="info">
<Alert>
It is safe to declare and use an option in the same pull request, you don't need to
split them up.
</Alert>
Expand Down Expand Up @@ -55,7 +55,7 @@ from sentry import options
options.set("performance.some-feature-rate", 0.01)
```

<Alert level="info">
<Alert>
If you do not have access to the shell, you'll need to contact OPS to set the option
value for you.
</Alert>
Expand Down Expand Up @@ -125,7 +125,7 @@ from sentry import options
options.delete("performance.some-feature-rate")
```

<Alert level="info">
<Alert>
If you do not have access to the shell, you'll need to contact OPS to remove the option
for you.
</Alert>
4 changes: 2 additions & 2 deletions develop-docs/development-infrastructure/environment/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Access it at [http://dev.getsentry.net:8000](http://dev.getsentry.net:8000) (you
A superuser account should have been created for you during bootstrap - `[email protected]` with password `admin`.
You can create other users with `sentry createuser`.

<Alert title="Note" level="info">
<Alert title="Note">
When asked for the root address of the server, make sure that you use
[http://dev.getsentry.net:8000](http://dev.getsentry.net:8000), as both
protocol _and_ port are required in order for DNS and some pages' URLs to be
Expand Down Expand Up @@ -75,7 +75,7 @@ yarn https-proxy

After the server is running we can visit the dev server using `https` at port `:8003` instead of over `http` at `:8000`.

<Alert title="HTTP Strict-Transport-Security" level="info">
<Alert title="HTTP Strict-Transport-Security">
You might get into a situation where [HSTS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security) is enabled for your domain and you're unable to visit using `http` anymore.

To clear the HSTS visit `chrome://net-internals/#hsts` in Chrome based browsers and use the "Delete domain security policies" form.
Expand Down
2 changes: 1 addition & 1 deletion develop-docs/development-infrastructure/testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ SENTRY_SCREENSHOT=1 VISUAL_SNAPSHOT_ENABLE=1 \
-k test_with_onboarding
```

<Alert title="Tip!" level="info">
<Alert title="Tip!">
If you're seeing `WARNING: Failed to gather log types: Message: unknown command:
Cannot call non W3C standard command while in W3C mode`, it means that `Webpack` hasn't compiled assets properly.
</Alert>
Expand Down
2 changes: 1 addition & 1 deletion develop-docs/frontend/component-library.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: UI Component Library
sidebar_order: 40
---

<Alert level="info">
<Alert>
To jump straight in visit <Link to="https://sentry.io/orgredirect/organizations/:orgslug/stories/"><code>/stories/</code></Link> on your existing Sentry Org/Install.
</Alert>

Expand Down
6 changes: 3 additions & 3 deletions develop-docs/frontend/design-tenets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Frontend Design Tenets
sidebar_order: 20
---

<Alert level="info">
<Alert>
<strong>ten·et (noun)</strong>

_a principle or belief, especially one of the main principles of a religion or philosophy._
Expand All @@ -19,7 +19,7 @@ Why disable (grey out)?
- Educates the user on capabilities they don't have permission for (yet)
- Informs of the current value (read access)

<Alert level="info">
<Alert>
Bonus: where it makes sense, consider <Link href="https://blog.sentry.io/how-we-grew-sentrys-monthly-active-users-by-rethinking-invitations/" remote>prompting the user to request access</Link>.
</Alert>

Expand All @@ -36,7 +36,7 @@ Why preserve state change in the URL?
- Preserves browser back and forward buttons
- Makes content shareable (user can share exact view with a teammate)

<Alert level="info">
<Alert>
Ask yourself this question: "If I was sharing this page with my coworker on Slack, is it important that they see the exact view I'm looking at?" If the answer is "yes", then the state to regenerate that view should be present in the URL.
</Alert>

Expand Down
4 changes: 2 additions & 2 deletions develop-docs/frontend/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ For event callback props passed to the component use the `on` prefix, e.g:

## State management

<Alert level="info">
<Alert>
For React Hooks tips check out <Link to="/frontend/using-hooks/">this page</Link>.
</Alert>

Expand All @@ -120,7 +120,7 @@ Reflux implements the unidirectional data flow pattern outlined by [Flux](https:

## Testing

<Alert level="info">
<Alert>
For React Testing Library (RTL) tips check out <Link to="/frontend/using-rtl/">this page</Link>.
</Alert>

Expand Down
2 changes: 1 addition & 1 deletion develop-docs/frontend/upgrade-policies.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Overall, our approach to upgrading packages is **a balanced one**, taking into a

## How to upgrade a package

<Alert level="info">
<Alert>

You may not have to do this manually! See the below section on [Take advantage of tooling](#take-advantage-of-tooling) to learn more about our usage of `dependabot` for automatic frontend package upgrades.

Expand Down
2 changes: 1 addition & 1 deletion develop-docs/frontend/using-styled-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const SomeComponent = styled('div')`

## Dynamic Properties

<Alert level="info">
<Alert>
Most of the time dynamic properties are not needed!
</Alert>

Expand Down
Loading

0 comments on commit 6cab7b7

Please sign in to comment.