Error rate on the payment service doubles at 14:10. A deployment went out, but three feature flags also changed value. Without a link between your traces and your flags, you are guessing. With OpenFeature feature flags wired into telemetry, one query tells you which variant the failing requests were served.
The facts come from the OpenFeature documentation, the OpenFeature OpenTelemetry hooks repository and the OpenTelemetry semantic conventions, read on 13 November 2026. I did not run this code against a real flag provider: the examples are illustrations, and anything unverified is flagged as such.
New to traces? Read the anatomy of an OpenTelemetry span first. Here we add one more piece of information to the span: the decision the flag made.
The problem: a regression with no culprit
A flag is a condition in your code whose value changes at runtime. It is handy for progressive delivery, yet the value served appears in neither your logs nor your traces by default. Two identical requests behave differently and nothing explains why.
The operational decision is simple. Do you want to record every flag evaluation, the way you record an HTTP call? If so, you need a single hook point in the application, not a log.info in the middle of every function.
OpenFeature feature flags: the useful building blocks
OpenFeature is a specification plus SDKs, not a flag service. The documentation names four building blocks that matter here:
- the Evaluation API, which application code calls to evaluate a flag;
- the provider, a translation layer to your flag management tool (vendor SDK, REST API or local file);
- the Evaluation Context, the contextual data (user, region) used to decide;
- hooks, which add behaviour at set points of the evaluation. The documentation lists logging and telemetry among their uses.
Because the provider is swappable, you write the telemetry once. Changing flag tool does not break your dashboards.
Hooks: where to attach telemetry
The specification defines four stages: before (ahead of resolution), after (after a successful resolution, with the evaluation details), error (after a failure) and finally (at the end, whatever happened). To tie a flag to a trace, after is nearly always enough. Use error to count failed evaluations.
Watch out: a failing flag usually returns the default value coded in the application. Without an error hook, you mistake that default for a normal provider decision.
The ready-made OpenTelemetry hooks
The js-sdk-contrib repository publishes the @openfeature/open-telemetry-hooks package. According to its README, it holds four hooks:
EventHookemits the evaluation as an event through an OpenTelemetry EventLogger, even with no active span. The README recommends it first;SpanEventHookadds the event to the active span and does nothing without one. The README notes that OpenTelemetry is deprecating span events;SpanHookcreates one span per evaluation, with the details as attributes;MetricsHookproduces four metrics:feature_flag.evaluation_requests_total,feature_flag.evaluation_success_total,feature_flag.evaluation_error_totalandfeature_flag.evaluation_active_count.
Options let you add attributes (attributeMapper), drop some (excludeAttributes) or transform the event (eventMutator). The README states no licence for this package: check it before adopting.

Knowing the variant: the attributes to capture
The OpenTelemetry semantic conventions for feature flags describe an event named feature_flag.evaluation. Only feature_flag.key is required. The variant sits in feature_flag.result.variant, required when the provider has a variant concept; otherwise the value goes in feature_flag.result.value. Recommended: feature_flag.provider.name, feature_flag.result.reason and feature_flag.context.id. On failure, error.type is added. The page rates the event “Release Candidate” and the document “Development”, so names may still move.
The variant, not the boolean, answers “which version broke it?”. A flag with three variants (control, new-calc, new-calc-cached) gets lost in a plain true or false.

Finding the guilty variant step by step
- Register the hook at start-up, before the first evaluation (see the configuration above).
- Check the event leaves: search your backend for
feature_flag.evaluationand confirm a known flag key shows up with its variant. - Ask the regression question: group errors by key and variant over the incident window.
- Compare with the control variant: if only
new-calccarries the errors, switch it off.
Here is an illustrative DQL query. It assumes events arrive as logs with these attributes; I did not verify the exact mapping in your ingestion pipeline, so adapt the field names:
fetch logs, from: now() - 2h
| filter feature_flag.key == "vat-calc"
| summarize evaluations = count(), by: {feature_flag.result.variant, error.type}
| sort evaluations desc

For the syntax, see the DQL filter, summarize and timeseries commands. To tie the event to one specific trace, a shared correlation identifier helps, as in correlation ID or trace ID.
Best practices
- Prefer
EventHooktoSpanEventHook: it works without an active span. - Keep flag keys and variant names stable: they become query dimensions.
- Avoid personal identifiers in the evaluation context. Use
excludeAttributesto drop anything sensitive. - Count cardinality before adding attributes to metrics: one variant per user blows up the series.
- Treat a flag as a deployment: a regression that burns budget reads best with the error budget calculation.
Frequently asked questions
Does OpenFeature replace my feature flag tool?
No. OpenFeature is a standard layer on top of your tool. The provider translates to your existing system.
Do I need an active span to send the evaluation?
Not with EventHook, which logs even without a span. SpanEventHook writes nothing when no span is active.
Can I use Dynatrace to analyse this data?
Yes, if your OpenTelemetry events or metrics reach the platform. The exact ingestion path and field mapping are not verified here; test them on a demo flag before relying on them.
Conclusion
A flag is a production change. Register one hook, capture the key and the variant, and “who caused the regression?” becomes a query. Sources: OpenFeature documentation, OpenTelemetry semantic conventions for feature flags, OpenTelemetry hooks in the js-sdk-contrib repository.
span.observer is an independent community blog, not affiliated with Dynatrace LLC or the OpenFeature project. Trademarks belong to their owners. Tools change fast: check names and options in the official documentation.