Repository navigation
feat(service): Add Sentry spans and cache metrics - #13
Merged
Merged
Conversation
Each proxied request is now a trace, with spans for the key, the store read, and the live request. New metrics count each request by result (replayed, live, missed, passthrough) and time it, so the hit rate of each tenant and rule shows in Sentry. They replace roach.recording, and they do not have the key or the run. The SDK no longer adds request data or trace headers: request data had URLs and bodies, and the proxy sent sentry-trace and baggage upstream. Co-Authored-By: David Cramer <david@sentry.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds Sentry tracing and new metrics (
Sentry.metrics.*,@sentry/node11.6.0, no upgrade needed), so the hit rate of each tenant and rule shows in Sentry.Metrics (attributes:
tenant,mode,rule,origin,result; no key or run). They replaceroach.recording.roach.request: counter,result=replayed|live|missed|passthroughroach.request.duration: distribution (ms), byresultroach.recording.write: counter,result=written|dropped(failed session)Hit rate =
replayed / (replayed + live + missed), fromroach.requestgrouped byresult.Spans (each has
tenant,mode,run):roach.run.start,roach.request(the root of each proxied request, withrule,result, status),roach.key(key),roach.store.read(hit/miss),roach.upstream(status),roach.store.write. The sample rate is 1.Telemetry has no credentials, bodies, or URL paths. The SDK's HTTP spans, breadcrumbs, and
RequestDataare off, because they put full URLs, headers, and request bodies on spans (thePOST /runsbody has the runsecrets).tracePropagationTargets: []means the proxy no longer sendssentry-trace/baggageupstream.mainsends them today.No change to
RoachServiceConfigordeploy/gcp/. The README has a new "Sentry" section.To check:
pnpm exec vitest run tests/deployed.test.ts. The fake Sentry server now checks every metric and span, and checks that no envelope has a token, a path, or a body. It also checks that the upstream gets no trace headers.This branch merges cleanly with #12 (I checked locally, and typecheck and tests pass on the merge).
via David Cramer.
--
View Junior Session [Sentry]