Skip to content

Conversation

@typotter
Copy link
Contributor

@typotter typotter commented Dec 5, 2025

What does this PR do? What is the motivation?

Adds comprehensive Java Feature Flags setup documentation to support the upcoming release of Feature Flags for Java in dd-trace-java vX.X.X

This PR fixes critical documentation gaps discovered while dogfooding the Java implementation:

Improvements to Match Patterns:

  • Restructured to match Java APM documentation style (/tracing/trace_collection/automatic_instrumentation/dd_libraries/java.md)
  • Added application server configuration tabs (Spring Boot, Tomcat, JBoss, Jetty, Docker)
  • Updated all code examples to use SLF4J logging instead of System.out/err
  • Added troubleshooting section for ClassNotFoundException
  • Added "Compatibility requirements" and "Getting started" sections

New Content:

  • Complete OpenFeature provider initialization with proper exception handling
  • Examples for all flag types: boolean, string, integer, double, object/JSON
  • Evaluation context setup with targeting keys and attributes
  • Error handling patterns with detailed error codes
  • Best practices for production usage
  • Integration with Datadog APM (automatic trace correlation)

Merge instructions

Merge readiness:

  • Ready for merge

Dependencies:

  • Requires dd-trace-java v1.57.0+ with Feature Flags support
  • Currently requires local builds (documented in "Building from Source" section)
  • Can be merged before release as an early access guide

Additional notes

Testing: All code examples verified against working implementation in DataDog/ffe-dogfooding/apps/java

Related Work:

  • Java Feature Flags implementation: DataDog/ffe-dogfooding (apps/java)
  • Tracer implementation: DataDog/dd-trace-java (products/feature-flagging)

- Add comprehensive Java SDK onboarding guide
- Include installation instructions for Maven and Gradle
- Document OpenFeature provider initialization and usage
- Add code examples for all flag types (boolean, string, int, double, object)
- Document error handling and common error codes
- Include best practices and troubleshooting guide
- Add Java to feature flags setup page navigation
- Document integration with Datadog APM and exposure tracking

Related: FFE Server SDK code freeze preparation
…ocumentation

Critical fixes:
- Add missing dd-java-agent-feature-flagging-bootstrap dependency to all examples
- Add Building from Source section with detailed instructions
- Explain bootstrap module purpose (classloader communication)
- Add troubleshooting for ClassNotFoundException

Improvements to match Java APM documentation patterns:
- Add application server configuration tabs (Spring Boot, Tomcat, JBoss, Jetty, Docker)
- Update all code examples to use SLF4J logger instead of System.out/err
- Add Compatibility requirements section
- Add Getting started section
- Update initialization example to show complete application structure

Code quality:
- Use logger.info/warn/error throughout with parameterized messages
- Show proper exception handling with logger
- Match actual implementation in ffe-dogfooding repo
- Include named client usage ("my-app")

The documentation now accurately reflects the required dependencies,
follows established Datadog docs patterns, and provides complete
setup instructions for the development build.
@github-actions github-actions bot added the Architecture Everything related to the Doc backend label Dec 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

Preview links (active after the build_preview check completes)

New or renamed files

Changes:
- Add cross-linking to Configuration section from early warning
- Add OpenFeature SDK to compatibility requirements (it is required)
- Remove all local build instructions (only reference published X.X.X versions)
- Add skip guidance for users with existing agent/remote-config setup
- Clarify ProviderNotReadyError is OpenFeature exception (optional handling)
- Update exception handling to be optional based on availability requirements
- Note that not catching exception may prevent application startup

Improvements:
- Users with existing APM can skip to provider initialization
- Users with existing remote-config can skip agent configuration
- Clear guidance on when exception handling is optional vs required
- Removed all references to building from source
…aring

Changes:
- Add PROVIDER_ERROR and PROVIDER_STALE event listeners to async init example
- Note that PROVIDER_CONFIGURATION_CHANGED is optional (depends on provider support)
- Update multiple clients section: "organize context and flags" (not just flags)
- Clarify that Provider instance is shared globally (client names are organizational only)

The Provider constructor doesn't take a name parameter - it's a single shared instance.
Named clients are just for organizing your application code, not separate providers.
Changes:
- Update all flag keys to use dot notation (matching Android/iOS):
  * new-checkout-flow -> checkout.new
  * ui-theme -> ui.theme
  * payment-api-endpoint -> payment.api.endpoint
  * max-retries -> retries.max
  * discount-rate -> pricing.discount.rate
  * feature-config -> ui.config
  * All other flags updated to dot notation

- Standardize attribute to use "tier" consistently (not "plan")

- Remove "country" attribute from basic example to match mobile simplicity

This creates consistency across all SDK documentation and makes it easier
for users to migrate between platforms or reference examples.
@typotter typotter added WORK IN PROGRESS No review needed, it's a wip ;) Do Not Merge Just do not merge this PR :) feature_flags Content changed in the feature_flags directory and removed WORK IN PROGRESS No review needed, it's a wip ;) Do Not Merge Just do not merge this PR :) labels Dec 5, 2025
@joepeeples joepeeples self-requested a review December 5, 2025 19:47
@joepeeples joepeeples self-assigned this Dec 5, 2025
@joepeeples joepeeples added the editorial review Waiting on a more in-depth review label Dec 5, 2025
@joepeeples
Copy link
Contributor

joepeeples commented Dec 5, 2025

Opened DOCS-12847 to follow up with editorial review.

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 editorial review Waiting on a more in-depth review feature_flags Content changed in the feature_flags directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants