Skip to content

feat: enable override of TraceProvider in JSON evaluations - #2070

Merged
toddbaert merged 2 commits into
open-feature:mainfrom
nelzblooket:eval-trace-provider
Sep 24, 2026
Merged

toddbaert merged 2 commits into
open-feature:mainfrom
nelzblooket:eval-trace-provider

Conversation

@nelzblooket

Copy link
Copy Markdown
Contributor

This PR

Enable using something other than the global default TraceProvider when setting up a JSON evaluator.

Notes

My eventual goal is to have this added via the InProcessService:
https://github.com/open-feature/go-sdk-contrib/blob/dfc4d8366adf483b82bbb021cfb517030259be59/providers/flagd/pkg/service/in_process/service.go#L140

Follow-up Tasks

nb - the traces started in the Resolver, e.g. resolve<Type>, are pretty chatty but sparse of information, and since the returned context.Context is ignored, the trace acts like an orphan in the waterfall of spans. Maybe this should be re-evaluated?

How to test

If you configure with a noop.NewTraceProvider(), you should no longer see resolve<Type> in emitted spans.

@nelzblooket
nelzblooket requested review from a team as code owners September 22, 2026 16:00
@netlify

netlify Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for polite-licorice-3db33c canceled.

Name Link
🔨 Latest commit f7126c2
🔍 Latest deploy log https://app.netlify.com/projects/polite-licorice-3db33c/deploys/6ab519e08faf00000848ca2b

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: f8f6ecf2-d8fc-4f07-bb94-93dbfdb233c3

📥 Commits

Reviewing files that changed from the base of the PR and between d1d1f33 and f7126c2.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: b8625ca5-1146-4ce8-9658-7f10e142ae08

📥 Commits

Reviewing files that changed from the base of the PR and between afd7019 and d1d1f33.

📒 Files selected for processing (1)
  • core/pkg/evaluator/json.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • core/pkg/evaluator/json.go

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The JSON evaluator option is renamed to WithTracerProvider. It configures evaluator and resolver tracing with the supplied provider. A shared constant replaces the tracer name literal used during initialization.

Changes

JSON evaluator tracing

Layer / File(s) Summary
Configure JSON evaluator tracing
core/pkg/evaluator/json.go
Renames WithTraceProvider to WithTracerProvider without changing its behavior. Adds the shared jsonEvaluatorTracerName constant and uses it during tracer initialization.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: toddbaert

Merge Risk: ⚪ Minimal · up to d1d1f

The tracer override appears ready to merge after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: allowing JSON evaluations to override the default tracing provider.
Description check ✅ Passed The description explains the tracing provider override, the intended behavior, testing approach, and follow-up work. It is directly related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@nelzblooket nelzblooket changed the title enable override of TraceProvider in JSON evaluations feat: enable override of TraceProvider in JSON evaluations Sep 22, 2026

@toddbaert toddbaert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good - I just have one small request:

Could we call it WithTracerProvider? OTel's type is TracerProvider and that's the convention in otelgrpc etc. This is new public API in core, so renaming later would be breaking. I know it's a nit but I can't un-see it.

@toddbaert
toddbaert self-requested a review September 24, 2026 12:38
@sonarqubecloud

Copy link
Copy Markdown

@toddbaert
toddbaert merged commit d090fa7 into open-feature:main Sep 24, 2026
18 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 24, 2026
toddbaert pushed a commit that referenced this pull request Sep 25, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>flagd: 0.17.0</summary>

##
[0.17.0](flagd/v0.16.3...flagd/v0.17.0)
(2026-09-25)


### ⚠ BREAKING CHANGES

* **sync:** server-side sync metrics renamed (client metrics added
alongside): feature_flag.flagd.sync.active_streams ->
feature_flag.flagd.sync.server.active_streams
feature_flag.flagd.sync.stream.duration ->
feature_flag.flagd.sync.server.stream.duration

### 🐛 Bug Fixes

* **security:** update module go.opentelemetry.io/otel/sdk to v1.45.0
[security] ([#2056](#2056))
([904232a](904232a))
* wait for flag state before reporting ready
([#2050](#2050))
([1c517f5](1c517f5))


### ✨ New Features

* gzip compression for OFREP evaluation responses
([#2071](#2071))
([d0cc7fc](d0cc7fc))
* **sync:** instrument the outbound sync channel (flagd as client)
([#2051](#2051))
([ad63aad](ad63aad))


### 🧹 Chore

* **deps:** update gcr.io/distroless/static:nonroot docker digest to
e2e927e ([#2068](#2068))
([8554906](8554906))
</details>

<details><summary>flagd-proxy: 0.9.10</summary>

##
[0.9.10](flagd-proxy/v0.9.9...flagd-proxy/v0.9.10)
(2026-09-25)


### 🧹 Chore

* **deps:** update gcr.io/distroless/static:nonroot docker digest to
e2e927e ([#2068](#2068))
([8554906](8554906))
</details>

<details><summary>core: 0.18.0</summary>

##
[0.18.0](core/v0.17.0...core/v0.18.0)
(2026-09-25)


### ⚠ BREAKING CHANGES

* **sync:** server-side sync metrics renamed (client metrics added
alongside): feature_flag.flagd.sync.active_streams ->
feature_flag.flagd.sync.server.active_streams
feature_flag.flagd.sync.stream.duration ->
feature_flag.flagd.sync.server.stream.duration

### 🐛 Bug Fixes

* **security:** update module go.opentelemetry.io/otel/sdk to v1.45.0
[security] ([#2056](#2056))
([904232a](904232a))


### ✨ New Features

* enable override of `TraceProvider` in JSON evaluations
([#2070](#2070))
([d090fa7](d090fa7))
* **sync:** instrument the outbound sync channel (flagd as client)
([#2051](#2051))
([ad63aad](ad63aad))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Signed-off-by: OpenFeature Bot <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@nelzblooket
nelzblooket deleted the eval-trace-provider branch October 30, 2026 22:33
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.

2 participants