Skip to content

feat: split EvaluationTrace into reason + error_code#319

Open
fabriziodemaria wants to merge 9 commits intomainfrom
feat/split-evaluation-trace-reason-error
Open

feat: split EvaluationTrace into reason + error_code#319
fabriziodemaria wants to merge 9 commits intomainfrom
feat/split-evaluation-trace-reason-error

Conversation

@fabriziodemaria
Copy link
Member

@fabriziodemaria fabriziodemaria commented Mar 19, 2026

Summary

Aligns the Java SDK telemetry with the updated proto: splits evaluation tracking into separate reason and error_code fields for finer-grained metrics.

  • Telemetry class: tracks EvaluationReason + EvaluationErrorCode per evaluation
  • Confidence: wires evaluation tracking into getEvaluation and getEvaluationFuture
  • Proto: updated telemetry.proto with EvaluationTrace containing EvaluationReason and EvaluationErrorCode enums

Related PRs

Test plan

  • Updated ConfidenceIntegrationTest and FeatureProviderTest

- Added MetricAnnotation message for custom metrics.
- Extended EnumValueOptions to include metric annotations.
- Refactored LibraryTraces to support multiple trace types: RequestTrace and EvaluationTrace.
- Updated telemetry methods to track evaluation reasons and error codes.
- Modified tests to validate new trace structures and metrics.
@fabriziodemaria fabriziodemaria changed the title feat: split EvaluationTrace into reason + error_code (OpenFeature-aligned) feat: split EvaluationTrace into reason + error_code Mar 19, 2026
Added tracking of evaluation reasons to the telemetry client in the ConfidenceFeatureProvider. This change ensures that the reason for flag resolution is logged, improving visibility into feature flag evaluations.
@fabriziodemaria fabriziodemaria marked this pull request as ready for review March 20, 2026 10:07
Align the Java SDK error mapping with the Swift SDK by adding
explicit mappings for PARSE_ERROR and PROVIDER_NOT_READY instead
of falling through to GENERAL.

Made-with: Cursor
…errors

Add RESOLVE_REASON_UNRECOGNIZED_TARGETING_RULE to resolver proto,
Confidence-specific evaluation error codes to telemetry proto, map
RESOLVE_REASON_STALE and use granular error codes instead of generic
EVALUATION_ERROR_CODE_GENERAL. Also upgrade google-java-format to
1.35.0 to fix JDK 25 build compatibility.

Made-with: Cursor
…DK 17

The override requires JDK 22+ but CI runs on JDK 17, causing
`JCTree$JCAnyPattern` class-not-found failures. Reverting to the
fmt-maven-plugin 2.25 bundled formatter (1.24.0) and restoring the
original string-wrapping style it expects.

Made-with: Cursor
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