feat: Add trace when evaluating feature flags#755
Conversation
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #755 +/- ##
==========================================
+ Coverage 93.47% 93.59% +0.12%
==========================================
Files 68 70 +2
Lines 2956 3030 +74
Branches 351 374 +23
==========================================
+ Hits 2763 2836 +73
Misses 135 135
- Partials 58 59 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request implements OpenTelemetry tracing for feature flag evaluations in the OpenFeature client, including the addition of an activity source and corresponding unit tests. The review feedback highlights several discrepancies with OpenTelemetry Semantic Conventions, suggesting the use of standard attribute names (e.g., 'feature_flag.provider_name', 'feature_flag.evaluation_reason', 'feature_flag.evaluation_value', 'feature_flag.variant') and recommending that span statuses be explicitly set to 'Error' when failures occur to improve telemetry accuracy.
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
This PR
Add trace when evaluating feature flags. This is different from the
TraceEnricherHookwhich enriches the current span or trace with an event, instead this more closely follows the semantic conventions: https://opentelemetry.io/docs/specs/semconv/feature-flags/feature-flags-events/. Also add OpenTelemetry logging to the sample application and ensure traces are always sampled.Success tracwe
Error trace
Related Issues
Fixes #595
Fixes #541
Notes
Follow-up Tasks
How to test