Skip to content

feat(server): expose in-app frame config and captureException options - #670

Draft
cat-ph wants to merge 2 commits into
cat/java-et-coercerfrom
cat/java-et-server-config
Draft

feat(server): expose in-app frame config and captureException options#670
cat-ph wants to merge 2 commits into
cat/java-et-coercerfrom
cat/java-et-server-config

Conversation

@cat-ph

@cat-ph cat-ph commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Second PR in the 4-PR JVM error-tracking stack. It exposes the in-app classification configuration surface on the server SDK and adds the missing captureException overloads.

releaseIdentifier exposure + stateless parity fix shipped separately in #668 (merged); this PR now carries only the in-app classification config and capture options.

Contains:

  1. feat(server): expose in-app frame config and captureException options:
    • PostHogConfig.inAppIncludes / inAppExcludes control in_app classification of captured frames (class-name prefix match; excludes always win). inAppExcludes defaults to a new PostHogConfig.DEFAULT_IN_APP_EXCLUDES list 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.
    • Both are available on the config Builder.
    • New captureException(exception, distinctId, options) / captureException(exception, options) overloads take PostHogCaptureOptions with the same merging semantics as capture(..., options): custom properties, $groups, $set/$set_once, timestamp, and feature-flag enrichment via a pre-evaluated flags snapshot or appendFeatureFlags. 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. Because the options overload sits next to the existing properties overload at the same arity, Java callers that passed an explicit untyped null as the third argument now need to cast it — called out in the changeset and the KDoc.
  2. docs(server): use the canonical proguard upload command in releaseIdentifier KDoc — the KDoc landed in fix: attach map_id to frames from stateless exception capture #668 cites the hidden posthog-cli exp proguard upload alias; use the canonical posthog-cli proguard upload.

💚 How did you test it?

  • 13 new tests in posthog-server (7 in PostHogConfigTest, 6 in PostHogTest): defaults and overrides for the new config, DEFAULT_IN_APP_EXCLUDES contents, exclude-beats-include classification, and each new captureException overload including options merging, reserved-property overrides, personless fallback, and map_id presence/absence on the options path.
  • ./gradlew :posthog:test :posthog-server:test :posthog:apiCheck :posthog-server:apiCheck pass; spotlessCheck clean. API dumps regenerated; the posthog-server diff is additive only on top of fix: attach map_id to frames from stateless exception capture #668's entries, which now come from main.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran pnpm changeset to generate a changeset file
  • Added the "release" label to the PR to indicate we're publishing new versions for the affected packages

🔗 Stacked PR

Position 2 of 4. Base: cat/java-et-coercer (PR #669).

  1. PR feat(error-tracking): complete exception chain metadata and in-app classification #669 — core exception chain metadata + in-app classification
  2. this PR — server in-app classification config and captureException options
  3. cat/java-et-uncaught — opt-in server uncaught-exception capture
  4. cat/java-et-logback — new posthog-server-logback appender module

Review after its parent; the diff shown here is only this PR's own commits once the parent merges.

@cat-ph
cat-ph force-pushed the cat/java-et-server-config branch from b4e866a to ffe3132 Compare August 3, 2026 23:03
@cat-ph
cat-ph force-pushed the cat/java-et-server-config branch from ffe3132 to 2174c3c Compare August 5, 2026 11:41
@cat-ph
cat-ph force-pushed the cat/java-et-coercer branch from 7e81e8d to 71672e6 Compare August 5, 2026 11:41
@cat-ph cat-ph changed the title feat(server): expose error tracking config and captureException options feat(server): expose in-app frame config and captureException options Aug 5, 2026
@cat-ph
cat-ph force-pushed the cat/java-et-server-config branch from 2174c3c to 9c02cbf Compare August 7, 2026 21:54
cat-ph added 2 commits August 8, 2026 01:12
- 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.
- 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
cat-ph force-pushed the cat/java-et-server-config branch from 9c02cbf to d6d6b47 Compare August 7, 2026 22:21
@cat-ph
cat-ph force-pushed the cat/java-et-coercer branch from 32939f8 to 4c2b895 Compare August 7, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant