Skip to content

feat(dyn-sampling): Adds get_blended_sample_rate to Quota abstraction#39967

Merged
ahmedetefy merged 1 commit into
masterfrom
ahmed/add-floor-rate-interface
Oct 13, 2022
Merged

feat(dyn-sampling): Adds get_blended_sample_rate to Quota abstraction#39967
ahmedetefy merged 1 commit into
masterfrom
ahmed/add-floor-rate-interface

Conversation

@ahmedetefy

@ahmedetefy ahmedetefy commented Oct 13, 2022

Copy link
Copy Markdown
Contributor

Adds get_blended_sample_rate method to the Quota abstraction to support functionality on both sentry/getsentry to create and thereby send uniform sampling rules as part of the ProjectConfig sent to Relay.

This method will be called:

  • When UI requests project details endpoint, we return all DS rules including the uniform rule as part of the response. And so we inject the uniform sampling rule with the blended_sample_rate into the response.
  • When computing ProjectConfig as in sentry/relay/config/init.py::_get_project_config. This is called when the schedule_invalidate_project_config task is invoked.

Thereby we would expect the project config cache to be invalidated when:

  • Beginning of the billing cycle due to plan downgrades/upgrades or crossing from on demand back to prepaid
  • Crossing over from prepaid to on demand budget
  • Is there other scenarios where we should invalidate cache in?

@markstory markstory left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks reasonable to me.

…tion

Adds `get_blended_sample_rate` method to the `Quota` abstraction
to support functionality on both sentry/getsentry to create and thereby
send uniform sampling rules as part of the ProjectConfig sent to Relay
@ahmedetefy ahmedetefy force-pushed the ahmed/add-floor-rate-interface branch from 0de511e to 3e7b109 Compare October 13, 2022 13:48
@ahmedetefy ahmedetefy merged commit 7e94306 into master Oct 13, 2022
@ahmedetefy ahmedetefy deleted the ahmed/add-floor-rate-interface branch October 13, 2022 14:51
ahmedetefy pushed a commit that referenced this pull request Oct 17, 2022
This PR is follow up for issues:

```
E   AttributeError: module 'sentry.quotas' has no attribute 'get_blended_sample_rate'
```

related to #39967

Co-authored-by: Andrii Soldatenko <andrii.soldatenko@gmail.io>
barkbarkimashark pushed a commit that referenced this pull request Oct 18, 2022
…tion (#39967)

Adds `get_blended_sample_rate` method to the `Quota` abstraction to
support functionality on both sentry/getsentry to create and thereby
send uniform sampling rules as part of the ProjectConfig sent to Relay.

This method will be called:
- When UI requests project details endpoint, we return all DS rules
including the uniform rule as part of the response. And so we inject the
uniform sampling rule with the `blended_sample_rate` into the response.
- When computing `ProjectConfig` as in
`sentry/relay/config/init.py::_get_project_config`. This is called when
the `schedule_invalidate_project_config` task is invoked.

Thereby we would expect the project config cache to be invalidated when:
- Beginning of the billing cycle due to plan downgrades/upgrades or
crossing from on demand back to prepaid
- Crossing over from prepaid to on demand budget
- Is there other scenarios where we should invalidate cache in?
barkbarkimashark pushed a commit that referenced this pull request Oct 18, 2022
This PR is follow up for issues:

```
E   AttributeError: module 'sentry.quotas' has no attribute 'get_blended_sample_rate'
```

related to #39967

Co-authored-by: Andrii Soldatenko <andrii.soldatenko@gmail.io>
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants