Skip to content

Commit a5138d1

Browse files
amarzialidevflow.devflow-routing-intake
andauthored
Cover documentation for config inversion json checks (#11516)
Cover documentation for config inversion json checks precisions remove unneeded info Co-authored-by: devflow.devflow-routing-intake <devflow.devflow-routing-intake@kubernetes.us1.ddbuild.io>
1 parent 864ef84 commit a5138d1

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

.claude/skills/add-apm-integrations/SKILL.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ pattern before writing new code. Use it as a template.
6363
- `testImplementation` dependencies for tests
6464
- `muzzle { pass { } }` directives (see Step 9)
6565
4. Register the new module in `settings.gradle.kts` in **alphabetical order**
66+
5. Register the integration name in `metadata/supported-configurations.json`, or
67+
`checkInstrumenterModuleConfigurations` fails. The name in `super(...)` maps to env var
68+
`DD_TRACE_<NAME>_ENABLED` (`.` and `-` become `_`, uppercased — `couchbase-3`
69+
`DD_TRACE_COUCHBASE_3_ENABLED`). Add a `"type": "boolean"` entry, in alphabetical order, with
70+
aliases `DD_TRACE_INTEGRATION_<NAME>_ENABLED` and `DD_INTEGRATION_<NAME>_ENABLED`. Set `default`
71+
to the module's real default — `"true"`, or `"false"` if it overrides `defaultEnabled()` (e.g.
72+
OpenTelemetry, Hazelcast). Declaring several names (`super("a", "b")`) means one entry each.
6673

6774
## Step 5 – Write the InstrumenterModule
6875

@@ -193,11 +200,15 @@ Run these commands in order and fix any failures before proceeding:
193200
./gradlew :dd-java-agent:instrumentation:$framework-$version:muzzle
194201
./gradlew :dd-java-agent:instrumentation:$framework-$version:test
195202
./gradlew :dd-java-agent:instrumentation:$framework-$version:latestDepTest
203+
./gradlew checkInstrumenterModuleConfigurations
196204
./gradlew spotlessCheck
197205
```
198206

199207
**If muzzle fails:** check for missing helper class names in `helperClassNames()`.
200208

209+
**If `checkInstrumenterModuleConfigurations` fails:** an integration name from `super(...)` is missing
210+
(or mismatched) in `metadata/supported-configurations.json` — see Step 4, item 5.
211+
201212
**If tests fail:** verify span lifecycle order (start → activate → error → finish → close), helper registration,
202213
and `contextStore()` map entries match actual usage.
203214

@@ -208,6 +219,7 @@ and `contextStore()` map entries match actual usage.
208219
Output this checklist and confirm each item is satisfied:
209220

210221
- [ ] `settings.gradle.kts` entry added in alphabetical order
222+
- [ ] `metadata/supported-configurations.json` has a `DD_TRACE_<NAME>_ENABLED` entry (+ the two aliases) for every name passed to `super(...)`
211223
- [ ] `build.gradle` has `compileOnly` deps and `muzzle` directives with `assertInverse = true`
212224
- [ ] `@AutoService(InstrumenterModule.class)` annotation present on the module class
213225
- [ ] `helperClassNames()` lists ALL referenced helpers (including inner, anonymous, and enum synthetic classes)

docs/add_new_instrumentation.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@ public class GoogleHttpClientInstrumentation extends InstrumenterModule.Tracing
6767
}
6868
```
6969

70+
> [!IMPORTANT]
71+
> **The instrumentation name controls a config flag that must be registered.** The name passed to
72+
> `super(...)` becomes the config key `dd.trace.<name>.enabled` → environment variable
73+
> `DD_TRACE_<NAME>_ENABLED` (`.` and `-` become `_`, then uppercased — e.g. `couchbase-3`
74+
> `DD_TRACE_COUCHBASE_3_ENABLED`). Every such name must be registered in
75+
> `metadata/supported-configurations.json` with the two standard aliases
76+
> (`DD_TRACE_INTEGRATION_<NAME>_ENABLED` and `DD_INTEGRATION_<NAME>_ENABLED`), or the
77+
> `checkInstrumenterModuleConfigurations` Gradle task fails the build. A module declaring multiple
78+
> names (`super("a", "b")`) needs **one entry per name**. See
79+
> [Add new configurations](./add_new_configurations.md) for the JSON entry shape.
80+
7081
## Match the target class
7182

7283
In this case we target only one known class to instrument. This is the class which contains the method this

0 commit comments

Comments
 (0)