feat(server): expose error tracking config and captureException options - #670
Draft
cat-ph wants to merge 2 commits into
Draft
feat(server): expose error tracking config and captureException options#670cat-ph wants to merge 2 commits into
cat-ph wants to merge 2 commits into
Conversation
This was referenced Aug 3, 2026
…on capture The stateful captureException path forwards config.releaseIdentifier to the frame serializer (map_id per frame for ProGuard symbolication) but the stateless path used by posthog-server omitted it, so server-side frames could never carry map_id. Forward it for parity.
- PostHogConfig.inAppIncludes/inAppExcludes control in_app frame classification (prefix match, excludes win); inAppExcludes defaults to DEFAULT_IN_APP_EXCLUDES (JDK/Kotlin/framework noise) so zero-config users get a your-code vs framework split out of the box. - PostHogConfig.releaseIdentifier stamps frames with map_id, tying events to an uploaded ProGuard/R8 mapping for symbolication. - New captureException(exception[, distinctId], options) overloads with the same option-merging semantics as capture(..., options): custom props, $groups, $set/$set_once, timestamp, and flag enrichment via snapshot or appendFeatureFlags; reserved props ($exception_level, ...) overridable via options properties; request-context resolution and personless fallback unchanged.
cat-ph
force-pushed
the
cat/java-et-server-config
branch
from
August 3, 2026 23:03
b4e866a to
ffe3132
Compare
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.
💡 Motivation and Context
Second PR in the 4-PR JVM error-tracking stack. It exposes the error-tracking configuration surface on the server SDK and adds the missing
captureExceptionoverloads.Contains two commits:
fix(error-tracking): pass releaseIdentifier through stateless exception capture— the stateless capture path (captureExceptionStateless, which is whatposthog-serveruses) never forwardedPostHogConfig.releaseIdentifierto the frame serializer, so$exception_listframes were missingmap_idand could not be symbolicated. The statefulcaptureExceptionpath already did this; this restores parity. (Verified still missing onmainas of this PR.)feat(server): expose error tracking config and captureException options:PostHogConfig.inAppIncludes/inAppExcludescontrolin_appclassification of captured frames (class-name prefix match; excludes always win).inAppExcludesdefaults to a newPostHogConfig.DEFAULT_IN_APP_EXCLUDESlist of common JVM/framework prefixes (JDK, Kotlin, Spring, Netty, servlet containers, HTTP clients, the PostHog SDK itself) so zero-config users get a sensible your-code vs framework split. Assigning your own list replaces the defaults.PostHogConfig.releaseIdentifierstamps every frame withmap_id, tying events to a ProGuard/R8 mapping uploaded viaposthog-cli.Builder.captureException(exception, distinctId, options)/captureException(exception, options)overloads takePostHogCaptureOptionswith the same merging semantics ascapture(..., options): custom properties,$groups,$set/$set_once, timestamp, and feature-flag enrichment via a pre-evaluatedflagssnapshot orappendFeatureFlags. Reserved exception properties (e.g.$exception_level,$exception_fingerprint) can be overridden through options properties. Request-context distinct-id resolution and personless fallback behave exactly like the existing overloads.💚 How did you test it?
posthog-server'sPostHogConfigTestandPostHogTest(defaults and overrides for the new config, exclude-beats-include classification,map_idstamping, and each newcaptureExceptionoverload including options merging and reserved-property overrides), plus 1 new core test inPostHogStatelessTestfor thereleaseIdentifierparity fix../gradlew :posthog:test :posthog-server:test :posthog:apiCheck :posthog-server:apiCheckpass;spotlessCheckclean. API dumps regenerated; both diffs are additive only.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🔗 Stacked PR
Position 2 of 4. Base:
cat/java-et-coercer(PR #669).captureExceptionoptionscat/java-et-uncaught— opt-in server uncaught-exception capturecat/java-et-logback— newposthog-server-logbackappender moduleReview after its parent; the diff shown here is only this PR's own commits once the parent merges.