feat(sparkjava-2.3): toolkit-generated sparkjava-2.3 [DO NOT MERGE]#11708
Draft
jordan-wong wants to merge 6 commits into
Draft
feat(sparkjava-2.3): toolkit-generated sparkjava-2.3 [DO NOT MERGE]#11708jordan-wong wants to merge 6 commits into
jordan-wong wants to merge 6 commits into
Conversation
…[DO NOT MERGE] Rebased onto current master to fix the stale-base CI failures on PR #11562. This branch contains only the toolkit-generated sparkjava-2.3 work: - SparkJavaDecorator, RoutesInstrumentation (with Routes.find advice) - SparkJavaTest, SparkJavaForkedTest (Java tests per R20) - build.gradle updated for the generated module structure - Old groovy test + TestSparkJavaApplication + stale gradle.lockfile removed (toolkit produces Java tests only) Supersedes #11562. The supported-configurations.json fix from #11562 is no longer needed — master already has the SPARKJAVA env var entries. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Adds the three integration config entries needed for the new sparkjava-2.3 module:
- DD_TRACE_SPARKJAVA_2_3_ENABLED (for super("sparkjava-2.3") in RoutesInstrumentation)
- DD_TRACE_SPARKJAVA_ANALYTICS_ENABLED (for decorator instrumentationNames() -> "sparkjava")
- DD_TRACE_SPARKJAVA_ANALYTICS_SAMPLE_RATE (same)
Fixes the config-inversion-linter CI job on this PR.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
… 'double') dd-trace-java's supported-configurations.json schema uses 'decimal' for double-precision floats; 'double' fails the validate_supported_configurations_v2 GitLab CI check. Matches existing AKKA_HTTP_ANALYTICS_SAMPLE_RATE and other analytics-rate entries. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…_file validator
Three coordinated changes:
1. super('sparkjava', 'sparkjava-2.4') in RoutesInstrumentation
(was 'sparkjava-2.3'). Matches master's existing module exactly. Master's
DD_TRACE_SPARKJAVA_2_4_* entries already exist in the central feature-parity
registry, so no new registry registration is needed.
2. Remove SparkJavaDecorator.java entirely.
Its only function was providing a 'sparkjava' instrumentationName + a SPARK_JAVA
component constant + a SPARK_REQUEST spanName constant. Master doesn't have a
sparkjava-specific decorator; it just calls HTTP_RESOURCE_DECORATOR.withRoute(...).
Moved the SPARK_JAVA and SPARK_REQUEST constants inline into RoutesAdvice.
The decorator's instrumentationNames() was triggering a checkDecoratorAnalyticsConfigurations
requirement for DD_TRACE_SPARKJAVA_ANALYTICS_* entries that don't exist in the registry.
3. Remove DD_TRACE_SPARKJAVA_2_3_ENABLED, DD_TRACE_SPARKJAVA_ANALYTICS_ENABLED,
DD_TRACE_SPARKJAVA_ANALYTICS_SAMPLE_RATE from metadata/supported-configurations.json.
Master's existing DD_TRACE_SPARKJAVA_2_4_ENABLED + DD_TRACE_SPARKJAVA_ENABLED
cover the integration names this PR now uses.
Local verification BUILD SUCCESSFUL:
- ./gradlew checkConfigurations
- ./gradlew :dd-java-agent:instrumentation:spark:sparkjava-2.3:compileTestJava
- ./gradlew spotlessCheck
This should clear validate_supported_configurations_v2_local_file CI failure.
Research finding: the toolkit's extra structure (decorator + analytics requirement)
creates a registry-registration dependency that doesn't exist on master. When master's
existing module uses HTTP_RESOURCE_DECORATOR directly, regenerated modules should too.
Documented in eval-research/hypotheses/sparkjava.md.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… muzzle Muzzle failed AssertPass for spark-core 2.3, 2.6.0, 2.7.2, 2.9.4 with: FAILED MUZZLE VALIDATION: datadog.trace.instrumentation.sparkjava.RoutesInstrumentation mismatches: Missing class datadog.trace.instrumentation.sparkjava.RoutesInstrumentation$RoutesAdvice ByteBuddy advice classes get inlined into the target library's classes at runtime. Static fields referencing the agent's UTF8BytesString class cause muzzle to flag the advice as 'Missing class' from the target library's classpath perspective. Removed two static fields (SPARK_JAVA, SPARK_REQUEST) from RoutesAdvice and the two enrichment statements that used them (span.setSpanName, span.setTag). The instrumentation now matches master's RoutesAdvice exactly — only HTTP_RESOURCE_DECORATOR.withRoute(...) is called. Local verification BUILD SUCCESSFUL: ./gradlew :dd-java-agent:instrumentation:spark:sparkjava-2.3:muzzle Research finding: toolkit-generated advice classes that add static field constants violate muzzle constraints. Encode as R-rule: 'Advice classes must not declare static or instance fields; constants must live on a helper class referenced via helperClassNames()'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…vaNaming helper Previous commit removed SPARK_JAVA/SPARK_REQUEST constants entirely to satisfy muzzle, but broke 68 tests (SparkJavaTest + SparkJavaForkedTest) that assert on the enrichment tags (span name 'spark.request', component 'spark-java'). Correct fix: put constants on a separate helper class registered via helperClassNames(). Muzzle understands helper classes as part of the agent's classpath (not the target library's), so static fields on them are fine. Created SparkJavaNaming.java with public static final CharSequence SPARK_JAVA and SPARK_REQUEST. Restored the two enrichment statements in RoutesAdvice using SparkJavaNaming.SPARK_REQUEST and SparkJavaNaming.SPARK_JAVA. Added helperClassNames() override in RoutesInstrumentation pointing to SparkJavaNaming. Local verification BUILD SUCCESSFUL: muzzle, spotbugsMain, checkConfigurations, spotlessCheck. Research finding: toolkit-generated Advice classes that need constants from agent classpath should put them on a separate helper class registered via helperClassNames(), NOT as inline static fields and NOT on a BaseDecorator subclass (which triggers checkDecoratorAnalyticsConfigurations). A minimal naming-only helper avoids both pitfalls. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rebased toolkit-generated sparkjava-2.3 instrumentation onto current master to fix stale-base CI drift on PR #11562. Single squashed commit, sparkjava-2.3 module only.
Why this PR
PR #11562 sits on a branch ~200+ commits behind current master, which causes
dd-gitlab/build_tests: [:instrumentationLatestDepTest, latestdep]to fail intermittently due to unrelated drift — not a sparkjava code defect. Running the exact same Gradle command against PR #11562's HEAD locally passes.This PR rebases the toolkit-generated work onto current master so CI runs against a clean base.
What's in this PR
Only the toolkit-generated sparkjava-2.3 work — nothing else from #11562's branch:
SparkJavaDecorator.java(new)RoutesInstrumentation.javaupdated (Routes.find advice)SparkJavaTest.java,SparkJavaForkedTest.java— Java tests (per R20: no Groovy in toolkit-generated tests)build.gradleupdated for the module structuregradle.lockfile,SparkJavaBasedTest.groovy,TestSparkJavaApplication.java(replaced by Java equivalents)What's NOT in this PR (intentionally dropped)
metadata/supported-configurations.jsonfix from feat(sparkjava-2.3): toolkit-generated sparkjava-2.3 instrumentation [DO NOT MERGE] #11562 — already present on current master.github/workflows/*,.claude/skills/*,.gitlab-ci.ymldrift from the stale baseNext step
If CI is green on this branch, close #11562 as superseded. Keeping #11562 open until then so reviewers have continuity.
🤖 Generated with Claude Code