Skip to content

feat(uptime): add trace_sampling attribute in apis#80865

Merged
JoshFerge merged 13 commits into
masterfrom
jferg/uptime-sample-code--2
Nov 18, 2024
Merged

feat(uptime): add trace_sampling attribute in apis#80865
JoshFerge merged 13 commits into
masterfrom
jferg/uptime-sample-code--2

Conversation

@JoshFerge

@JoshFerge JoshFerge commented Nov 15, 2024

Copy link
Copy Markdown
Member

Adds ability for trace_sampling attribute on uptime alerts to be set via API, and serializes the field as well. part of https://github.com/getsentry/team-uptime/issues/22

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 15, 2024
@JoshFerge JoshFerge changed the title Jferg/uptime sample code 2 feat(uptime): add trace_sampling attribute in apis Nov 15, 2024
@JoshFerge JoshFerge marked this pull request as ready for review November 18, 2024 15:34
@JoshFerge JoshFerge requested a review from a team as a code owner November 18, 2024 15:34
Comment on lines +58 to +70
uptime_monitor = ProjectUptimeSubscription.objects.get(id=resp.data["id"])
uptime_subscription = uptime_monitor.uptime_subscription
assert uptime_monitor.name == "test"
assert uptime_monitor.environment == Environment.get_or_create(
project=self.project, name="uptime-prod"
)
assert uptime_monitor.owner_user_id == self.user.id
assert uptime_monitor.owner_team_id is None
assert uptime_monitor.mode == ProjectUptimeSubscriptionMode.MANUAL
assert uptime_subscription.url == "http://sentry.io"
assert uptime_subscription.interval_seconds == 60
assert uptime_subscription.timeout_ms == 1500
assert uptime_subscription.body is None

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.

nit: I'm sure the rests of the tests are like this, but I feel like we probably don't need to check everything else if this test is just testing trace sampling

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

will follow up.

@JoshFerge JoshFerge merged commit e2b6cc1 into master Nov 18, 2024
@JoshFerge JoshFerge deleted the jferg/uptime-sample-code--2 branch November 18, 2024 15:54
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 4, 2024
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