Skip to content

changing List<Span> for List<DDSpan>#1

Merged
gpolaert merged 1 commit into
devfrom
gpolaert/span_DDspan
Apr 27, 2017
Merged

changing List<Span> for List<DDSpan>#1
gpolaert merged 1 commit into
devfrom
gpolaert/span_DDspan

Conversation

@gpolaert
Copy link
Copy Markdown
Contributor

No description provided.

@gpolaert gpolaert merged commit 6ef772b into dev Apr 27, 2017
@gpolaert gpolaert deleted the gpolaert/span_DDspan branch April 27, 2017 17:10
gpolaert pushed a commit that referenced this pull request May 2, 2017
gpolaert pushed a commit that referenced this pull request May 2, 2017
gpolaert pushed a commit that referenced this pull request May 2, 2017
gpolaert pushed a commit that referenced this pull request May 2, 2017
gpolaert pushed a commit that referenced this pull request May 2, 2017
gpolaert pushed a commit that referenced this pull request May 2, 2017
gpolaert pushed a commit that referenced this pull request May 2, 2017
gpolaert pushed a commit that referenced this pull request May 2, 2017
gpolaert pushed a commit that referenced this pull request May 2, 2017
gpolaert pushed a commit that referenced this pull request May 2, 2017
gpolaert pushed a commit that referenced this pull request May 2, 2017
gpolaert pushed a commit that referenced this pull request May 2, 2017
gpolaert pushed a commit that referenced this pull request May 2, 2017
gpolaert pushed a commit that referenced this pull request May 3, 2017
gpolaert pushed a commit that referenced this pull request May 3, 2017
…d do not instantiate HashMap if it's not needed)
@mrproliu mrproliu mentioned this pull request Mar 4, 2019
tylerbenson pushed a commit that referenced this pull request Jul 19, 2019
am312 pushed a commit that referenced this pull request Jun 16, 2023
Add support for Amazon Opensearch instrumentation.
jordan-wong added a commit that referenced this pull request May 11, 2026
…lkit-generated)

This PR adds a new module `dd-java-agent/instrumentation/jedis/jedis-gen-3.0`
containing an alternative Jedis 3.0 instrumentation generated by the
APM instrumentation toolkit. Placed alongside existing `jedis-3.0`.

Module name follows dd-trace-java's instrumentation-naming convention:
{framework}-gen-{version} ending in the required version suffix.

Bundled with two test-framework bug fixes the toolkit's agent discovered
while iterating. They can be split into a separate PR if preferred — both
are principled and benefit all instrumentation tests.

## Module changes (jedis-gen-3.0/)

One agent-driven workflow run. Cost: $41.04, ~92 min, reviewer approved
first iteration.

Key choices the agent made:
- Instruments `redis.clients.jedis.Connection` (protocol layer — same target
  as existing `jedis-1.4`). Classloader matcher: `hasClassNamed(ProtocolCommand)`
  with `.and(not(hasClassNamed(CommandObject)))` to avoid clashing with jedis-4.0+
- `JedisClientDecorator` extends `DatabaseClientDecorator`
- Three Spock tests covering base + V0 + V1 naming schemas
- Muzzle: explicit `fail [,3.0.0)` + `pass [3.0.0,4.0.0)` + `skipVersions += "jedis-3.6.2"`
  (jedis-3.6.2 is a malformed Maven release with a literal `jedis-` prefix —
  same workaround used by existing `jedis-3.0` module on master)

## Test-framework fixes (instrumentation-testing/)

The agent's verbatim reasoning from apm_test diagnosis output:

### Fix #1 — Is.java: CharSequence comparison

> The Is matcher used `expected.equals(actual)`, but `String.equals()` requires
> the other object to also be a String. When span attributes return
> `UTF8BytesString` (a CharSequence implementation), the equality check fails
> even when text content is identical. Fix: Added fallback using
> `String.contentEquals(CharSequence)` in `Is.test()`.

Real bug: span attributes return `CharSequence` (`UTF8BytesString` in
production). The `Is<T>` matcher's `expected.equals(t)` is asymmetric — any
test using `is("redis.query")` on a span attribute would fail despite the
value being correct.

### Fix #2 — TagsMatcher.java: DD_SVC_SRC default + nullable ERROR_MSG

> The TagsMatcher.defaultTags() was missing the `_dd.svc_src` tag that the
> tracer automatically sets. Also, the `error(Class)` matcher didn't account
> for `error.message` tags when no specific message was expected. Both caused
> "Unexpected tags" assertion failures.

Two related issues. (1) `_dd.svc_src` parity gap: the Groovy framework
(`TagsAssert.groovy:158`) already handles this tag; JUnit 5 `TagsMatcher.java`
was missing it. (2) Asymmetric ERROR_MSG handling: `error(Class)` wasn't
adding any matcher for `error.message`, so spans containing one would fail
with "Unexpected tags".

## Verification

```
./gradlew :dd-java-agent:instrumentation:jedis:jedis-gen-3.0:check \\
          :dd-java-agent:instrumentation:jedis:jedis-gen-3.0:muzzle \\
          :dd-java-agent:instrumentation:jedis:jedis-gen-3.0:latestDepTest
BUILD SUCCESSFUL in 28s
```

Multi-JVM matrix not run locally; standard CI will cover that.

## Reviewer notes

- Framework fixes (Is.java, TagsMatcher.java) are independent of the
  jedis-gen-3.0 module. Can be split into a separate PR if preferred.
- Protocol-layer target (`Connection`, not `Client`) matches existing
  `jedis-1.4` pattern. A prior toolkit run (April 2026) incorrectly chose
  `Client` and produced zero spans; this run correctly chose `Connection`.
- Class names follow the project convention.
- The `skipVersions += "jedis-3.6.2"` workaround is copied from existing
  `jedis-3.0` module on master.

## Provenance

Generated by apm-instrumentation-toolkit (DataDog/apm-instrumentation-toolkit
branch eval/java). Research artifacts:
- docs/eval-research/runs/jedis3/attempt1/
- docs/eval-research/hypotheses/jedis3.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant