Skip to content

dev(mocks): empower-mocks v0 WIP#76520

Closed
maxkosty wants to merge 4 commits intomasterfrom
empower-mocks-v0
Closed

dev(mocks): empower-mocks v0 WIP#76520
maxkosty wants to merge 4 commits intomasterfrom
empower-mocks-v0

Conversation

@maxkosty
Copy link
Copy Markdown
Contributor

@maxkosty maxkosty commented Aug 24, 2024

Use latest real events from Empower Plant in your dev environment, with distributed tracing and linked Replays preserved.

This PR

This PR ships a dev environment script, empower-mocks similar to load-mocks that takes previously captured envelopes stored in a public GCP bucket, tweaks them to have latest timestamps and unique IDs and sends into locally running ingest pipeline.

./bin/empower-mocks --help
usage: empower-mocks [-h] [--projects [PROJECTS ...]] [--stream [INTERVAL_SECONDS]] [--quiet]

Load latest mock data from empower

options:
  -h, --help            show this help message and exit
  --projects [PROJECTS ...]
                        Space-separated list of empower projects (default: react flask)
  --stream [INTERVAL_SECONDS]
                        Send new events continuously at given interval in seconds (default: 5)
  --quiet               Don't print ingest responses

Second part, currently being built, is event capture using mini-relay integrated into Empower CI and will allow empower-mocks script to have the most recent events, e.g. ones using latest SDK. The goal of it is to provide high-quality real data for local debugging. "Mocks" therefore is a bit of misnomer as this is actual E2E test data.

--stream option

Instead of ingesting just 1 sample set of events --stream [INTERVAL_SECONDS] option will use captured Empower events as a template to generate new events every INTERVAL_SECONDS (default: 5) with adjusted timestamps and new IDs.

Empower

Empower Plant (https://demo.sentry.io/) offers a variety of SDKs and backends, has rich context and good-looking trace waterfall graphs. Its code lives in sentry-demos/empower monorepo and is co-owned by SE and SDK Engineering teams. It has CI and will build, deploy and stream all new merged changes to our demo org. You can learn more in #discuss-demo channel on Slack which has documentation links at the top.

Event capture

The part that captures events from empower and stores them in GCP bucket is still work in progress:
design doc
work already done

Implementation details

We chose not to parse envelopes for simplicity and low maintenance burden. Instead whenever possible we search-and-replace values that need to be adjusted. We accept the risk of those accidentally modifying unrelated keys in the event context because this is only test data.

Expected bucket structure

Note: relies on sequential digit filenames (1,2,3,...) instead of current 3629.173098407 and like. GCP doesn't seem to have a way to browse the bucket via public HTTP. In the future we also want project folders in the bucket to match project names in empower to eliminate the need to hardcode the mapping.

Testing

./bin/empower-mocks
Mocking org Sentry
> Mocking team Empower Plant
  > Mocking project react
  > Mocking project flask
{}
{"id":"aedbad1aaf2ada9a4400c4baa5a70ec5"}
{}
{}
    > Done sending envelopes. Waiting for processing to finish
    > Processing pending buffers
    > Processing complete
Screenshot 2024-08-24 at 12 04 24 AM
./bin/empower-mocks --stream
Mocking org Sentry
> Mocking team Empower Plant
  > Mocking project react
  > Mocking project flask

> Sending new batch of events every 5 seconds

^C	Exit
^Z	Pause
fg	Resume

{}
{}
{"id":"e20479bc8b571bf4d64ad23bd96a7d2f"}
{}

{}
{}
{"id":"3fc5f4fec379770efe9ae2d04c4385ce"}
{}

^Z
Paused. Use `fg` command to resume

zsh: suspended  ./bin/empower-mocks --stream
fg
[1]  + continued  ./bin/empower-mocks --stream
{}
{}
{"id":"1d0ceb4195340601993797f9649e38b7"}
{}

{}
{}
{"id":"4cc3ecc28cae14ed196aa894b04be75f"}
{}

^C
Exiting...

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 24, 2024
@maxkosty maxkosty added Component: Developer Environment This covers issues related to setting up a developer's environment and removed Scope: Backend Automatically applied to PRs that change backend components labels Aug 27, 2024
@getsantry
Copy link
Copy Markdown
Contributor

getsantry Bot commented Sep 17, 2024

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added the Stale label Sep 17, 2024
@maxkosty maxkosty changed the title dev(mocks): empower-mocks v0 dev(mocks): empower-mocks v0 WIP Sep 17, 2024
@getsantry getsantry Bot removed the Stale label Sep 18, 2024
@getsantry
Copy link
Copy Markdown
Contributor

getsantry Bot commented Oct 10, 2024

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added the Stale label Oct 10, 2024
@maxkosty maxkosty added the WIP label Oct 10, 2024
@maxkosty
Copy link
Copy Markdown
Contributor Author

how's this for activity?

@natemoo-re
Copy link
Copy Markdown
Member

I'm going through our PR backlog to cut down on noise. PRs and drafts without any recent activity are being closed.

If this one is still relevant, please feel free to reopen!

@natemoo-re natemoo-re closed this Jul 25, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Component: Developer Environment This covers issues related to setting up a developer's environment Stale WIP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants