Repository navigation
Conversation
…r lowercase names in every client Auth, Storage and Functions now record the OpenTelemetry http.client.request.duration metric on their own meters, with the same HTTP client attributes Postgrest emits and no URL. The instrument and its attributes live once in Core. Every client builds the attributes only when something listens. Realtime logs under supabase.realtime, defined once. The Diagnostics docs no longer call the source names case-sensitive.
Tr00d
marked this pull request as ready for review
November 26, 2026 13:22
This branch has not been deployed
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.
What changed
Finishes aligning the SDK's telemetry with the Supabase OTel contract before 8.15.0 ships. #840 did it for Postgrest and #842 lowercased the Auth, Storage and Functions source names. This PR does the rest.
supabase.realtimeinstead ofSupabase.Realtime. The category is defined once (Supabase.Realtime.RealtimeLogging.Category, internal) and used by the socket, the client, the channel andSupabase.Client. Realtime now exposes its internals to theSupabaseassembly for this. The value is aconst, so it is compiled intoSupabase.dlland creates no runtime binding to a Realtime internal. TheSupabaseOptions.LoggerFactorydoc lists the new category.http.client.request.duration, the same instrument Postgrest records. Each keeps its own meter (supabase.gotrue,supabase.storage,supabase.functions), so the meter scope still names the product. Every measurement carrieshttp.request.method,server.address,server.portandurl.scheme, plushttp.response.status_codewhen there was a response anderror.typewhen the request failed. Functions keepsfaas.invoked_name.url.pathis gone from these metrics, as it is from Postgrest's.Supabase.Core.Diagnostics.HttpClientRequestDuration(internal). Each product creates it on its own meter withHttpClientRequestDuration.On(Meter)and appends its own attributes toTagsOf(...).Instrumentation.SecondsSince(internal) replaces the four copies of the elapsed-seconds calculation.Enabledcheck fromPostgrestInstrumentation.RecordRequest, so aTagListwas built for every request even without a listener. All four products now build tags only when the instrument is enabled, under the same guard:if (RequestDuration.Enabled) RequestDuration.Record(...).*DiagnosticsXML docs no longer say "(case-sensitive) source names". The OpenTelemetry SDK matchesAddSourceandAddMeternames without regard to case, so that claim was wrong for the main use. The docs still say to use the constant rather than a string literal. The Auth, Storage and Functions READMEs describe the new metric.Things to review
supabase.storage.transfer.durationandsupabase.storage.transfer.sizemeasure a whole upload or download, which can span many HTTP requests (a TUS upload is one span for all its chunks). They are not single HTTP requests, so they keep their names and their attributes, includingurl.pathandstorage.transfer.direction.if (Enabled) Record(...), notif (!Enabled) return;. The two do the same thing, but Stryker turns the earlyreturn;into an equivalent mutant: removing it changes nothing a test can see. That is why feat(postgrest): align client span and metric with the Supabase OTel contract #840 dropped the guard. In the positive form, every mutant changes what a listener receives, so the tests kill them all.url.path. The OTel HTTP client metric does not define it, and on these clients the path holds user ids, factor ids and object names, which are high-cardinality and can identify someone. The spans still carry the path.BackgroundWorkEventprefixes the component, so messages now readsupabase.realtime: connected.StorageInstrumentation.cs,FunctionsInstrumentation.csandSupabaseDiagnostics.csmoved to file-scoped namespaces. Most of their diff is indentation;git diff -wshows the real change.TransferMetricsTests(Storage) pins that each transfer metric records when only it is listened to, and that a failed transfer carrieserror.type. They kill surviving mutants in the transfer guard that the reformat brought into the diff.SupabaseDiagnosticsTestspinsSourceNames, which had no hermetic test.Verification
changed-lines-coverage.py): 100% for every touched package. Core 19/19, Postgrest 8/8, Functions 19/19, Storage 41/41, Realtime 7/7, Supabase 7/7, Gotrue 3/3.HttpClientRequestDuration.cs,Instrumentation.cs,PostgrestInstrumentation.cs,GotrueInstrumentation.cs,StorageInstrumentation.csandFunctionsInstrumentation.cs: 0 survived and 0 uncovered mutants in these files, not only on changed lines. Core scored 100% (22 tested). Storage: 23 killed, 6 timeouts. Postgrest: 24 killed. Functions: 5 killed. Gotrue: 3 killed. The rest are compile errors or ignored.SupabaseDiagnostics.csandRealtimeLogging.cshold only constants and produce no testable mutants.gate.shper package: INCOMPLETE for Core, Gotrue, Storage, Functions, Postgrest, Realtime and Supabase. Build (at baseline), format, inner loop, public API declared, vulnerability scan and public API diff all PASS. E2E and coverage were skipped because the local stack was down, so CI is the gate. No public API changes.Telemetry changes in 8.15.0
Every name the SDK emits telemetry under is now lowercase. Auth, Database, Storage and Functions record the standard OpenTelemetry
http.client.request.durationmetric.ActivitySource and Meter names (
*Diagnostics.SourceName)Supabase.Gotruesupabase.gotrueSupabase.Postgrestsupabase.postgrestSupabase.Storagesupabase.storageSupabase.Functionssupabase.functionsLog categories (
SupabaseOptions.LoggerFactory)Supabase.Gotruesupabase.gotrueSupabase.Postgrestsupabase.postgrestSupabase.Storagesupabase.storageSupabase.Functionssupabase.functionsSupabase.Realtimesupabase.realtimeBackground-work messages start with the category, so they now read
supabase.gotrue: ...andsupabase.realtime: ....Metrics
supabase.gotrue.http.request.durationhttp.client.request.durationon thesupabase.gotruemetersupabase.postgrest.http.request.durationhttp.client.request.durationon thesupabase.postgrestmetersupabase.storage.http.request.durationhttp.client.request.durationon thesupabase.storagemetersupabase.functions.invoke.durationhttp.client.request.durationon thesupabase.functionsmetersupabase.storage.transfer.durationandsupabase.storage.transfer.sizeare unchanged.Attributes of
http.client.request.duration, for every client:server.portandurl.scheme.url.path. The metric carries no URL.http.request.method,server.address,http.response.status_code,error.type, andfaas.invoked_nameon Functions.Database span and metric attributes
db.operation→supabase.postgrest.operation.HEAD) is reported asselectinstead ofcount.supabase.postgrest.tableon table calls, andsupabase.postgrest.functionon RPC calls.url.fullon the span now includes the query string with every value replaced byREDACTED, except the values ofselect,order,limitandoffset. Before, the query string was dropped.Recompile if you use the constants.
GotrueDiagnostics.SourceName,PostgrestDiagnostics.SourceName,StorageDiagnostics.SourceNameandFunctionsDiagnostics.SourceNameareconst, so an assembly compiled against an earlier version keeps the old name until it is recompiled. If you registered a source, meter or log category as a string literal, or filter on a metric name, update the string.