feat: send error tracking stack frames in canonical bottom-up order#254
Draft
cat-ph wants to merge 1 commit into
Draft
feat: send error tracking stack frames in canonical bottom-up order#254cat-ph wants to merge 1 commit into
cat-ph wants to merge 1 commit into
Conversation
Contributor
posthog-go Compliance ReportDate: 2026-07-03 00:16:52 UTC
|
| Test | Status | Duration |
|---|---|---|
| Endpoint And Method.Targets V1 Endpoint | ✅ | 25ms |
| Endpoint And Method.Does Not Use Legacy Endpoints | ✅ | 5ms |
| Required Headers.Has Authorization Bearer Header | ✅ | 6ms |
| Required Headers.Has Content Type Json | ✅ | 5ms |
| Required Headers.Has Posthog Sdk Info Format | ✅ | 6ms |
| Required Headers.Has Posthog Attempt Header | ✅ | 5ms |
| Required Headers.Has Posthog Request Id | ✅ | 6ms |
| Required Headers.Has Posthog Request Timestamp | ✅ | 6ms |
| Required Headers.Has User Agent | ✅ | 6ms |
| Body Format.Body Has Created At And Batch | ✅ | 6ms |
| Body Format.No Api Key In Body | ✅ | 6ms |
| Body Format.No Sent At In Body | ✅ | 5ms |
| Event Format.Event Has Required Root Fields | ✅ | 6ms |
| Event Format.Event Uuid Is Valid | ✅ | 6ms |
| Event Format.Event Timestamp Is Rfc3339 | ✅ | 6ms |
| Event Format.Distinct Id Is String | ✅ | 6ms |
| Event Format.Distinct Id At Root Not Properties | ✅ | 5ms |
| Event Format.Custom Properties Preserved | ✅ | 6ms |
| Event Format.Set Properties Preserved | ✅ | 6ms |
| Event Format.Set Once Properties Preserved | ✅ | 6ms |
| Event Format.Groups Properties Preserved | ✅ | 16ms |
| Event Format.Sdk Generates Uuid If Not Provided | ✅ | 6ms |
| Event Format.Event Has Required Root Fields Batch | ✅ | 8ms |
| Event Format.Event Uuid Is Valid Batch | ✅ | 8ms |
| Event Format.Event Timestamp Is Rfc3339 Batch | ✅ | 8ms |
| Event Format.Distinct Id Is String Batch | ✅ | 9ms |
| Event Format.Distinct Id At Root Not Properties Batch | ✅ | 8ms |
| Event Format.Custom Properties Preserved Batch | ✅ | 8ms |
| Event Format.Set Properties Preserved Batch | ✅ | 8ms |
| Event Format.Set Once Properties Preserved Batch | ✅ | 9ms |
| Event Format.Groups Properties Preserved Batch | ✅ | 8ms |
| Event Format.Sdk Generates Uuid If Not Provided Batch | ✅ | 8ms |
| Batch Behavior.Multiple Events In Single Batch | ✅ | 31ms |
| Batch Behavior.Batch Envelope Smoke | ✅ | 10ms |
| Batch Behavior.Flush With No Events Sends Nothing | ✅ | 3ms |
| Batch Behavior.Flush At Triggers Batch | ✅ | 1007ms |
| Batch Behavior.Created At Reflects Batch Creation Time | ✅ | 7ms |
| Deduplication.Generates Unique Uuids | ✅ | 15ms |
| Deduplication.Different Events Same Content Different Uuids | ✅ | 7ms |
| Deduplication.Preserves Uuid On Retry | ✅ | 5135ms |
| Deduplication.Preserves Timestamp On Retry | ✅ | 5136ms |
| Deduplication.Preserves Uuid And Timestamp On Batch Retry | ✅ | 5133ms |
| Deduplication.No Duplicate Events In Batch | ✅ | 31ms |
| Header Behavior On Retry.Attempt Header Starts At One | ✅ | 6ms |
| Header Behavior On Retry.Attempt Header Increments On Retry | ✅ | 10139ms |
| Header Behavior On Retry.Request Id Preserved On Retry | ✅ | 5136ms |
| Header Behavior On Retry.Different Requests Have Different Request Ids | ✅ | 2014ms |
| Header Behavior On Retry.Request Timestamp Changes On Retry | ✅ | 5134ms |
| Response Format Validation.Success Response Has Uuid Keyed Results | ✅ | 7ms |
| Response Format Validation.Success Response Has Ok For Each Event | ✅ | 28ms |
| Response Format Validation.Success No Retry After When All Ok | ✅ | 27ms |
| Response Format Validation.Success Retry After Present When Retry Events | ✅ | 129ms |
| Response Format Validation.Success No Retry After When Drop Only | ✅ | 28ms |
| Response Format Validation.Response Echoes Request Id | ✅ | 6ms |
| Retry Behavior.Retries On 408 | ✅ | 5134ms |
| Retry Behavior.Retries On 500 | ✅ | 5136ms |
| Retry Behavior.Retries On 503 | ✅ | 5135ms |
| Retry Behavior.Retries On 504 | ✅ | 5135ms |
| Retry Behavior.Retryable Errors Have Retry After | ✅ | 2134ms |
| Retry Behavior.Respects Retry After On Retryable Error | ✅ | 8133ms |
| Retry Behavior.Does Not Retry On 400 | ✅ | 2133ms |
| Retry Behavior.Does Not Retry On 401 | ✅ | 2132ms |
| Retry Behavior.Does Not Retry On 402 | ✅ | 2133ms |
| Retry Behavior.Does Not Retry On 413 | ✅ | 2132ms |
| Retry Behavior.Does Not Retry On 415 | ✅ | 2133ms |
| Retry Behavior.Non Retryable Errors Have No Retry After | ✅ | 2133ms |
| Retry Behavior.Implements Backoff | ✅ | 15142ms |
| Retry Behavior.Max Retries Respected | ✅ | 15143ms |
| Partial Batch Handling.Handles 200 Full Success | ✅ | 2009ms |
| Partial Batch Handling.Handles 200 With All Ok | ✅ | 3031ms |
| Partial Batch Handling.Does Not Retry Dropped Events | ✅ | 3030ms |
| Partial Batch Handling.Does Not Retry Limited Events | ✅ | 3032ms |
| Partial Batch Handling.Prunes Ok Events On Partial Retry | ✅ | 5135ms |
| Partial Batch Handling.Prunes Dropped Events On Partial Retry | ✅ | 5136ms |
| Partial Batch Handling.Retries Only Retry Events From Partial | ✅ | 5137ms |
| Partial Batch Handling.Partial Retry Preserves Uuids | ✅ | 5137ms |
| Partial Batch Handling.Partial Retry Attempt Header Increments | ✅ | 5136ms |
| Partial Batch Handling.Partial Retry Request Id Preserved | ✅ | 5135ms |
| Partial Batch Handling.Respects Retry After On Partial | ✅ | 5136ms |
| Partial Batch Handling.Unknown Result Treated As Terminal | ✅ | 3031ms |
| Partial Batch Handling.Mixed Ok Drop Limited No Retry | ✅ | 3033ms |
| Compression.Sends Gzip Content Encoding | ✅ | 7ms |
| Compression.No Content Encoding When Disabled | ✅ | 6ms |
| Compression.Compressed Body Is Decompressible | ✅ | 6ms |
| Error Handling.Does Not Retry On Unknown 4Xx | ✅ | 2131ms |
| Event Options.Cookieless Mode Override | ✅ | 7ms |
| Event Options.Disable Skew Correction Override | ✅ | 6ms |
| Event Options.Process Person Profile Override | ✅ | 5ms |
| Event Options.Product Tour Id Override | ✅ | 6ms |
| Event Options.Unset Options Omitted | ✅ | 5ms |
| Event Options.Options Override In Batch | ✅ | 9ms |
| Geoip And Historical Migration.Geoip Disable Injected Into Properties | ✅ | 6ms |
| Geoip And Historical Migration.Historical Migration Set In Body | ✅ | 6ms |
| Geoip And Historical Migration.Historical Migration Absent By Default | ✅ | 6ms |
Feature_Flags Tests
View Details
| Test | Status | Duration |
|---|---|---|
| Request Payload.Request With Person Properties Device Id | ✅ | 15ms |
| Request Payload.Flags Request Uses V2 Query Param | ✅ | 16ms |
| Request Payload.Flags Request Hits Flags Path Not Decide | ✅ | 15ms |
| Request Payload.Flags Request Omits Authorization Header | ✅ | 15ms |
| Request Payload.Token In Flags Body Matches Init | ✅ | 16ms |
| Request Payload.Groups Round Trip | ✅ | 16ms |
| Request Payload.Groups Default To Empty Object | ✅ | 15ms |
| Request Payload.Disable Geoip False Propagates As Geoip Disable False | ✅ | 15ms |
| Request Payload.Disable Geoip Omitted Defaults To False | ✅ | 16ms |
| Request Payload.Flag Keys To Evaluate Contains Only Requested Key | ✅ | 16ms |
| Request Lifecycle.No Flags Request On Init Alone | ✅ | 2ms |
| Request Lifecycle.No Flags Request On Normal Capture | ✅ | 6ms |
| Request Lifecycle.Two Flag Calls Produce Two Remote Requests | ✅ | 29ms |
| Request Lifecycle.Mock Response Value Is Returned To Caller | ✅ | 16ms |
| Retry Behavior.Retries Flags On 502 | ❌ | 5ms |
| Retry Behavior.Retries Flags On 504 | ❌ | 5ms |
| Side Effect Events.Get Feature Flag Captures Feature Flag Called Event | ✅ | 17ms |
Failures
retry_behavior.retries_flags_on_502
500, message='Internal Server Error', url='http://sdk-adapter:8080/get_feature_flag'
retry_behavior.retries_flags_on_504
500, message='Internal Server Error', url='http://sdk-adapter:8080/get_feature_flag'
|
Reviews (1): Last reviewed commit: "feat: send error tracking stack frames i..." | Re-trigger Greptile |
Contributor
|
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
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.
Problem
PostHog SDKs disagree on the order of stack frames inside
$exception_list[].stacktrace.frames. posthog-go currently emits frames in Go's nativeruntime.CallersFramesorder (innermost first, crash/capture site at index 0), while the canonical cross-SDK convention being standardized in PostHog/sdk-specs#11 is bottom-up: entry point first, crash site last. Mixed conventions make the same logical error group, fingerprint, and display differently per platform.Changes
DefaultStackTraceExtractor.GetStackTracereverses the collected frames after theruntime.CallersFramesloop, emitting canonical wire order (frames[0] = outermost/entry point, last = capture site). This matches the already-canonicalNativeStackTraceExtractor.$exception_listbehavior is unchanged.Tests
TestDefaultStackTraceExtractor_CanonicalWireOrder: first frame = entry point (runtime.goexit), last frame = capture site (runtime.Callers).go build ./...,go vet ./..., focused error-tracking suite: 31 passed.Coordination
This is a breaking wire-order change. Do not merge/release until the ingestion pipeline's normalization gate (cymbal) is live; it gates legacy payloads per
$lib/$lib_version, so this must ship as a minor release. Part of the cross-SDK ordering standardization tracked in PostHog/sdk-specs#11.