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

feat(replays): add replays to self hosted #1990

Merged
merged 1 commit into from
Feb 28, 2023

Conversation

JoshFerge
Copy link
Member

@JoshFerge JoshFerge commented Feb 28, 2023

  • Enables the replays feature flags by default for self hosted
  • Adds the consumers ingest-replay-recordings and snuba-replays-consumer to the docker-compose
  • Adds ingest-replay-recordings to kafka creation script (ingest-replay-events is automatically handled by the snuba creation script)
  • Adds an end-to-end test to confirm that a basic replay makes it through the system. This test checks two endpoints, one for clickhouse, and one for replay storage.

also confirmed this works w/ self hosted by running a webpage with our SDK pointed at the DSN of the self hosted server, then seeing it in the UI.

@JoshFerge JoshFerge requested review from a team February 28, 2023 01:38
head /dev/urandom | tr -dc "a-f0-9" | head -c 32
)
TIME_IN_SECONDS=$(date +%s)
curl -sf --data '{"event_id":"'"$TEST_REPLAY_ID"'","sdk":{"name":"sentry.javascript.browser","version":"7.38.0"}}
Copy link
Member Author

Choose a reason for hiding this comment

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

for some reason the bash syntax of $' for C escaped strings for newlines wasn't working so just put in the real values

printf "Getting the test replay back"
REPLAY_SEGMENT_PATH="api/0/projects/sentry/internal/replays/$TEST_EVENT_ID/recording-segments/?download"
REPLAY_EVENT_PATH="api/0/projects/sentry/internal/replays/$TEST_EVENT_ID/"
timeout 60 bash -c 'until $(sentry_api_request "$REPLAY_EVENT_PATH" -Isf -X GET -o /dev/null); do printf '.'; sleep 0.5; done'
Copy link
Member

Choose a reason for hiding this comment

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

So this test itself will take more than 2 minutes? Is there any way to cut down on that time? I know dev-infra isn't super happy about self-hosted e2e tests taking over 15 minutes

Copy link
Member Author

Choose a reason for hiding this comment

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

hmm it shouldn't, i just copied the defaults from the other tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

are we noticing its increasing the time of the test by two minutes?

Copy link
Member Author

Choose a reason for hiding this comment

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

i can lower the timeout here if needed i don't think the tests take more than a few seconds

Copy link
Member

Choose a reason for hiding this comment

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

ahh I read that wrong, guess I'm still waking up 😅

@hubertdeng123
Copy link
Member

Awesome work @JoshFerge and the rest of the @getsentry/replay team. Approximately how much more disk space will need to be used for replays? Right now we have a minimum requirement of 20 GB of free space to run self-hosted

@JoshFerge
Copy link
Member Author

Awesome work @JoshFerge and the rest of the @getsentry/replay team. Approximately how much more disk space will need to be used for replays? Right now we have a minimum requirement of 20 GB of free space to run self-hosted

I don't think it meaningfully impacts the amount of default disk space. if they are sending a lot of replays, they'll want to add some more disk space but i assume that's the same with any other usage of the software.

@hubertdeng123
Copy link
Member

I don't think it meaningfully impacts the amount of default disk space. if they are sending a lot of replays, they'll want to add some more disk space but i assume that's the same with any other usage of the software.

Yeah I agree with this about the default disk space part. Maybe this comes from me not understanding how replays work, but I assumed that replays would take up a good amount of storage compared to before. Is that the case? If so I'm thinking it might be useful to warn them about this.

Reason I say this is we've gotten multiple issues of people filing issues and complaining about disk space usage in the past and it'd be nice to point them to some documentation warning them if it's expected

@JoshFerge
Copy link
Member Author

I don't think it meaningfully impacts the amount of default disk space. if they are sending a lot of replays, they'll want to add some more disk space but i assume that's the same with any other usage of the software.

Yeah I agree with this about the default disk space part. Maybe this comes from me not understanding how replays work, but I assumed that replays would take up a good amount of storage compared to before. Is that the case? If so I'm thinking it might be useful to warn them about this.

Reason I say this is we've gotten multiple issues of people filing issues and complaining about disk space usage in the past and it'd be nice to point them to some documentation warning them if it's expected

replays are about ~10x larger than an error / transaction, but generally with how people use them they send a lot less. so just kind of hard to say. the average replay is ~200KB (will vary on the characteristics of their website), so users can calculate how much extra space they need based on their expected volume.

@hubertdeng123
Copy link
Member

Gotcha, thanks for the context 😁. I think it'd be a nice to add that somewhere for our users. Maybe under https://develop.sentry.dev/self-hosted/? Any thoughts @chadwhitacre?

@JoshFerge
Copy link
Member Author

Gotcha, thanks for the context 😁. I think it'd be a nice to add that somewhere for our users. Maybe under https://develop.sentry.dev/self-hosted/? Any thoughts @chadwhitacre?

it seems like we don't really call out resource usage anywhere on this page -- would lean towards not adding it for now from what I see.

@@ -322,6 +325,9 @@ services:
ingest-consumer:
<<: *sentry_defaults
command: run ingest-consumer --all-consumer-types
ingest-replay-recordings:
<<: *sentry_defaults
command: run ingest-replay-recordings
Copy link
Member

Choose a reason for hiding this comment

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

Dang 33 services 😭

clickhouse
cron
geoipupdate
ingest-consumer
ingest-replay-recordings
kafka
memcached
nginx
post-process-forwarder-errors
post-process-forwarder-transactions
postgres
redis
relay
sentry-cleanup
smtp
snuba-api
snuba-cleanup
snuba-consumer
snuba-outcomes-consumer
snuba-replacer
snuba-replays-consumer
snuba-sessions-consumer
snuba-subscription-consumer-events
snuba-subscription-consumer-transactions
snuba-transactions-cleanup
snuba-transactions-consumer
subscription-consumer-events
subscription-consumer-transactions
symbolicator
symbolicator-cleanup
web
worker
zookeeper

Copy link
Member

Choose a reason for hiding this comment

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

11 snubas 😖

Copy link
Member

Choose a reason for hiding this comment

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

getsentry/snuba#1670

That said this would only help with a 33% reduction.

Looks like we need a similar issue for Sentry to consolidate all those query-subscription-consumer and post-process-forwarder services.

@hubertdeng123
Copy link
Member

We've decided to document the changes in the changelog for the next release and include some documentation around resource usage for replays there. Documentation in develop can come later as another issue of migrating README details to the develop docs. PR is good to merge by me

@JoshFerge JoshFerge merged commit 19a95c3 into master Feb 28, 2023
@JoshFerge JoshFerge deleted the jferg/add-replays-self-hosted branch February 28, 2023 21:24
@chadwhitacre
Copy link
Member

This was referenced Feb 28, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants