Skip to content

Add evaluation metrics section to Java feature flags docs#35970

Draft
typotter wants to merge 19 commits intomasterfrom
typo/java-eval-metrics-docs
Draft

Add evaluation metrics section to Java feature flags docs#35970
typotter wants to merge 19 commits intomasterfrom
typo/java-eval-metrics-docs

Conversation

@typotter
Copy link
Copy Markdown
Contributor

What does this PR do? What is the motivation?

Documents the feature_flag.evaluations OTel counter metric introduced in dd-openfeature v1.61.0 (DataDog/dd-trace-java#11040).

  • Adds a new Evaluation metrics section to the Java feature flags page covering:
    • Optional OTel SDK dependencies (Maven, Gradle Groovy, Gradle Kotlin)
    • OTLP endpoint resolution order
    • feature_flag.evaluations metric attribute reference
    • Graceful degradation behavior (missing deps → warning logged, flag eval unaffected)
  • Bumps dd-openfeature version references from 1.57.0 to 1.61.0

Merge instructions

Merge readiness:

  • Ready for merge

Additional notes

The parent _index.md describes DD_METRICS_OTEL_ENABLED=true as the activation mechanism for evaluation metrics across all server SDKs. The Java SDK uses classpath detection instead (OTel SDK deps on classpath enable metrics automatically). The parent page may need a follow-up note calling out this difference.

typotter and others added 19 commits March 17, 2026 13:13
Add comprehensive Unity Feature Flags documentation with two implementations:

1. unity.md - Direct FlagsClient API (current implementation)
   - Uses DdFlags.CreateClient() and direct FlagsClient methods
   - Synchronous flag evaluation (GetBooleanValue, GetStringValue, etc.)
   - Simpler API without async/await

2. unity-openfeature.md - OpenFeature integration (future/alternative)
   - Uses OpenFeature Api.Instance.GetClient()
   - Async flag evaluation methods
   - Standards-based approach

Both pages:
- Include cross-links to each other for easy navigation
- Follow the structure of Android/iOS feature flags docs
- Include installation, setup, evaluation, and advanced config sections
- Add Unity card to feature flags client navigation

The documentation is ready for preview and user feedback.
Replace full documentation with minimal placeholder pages to test CI:
- Keep navigation links and cross-references
- Add 'Documentation coming soon' message
- Reduce from ~270 lines to ~28 lines each
- Test if minimal changes pass all CI checks

Full documentation will be added incrementally after CI validation.
…e docs

Incremental update to unity-openfeature.md:
- Add detailed Overview explaining OpenFeature integration
- Add complete Installation instructions (EDM4U, Unity package, Android setup)
- Add Initialize SDK section with reference to Unity Monitoring Setup
- Add reference links at bottom

File size: 27 → 68 lines (+41 lines)
Add back all sections to unity-openfeature.md:
- Enable flags
- Create and retrieve a client
- Set the evaluation context
- Evaluate flags (boolean, string, integer, double, object)
- Flag evaluation details
- Advanced configuration

Also fixes duplicate further_reading partial and adds
OpenFeature external link to further_reading frontmatter.
Add back all sections to unity.md:
- Overview
- Installation
- Initialize the SDK
- Enable flags
- Create and retrieve a client
- Set the evaluation context
- Evaluate flags (boolean, string, integer, double, object)
- Flag evaluation details
- Advanced configuration
Feature flags are no longer in preview. Removed the callout
from both unity.md and unity-openfeature.md to match the
other SDK pages (android, ios, javascript, react).
…section

- FlagsConfiguration is now immutable (constructor-based, not object initializer)
- Add Getting Started quickstart section to unity.md
- Fix DdFlags.Instance.CreateClient() throughout unity.md
- Update parameter names to match constructor signatures (camelCase)
- Add EvaluationFlushIntervalSeconds clamp range [1, 60] to both pages
- Revert FlagsConfiguration to object initializer syntax (mutable properties, PascalCase)
- Restore DdFlags.SetEvaluationContext() as static method (not on client)
- DdFlags.CreateClient() returns void; OpenFeature client retrieved via Api.Instance.GetClient()
- Add Getting Started quickstart section
- Restore correct advanced config property names (PascalCase)
- DdFlags is an instance class with immutable FlagsConfiguration (constructor syntax)
- DdFlags.Instance.CreateProvider() returns provider for registration with OpenFeature
- Provider registered via Api.Instance.SetProviderAsync(provider)
- Evaluation context set via OpenFeature standard EvaluationContext.Builder()
- No Datadog-specific context types or direct provider method calls
- Rename "Create and retrieve a client" section to "Register the provider"
- Evaluation context set via client.SetEvaluationContext(FlagsEvaluationContext) not OpenFeature context builder
- DdFlags.Instance.CreateClient() returns FlagsClient (held for context setting); OpenFeature client retrieved separately via Api.Instance.GetClient()
- Show Unity coroutine pattern (WaitUntil) for async flag evaluation — MonoBehaviour does not support await
- Fix named provider registration: Api.Instance.SetProviderAsync("domain", provider)
- Add Getting Started as full MonoBehaviour example
- Remove unused openfeature.dev footnote
- Merge unity.md and unity-openfeature.md into one page, OpenFeature-first
- Add aliases for old unity-openfeature URLs
- Direct FlagsClient API moved to collapsed advanced section at the bottom
- Drop FlagDetails documentation (FlagDetails<T> and FlagEvaluationError are now internal)
- Flag evaluation details section uses OpenFeature FlagEvaluationDetails types only
- Delete unity-openfeature.md and unity.md.bak
- new DatadogFeatureProvider(client) replaces DdFlags.Instance.CreateProvider()
- DatadogFeatureProvider is in separate com.datadoghq.unity.flags.openfeature package
- using Datadog.Unity.Flags.OpenFeature namespace required
- DdFlags.Instance is always non-null (static readonly singleton)
- CreateClient() returns IFlagsClient (public interface)
- FlagDetails<T> and FlagEvaluationError are public — restore detail methods in direct API section
- Installation section updated for two-package architecture and NuGetForUnity
- Remove all OpenFeature references and the openfeature package install steps
- Follow iOS page structure: Enable → Create client → Set context → Evaluate → Advanced config
- DdFlags.Enable() / DdFlags.Instance.CreateClient() / client.SetEvaluationContext()
- Synchronous typed getters: GetBooleanValue, GetStringValue, GetIntegerValue, GetDoubleValue, GetObjectValue
- FlagDetails<T> detail methods documented
- FlagsConfiguration uses constructor syntax (immutable)
- Backup of previous state at typo/unity-feature-flags-docs-openfeature-backup
- Remove /feature_flags/setup/unity/ alias (URL never existed)
- Simplify Git URL installation step wording
- ensure -> help ensure (Vale rule)
- once the -> after the (Vale rule)
Documents the feature_flag.evaluations OTel counter metric added in
dd-openfeature v1.61.0. Covers optional OTel SDK dependencies, OTLP
endpoint configuration, and metric attribute reference.

Also bumps dd-openfeature version references from 1.57.0 to 1.61.0.
@github-actions github-actions bot added the Architecture Everything related to the Doc backend label Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Architecture Everything related to the Doc backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants