dev(mocks): empower-mocks v0 WIP #76520
Draft
+327
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 toload-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.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 everyINTERVAL_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