Skip to content

[FFL-1945] Remove redundant UNKNOWN_TYPE from ERROR_TYPE_MAP#5658

Merged
sameerank merged 3 commits into
masterfrom
sameerank/cleanup-unknown-type-error-mapping
May 5, 2026
Merged

[FFL-1945] Remove redundant UNKNOWN_TYPE from ERROR_TYPE_MAP#5658
sameerank merged 3 commits into
masterfrom
sameerank/cleanup-unknown-type-error-mapping

Conversation

@sameerank

@sameerank sameerank commented May 1, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Removes the redundant UNKNOWN_TYPE entry from ERROR_TYPE_MAP in the OpenFeature flag evaluation metrics.

Motivation:

Follow-up to PR #5599 based on review feedback.

Shall we remove it from the map here as it only causes confusion? (We still have defaulting to DEFAULT_ERROR_TYPE in normalize_error_type.)

The normalize_error_type method uses Hash#fetch with DEFAULT_ERROR_TYPE as the fallback, so explicitly mapping UNKNOWN_TYPE => DEFAULT_ERROR_TYPE is redundant. Any unmapped error codes (including UNKNOWN_TYPE) automatically default to 'general'.

Change log entry

None.

Additional Notes:

Added behavioral tests to verify the defaulting mechanism works correctly for both UNKNOWN_TYPE and arbitrary unmapped error codes.

How to test the change?

bundle exec rake test:open_feature

All 98 tests pass on both openfeature_latest and openfeature_min gemfiles.

sameerank added 2 commits May 1, 2026 10:00
Since normalize_error_type uses fetch with DEFAULT_ERROR_TYPE as the
fallback, explicitly mapping UNKNOWN_TYPE is redundant. Any unmapped
error codes (including UNKNOWN_TYPE) automatically default to 'general'.
@sameerank sameerank added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label May 1, 2026
@datadog-official

datadog-official Bot commented May 1, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 97.21% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a7f4331 | Docs | Datadog PR Page | Give us feedback!

Comment thread spec/datadog/open_feature/metrics/flag_eval_metrics_spec.rb
@sameerank
sameerank marked this pull request as ready for review May 1, 2026 20:11
@sameerank
sameerank requested a review from a team as a code owner May 1, 2026 20:11
@sameerank
sameerank requested review from greghuels and typotter May 1, 2026 20:11
@sameerank
sameerank requested review from dd-oleksii and removed request for greghuels May 1, 2026 20:12
@sameerank
sameerank enabled auto-merge (squash) May 5, 2026 14:53
@pr-commenter

pr-commenter Bot commented May 5, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-05-05 15:44:56

Comparing candidate commit a7f4331 in PR branch sameerank/cleanup-unknown-type-error-mapping with baseline commit e135853 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 45 metrics, 1 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

@sameerank
sameerank merged commit bc0f740 into master May 5, 2026
585 checks passed
@sameerank
sameerank deleted the sameerank/cleanup-unknown-type-error-mapping branch May 5, 2026 15:55
@dd-octo-sts dd-octo-sts Bot added this to the 2.32.0 milestone May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants