feat: add two-dimensional evaluation telemetry schema#351
Closed
fabriziodemaria wants to merge 3 commits intomainfrom
Closed
feat: add two-dimensional evaluation telemetry schema#351fabriziodemaria wants to merge 3 commits intomainfrom
fabriziodemaria wants to merge 3 commits intomainfrom
Conversation
Replace the flat ResolveReason-based resolve_rate counters with a two-dimensional (EvaluationReason, EvaluationErrorCode) model that aligns with the remote SDK telemetry header schema (confidence.telemetry.v1.EvaluationTrace). This enables unified metrics across local and remote resolvers: - MATCH → TARGETING_MATCH - NO_SEGMENT_MATCH / NO_TREATMENT_MATCH → DEFAULT - FLAG_ARCHIVED → DISABLED - TARGETING_KEY_ERROR → ERROR + TARGETING_KEY_MISSING - ERROR / UNRECOGNIZED_TARGETING_RULE / MATERIALIZATION_NOT_SUPPORTED → ERROR + GENERAL The legacy resolve_rate field is deprecated but still populated for backward compatibility. The new evaluation_rate field (tag 9) carries the same data mapped through the two-dimensional model. Made-with: Cursor
Made-with: Cursor
…nce lint Made-with: Cursor
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.
Summary
EvaluationReasonandEvaluationErrorCodeenums toTelemetryData, aligned with the remote SDK telemetry header schema (confidence.telemetry.v1.EvaluationTrace)repeated EvaluationRate evaluation_rate = 9as a new field carrying two-dimensional(reason, error_code)counters, replacing the flatResolveReason-basedresolve_rateresolve_ratefield (tag 5) is deprecated but still populated for backward compatibilitymap_resolve_reason()in Rust to translateResolveReason→(EvaluationReason, EvaluationErrorCode)with the same mapping logic used in the Java/Swift/JS remote SDKsMapping
ResolveReasonEvaluationReasonEvaluationErrorCodeMATCHTARGETING_MATCHUNSPECIFIEDNO_SEGMENT_MATCH/NO_TREATMENT_MATCHDEFAULTUNSPECIFIEDFLAG_ARCHIVEDDISABLEDUNSPECIFIEDTARGETING_KEY_ERRORERRORTARGETING_KEY_MISSINGERRORERRORGENERALUNRECOGNIZED_TARGETING_RULEERRORGENERALMATERIALIZATION_NOT_SUPPORTEDERRORGENERALWhy
This enables unified telemetry metrics across local resolvers (WASM/native) and remote SDKs (Java, Swift, JS), which all use the same
(EvaluationReason, EvaluationErrorCode)dimensions. The backendConfidenceSdkTelemetryInterceptoralready processes these dimensions from theX-CONFIDENCE-TELEMETRYheader — this change brings the local resolver'sWriteFlagLogstelemetry in line.Not included (future work)
EvaluationErrorCodeenum already has the values for this; a new WASM guest function will be added in a follow-up.Test plan
cargo test -- telemetry)map_resolve_reason_coveragevalidates allResolveReason→(EvaluationReason, EvaluationErrorCode)mappingstelemetry_mark_resolve_error_reasonsvalidates error-specific countersresolve_rateand newevaluation_ratefieldsMade with Cursor